From b875274c4f28252b5d71c1323d829672d2189136 Mon Sep 17 00:00:00 2001 From: Take Weiland Date: Sun, 14 Feb 2016 15:02:45 +0100 Subject: [PATCH] Fix the entity shader hook --- .../client/renderer/EntityRenderer.java.patch | 2 +- .../net/minecraftforge/client/ForgeHooksClient.java | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch index 35a1f9c27..8ee9bcf8e 100644 --- a/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch +++ b/patches/minecraft/net/minecraft/client/renderer/EntityRenderer.java.patch @@ -4,7 +4,7 @@ { this.func_175069_a(new ResourceLocation("shaders/post/invert.json")); } -+ else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_.getClass(), this); ++ else net.minecraftforge.client.ForgeHooksClient.loadEntityShader(p_175066_1_, this); } } diff --git a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java index 1641e965f..5b8cfea86 100644 --- a/src/main/java/net/minecraftforge/client/ForgeHooksClient.java +++ b/src/main/java/net/minecraftforge/client/ForgeHooksClient.java @@ -575,12 +575,15 @@ public class ForgeHooksClient return Optional.of(new TRSRTransformation(matrix)); } - public static void loadEntityShader(Class entityClass, EntityRenderer entityRenderer) + public static void loadEntityShader(Entity entity, EntityRenderer entityRenderer) { - ResourceLocation shader = ClientRegistry.getEntityShader(entityClass); - if (shader != null) + if (entity != null) { - entityRenderer.loadShader(shader); + ResourceLocation shader = ClientRegistry.getEntityShader(entity.getClass()); + if (shader != null) + { + entityRenderer.loadShader(shader); + } } } }