diff --git a/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java b/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java index 966bdec..4c6f10f 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java +++ b/src/main/java/dev/itsmeow/whisperwoods/client/init/ClientLifecycleHandler.java @@ -44,25 +44,13 @@ public class ClientLifecycleHandler { public static RenderFactory R = IMDLibClient.getRenderRegistry(WhisperwoodsMod.MODID); public static class RenderTypes extends RenderType { - protected static final RenderState.WriteMaskState NO_WRITE = new RenderState.WriteMaskState(false, false); - private static final RenderType TRANSLUCENT_DEPTH_MASK_OFF = makeType("translucent_depth_mask_off", DefaultVertexFormats.BLOCK, 7, 262144, true, true, RenderType.State.getBuilder().shadeModel(SHADE_ENABLED).lightmap(LIGHTMAP_ENABLED).texture(BLOCK_SHEET_MIPPED).transparency(TRANSLUCENT_TRANSPARENCY).target(OUTLINE_TARGET).writeMask(COLOR_WRITE).build(true)); - public RenderTypes() { super(null, null, 0, 0, false, false, null, null); } - public static RenderType getEyesDepthMaskOff(ResourceLocation locationIn) { - RenderState.TextureState renderstate$texturestate = new RenderState.TextureState(locationIn, false, false); - return makeType("eyes_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).build(false)); - } - public static RenderType getEyesEntityCutoutNoCullDepthMaskOff(ResourceLocation locationIn) { RenderState.TextureState renderstate$texturestate = new RenderState.TextureState(locationIn, false, false); - return makeType("eyes_entity_cutout_no_cull_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).diffuseLighting(DIFFUSE_LIGHTING_ENABLED).alpha(DEFAULT_ALPHA).lightmap(LIGHTMAP_ENABLED).overlay(OVERLAY_ENABLED).build(false)); - } - - public static RenderType getTranslucentDepthMaskOff() { - return TRANSLUCENT_DEPTH_MASK_OFF; + return makeType("eyes_entity_cutout_no_cull_depth_mask_off", DefaultVertexFormats.ENTITY, 7, 256, false, true, RenderType.State.getBuilder().texture(renderstate$texturestate).cull(CULL_DISABLED).transparency(ADDITIVE_TRANSPARENCY).writeMask(COLOR_WRITE).fog(BLACK_FOG).diffuseLighting(DIFFUSE_LIGHTING_ENABLED).alpha(DEFAULT_ALPHA).lightmap(LIGHTMAP_DISABLED).overlay(OVERLAY_ENABLED).build(false)); } } @@ -84,7 +72,7 @@ public void render(MatrixStack matrixStackIn, IRenderTypeBuffer bufferIn, int pa matrixStackIn.push(); this.getEntityModel().setLivingAnimations(entity, limbSwing, limbSwingAmount, partialTicks); this.getEntityModel().setRotationAngles(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch); - this.getEntityModel().render(matrixStackIn, bufferIn.getBuffer(entity.getOpen() ? RenderTypes.getEyesDepthMaskOff(ModResources.HIDEBEHIND_OPEN_GLOW) : RenderTypes.getEyesDepthMaskOff(ModResources.HIDEBEHIND_GLOW)), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); + this.getEntityModel().render(matrixStackIn, bufferIn.getBuffer(entity.getOpen() ? RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(ModResources.HIDEBEHIND_OPEN_GLOW) : RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(ModResources.HIDEBEHIND_GLOW)), 15728640, OverlayTexture.NO_OVERLAY, 1.0F, 1.0F, 1.0F, 1.0F); matrixStackIn.pop(); } } diff --git a/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java b/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java index 4cd8a1e..e63bfbd 100644 --- a/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java +++ b/src/main/java/dev/itsmeow/whisperwoods/client/renderer/entity/layer/LayerEyes.java @@ -1,6 +1,7 @@ package dev.itsmeow.whisperwoods.client.renderer.entity.layer; import com.mojang.blaze3d.matrix.MatrixStack; +import dev.itsmeow.whisperwoods.client.init.ClientLifecycleHandler; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.entity.MobRenderer; @@ -16,7 +17,7 @@ public class LayerEyes> extends La public LayerEyes(MobRenderer baseRenderer, ResourceLocation texture) { super(baseRenderer); - this.GLOW_STATE = RenderType.getEyes(texture); + this.GLOW_STATE = ClientLifecycleHandler.RenderTypes.getEyesEntityCutoutNoCullDepthMaskOff(texture); } @Override diff --git a/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png b/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png index 6ea1b07..677ac24 100644 Binary files a/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png and b/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_glow.png differ diff --git a/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_open_glow.png b/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_open_glow.png index 2b70700..64b16ed 100644 Binary files a/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_open_glow.png and b/src/main/resources/assets/whisperwoods/textures/entity/hidebehind_open_glow.png differ diff --git a/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png b/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png index 6d82a2e..d5f8ac4 100644 Binary files a/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png and b/src/main/resources/assets/whisperwoods/textures/entity/zotzpyre_eyes.png differ