| 1 | package net.minecraft.client.particle;
|
| 2 |
|
| 3 | import net.minecraft.client.Minecraft;
|
| 4 | import net.minecraft.client.renderer.WorldRenderer;
|
| 5 | import net.minecraft.entity.Entity;
|
| 6 | import net.minecraft.init.Blocks;
|
| 7 | import net.minecraft.item.Item;
|
| 8 | import net.minecraft.world.World;
|
| 9 |
|
| 10 | public class Barrier extends EntityFX
|
| 11 | {
|
| 12 | protected Barrier(World worldIn, double p_i46286_2_, double p_i46286_4_, double p_i46286_6_, Item p_i46286_8_)
|
| 13 | {
|
| 14 | super(worldIn, p_i46286_2_, p_i46286_4_, p_i46286_6_, 0.0D, 0.0D, 0.0D);
|
| 15 | this.setParticleIcon(Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(p_i46286_8_));
|
| 16 | this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
|
| 17 | this.motionX = this.motionY = this.motionZ = 0.0D;
|
| 18 | this.particleGravity = 0.0F;
|
| 19 | this.particleMaxAge = 80;
|
| 20 | }
|
| 21 |
|
| 22 | public int getFXLayer()
|
| 23 | {
|
| 24 | return 1;
|
| 25 | }
|
| 26 |
|
| 27 | /**
|
| 28 | * Renders the particle
|
| 29 | */
|
| 30 | public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
|
| 31 | {
|
| 32 | float f = this.particleIcon.getMinU();
|
| 33 | float f1 = this.particleIcon.getMaxU();
|
| 34 | float f2 = this.particleIcon.getMinV();
|
| 35 | float f3 = this.particleIcon.getMaxV();
|
| 36 | float f4 = 0.5F;
|
| 37 | float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
|
| 38 | float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
|
| 39 | float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
|
| 40 | int i = this.getBrightnessForRender(partialTicks);
|
| 41 | int j = i >> 16 & 65535;
|
| 42 | int k = i & 65535;
|
| 43 | worldRendererIn.pos((double)(f5 - rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
|
| 44 | worldRendererIn.pos((double)(f5 - rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
|
| 45 | worldRendererIn.pos((double)(f5 + rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
|
| 46 | worldRendererIn.pos((double)(f5 + rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
|
| 47 | }
|
| 48 |
|
| 49 | public static class Factory implements IParticleFactory
|
| 50 | {
|
| 51 | public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
| 52 | {
|
| 53 | return new Barrier(worldIn, xCoordIn, yCoordIn, zCoordIn, Item.getItemFromBlock(Blocks.barrier));
|
| 54 | }
|
| 55 | }
|
| 56 | }
|
| 57 |
|