package kubatech.client.effect; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.init.Blocks; import net.minecraft.world.World; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class CropRenderer extends EntityFX { int meta; public CropRenderer(World world, int x, int y, int z, int meta, int age) { super(world, (double) x, ((double) y - 0.0625d), (double) z); this.prevPosX = this.posX; this.prevPosY = this.posY; this.prevPosZ = this.posZ; this.particleMaxAge = age; this.meta = meta; } @Override public void onUpdate() { if (this.particleAge++ >= this.particleMaxAge) this.setDead(); } @Override public void renderParticle( Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_) { Tessellator tessellator = Tessellator.instance; GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); tessellator.setColorRGBA(255, 255, 255, 255); float f11 = (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) p_70539_2_ - interpPosX); float f12 = (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) p_70539_2_ - interpPosY); float f13 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) p_70539_2_ - interpPosZ); RenderBlocks.getInstance().renderBlockCropsImpl(Blocks.wheat, meta, f11, f12, f13); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); } @Override public int getFXLayer() { return 1; } @Override public boolean shouldRenderInPass(int pass) { return pass == 2; } }