diff options
Diffstat (limited to 'src/main/java/client')
-rw-r--r-- | src/main/java/client/renderer/TetherRenderer.java | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/main/java/client/renderer/TetherRenderer.java b/src/main/java/client/renderer/TetherRenderer.java index 6484da7cef..7e69122846 100644 --- a/src/main/java/client/renderer/TetherRenderer.java +++ b/src/main/java/client/renderer/TetherRenderer.java @@ -6,7 +6,6 @@ import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; @@ -15,7 +14,7 @@ public class TetherRenderer extends TileEntitySpecialRenderer { private static final ResourceLocation tetherBeamTexture = new ResourceLocation(KekzCore.MODID, "textures/effects/Tether_beam.png"); public void renderTileEntityAt(TE_SpaceElevatorTether teTether, double x, double y, double z, float partialTick) { - float sthBeamLength = 1.0F; // 0.1F is about 30 or so blocks? + float beamLengthScale = 1.0F; // [0.0F, 1.0F] -> linear scale from 0 to 256 GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); // Get Tessellator instance @@ -43,28 +42,28 @@ public class TetherRenderer extends TileEntitySpecialRenderer { double d_rot6 = 0.5D + Math.sin(3.9269908169872414D) * halfBeamWidth; double d_rot7 = 0.5D + Math.cos(5.497787143782138D) * halfBeamWidth; double d_rot8 = 0.5D + Math.sin(5.497787143782138D) * halfBeamWidth; // ...until here - double d23 = 256.0F * sthBeamLength; + double height = 256.0F * beamLengthScale; double uv_x1 = 0.0D; double uv_x2 = 1.0D; double uv_y1 = -1.0D; // This makes the beam stream upwards if you add a time sensitive number to it - double uv_y2 = (double)(256.0F * sthBeamLength) * (0.5D / halfBeamWidth) + uv_y1; + double uv_y2 = (double)(256.0F * beamLengthScale) * (0.5D / halfBeamWidth) + uv_y1; // Construct mesh with texture - tessellator.addVertexWithUV(x + d_rot1, y + d23, z + d_rot2, uv_x2, uv_y2); + tessellator.addVertexWithUV(x + d_rot1, y + height, z + d_rot2, uv_x2, uv_y2); tessellator.addVertexWithUV(x + d_rot1, y, z + d_rot2, uv_x2, uv_y1); tessellator.addVertexWithUV(x + d_rot3, y, z + d_rot4, uv_x1, uv_y1); - tessellator.addVertexWithUV(x + d_rot3, y + d23, z + d_rot4, uv_x1, uv_y2); - tessellator.addVertexWithUV(x + d_rot7, y + d23, z + d_rot8, uv_x2, uv_y2); + tessellator.addVertexWithUV(x + d_rot3, y + height, z + d_rot4, uv_x1, uv_y2); + tessellator.addVertexWithUV(x + d_rot7, y + height, z + d_rot8, uv_x2, uv_y2); tessellator.addVertexWithUV(x + d_rot7, y, z + d_rot8, uv_x2, uv_y1); tessellator.addVertexWithUV(x + d_rot5, y, z + d_rot6, uv_x1, uv_y1); - tessellator.addVertexWithUV(x + d_rot5, y + d23, z + d_rot6, uv_x1, uv_y2); - tessellator.addVertexWithUV(x + d_rot3, y + d23, z + d_rot4, uv_x2, uv_y2); + tessellator.addVertexWithUV(x + d_rot5, y + height, z + d_rot6, uv_x1, uv_y2); + tessellator.addVertexWithUV(x + d_rot3, y + height, z + d_rot4, uv_x2, uv_y2); tessellator.addVertexWithUV(x + d_rot3, y, z + d_rot4, uv_x2, uv_y1); tessellator.addVertexWithUV(x + d_rot7, y, z + d_rot8, uv_x1, uv_y1); - tessellator.addVertexWithUV(x + d_rot7, y + d23, z + d_rot8, uv_x1, uv_y2); - tessellator.addVertexWithUV(x + d_rot5, y + d23, z + d_rot6, uv_x2, uv_y2); + tessellator.addVertexWithUV(x + d_rot7, y + height, z + d_rot8, uv_x1, uv_y2); + tessellator.addVertexWithUV(x + d_rot5, y + height, z + d_rot6, uv_x2, uv_y2); tessellator.addVertexWithUV(x + d_rot5, y, z + d_rot6, uv_x2, uv_y1); tessellator.addVertexWithUV(x + d_rot1, y, z + d_rot2, uv_x1, uv_y1); - tessellator.addVertexWithUV(x + d_rot1, y + d23, z + d_rot2, uv_x1, uv_y2); + tessellator.addVertexWithUV(x + d_rot1, y + height, z + d_rot2, uv_x1, uv_y2); // Draw! tessellator.draw(); |