End shader

This commit is contained in:
2026-04-08 19:58:10 +02:00
parent d782bccb5f
commit 88db7a8383
@@ -8,35 +8,30 @@ import com.mojang.blaze3d.pipeline.RenderPipeline;
import net.minecraft.client.gl.RenderPipelines; import net.minecraft.client.gl.RenderPipelines;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderLayers; import net.minecraft.client.render.RenderLayers;
import net.minecraft.client.render.block.entity.EndPortalBlockEntityRenderer; import net.minecraft.client.render.RenderSetup;
import net.minecraft.client.render.block.entity.AbstractEndPortalBlockEntityRenderer;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
public class ShaderUtils { public class ShaderUtils {
// public static final RenderPipeline END_GATEWAY_PIPELINE = public static final RenderPipeline END_GATEWAY_PIPELINE = RenderPipelines.register(
// RenderPipelines.register( RenderPipeline.builder(new RenderPipeline.Snippet[] {
// RenderPipeline.builder(new RenderPipeline.Snippet[] { RenderPipelines.RENDERTYPE_END_PORTAL_SNIPPET })
// RenderPipelines.RENDERTYPE_END_PORTAL_SNIPPET }) .withLocation("pipeline/end_gateway")
// .withLocation("pipeline/end_gateway") .withShaderDefine("PORTAL_LAYERS", 16)
// .withShaderDefine("PORTAL_LAYERS", 16) .withCull(false)
// .withCull(false) .build());
// .build());
// public static final RenderLayer END_GATEWAY = RenderLayer.of("end_gateway", public static final RenderLayer END_GATEWAY = RenderLayer.of("end_gateway",
// 1536, false, false, RenderSetup.builder(END_GATEWAY_PIPELINE)
// END_GATEWAY_PIPELINE, .texture("Sampler0", AbstractEndPortalBlockEntityRenderer.SKY_TEXTURE)
// RenderLayer.MultiPhaseParameters.builder() .texture("Sampler1", AbstractEndPortalBlockEntityRenderer.PORTAL_TEXTURE).build());
// .texture(Textures.create().add(EndPortalBlockEntityRenderer.SKY_TEXTURE,
// false)
// .add(EndPortalBlockEntityRenderer.PORTAL_TEXTURE, false).build())
// .build(false));
public static RenderLayer getRenderLayer(IdentifierRef texture) { public static RenderLayer getRenderLayer(IdentifierRef texture) {
String path = texture.toString(); String path = texture.toString();
if (path.endsWith(".gif")) { if (path.endsWith(".gif")) {
return RenderLayers.entityAlpha((Identifier) (Object) GifUtils.get(texture)); return RenderLayers.entityAlpha((Identifier) (Object) GifUtils.get(texture));
} else if (path.endsWith("end.png")) { } else if (path.endsWith("end.png")) {
// return END_GATEWAY; return END_GATEWAY;
return RenderLayers.endGateway();
} else { } else {
return RenderLayers.entityAlpha((Identifier) (Object) texture); return RenderLayers.entityAlpha((Identifier) (Object) texture);
} }