OSDN Git Service

粉塵実装。デバッグよろしくお願いします
[chemicraft/chemicraft.git] / common / pcc / chemicraft / render / RenderDust.java
1 package pcc.chemicraft.render;
2
3 import org.lwjgl.opengl.GL11;
4 import org.lwjgl.opengl.GL12;
5
6 import pcc.chemicraft.ChemiCraft;
7 import pcc.chemicraft.entity.EntityDust;
8 import net.minecraft.client.renderer.Tessellator;
9 import net.minecraft.client.renderer.entity.RenderEntity;
10 import net.minecraft.entity.Entity;
11
12 public class RenderDust extends RenderEntity {
13
14         @Override
15         public void doRender(Entity var1, double var2, double var4, double var6,
16                         float var8, float var9) {
17                 EntityDust entity = (EntityDust) var1;
18                 GL11.glPushMatrix();
19                 GL11.glTranslatef((float)var2, (float)var4, (float)var6);
20                 GL11.glEnable(GL12.GL_RESCALE_NORMAL);
21                 float var10 = entity.getDelay() / 8.0F;
22                 GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
23                 byte var11 = 0;
24                 this.loadTexture(ChemiCraft.instance.ENTITY_PARTICLE_TEXRURE);
25                 Tessellator var12 = Tessellator.instance;
26                 float var13 = (float)(var11 % 256 * 256 + 0) / 256F;
27                 float var14 = (float)(var11 % 256 * 256 + 256) / 256F;
28                 float var15 = (float)(var11 / 256 * 256 + 0) / 256F;
29                 float var16 = (float)(var11 / 256 * 256 + 256) / 256F;
30                 float var17 = 1.0F;
31                 float var18 = 0.5F;
32                 float var19 = 0.25F;
33                 GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
34                 GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
35                 var12.startDrawingQuads();
36                 var12.setNormal(0.0F, 1.0F, 0.0F);
37                 var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
38                 var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
39                 var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
40                 var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
41                 var12.draw();
42                 GL11.glDisable(GL12.GL_RESCALE_NORMAL);
43                 GL11.glPopMatrix();
44         }
45
46 }