Merge pull request #2470 from diesieben07/shader-fix
Fix the entity shader hook
This commit is contained in:
commit
9760b3b52f
2 changed files with 8 additions and 5 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 (shader != null)
|
||||
if (entity != null)
|
||||
{
|
||||
entityRenderer.loadShader(shader);
|
||||
ResourceLocation shader = ClientRegistry.getEntityShader(entity.getClass());
|
||||
if (shader != null)
|
||||
{
|
||||
entityRenderer.loadShader(shader);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue