Fixed a few issues with pipe renders

This commit is contained in:
DarkGuardsman 2014-01-12 02:23:57 -05:00
parent 605d4212c5
commit bca0fbdbaf
5 changed files with 563 additions and 558 deletions

View file

@ -2,8 +2,13 @@ package resonantinduction.mechanical;
import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.client.MinecraftForgeClient;
import resonantinduction.mechanical.fluid.pipe.ItemPipeRenderer; import resonantinduction.mechanical.fluid.pipe.ItemPipeRenderer;
import resonantinduction.mechanical.fluid.pipe.RenderPipe;
import resonantinduction.mechanical.fluid.pipe.TilePipe;
import resonantinduction.mechanical.fluid.tank.ItemTankRenderer; import resonantinduction.mechanical.fluid.tank.ItemTankRenderer;
import resonantinduction.mechanical.fluid.tank.RenderTank;
import resonantinduction.mechanical.fluid.tank.TileTank;
import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler; import resonantinduction.mechanical.render.MechanicalBlockRenderingHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.client.registry.RenderingRegistry;
public class ClientProxy extends CommonProxy public class ClientProxy extends CommonProxy
@ -19,5 +24,7 @@ public class ClientProxy extends CommonProxy
{ {
MinecraftForgeClient.registerItemRenderer(Mechanical.blockTank.blockID, new ItemTankRenderer()); MinecraftForgeClient.registerItemRenderer(Mechanical.blockTank.blockID, new ItemTankRenderer());
MinecraftForgeClient.registerItemRenderer(Mechanical.blockPipe.blockID, new ItemPipeRenderer()); MinecraftForgeClient.registerItemRenderer(Mechanical.blockPipe.blockID, new ItemPipeRenderer());
ClientRegistry.bindTileEntitySpecialRenderer(TilePipe.class, new RenderPipe());
ClientRegistry.bindTileEntitySpecialRenderer(TileTank.class, new RenderTank());
} }
} }

View file

@ -95,7 +95,6 @@ public class ItemBlockFluidContainer extends ItemBlock
{ {
return 1; return 1;
} }
return this.maxStackSize; return this.maxStackSize;
} }
@ -108,7 +107,7 @@ public class ItemBlockFluidContainer extends ItemBlock
@Override @Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{ {
if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (stack.getItemDamage() / FluidContainerMaterial.spacing))) if (super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, (metadata / FluidContainerMaterial.spacing)))
{ {
TileEntity tile = world.getBlockTileEntity(x, y, z); TileEntity tile = world.getBlockTileEntity(x, y, z);
if (tile instanceof TileFluidNetwork) if (tile instanceof TileFluidNetwork)

View file

@ -45,26 +45,26 @@ public class ItemPipeRenderer implements IItemRenderer
if (type == ItemRenderType.ENTITY) if (type == ItemRenderType.ENTITY)
{ {
GL11.glTranslatef(-.5F, -1F, -.5F); GL11.glTranslatef(-.5F, -1F, -.5F);
RenderPipe.render(meta, (byte) 0b000011); RenderPipe.render(meta, (byte) 0b001100);
} }
else if (type == ItemRenderType.INVENTORY) else if (type == ItemRenderType.INVENTORY)
{ {
GL11.glTranslatef(0F, -1F, 0F); GL11.glTranslatef(0F, -1F, 0F);
RenderPipe.render(meta, (byte) 0b000011); RenderPipe.render(meta, (byte) 0b001100);
} }
else if (type == ItemRenderType.EQUIPPED) else if (type == ItemRenderType.EQUIPPED)
{ {
GL11.glTranslatef(-1F, -1.2F, 0.5F); GL11.glTranslatef(-1F, -1.2F, 0.5F);
RenderPipe.render(meta, (byte) 0b001100); RenderPipe.render(meta, (byte) 0b000011);
} }
else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON) else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
{ {
GL11.glTranslatef(-2F, -1.5F, 0.2F); GL11.glTranslatef(-2F, -1.5F, 0.2F);
RenderPipe.render(meta, (byte) 0b001100); RenderPipe.render(meta, (byte) 0b000011);
} }
else else
{ {
RenderPipe.render(item.getItemDamage(), (byte) 0b001100); RenderPipe.render(item.getItemDamage(), (byte) 0b000011);
} }
if (Mechanical.blockReleaseValve != null && item.itemID == Mechanical.blockReleaseValve.blockID) if (Mechanical.blockReleaseValve != null && item.itemID == Mechanical.blockReleaseValve.blockID)
{ {

View file

@ -26,175 +26,175 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class RenderPipe extends TileEntitySpecialRenderer public class RenderPipe extends TileEntitySpecialRenderer
{ {
public static ModelPipe MODEL_PIPE = new ModelPipe(); public static ModelPipe MODEL_PIPE = new ModelPipe();
public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough(); public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough();
private static HashMap<Pair<FluidContainerMaterial, Integer>, ResourceLocation> TEXTURES = new HashMap<Pair<FluidContainerMaterial, Integer>, ResourceLocation>(); private static HashMap<Pair<FluidContainerMaterial, Integer>, ResourceLocation> TEXTURES = new HashMap<Pair<FluidContainerMaterial, Integer>, ResourceLocation>();
public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pipe.png"); public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_DIRECTORY + "pipe.png");
@Override @Override
public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f) public void renderTileEntityAt(TileEntity te, double d, double d1, double d2, float f)
{ {
FluidContainerMaterial mat = FluidContainerMaterial.IRON; FluidContainerMaterial mat = FluidContainerMaterial.IRON;
if (te.getBlockMetadata() < FluidContainerMaterial.values().length) if (te.getBlockMetadata() < FluidContainerMaterial.values().length)
{ {
mat = FluidContainerMaterial.values()[te.getBlockMetadata()]; mat = FluidContainerMaterial.values()[te.getBlockMetadata()];
} }
if (te instanceof TilePipe) if (te instanceof TilePipe)
{ {
TilePipe tile = (TilePipe) te; TilePipe tile = (TilePipe) te;
if (mat == FluidContainerMaterial.WOOD || mat == FluidContainerMaterial.STONE) if (mat == FluidContainerMaterial.WOOD || mat == FluidContainerMaterial.STONE)
{ {
FluidStack liquid = tile.getTank().getFluid(); FluidStack liquid = tile.getTank().getFluid();
int cap = tile.getTankInfo()[0].capacity; int cap = tile.getTankInfo()[0].capacity;
// FluidStack liquid = new FluidStack(FluidRegistry.WATER, cap); // FluidStack liquid = new FluidStack(FluidRegistry.WATER, cap);
if (liquid != null && liquid.amount > 100) if (liquid != null && liquid.amount > 100)
{ {
float per = Math.max(1, (float) liquid.amount / (float) (cap)); float per = Math.max(1, (float) liquid.amount / (float) (cap));
int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, te.worldObj, false); int[] displayList = RenderFluidHelper.getFluidDisplayLists(liquid, te.worldObj, false);
bindTexture(RenderFluidHelper.getFluidSheet(liquid)); bindTexture(RenderFluidHelper.getFluidSheet(liquid));
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.3F); GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.3F);
GL11.glScalef(0.4F, 0.4F, 0.4F); GL11.glScalef(0.4F, 0.4F, 0.4F);
GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]);
GL11.glPopAttrib(); GL11.glPopAttrib();
GL11.glPopMatrix(); GL11.glPopMatrix();
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
{ {
if (tile.canRenderSide(direction)) if (tile.canRenderSide(direction))
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
switch (direction.ordinal()) switch (direction.ordinal())
{ {
case 4: case 4:
GL11.glTranslatef((float) d + 0F, (float) d1 + 0.1F, (float) d2 + 0.3F); GL11.glTranslatef((float) d + 0F, (float) d1 + 0.1F, (float) d2 + 0.3F);
break; break;
case 5: case 5:
GL11.glTranslatef((float) d + 0.7F, (float) d1 + 0.1F, (float) d2 + 0.3F); GL11.glTranslatef((float) d + 0.7F, (float) d1 + 0.1F, (float) d2 + 0.3F);
break; break;
case 2: case 2:
GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0F); GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0F);
break; break;
case 3: case 3:
GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.7F); GL11.glTranslatef((float) d + 0.3F, (float) d1 + 0.1F, (float) d2 + 0.7F);
break; break;
} }
GL11.glScalef(0.3F, 0.4F, 0.4F); GL11.glScalef(0.3F, 0.4F, 0.4F);
GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]); GL11.glCallList(displayList[(int) (per * (RenderFluidHelper.DISPLAY_STAGES - 1))]);
GL11.glPopAttrib(); GL11.glPopAttrib();
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }
} }
} }
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F); GL11.glScalef(1.0F, -1F, -1F);
bindTexture(RenderPipe.getTexture(mat, 0)); bindTexture(RenderPipe.getTexture(mat, 0));
render(mat, tile.getSubID(), tile.renderSides); render(mat, tile.getSubID(), tile.renderSides);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
else else
{ {
GL11.glPushMatrix(); GL11.glPushMatrix();
GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F); GL11.glTranslatef((float) d + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
GL11.glScalef(1.0F, -1F, -1F); GL11.glScalef(1.0F, -1F, -1F);
render(mat, 0, (byte) 0b0); render(mat, 0, (byte) 0b0);
GL11.glPopMatrix(); GL11.glPopMatrix();
} }
} }
public static ResourceLocation getTexture(FluidContainerMaterial mat, int pipeID) public static ResourceLocation getTexture(FluidContainerMaterial mat, int pipeID)
{ {
if (mat != null) if (mat != null)
{ {
Pair<FluidContainerMaterial, Integer> index = new Pair<FluidContainerMaterial, Integer>(mat, pipeID); Pair<FluidContainerMaterial, Integer> index = new Pair<FluidContainerMaterial, Integer>(mat, pipeID);
if (!TEXTURES.containsKey(index)) if (!TEXTURES.containsKey(index))
{ {
String pipeName = ""; String pipeName = "";
if (EnumPipeType.get(pipeID) != null) if (EnumPipeType.get(pipeID) != null)
{ {
pipeName = EnumPipeType.get(pipeID).getName(pipeID); pipeName = EnumPipeType.get(pipeID).getName(pipeID);
} }
TEXTURES.put(index, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe/" + mat.matName + ".png")); TEXTURES.put(index, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe/" + mat.matName + ".png"));
} }
return TEXTURES.get(index); return TEXTURES.get(index);
} }
return TEXTURE; return TEXTURE;
} }
public static ResourceLocation getTexture(int meta) public static ResourceLocation getTexture(int meta)
{ {
return getTexture(FluidContainerMaterial.getFromItemMeta(meta), FluidContainerMaterial.getType(meta)); return getTexture(FluidContainerMaterial.getFromItemMeta(meta), FluidContainerMaterial.getType(meta));
} }
public static void render(FluidContainerMaterial mat, int pipeID, byte side) public static void render(FluidContainerMaterial mat, int pipeID, byte side)
{ {
if (mat == FluidContainerMaterial.WOOD) if (mat == FluidContainerMaterial.WOOD)
{ {
// MODEL_TROUGH_PIPE.render(side, false); MODEL_TROUGH_PIPE.render(side, false);
} }
else if (mat == FluidContainerMaterial.STONE) else if (mat == FluidContainerMaterial.STONE)
{ {
// MODEL_TROUGH_PIPE.render(side, true); MODEL_TROUGH_PIPE.render(side, true);
} }
else else
{ {
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.DOWN)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.DOWN))
{ {
MODEL_PIPE.renderBottom(); MODEL_PIPE.renderBottom();
} }
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.UP)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.UP))
{ {
MODEL_PIPE.renderTop(); MODEL_PIPE.renderTop();
} }
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.NORTH)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.NORTH))
{ {
MODEL_PIPE.renderBack(); MODEL_PIPE.renderBack();
} }
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.SOUTH)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.SOUTH))
{ {
MODEL_PIPE.renderFront(); MODEL_PIPE.renderFront();
} }
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.WEST)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.WEST))
{ {
MODEL_PIPE.renderLeft(); MODEL_PIPE.renderLeft();
} }
if (TileFluidNetwork.canRenderSide(side, ForgeDirection.EAST)) if (TileFluidNetwork.canRenderSide(side, ForgeDirection.EAST))
{ {
MODEL_PIPE.renderRight(); MODEL_PIPE.renderRight();
} }
MODEL_PIPE.renderMiddle(); MODEL_PIPE.renderMiddle();
} }
} }
public static void render(int meta, byte sides) public static void render(int meta, byte sides)
{ {
render(FluidContainerMaterial.getFromItemMeta(meta), FluidContainerMaterial.getType(meta), sides); render(FluidContainerMaterial.getFromItemMeta(meta), FluidContainerMaterial.getType(meta), sides);
} }
} }

View file

@ -6,420 +6,419 @@
package resonantinduction.old.client.model; package resonantinduction.old.client.model;
import resonantinduction.mechanical.fluid.prefab.TileFluidNetwork;
import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.model.ModelRenderer;
import net.minecraftforge.common.ForgeDirection;
public class ModelOpenTrough extends ModelBase public class ModelOpenTrough extends ModelBase
{ {
// fields // fields
ModelRenderer base; ModelRenderer base;
ModelRenderer leftBase; ModelRenderer leftBase;
ModelRenderer leftBaseB; ModelRenderer leftBaseB;
ModelRenderer rightBaseB; ModelRenderer rightBaseB;
ModelRenderer rightBase; ModelRenderer rightBase;
ModelRenderer frontBase; ModelRenderer frontBase;
ModelRenderer frontBaseB; ModelRenderer frontBaseB;
ModelRenderer backBase; ModelRenderer backBase;
ModelRenderer backBaseB; ModelRenderer backBaseB;
ModelRenderer frontA; ModelRenderer frontA;
ModelRenderer frontB; ModelRenderer frontB;
ModelRenderer backA; ModelRenderer backA;
ModelRenderer backB; ModelRenderer backB;
ModelRenderer rightA; ModelRenderer rightA;
ModelRenderer rightB; ModelRenderer rightB;
ModelRenderer leftB; ModelRenderer leftB;
ModelRenderer leftA; ModelRenderer leftA;
ModelRenderer centerA; ModelRenderer centerA;
ModelRenderer centerB; ModelRenderer centerB;
ModelRenderer centerC; ModelRenderer centerC;
ModelRenderer centerD; ModelRenderer centerD;
ModelRenderer frontDoorA; ModelRenderer frontDoorA;
ModelRenderer frontDoorB; ModelRenderer frontDoorB;
ModelRenderer frontDoorC; ModelRenderer frontDoorC;
ModelRenderer backDoorA; ModelRenderer backDoorA;
ModelRenderer backDoorB; ModelRenderer backDoorB;
ModelRenderer backDoorC; ModelRenderer backDoorC;
ModelRenderer leftDoorA; ModelRenderer leftDoorA;
ModelRenderer leftDoorB; ModelRenderer leftDoorB;
ModelRenderer leftDoorC; ModelRenderer leftDoorC;
ModelRenderer rightDoorA; ModelRenderer rightDoorA;
ModelRenderer rightDoorB; ModelRenderer rightDoorB;
ModelRenderer rightDoorC; ModelRenderer rightDoorC;
ModelRenderer cornerBackLeft; ModelRenderer cornerBackLeft;
ModelRenderer cornerBackRight; ModelRenderer cornerBackRight;
ModelRenderer cornerFrontLeft; ModelRenderer cornerFrontLeft;
ModelRenderer cornerFrontRight; ModelRenderer cornerFrontRight;
public ModelOpenTrough() public ModelOpenTrough()
{ {
textureWidth = 128; textureWidth = 128;
textureHeight = 128; textureHeight = 128;
base = new ModelRenderer(this, 0, 0); base = new ModelRenderer(this, 0, 0);
base.addBox(-4F, 0F, -4F, 8, 2, 8); base.addBox(-4F, 0F, -4F, 8, 2, 8);
base.setRotationPoint(0F, 22F, 0F); base.setRotationPoint(0F, 22F, 0F);
base.setTextureSize(64, 32); base.setTextureSize(64, 32);
base.mirror = true; base.mirror = true;
setRotation(base, 0F, 0F, 0F); setRotation(base, 0F, 0F, 0F);
leftBase = new ModelRenderer(this, 32, 0); leftBase = new ModelRenderer(this, 32, 0);
leftBase.addBox(-4F, 0F, -4F, 4, 1, 8); leftBase.addBox(-4F, 0F, -4F, 4, 1, 8);
leftBase.setRotationPoint(8F, 22F, 0F); leftBase.setRotationPoint(8F, 22F, 0F);
leftBase.setTextureSize(64, 32); leftBase.setTextureSize(64, 32);
leftBase.mirror = true; leftBase.mirror = true;
setRotation(leftBase, 0F, 0F, 0F); setRotation(leftBase, 0F, 0F, 0F);
leftBaseB = new ModelRenderer(this, 36, 10); leftBaseB = new ModelRenderer(this, 36, 10);
leftBaseB.addBox(-4F, 0F, -3F, 4, 1, 6); leftBaseB.addBox(-4F, 0F, -3F, 4, 1, 6);
leftBaseB.setRotationPoint(8F, 23F, 0F); leftBaseB.setRotationPoint(8F, 23F, 0F);
leftBaseB.setTextureSize(64, 32); leftBaseB.setTextureSize(64, 32);
leftBaseB.mirror = true; leftBaseB.mirror = true;
setRotation(leftBaseB, 0F, 0F, 0F); setRotation(leftBaseB, 0F, 0F, 0F);
rightBaseB = new ModelRenderer(this, 36, 10); rightBaseB = new ModelRenderer(this, 36, 10);
rightBaseB.addBox(-4F, 0F, -3F, 4, 1, 6); rightBaseB.addBox(-4F, 0F, -3F, 4, 1, 6);
rightBaseB.setRotationPoint(-4F, 23F, 0F); rightBaseB.setRotationPoint(-4F, 23F, 0F);
rightBaseB.setTextureSize(64, 32); rightBaseB.setTextureSize(64, 32);
rightBaseB.mirror = true; rightBaseB.mirror = true;
setRotation(rightBaseB, 0F, 0F, 0F); setRotation(rightBaseB, 0F, 0F, 0F);
rightBase = new ModelRenderer(this, 32, 0); rightBase = new ModelRenderer(this, 32, 0);
rightBase.addBox(-4F, 0F, -4F, 4, 1, 8); rightBase.addBox(-4F, 0F, -4F, 4, 1, 8);
rightBase.setRotationPoint(-4F, 22F, 0F); rightBase.setRotationPoint(-4F, 22F, 0F);
rightBase.setTextureSize(64, 32); rightBase.setTextureSize(64, 32);
rightBase.mirror = true; rightBase.mirror = true;
setRotation(rightBase, 0F, 0F, 0F); setRotation(rightBase, 0F, 0F, 0F);
frontBase = new ModelRenderer(this, 60, 6); frontBase = new ModelRenderer(this, 60, 6);
frontBase.addBox(-3F, 0F, -4F, 6, 1, 4); frontBase.addBox(-3F, 0F, -4F, 6, 1, 4);
frontBase.setRotationPoint(0F, 23F, -4F); frontBase.setRotationPoint(0F, 23F, -4F);
frontBase.setTextureSize(64, 32); frontBase.setTextureSize(64, 32);
frontBase.mirror = true; frontBase.mirror = true;
setRotation(frontBase, 0F, 0F, 0F); setRotation(frontBase, 0F, 0F, 0F);
frontBaseB = new ModelRenderer(this, 58, 0); frontBaseB = new ModelRenderer(this, 58, 0);
frontBaseB.addBox(-4F, 0F, -4F, 8, 1, 4); frontBaseB.addBox(-4F, 0F, -4F, 8, 1, 4);
frontBaseB.setRotationPoint(0F, 22F, -4F); frontBaseB.setRotationPoint(0F, 22F, -4F);
frontBaseB.setTextureSize(64, 32); frontBaseB.setTextureSize(64, 32);
frontBaseB.mirror = true; frontBaseB.mirror = true;
setRotation(frontBaseB, 0F, 0F, 0F); setRotation(frontBaseB, 0F, 0F, 0F);
backBase = new ModelRenderer(this, 58, 0); backBase = new ModelRenderer(this, 58, 0);
backBase.addBox(-4F, 0F, -4F, 8, 1, 4); backBase.addBox(-4F, 0F, -4F, 8, 1, 4);
backBase.setRotationPoint(0F, 22F, 8F); backBase.setRotationPoint(0F, 22F, 8F);
backBase.setTextureSize(64, 32); backBase.setTextureSize(64, 32);
backBase.mirror = true; backBase.mirror = true;
setRotation(backBase, 0F, 0F, 0F); setRotation(backBase, 0F, 0F, 0F);
backBaseB = new ModelRenderer(this, 60, 6); backBaseB = new ModelRenderer(this, 60, 6);
backBaseB.addBox(-3F, 0F, -4F, 6, 1, 4); backBaseB.addBox(-3F, 0F, -4F, 6, 1, 4);
backBaseB.setRotationPoint(0F, 23F, 8F); backBaseB.setRotationPoint(0F, 23F, 8F);
backBaseB.setTextureSize(64, 32); backBaseB.setTextureSize(64, 32);
backBaseB.mirror = true; backBaseB.mirror = true;
setRotation(backBaseB, 0F, 0F, 0F); setRotation(backBaseB, 0F, 0F, 0F);
frontA = new ModelRenderer(this, 0, 12); frontA = new ModelRenderer(this, 0, 12);
frontA.addBox(-4F, 0F, -4F, 2, 7, 4); frontA.addBox(-4F, 0F, -4F, 2, 7, 4);
frontA.setRotationPoint(0F, 15F, -4F); frontA.setRotationPoint(0F, 15F, -4F);
frontA.setTextureSize(64, 32); frontA.setTextureSize(64, 32);
frontA.mirror = true; frontA.mirror = true;
setRotation(frontA, 0F, 0F, 0F); setRotation(frontA, 0F, 0F, 0F);
frontB = new ModelRenderer(this, 0, 12); frontB = new ModelRenderer(this, 0, 12);
frontB.addBox(-4F, 0F, -4F, 2, 7, 4); frontB.addBox(-4F, 0F, -4F, 2, 7, 4);
frontB.setRotationPoint(6F, 15F, -4F); frontB.setRotationPoint(6F, 15F, -4F);
frontB.setTextureSize(64, 32); frontB.setTextureSize(64, 32);
frontB.mirror = true; frontB.mirror = true;
setRotation(frontB, 0F, 0F, 0F); setRotation(frontB, 0F, 0F, 0F);
backA = new ModelRenderer(this, 0, 12); backA = new ModelRenderer(this, 0, 12);
backA.addBox(-4F, 0F, -4F, 2, 7, 4); backA.addBox(-4F, 0F, -4F, 2, 7, 4);
backA.setRotationPoint(0F, 15F, 8F); backA.setRotationPoint(0F, 15F, 8F);
backA.setTextureSize(64, 32); backA.setTextureSize(64, 32);
backA.mirror = true; backA.mirror = true;
setRotation(backA, 0F, 0F, 0F); setRotation(backA, 0F, 0F, 0F);
backB = new ModelRenderer(this, 0, 12); backB = new ModelRenderer(this, 0, 12);
backB.addBox(-4F, 0F, -4F, 2, 7, 4); backB.addBox(-4F, 0F, -4F, 2, 7, 4);
backB.setRotationPoint(6F, 15F, 8F); backB.setRotationPoint(6F, 15F, 8F);
backB.setTextureSize(64, 32); backB.setTextureSize(64, 32);
backB.mirror = true; backB.mirror = true;
setRotation(backB, 0F, 0F, 0F); setRotation(backB, 0F, 0F, 0F);
rightA = new ModelRenderer(this, 13, 12); rightA = new ModelRenderer(this, 13, 12);
rightA.addBox(-8F, 0F, 0F, 4, 7, 2); rightA.addBox(-8F, 0F, 0F, 4, 7, 2);
rightA.setRotationPoint(0F, 15F, -4F); rightA.setRotationPoint(0F, 15F, -4F);
rightA.setTextureSize(64, 32); rightA.setTextureSize(64, 32);
rightA.mirror = true; rightA.mirror = true;
setRotation(rightA, 0F, 0F, 0F); setRotation(rightA, 0F, 0F, 0F);
rightB = new ModelRenderer(this, 13, 12); rightB = new ModelRenderer(this, 13, 12);
rightB.addBox(-8F, 0F, 6F, 4, 7, 2); rightB.addBox(-8F, 0F, 6F, 4, 7, 2);
rightB.setRotationPoint(0F, 15F, -4F); rightB.setRotationPoint(0F, 15F, -4F);
rightB.setTextureSize(64, 32); rightB.setTextureSize(64, 32);
rightB.mirror = true; rightB.mirror = true;
setRotation(rightB, 0F, 0F, 0F); setRotation(rightB, 0F, 0F, 0F);
leftB = new ModelRenderer(this, 13, 12); leftB = new ModelRenderer(this, 13, 12);
leftB.addBox(4F, 0F, 6F, 4, 7, 2); leftB.addBox(4F, 0F, 6F, 4, 7, 2);
leftB.setRotationPoint(0F, 15F, -4F); leftB.setRotationPoint(0F, 15F, -4F);
leftB.setTextureSize(64, 32); leftB.setTextureSize(64, 32);
leftB.mirror = true; leftB.mirror = true;
setRotation(leftB, 0F, 0F, 0F); setRotation(leftB, 0F, 0F, 0F);
leftA = new ModelRenderer(this, 13, 12); leftA = new ModelRenderer(this, 13, 12);
leftA.addBox(4F, 0F, 0F, 4, 7, 2); leftA.addBox(4F, 0F, 0F, 4, 7, 2);
leftA.setRotationPoint(0F, 15F, -4F); leftA.setRotationPoint(0F, 15F, -4F);
leftA.setTextureSize(64, 32); leftA.setTextureSize(64, 32);
leftA.mirror = true; leftA.mirror = true;
setRotation(leftA, 0F, 0F, 0F); setRotation(leftA, 0F, 0F, 0F);
centerA = new ModelRenderer(this, 27, 12); centerA = new ModelRenderer(this, 27, 12);
centerA.addBox(-4F, 0F, -4F, 2, 7, 2); centerA.addBox(-4F, 0F, -4F, 2, 7, 2);
centerA.setRotationPoint(6F, 15F, 6F); centerA.setRotationPoint(6F, 15F, 6F);
centerA.setTextureSize(64, 32); centerA.setTextureSize(64, 32);
centerA.mirror = true; centerA.mirror = true;
setRotation(centerA, 0F, 0F, 0F); setRotation(centerA, 0F, 0F, 0F);
centerB = new ModelRenderer(this, 27, 12); centerB = new ModelRenderer(this, 27, 12);
centerB.addBox(-4F, 0F, -4F, 2, 7, 2); centerB.addBox(-4F, 0F, -4F, 2, 7, 2);
centerB.setRotationPoint(6F, 15F, 0F); centerB.setRotationPoint(6F, 15F, 0F);
centerB.setTextureSize(64, 32); centerB.setTextureSize(64, 32);
centerB.mirror = true; centerB.mirror = true;
setRotation(centerB, 0F, 0F, 0F); setRotation(centerB, 0F, 0F, 0F);
centerC = new ModelRenderer(this, 27, 12); centerC = new ModelRenderer(this, 27, 12);
centerC.addBox(-4F, 0F, -4F, 2, 7, 2); centerC.addBox(-4F, 0F, -4F, 2, 7, 2);
centerC.setRotationPoint(0F, 15F, 0F); centerC.setRotationPoint(0F, 15F, 0F);
centerC.setTextureSize(64, 32); centerC.setTextureSize(64, 32);
centerC.mirror = true; centerC.mirror = true;
setRotation(centerC, 0F, 0F, 0F); setRotation(centerC, 0F, 0F, 0F);
centerD = new ModelRenderer(this, 27, 12); centerD = new ModelRenderer(this, 27, 12);
centerD.addBox(-4F, 0F, -4F, 2, 7, 2); centerD.addBox(-4F, 0F, -4F, 2, 7, 2);
centerD.setRotationPoint(0F, 15F, 6F); centerD.setRotationPoint(0F, 15F, 6F);
centerD.setTextureSize(64, 32); centerD.setTextureSize(64, 32);
centerD.mirror = true; centerD.mirror = true;
setRotation(centerD, 0F, 0F, 0F); setRotation(centerD, 0F, 0F, 0F);
frontDoorA = new ModelRenderer(this, 0, 25); frontDoorA = new ModelRenderer(this, 0, 25);
frontDoorA.addBox(-4F, 0F, -4F, 4, 7, 2); frontDoorA.addBox(-4F, 0F, -4F, 4, 7, 2);
frontDoorA.setRotationPoint(2F, 15F, -4F); frontDoorA.setRotationPoint(2F, 15F, -4F);
frontDoorA.setTextureSize(64, 32); frontDoorA.setTextureSize(64, 32);
frontDoorA.mirror = true; frontDoorA.mirror = true;
setRotation(frontDoorA, 0F, 0F, 0F); setRotation(frontDoorA, 0F, 0F, 0F);
frontDoorB = new ModelRenderer(this, 0, 25); frontDoorB = new ModelRenderer(this, 0, 25);
frontDoorB.addBox(-4F, 0F, -4F, 4, 7, 2); frontDoorB.addBox(-4F, 0F, -4F, 4, 7, 2);
frontDoorB.setRotationPoint(2F, 15F, -2F); frontDoorB.setRotationPoint(2F, 15F, -2F);
frontDoorB.setTextureSize(64, 32); frontDoorB.setTextureSize(64, 32);
frontDoorB.mirror = true; frontDoorB.mirror = true;
setRotation(frontDoorB, 0F, 0F, 0F); setRotation(frontDoorB, 0F, 0F, 0F);
frontDoorC = new ModelRenderer(this, 0, 25); frontDoorC = new ModelRenderer(this, 0, 25);
frontDoorC.addBox(-4F, 0F, -4F, 4, 7, 2); frontDoorC.addBox(-4F, 0F, -4F, 4, 7, 2);
frontDoorC.setRotationPoint(2F, 15F, 0F); frontDoorC.setRotationPoint(2F, 15F, 0F);
frontDoorC.setTextureSize(64, 32); frontDoorC.setTextureSize(64, 32);
frontDoorC.mirror = true; frontDoorC.mirror = true;
setRotation(frontDoorC, 0F, 0F, 0F); setRotation(frontDoorC, 0F, 0F, 0F);
backDoorA = new ModelRenderer(this, 0, 25); backDoorA = new ModelRenderer(this, 0, 25);
backDoorA.addBox(-4F, 0F, -4F, 4, 7, 2); backDoorA.addBox(-4F, 0F, -4F, 4, 7, 2);
backDoorA.setRotationPoint(2F, 15F, 10F); backDoorA.setRotationPoint(2F, 15F, 10F);
backDoorA.setTextureSize(64, 32); backDoorA.setTextureSize(64, 32);
backDoorA.mirror = true; backDoorA.mirror = true;
setRotation(backDoorA, 0F, 0F, 0F); setRotation(backDoorA, 0F, 0F, 0F);
backDoorB = new ModelRenderer(this, 0, 25); backDoorB = new ModelRenderer(this, 0, 25);
backDoorB.addBox(-4F, 0F, -4F, 4, 7, 2); backDoorB.addBox(-4F, 0F, -4F, 4, 7, 2);
backDoorB.setRotationPoint(2F, 15F, 8F); backDoorB.setRotationPoint(2F, 15F, 8F);
backDoorB.setTextureSize(64, 32); backDoorB.setTextureSize(64, 32);
backDoorB.mirror = true; backDoorB.mirror = true;
setRotation(backDoorB, 0F, 0F, 0F); setRotation(backDoorB, 0F, 0F, 0F);
backDoorC = new ModelRenderer(this, 0, 25); backDoorC = new ModelRenderer(this, 0, 25);
backDoorC.addBox(-4F, 0F, -4F, 4, 7, 2); backDoorC.addBox(-4F, 0F, -4F, 4, 7, 2);
backDoorC.setRotationPoint(2F, 15F, 6F); backDoorC.setRotationPoint(2F, 15F, 6F);
backDoorC.setTextureSize(64, 32); backDoorC.setTextureSize(64, 32);
backDoorC.mirror = true; backDoorC.mirror = true;
setRotation(backDoorC, 0F, 0F, 0F); setRotation(backDoorC, 0F, 0F, 0F);
leftDoorA = new ModelRenderer(this, 16, 24); leftDoorA = new ModelRenderer(this, 16, 24);
leftDoorA.addBox(4F, 0F, 6F, 2, 7, 4); leftDoorA.addBox(4F, 0F, 6F, 2, 7, 4);
leftDoorA.setRotationPoint(2F, 15F, -8F); leftDoorA.setRotationPoint(2F, 15F, -8F);
leftDoorA.setTextureSize(64, 32); leftDoorA.setTextureSize(64, 32);
leftDoorA.mirror = true; leftDoorA.mirror = true;
setRotation(leftDoorA, 0F, 0F, 0F); setRotation(leftDoorA, 0F, 0F, 0F);
leftDoorB = new ModelRenderer(this, 16, 24); leftDoorB = new ModelRenderer(this, 16, 24);
leftDoorB.addBox(4F, 0F, 6F, 2, 7, 4); leftDoorB.addBox(4F, 0F, 6F, 2, 7, 4);
leftDoorB.setRotationPoint(0F, 15F, -8F); leftDoorB.setRotationPoint(0F, 15F, -8F);
leftDoorB.setTextureSize(64, 32); leftDoorB.setTextureSize(64, 32);
leftDoorB.mirror = true; leftDoorB.mirror = true;
setRotation(leftDoorB, 0F, 0F, 0F); setRotation(leftDoorB, 0F, 0F, 0F);
leftDoorC = new ModelRenderer(this, 16, 24); leftDoorC = new ModelRenderer(this, 16, 24);
leftDoorC.addBox(4F, 0F, 6F, 2, 7, 4); leftDoorC.addBox(4F, 0F, 6F, 2, 7, 4);
leftDoorC.setRotationPoint(-2F, 15F, -8F); leftDoorC.setRotationPoint(-2F, 15F, -8F);
leftDoorC.setTextureSize(64, 32); leftDoorC.setTextureSize(64, 32);
leftDoorC.mirror = true; leftDoorC.mirror = true;
setRotation(leftDoorC, 0F, 0F, 0F); setRotation(leftDoorC, 0F, 0F, 0F);
rightDoorA = new ModelRenderer(this, 16, 24); rightDoorA = new ModelRenderer(this, 16, 24);
rightDoorA.addBox(4F, 0F, 6F, 2, 7, 4); rightDoorA.addBox(4F, 0F, 6F, 2, 7, 4);
rightDoorA.setRotationPoint(-12F, 15F, -8F); rightDoorA.setRotationPoint(-12F, 15F, -8F);
rightDoorA.setTextureSize(64, 32); rightDoorA.setTextureSize(64, 32);
rightDoorA.mirror = true; rightDoorA.mirror = true;
setRotation(rightDoorA, 0F, 0F, 0F); setRotation(rightDoorA, 0F, 0F, 0F);
rightDoorB = new ModelRenderer(this, 16, 24); rightDoorB = new ModelRenderer(this, 16, 24);
rightDoorB.addBox(4F, 0F, 6F, 2, 7, 4); rightDoorB.addBox(4F, 0F, 6F, 2, 7, 4);
rightDoorB.setRotationPoint(-10F, 15F, -8F); rightDoorB.setRotationPoint(-10F, 15F, -8F);
rightDoorB.setTextureSize(64, 32); rightDoorB.setTextureSize(64, 32);
rightDoorB.mirror = true; rightDoorB.mirror = true;
setRotation(rightDoorB, 0F, 0F, 0F); setRotation(rightDoorB, 0F, 0F, 0F);
rightDoorC = new ModelRenderer(this, 16, 24); rightDoorC = new ModelRenderer(this, 16, 24);
rightDoorC.addBox(4F, 0F, 6F, 2, 7, 4); rightDoorC.addBox(4F, 0F, 6F, 2, 7, 4);
rightDoorC.setRotationPoint(-8F, 15F, -8F); rightDoorC.setRotationPoint(-8F, 15F, -8F);
rightDoorC.setTextureSize(64, 32); rightDoorC.setTextureSize(64, 32);
rightDoorC.mirror = true; rightDoorC.mirror = true;
setRotation(rightDoorC, 0F, 0F, 0F); setRotation(rightDoorC, 0F, 0F, 0F);
cornerBackLeft = new ModelRenderer(this, 0, 37); cornerBackLeft = new ModelRenderer(this, 0, 37);
cornerBackLeft.addBox(-4F, 0F, -4F, 4, 10, 4); cornerBackLeft.addBox(-4F, 0F, -4F, 4, 10, 4);
cornerBackLeft.setRotationPoint(8F, 14F, 8F); cornerBackLeft.setRotationPoint(8F, 14F, 8F);
cornerBackLeft.setTextureSize(64, 32); cornerBackLeft.setTextureSize(64, 32);
cornerBackLeft.mirror = true; cornerBackLeft.mirror = true;
setRotation(cornerBackLeft, 0F, 0F, 0F); setRotation(cornerBackLeft, 0F, 0F, 0F);
cornerBackRight = new ModelRenderer(this, 0, 37); cornerBackRight = new ModelRenderer(this, 0, 37);
cornerBackRight.addBox(-4F, 0F, -4F, 4, 10, 4); cornerBackRight.addBox(-4F, 0F, -4F, 4, 10, 4);
cornerBackRight.setRotationPoint(-4F, 14F, 8F); cornerBackRight.setRotationPoint(-4F, 14F, 8F);
cornerBackRight.setTextureSize(64, 32); cornerBackRight.setTextureSize(64, 32);
cornerBackRight.mirror = true; cornerBackRight.mirror = true;
setRotation(cornerBackRight, 0F, 0F, 0F); setRotation(cornerBackRight, 0F, 0F, 0F);
cornerFrontLeft = new ModelRenderer(this, 0, 37); cornerFrontLeft = new ModelRenderer(this, 0, 37);
cornerFrontLeft.addBox(-4F, 0F, -4F, 4, 10, 4); cornerFrontLeft.addBox(-4F, 0F, -4F, 4, 10, 4);
cornerFrontLeft.setRotationPoint(8F, 14F, -4F); cornerFrontLeft.setRotationPoint(8F, 14F, -4F);
cornerFrontLeft.setTextureSize(64, 32); cornerFrontLeft.setTextureSize(64, 32);
cornerFrontLeft.mirror = true; cornerFrontLeft.mirror = true;
setRotation(cornerFrontLeft, 0F, 0F, 0F); setRotation(cornerFrontLeft, 0F, 0F, 0F);
cornerFrontRight = new ModelRenderer(this, 0, 37); cornerFrontRight = new ModelRenderer(this, 0, 37);
cornerFrontRight.addBox(-4F, 0F, -4F, 4, 10, 4); cornerFrontRight.addBox(-4F, 0F, -4F, 4, 10, 4);
cornerFrontRight.setRotationPoint(-4F, 14F, -4F); cornerFrontRight.setRotationPoint(-4F, 14F, -4F);
cornerFrontRight.setTextureSize(64, 32); cornerFrontRight.setTextureSize(64, 32);
cornerFrontRight.mirror = true; cornerFrontRight.mirror = true;
setRotation(cornerFrontRight, 0F, 0F, 0F); setRotation(cornerFrontRight, 0F, 0F, 0F);
} }
public void render(boolean[] side, boolean stone) public void render(byte side, boolean stone)
{ {
if (side != null) renderMiddle(TileFluidNetwork.canRenderSide(side, ForgeDirection.DOWN), stone);
{ renderBack(TileFluidNetwork.canRenderSide(side, ForgeDirection.NORTH) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
renderMiddle(!side[0], stone); renderFront(TileFluidNetwork.canRenderSide(side, ForgeDirection.SOUTH) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
renderBack(side[2] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); renderRight(TileFluidNetwork.canRenderSide(side, ForgeDirection.WEST) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
renderFront(side[3] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); renderLeft(TileFluidNetwork.canRenderSide(side, ForgeDirection.EAST) ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
renderRight(side[4] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP); }
renderLeft(side[5] ? PipeType.NORMAL : stone ? PipeType.SOLID : PipeType.MID_CAP);
}
}
public void renderMiddle(boolean bottom, boolean corners) public void renderMiddle(boolean bottom, boolean corners)
{ {
if (bottom) if (bottom)
base.render(0.0625F); base.render(0.0625F);
centerA.render(0.0625F); centerA.render(0.0625F);
centerB.render(0.0625F); centerB.render(0.0625F);
centerC.render(0.0625F); centerC.render(0.0625F);
centerD.render(0.0625F); centerD.render(0.0625F);
if (corners) if (corners)
{ {
cornerBackLeft.render(0.0625F); cornerBackLeft.render(0.0625F);
cornerBackRight.render(0.0625F); cornerBackRight.render(0.0625F);
cornerFrontLeft.render(0.0625F); cornerFrontLeft.render(0.0625F);
cornerFrontRight.render(0.0625F); cornerFrontRight.render(0.0625F);
} }
} }
public void renderLeft(PipeType type) public void renderLeft(PipeType type)
{ {
if (type != PipeType.MID_CAP) if (type != PipeType.MID_CAP)
{ {
leftBase.render(0.0625F); leftBase.render(0.0625F);
leftBaseB.render(0.0625F); leftBaseB.render(0.0625F);
leftB.render(0.0625F); leftB.render(0.0625F);
leftA.render(0.0625F); leftA.render(0.0625F);
if (type == PipeType.CAP || type == PipeType.SOLID) if (type == PipeType.CAP || type == PipeType.SOLID)
{ {
leftDoorA.render(0.0625F); leftDoorA.render(0.0625F);
if (type == PipeType.SOLID) if (type == PipeType.SOLID)
{ {
leftDoorB.render(0.0625F); leftDoorB.render(0.0625F);
leftDoorC.render(0.0625F); leftDoorC.render(0.0625F);
} }
} }
} }
else else
{ {
leftDoorC.render(0.0625F); leftDoorC.render(0.0625F);
} }
} }
public void renderRight(PipeType type) public void renderRight(PipeType type)
{ {
if (type != PipeType.MID_CAP) if (type != PipeType.MID_CAP)
{ {
rightBaseB.render(0.0625F); rightBaseB.render(0.0625F);
rightBase.render(0.0625F); rightBase.render(0.0625F);
rightA.render(0.0625F); rightA.render(0.0625F);
rightB.render(0.0625F); rightB.render(0.0625F);
if (type == PipeType.CAP || type == PipeType.SOLID) if (type == PipeType.CAP || type == PipeType.SOLID)
{ {
rightDoorA.render(0.0625F); rightDoorA.render(0.0625F);
if (type == PipeType.SOLID) if (type == PipeType.SOLID)
{ {
rightDoorB.render(0.0625F); rightDoorB.render(0.0625F);
rightDoorC.render(0.0625F); rightDoorC.render(0.0625F);
} }
} }
} }
else else
{ {
rightDoorC.render(0.0625F); rightDoorC.render(0.0625F);
} }
} }
public void renderBack(PipeType type) public void renderBack(PipeType type)
{ {
if (type != PipeType.MID_CAP) if (type != PipeType.MID_CAP)
{ {
backBase.render(0.0625F); backBase.render(0.0625F);
backBaseB.render(0.0625F); backBaseB.render(0.0625F);
backA.render(0.0625F); backA.render(0.0625F);
backB.render(0.0625F); backB.render(0.0625F);
if (type == PipeType.CAP || type == PipeType.SOLID) if (type == PipeType.CAP || type == PipeType.SOLID)
{ {
backDoorA.render(0.0625F); backDoorA.render(0.0625F);
if (type == PipeType.SOLID) if (type == PipeType.SOLID)
{ {
backDoorB.render(0.0625F); backDoorB.render(0.0625F);
backDoorC.render(0.0625F); backDoorC.render(0.0625F);
} }
} }
} }
else else
{ {
backDoorC.render(0.0625F); backDoorC.render(0.0625F);
} }
} }
public void renderFront(PipeType type) public void renderFront(PipeType type)
{ {
if (type != PipeType.MID_CAP) if (type != PipeType.MID_CAP)
{ {
frontBase.render(0.0625F); frontBase.render(0.0625F);
frontBaseB.render(0.0625F); frontBaseB.render(0.0625F);
frontA.render(0.0625F); frontA.render(0.0625F);
frontB.render(0.0625F); frontB.render(0.0625F);
if (type == PipeType.CAP || type == PipeType.SOLID) if (type == PipeType.CAP || type == PipeType.SOLID)
{ {
frontDoorA.render(0.0625F); frontDoorA.render(0.0625F);
if (type == PipeType.SOLID) if (type == PipeType.SOLID)
{ {
frontDoorB.render(0.0625F); frontDoorB.render(0.0625F);
frontDoorC.render(0.0625F); frontDoorC.render(0.0625F);
} }
} }
} }
else else
{ {
frontDoorC.render(0.0625F); frontDoorC.render(0.0625F);
} }
} }
private void setRotation(ModelRenderer model, float x, float y, float z) private void setRotation(ModelRenderer model, float x, float y, float z)
{ {
model.rotateAngleX = x; model.rotateAngleX = x;
model.rotateAngleY = y; model.rotateAngleY = y;
model.rotateAngleZ = z; model.rotateAngleZ = z;
} }
public static enum PipeType public static enum PipeType
{ {
/** When there is no connection */ /** When there is no connection */
MID_CAP, MID_CAP,
/** Pipe to pipe connection */ /** Pipe to pipe connection */
NORMAL, NORMAL,
/** Pipe to wall */ /** Pipe to wall */
CAP, CAP,
/** No pipe, used only by stone through */ /** No pipe, used only by stone through */
SOLID; SOLID;
} }
} }