De-obfuscate dart render code
This commit is contained in:
parent
555e96af81
commit
7dc1020de2
|
@ -39,62 +39,69 @@ public class RenderDart extends Render
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: de-obfuscate
|
||||
public void doRender(EntityDart dart, double p_180551_2_, double p_180551_4_, double p_180551_6_, float p_180551_8_, float p_180551_9_)
|
||||
public void doRender(EntityDart dart, double x, double y, double z, float entityYaw, float partialTicks)
|
||||
{
|
||||
this.bindEntityTexture(dart);
|
||||
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GlStateManager.pushMatrix();
|
||||
GlStateManager.translate((float)p_180551_2_, (float)p_180551_4_, (float)p_180551_6_);
|
||||
GlStateManager.rotate(dart.prevRotationYaw + (dart.rotationYaw - dart.prevRotationYaw) * p_180551_9_ - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(dart.prevRotationPitch + (dart.rotationPitch - dart.prevRotationPitch) * p_180551_9_, 0.0F, 0.0F, 1.0F);
|
||||
GlStateManager.translate((float)x, (float)y, (float)z);
|
||||
GlStateManager.rotate(dart.prevRotationYaw + (dart.rotationYaw - dart.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GlStateManager.rotate(dart.prevRotationPitch + (dart.rotationPitch - dart.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
|
||||
byte b0 = 0;
|
||||
float f2 = 0.0F;
|
||||
float f3 = 0.5F;
|
||||
float f4 = (float)(0 + b0 * 10) / 32.0F;
|
||||
float f5 = (float)(5 + b0 * 10) / 32.0F;
|
||||
float f6 = 0.0F;
|
||||
float f7 = 0.15625F;
|
||||
float f8 = (float)(5 + b0 * 10) / 32.0F;
|
||||
float f9 = (float)(10 + b0 * 10) / 32.0F;
|
||||
float f10 = 0.05625F;
|
||||
|
||||
float shaft_u0 = 0.0F;
|
||||
float shaft_u1 = 0.5F;
|
||||
float shaft_v0 = 0.0F;
|
||||
float shaft_v1 = 0.15625F;
|
||||
|
||||
float flights_u0 = 0.0F;
|
||||
float flights_u1 = 0.15625F;
|
||||
float flights_v0 = 0.15625F;
|
||||
float flights_v1 = 0.3125F;
|
||||
|
||||
float scale = 0.05625F;
|
||||
GlStateManager.enableRescaleNormal();
|
||||
|
||||
// render flights
|
||||
|
||||
GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
|
||||
GlStateManager.scale(f10, f10, f10);
|
||||
GlStateManager.scale(scale, scale, scale);
|
||||
GlStateManager.translate(-4.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(f10, 0.0F, 0.0F);
|
||||
|
||||
GL11.glNormal3f(scale, 0.0F, 0.0F);
|
||||
worldrenderer.startDrawingQuads();
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f8);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f8);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f9);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f9);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)flights_u0, (double)flights_v0);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)flights_u1, (double)flights_v0);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)flights_u1, (double)flights_v1);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)flights_u0, (double)flights_v1);
|
||||
tessellator.draw();
|
||||
GL11.glNormal3f(-f10, 0.0F, 0.0F);
|
||||
|
||||
GL11.glNormal3f(-scale, 0.0F, 0.0F);
|
||||
worldrenderer.startDrawingQuads();
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)f6, (double)f8);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)f7, (double)f8);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)f7, (double)f9);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)f6, (double)f9);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)flights_u0, (double)flights_v0);
|
||||
worldrenderer.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)flights_u1, (double)flights_v0);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)flights_u1, (double)flights_v1);
|
||||
worldrenderer.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)flights_u0, (double)flights_v1);
|
||||
tessellator.draw();
|
||||
|
||||
// render shaft
|
||||
|
||||
for (int i = 0; i < 4; ++i)
|
||||
{
|
||||
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glNormal3f(0.0F, 0.0F, f10);
|
||||
GL11.glNormal3f(0.0F, 0.0F, scale);
|
||||
worldrenderer.startDrawingQuads();
|
||||
worldrenderer.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)f2, (double)f4);
|
||||
worldrenderer.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)f3, (double)f4);
|
||||
worldrenderer.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)f3, (double)f5);
|
||||
worldrenderer.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)f2, (double)f5);
|
||||
worldrenderer.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)shaft_u0, (double)shaft_v0);
|
||||
worldrenderer.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)shaft_u1, (double)shaft_v0);
|
||||
worldrenderer.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)shaft_u1, (double)shaft_v1);
|
||||
worldrenderer.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)shaft_u0, (double)shaft_v1);
|
||||
tessellator.draw();
|
||||
}
|
||||
|
||||
GlStateManager.disableRescaleNormal();
|
||||
GlStateManager.popMatrix();
|
||||
super.doRender(dart, p_180551_2_, p_180551_4_, p_180551_6_, p_180551_8_, p_180551_9_);
|
||||
super.doRender(dart, x, y, z, entityYaw, partialTicks);
|
||||
}
|
||||
|
||||
protected ResourceLocation getEntityTexture(EntityDart dart)
|
||||
|
|
Loading…
Reference in New Issue