OSDN Git Service

いろいろした
[chemicraft/chemicraft.git] / common / pcc / chemicraft / base / render / RenderDust.java
1 package pcc.chemicraft.base.render;
2
3 import net.minecraft.client.renderer.Tessellator;
4 import net.minecraft.client.renderer.entity.RenderEntity;
5 import net.minecraft.entity.Entity;
6
7 import org.lwjgl.opengl.GL11;
8 import org.lwjgl.opengl.GL12;
9
10 import cpw.mods.fml.relauncher.Side;
11 import cpw.mods.fml.relauncher.SideOnly;
12
13 import pcc.chemicraft.base.entity.EntityDust;
14 import pcc.chemicraft.core.ChemiCraftCore;
15
16 /**
17  * 粉塵のRenderです
18  * @author mozipi
19  */
20 @SideOnly(Side.CLIENT)
21 public class RenderDust extends RenderEntity {
22
23         @Override
24         public void doRender(Entity var1, double var2, double var4, double var6,
25                         float var8, float var9) {
26                 EntityDust entity = (EntityDust) var1;
27                 GL11.glPushMatrix();
28                 GL11.glTranslatef((float)var2, (float)var4, (float)var6);
29                 GL11.glEnable(GL12.GL_RESCALE_NORMAL);
30                 float var10 = entity.getDelay() / 8.0F;
31                 GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
32                 byte var11 = 0;
33                 this.loadTexture(ChemiCraftCore.instance.ENTITY_PARTICLE_TEXRURE);
34                 Tessellator var12 = Tessellator.instance;
35                 float var13 = (float)(var11 % 256 * 256 + 0) / 256F;
36                 float var14 = (float)(var11 % 256 * 256 + 256) / 256F;
37                 float var15 = (float)(var11 / 256 * 256 + 0) / 256F;
38                 float var16 = (float)(var11 / 256 * 256 + 256) / 256F;
39                 float var17 = 1.0F;
40                 float var18 = 0.5F;
41                 float var19 = 0.25F;
42                 GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
43                 GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
44                 var12.startDrawingQuads();
45                 var12.setNormal(0.0F, 1.0F, 0.0F);
46                 var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
47                 var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
48                 var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
49                 var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
50                 var12.draw();
51                 GL11.glDisable(GL12.GL_RESCALE_NORMAL);
52                 GL11.glPopMatrix();
53         }
54
55 }