Permalink
Browse files

Fixed a bug with skull rotation.

  • Loading branch information...
Ri5ux committed Nov 26, 2018
1 parent f4e10c1 commit 17e791901400c4f626fb4d35dff28c1c9fcb6542
Showing with 16 additions and 10 deletions.
  1. +16 −10 src/main/java/org/avp/client/render/tile/RenderSkull.java
@@ -1,5 +1,6 @@
package org.avp.client.render.tile;
import org.avp.block.BlockSkull;
import org.avp.tile.TileEntitySkull;
import org.avp.tile.TileEntitySkull.EnumOrientation;
import org.lwjgl.opengl.GL11;
@@ -15,6 +16,8 @@
@Override
public void render(TileEntitySkull skull, double posX, double posY, double posZ, float renderPartialTicks, int destroyStage, float alpha)
{
BlockSkull block = (BlockSkull) skull.getBlockType();
OpenGL.pushMatrix();
float scale = 0.64F;
@@ -30,17 +33,20 @@ public void render(TileEntitySkull skull, double posX, double posY, double posZ,
}
skull.getSkullBlock().preRenderTransforms();
if (skull.getOrientation() == EnumOrientation.FLAT)
{
OpenGL.translate(-0.4, 0.71F, 0);
OpenGL.rotate(-53.5F, 0, 0, 1);
}
if (skull.getOrientation() == EnumOrientation.WALL)
if (block.canChangeOrientation())
{
OpenGL.translate(-0.25, -0.1, 0);
OpenGL.rotate(37.5F, 0, 0, 1);
if (skull.getOrientation() == EnumOrientation.FLAT)
{
OpenGL.translate(-0.4, 0.71F, 0);
OpenGL.rotate(-53.5F, 0, 0, 1);
}
if (skull.getOrientation() == EnumOrientation.WALL)
{
OpenGL.translate(-0.25, -0.1, 0);
OpenGL.rotate(37.5F, 0, 0, 1);
}
}
for (ModelRenderer m : skull.getSkullBlock().getSkullModelRenderers())

0 comments on commit 17e7919

Please sign in to comment.