diff --git a/src/main/java/codechicken/enderstorage/storage/item/EnderChestRenderer.java b/src/main/java/codechicken/enderstorage/storage/item/EnderChestRenderer.java index 9ef4c08..ff791f9 100644 --- a/src/main/java/codechicken/enderstorage/storage/item/EnderChestRenderer.java +++ b/src/main/java/codechicken/enderstorage/storage/item/EnderChestRenderer.java @@ -22,6 +22,7 @@ public class EnderChestRenderer extends TileEntitySpecialRenderer { private static ModelEnderChest model = new ModelEnderChest(); + static Vector3 Y = new Vector3(0, 1, 0); public EnderChestRenderer() {} @@ -63,7 +64,7 @@ public static void renderChest(CCRenderState state, int rotation, int freq, bool double time = ClientUtils.getRenderTime() + offset; Matrix4 pearlMat = CCModelLibrary.getRenderMatrix( new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + EnderStorageClientProxy.getPearlBob(time), z + 0.5), - new Rotation(time / 3, new Vector3(0, 1, 0)), + new Rotation(time / 3, Y), 0.04); GL11.glDisable(GL11.GL_LIGHTING); diff --git a/src/main/java/codechicken/enderstorage/storage/liquid/EnderTankRenderer.java b/src/main/java/codechicken/enderstorage/storage/liquid/EnderTankRenderer.java index df8db0e..9e6ec79 100644 --- a/src/main/java/codechicken/enderstorage/storage/liquid/EnderTankRenderer.java +++ b/src/main/java/codechicken/enderstorage/storage/liquid/EnderTankRenderer.java @@ -38,6 +38,17 @@ public class EnderTankRenderer extends TileEntitySpecialRenderer { static CCModel tankModel; static CCModel valveModel; static CCModel[] buttons; + + static UVTranslation[] UVTranslationButtons = new UVTranslation[16]; + static UVTranslation UVTvalveOwned = new UVTranslation(0, 13 / 64D); + static UVTranslation UVTvalveNotOwned = new UVTranslation(0, 0); + static Vector3 Y = new Vector3(0,1,0); + static Vector3 Z = new Vector3(0, 0, 1); + static Vector3 point = new Vector3(0, 0.4165, 0); + + static Cuboid6 cuboidFLuid = new Cuboid6(0.22, 0.12, 0.22, 0.78, 0.121 + 0.63, 0.78); + + static RenderCustomEndPortal renderEndPortal = new RenderCustomEndPortal(0.1205, 0.24, 0.76, 0.24, 0.76); static { @@ -62,6 +73,10 @@ public class EnderTankRenderer extends TileEntitySpecialRenderer { buttons = new CCModel[3]; for (int i = 0; i < 3; i++) buttons[i] = RenderEnderStorage.button.copy() .apply(TileEnderTank.buttonT[i].with(new Translation(-0.5, 0, -0.5))); + + for (int colour=0;colour<16;colour++){ + UVTranslationButtons[colour] = new UVTranslation(0.25 * (colour % 4), 0.25 * (colour / 4)); + } } @Override @@ -117,15 +132,15 @@ public static void renderTank(CCRenderState state, int rotation, float valve, in state.startDrawing(7); for (int i = 0; i < 3; i++) { int colour = EnderStorageManager.getColourFromFreq(freq, i); - buttons[i].render(new UVTranslation(0.25 * (colour % 4), 0.25 * (colour / 4))); + buttons[i].render(UVTranslationButtons[colour]); } state.draw(); - new Rotation(valve, new Vector3(0, 0, 1)).at(new Vector3(0, 0.4165, 0)).glApply(); + new Rotation(valve, Z).at(point).glApply(); state.changeTexture("enderstorage:textures/endertank.png"); state.startDrawing(4); - valveModel.render(new UVTranslation(0, owned ? 13 / 64D : 0)); + valveModel.render(owned ? UVTvalveOwned : UVTvalveNotOwned); state.draw(); GL11.glPopMatrix(); GL11.glDisable(GL12.GL_RESCALE_NORMAL); @@ -133,7 +148,7 @@ public static void renderTank(CCRenderState state, int rotation, float valve, in double time = ClientUtils.getRenderTime() + offset; Matrix4 pearlMat = CCModelLibrary.getRenderMatrix( new Vector3(x + 0.5, y + 0.45 + EnderStorageClientProxy.getPearlBob(time) * 2, z + 0.5), - new Rotation(time / 3, new Vector3(0, 1, 0)), + new Rotation(time / 3, Y), 0.04); GL11.glDisable(GL11.GL_LIGHTING); @@ -147,7 +162,7 @@ public static void renderTank(CCRenderState state, int rotation, float valve, in public static void renderLiquid(FluidStack liquid, double x, double y, double z) { RenderUtils.renderFluidCuboid( liquid, - new Cuboid6(0.22, 0.12, 0.22, 0.78, 0.121 + 0.63, 0.78).add(new Vector3(x, y, z)), + cuboidFLuid.add(new Vector3(x, y, z)), liquid.amount / ((double) EnderStorage.enderTankSize * FluidUtils.B), 0.75); }