Fixed shadows rendering in the gui

This commit is contained in:
Sollace 2019-02-14 14:20:15 +02:00
parent df7fe0e7f4
commit 35ffa71271

View file

@ -23,7 +23,7 @@ public class DisguiseRenderer {
if (entity.getEntityData().hasKey("disguise") && entity.getEntityData().getBoolean("disguise")) { if (entity.getEntityData().hasKey("disguise") && entity.getEntityData().getBoolean("disguise")) {
renderMan.setRenderShadow(true); renderMan.setRenderShadow(true);
renderDisguise(renderMan, entity); renderStaticDisguise(renderMan, entity);
renderMan.setRenderShadow(false); renderMan.setRenderShadow(false);
return true; return true;
@ -34,18 +34,20 @@ public class DisguiseRenderer {
return false; return false;
} }
protected void renderDisguise(RenderManager renderMan, Entity entity) { protected void renderDisguise(RenderManager renderMan, Entity entity, double x, double y, double z) {
entity.getEntityData().setBoolean("disguise", false); entity.getEntityData().setBoolean("disguise", false);
renderMan.renderEntity(entity, x, y, z, 0, 1, false);
entity.getEntityData().setBoolean("disguise", true);
}
protected void renderStaticDisguise(RenderManager renderMan, Entity entity) {
Entity observer = Minecraft.getMinecraft().getRenderViewEntity(); Entity observer = Minecraft.getMinecraft().getRenderViewEntity();
double x = entity.posX - observer.posX; double x = entity.posX - observer.posX;
double y = entity.posY - observer.posY; double y = entity.posY - observer.posY;
double z = entity.posZ - observer.posZ; double z = entity.posZ - observer.posZ;
renderMan.renderEntity(entity, x, y, z, 0, 1, false); renderDisguise(renderMan, entity, x, y, z);
entity.getEntityData().setBoolean("disguise", true);
} }
public boolean renderDisguiseToGui(IPlayer player) { public boolean renderDisguiseToGui(IPlayer player) {
@ -72,7 +74,7 @@ public class DisguiseRenderer {
e.setInvisible(false); e.setInvisible(false);
e.posY = player.getOwner().posY; e.posY = player.getOwner().posY;
renderMan.renderEntity(e, 0, 0, 0, 0, 1, false); renderDisguise(renderMan, e, 0, 0, 0);
} }
return true; return true;