mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-12-17 23:48:00 +01:00
Fixed disguise inventory rendering
This commit is contained in:
parent
0d1f79bf71
commit
4b543b45ac
1 changed files with 5 additions and 7 deletions
|
@ -24,14 +24,11 @@ public class DisguiseRenderer {
|
||||||
RenderManager renderMan = mc.getRenderManager();
|
RenderManager renderMan = mc.getRenderManager();
|
||||||
|
|
||||||
if (entity.getEntityData().hasKey("disguise") && entity.getEntityData().getBoolean("disguise")) {
|
if (entity.getEntityData().hasKey("disguise") && entity.getEntityData().getBoolean("disguise")) {
|
||||||
entity.getEntityData().setBoolean("disguise", false);
|
|
||||||
|
|
||||||
renderMan.setRenderShadow(!isAttachedEntity(entity));
|
renderMan.setRenderShadow(!isAttachedEntity(entity));
|
||||||
renderDisguise(renderMan, entity);
|
renderDisguise(renderMan, entity);
|
||||||
renderMan.setRenderShadow(false);
|
renderMan.setRenderShadow(false);
|
||||||
|
|
||||||
entity.getEntityData().setBoolean("disguise", true);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
renderMan.setRenderShadow(renderMan.isRenderShadow() || usedPartialTick != 1);
|
renderMan.setRenderShadow(renderMan.isRenderShadow() || usedPartialTick != 1);
|
||||||
|
@ -41,6 +38,7 @@ public class DisguiseRenderer {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void renderDisguise(RenderManager renderMan, Entity entity) {
|
protected void renderDisguise(RenderManager renderMan, Entity entity) {
|
||||||
|
entity.getEntityData().setBoolean("disguise", false);
|
||||||
|
|
||||||
Entity observer = Minecraft.getMinecraft().getRenderViewEntity();
|
Entity observer = Minecraft.getMinecraft().getRenderViewEntity();
|
||||||
|
|
||||||
|
@ -49,10 +47,8 @@ public class DisguiseRenderer {
|
||||||
double z = entity.posZ - observer.posZ;
|
double z = entity.posZ - observer.posZ;
|
||||||
|
|
||||||
renderMan.renderEntity(entity, x, y, z, 0, 0, false);
|
renderMan.renderEntity(entity, x, y, z, 0, 0, false);
|
||||||
}
|
|
||||||
|
|
||||||
protected void renderDisguiseFixedToBlock(RenderManager renderMan, Entity entity) {
|
|
||||||
|
|
||||||
|
entity.getEntityData().setBoolean("disguise", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean renderDisguiseToGui(IPlayer player) {
|
public boolean renderDisguiseToGui(IPlayer player) {
|
||||||
|
@ -74,8 +70,10 @@ public class DisguiseRenderer {
|
||||||
// Check for a disguise and render it in our place.
|
// Check for a disguise and render it in our place.
|
||||||
if (e != null) {
|
if (e != null) {
|
||||||
effect.update(player);
|
effect.update(player);
|
||||||
e.setInvisible(false);
|
|
||||||
e.setAlwaysRenderNameTag(false);
|
e.setAlwaysRenderNameTag(false);
|
||||||
|
e.setInvisible(false);
|
||||||
|
e.posY = player.getOwner().posY;
|
||||||
|
|
||||||
renderMan.renderEntity(e, 0, 0, 0, 0, 1, false);
|
renderMan.renderEntity(e, 0, 0, 0, 0, 1, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue