Merge pull request #2470 from diesieben07/shader-fix

Fix the entity shader hook
This commit is contained in:
Fry 2016-02-14 17:51:55 +03:00
commit 9760b3b52f
2 changed files with 8 additions and 5 deletions

View file

@ -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);
}
}

View file

@ -575,12 +575,15 @@ public class ForgeHooksClient
return Optional.of(new TRSRTransformation(matrix));
}
public static void loadEntityShader(Class<? extends Entity> entityClass, EntityRenderer entityRenderer)
public static void loadEntityShader(Entity entity, EntityRenderer entityRenderer)
{
ResourceLocation shader = ClientRegistry.getEntityShader(entityClass);
if (entity != null)
{
ResourceLocation shader = ClientRegistry.getEntityShader(entity.getClass());
if (shader != null)
{
entityRenderer.loadShader(shader);
}
}
}
}