mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 23:27:59 +01:00
Fixed shadows rendering in the gui
This commit is contained in:
parent
df7fe0e7f4
commit
35ffa71271
1 changed files with 8 additions and 6 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue