Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@

package com.lambda.mixin.render;

import com.lambda.util.LambdaResource;
import net.minecraft.client.gui.screen.SplashOverlay;
import net.minecraft.client.texture.ResourceTexture;
import net.minecraft.resource.DefaultResourcePack;
import net.minecraft.resource.InputSupplier;
import net.minecraft.resource.ResourceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.ColorHelper;
import org.spongepowered.asm.mixin.Final;
Expand All @@ -29,6 +34,7 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.io.InputStream;
import java.util.function.IntSupplier;

@Mixin(SplashOverlay.class)
Expand All @@ -47,4 +53,16 @@ private int redirectBrandArgb(IntSupplier originalSupplier) {
private void onInit(CallbackInfo ci) {
LOGO = Identifier.of("lambda", "textures/lambda_banner.png");
}

@Mixin(SplashOverlay.LogoTexture.class)
static class LogoTextureMixin extends ResourceTexture {
@Redirect(method = "loadTextureData", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/DefaultResourcePack;open(Lnet/minecraft/resource/ResourceType;Lnet/minecraft/util/Identifier;)Lnet/minecraft/resource/InputSupplier;"))
InputSupplier<InputStream> loadTextureData(DefaultResourcePack instance, ResourceType type, Identifier id) {
return () -> new LambdaResource("textures/lambda_banner.png").getStream();
}

public LogoTextureMixin(Identifier location) {
super(location);
}
}
}
1 change: 1 addition & 0 deletions common/src/main/resources/lambda.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ accessible method net/minecraft/client/render/Camera setRotation (FF)V
accessible field com/mojang/blaze3d/systems/RenderSystem$ShapeIndexBuffer id I
accessible field net/minecraft/client/render/BufferRenderer currentVertexBuffer Lnet/minecraft/client/gl/VertexBuffer;
accessible field net/minecraft/client/texture/NativeImage pointer J
accessible class net/minecraft/client/gui/screen/SplashOverlay$LogoTexture

# Text
accessible field net/minecraft/text/Style color Lnet/minecraft/text/TextColor;
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/lambda.mixins.common.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"render.RenderTickCounterMixin",
"render.ScreenHandlerMixin",
"render.SplashOverlayMixin",
"render.SplashOverlayMixin$LogoTextureMixin",
"render.VertexBufferMixin",
"render.WorldRendererMixin",
"world.BlockCollisionSpliteratorMixin",
Expand Down
Loading