Fixed pipe rendering
This commit is contained in:
parent
327c78d0a6
commit
8a9e3bda51
6 changed files with 238 additions and 189 deletions
|
@ -48,7 +48,7 @@ public class ItemPipeRenderer implements IItemRenderer
|
|||
else if (type == ItemRenderType.EQUIPPED_FIRST_PERSON)
|
||||
{
|
||||
GL11.glTranslatef(-2F, -1.5F, 0.2F);
|
||||
RenderPipe.render(meta, Byte.parseByte("000011", 2));
|
||||
RenderPipe.render(meta, Byte.parseByte("001100", 2));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -2,10 +2,10 @@ package resonantinduction.mechanical.fluid.pipe;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import calclavia.lib.render.RenderUtility;
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import calclavia.lib.render.RenderUtility;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -13,186 +13,251 @@ import cpw.mods.fml.relauncher.SideOnly;
|
|||
public class ModelPipe extends ModelBase
|
||||
{
|
||||
// fields
|
||||
ModelRenderer Body;
|
||||
ModelRenderer Deco1;
|
||||
ModelRenderer Deco4;
|
||||
ModelRenderer Deco2;
|
||||
ModelRenderer Deco3;
|
||||
ModelRenderer Deco5;
|
||||
ModelRenderer Deco6;
|
||||
ModelRenderer Deco7;
|
||||
ModelRenderer Deco8;
|
||||
ModelRenderer Deco9;
|
||||
ModelRenderer Body2;
|
||||
ModelRenderer Deco11;
|
||||
ModelRenderer Deco12;
|
||||
ModelRenderer Deco13;
|
||||
ModelRenderer Deco14;
|
||||
ModelRenderer Deco15;
|
||||
ModelRenderer Deco16;
|
||||
ModelRenderer Mid;
|
||||
ModelRenderer RightPipe;
|
||||
ModelRenderer RightInter;
|
||||
ModelRenderer RightConnect;
|
||||
ModelRenderer LeftInter;
|
||||
ModelRenderer LeftPipe;
|
||||
ModelRenderer LeftConnect;
|
||||
ModelRenderer TopInter;
|
||||
ModelRenderer TopPipe;
|
||||
ModelRenderer TopConnect;
|
||||
ModelRenderer BottomPipe;
|
||||
ModelRenderer BottomInter;
|
||||
ModelRenderer BottomConnect;
|
||||
ModelRenderer BackPipe;
|
||||
ModelRenderer BackInter;
|
||||
ModelRenderer BackConnect;
|
||||
ModelRenderer FrontInter;
|
||||
ModelRenderer FrontPipe;
|
||||
ModelRenderer FrontConnect;
|
||||
|
||||
public ModelPipe()
|
||||
{
|
||||
textureWidth = 64;
|
||||
textureWidth = 128;
|
||||
textureHeight = 32;
|
||||
|
||||
Body = new ModelRenderer(this, 0, 0);
|
||||
Body.addBox(0F, 0F, 0F, 5, 5, 16);
|
||||
Body.setRotationPoint(-2F, 17F, -8F);
|
||||
Body.setTextureSize(64, 32);
|
||||
Body.mirror = true;
|
||||
setRotation(Body, 0F, 0F, 0F);
|
||||
Deco1 = new ModelRenderer(this, 42, 0);
|
||||
Deco1.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco1.setRotationPoint(-2F, 16.5F, 0F);
|
||||
Deco1.setTextureSize(64, 32);
|
||||
Deco1.mirror = true;
|
||||
setRotation(Deco1, 0F, 0F, 0F);
|
||||
Deco4 = new ModelRenderer(this, 42, 0);
|
||||
Deco4.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco4.setRotationPoint(-2F, 21.5F, 4F);
|
||||
Deco4.setTextureSize(64, 32);
|
||||
Deco4.mirror = true;
|
||||
setRotation(Deco4, 0F, 0F, 0F);
|
||||
Deco2 = new ModelRenderer(this, 42, 2);
|
||||
Deco2.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Deco2.setRotationPoint(-1.5F, 16.5F, 4F);
|
||||
Deco2.setTextureSize(64, 32);
|
||||
Deco2.mirror = true;
|
||||
setRotation(Deco2, 0F, 0F, 1.570796F);
|
||||
Deco3 = new ModelRenderer(this, 42, 2);
|
||||
Deco3.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Deco3.setRotationPoint(3.5F, 16.5F, 4F);
|
||||
Deco3.setTextureSize(64, 32);
|
||||
Deco3.mirror = true;
|
||||
setRotation(Deco3, 0F, 0F, 1.570796F);
|
||||
Deco5 = new ModelRenderer(this, 42, 0);
|
||||
Deco5.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco5.setRotationPoint(-2F, 16.5F, 4F);
|
||||
Deco5.setTextureSize(64, 32);
|
||||
Deco5.mirror = true;
|
||||
setRotation(Deco5, 0F, 0F, 0F);
|
||||
Deco6 = new ModelRenderer(this, 42, 0);
|
||||
Deco6.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco6.setRotationPoint(-2F, 21.5F, 0F);
|
||||
Deco6.setTextureSize(64, 32);
|
||||
Deco6.mirror = true;
|
||||
setRotation(Deco6, 0F, 0F, 0F);
|
||||
Deco7 = new ModelRenderer(this, 42, 2);
|
||||
Deco7.addBox(0F, 0F, -5F, 6, 1, 1);
|
||||
Deco7.setRotationPoint(-1.5F, 16.5F, 5F);
|
||||
Deco7.setTextureSize(64, 32);
|
||||
Deco7.mirror = true;
|
||||
setRotation(Deco7, 0F, 0F, 1.570796F);
|
||||
Deco8 = new ModelRenderer(this, 42, 2);
|
||||
Deco8.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Deco8.setRotationPoint(3.5F, 16.5F, 0F);
|
||||
Deco8.setTextureSize(64, 32);
|
||||
Deco8.mirror = true;
|
||||
setRotation(Deco8, 0F, 0F, 1.570796F);
|
||||
Deco9 = new ModelRenderer(this, 42, 0);
|
||||
Deco9.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco9.setRotationPoint(-2F, 16.5F, -4F);
|
||||
Deco9.setTextureSize(64, 32);
|
||||
Deco9.mirror = true;
|
||||
setRotation(Deco9, 0F, 0F, 0F);
|
||||
Body2 = new ModelRenderer(this, 42, 0);
|
||||
Body2.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Body2.setRotationPoint(-2F, 21.5F, -4F);
|
||||
Body2.setTextureSize(64, 32);
|
||||
Body2.mirror = true;
|
||||
setRotation(Body2, 0F, 0F, 0F);
|
||||
Deco11 = new ModelRenderer(this, 42, 2);
|
||||
Deco11.addBox(0F, 0F, -5F, 6, 1, 1);
|
||||
Deco11.setRotationPoint(-1.5F, 16.5F, 1F);
|
||||
Deco11.setTextureSize(64, 32);
|
||||
Deco11.mirror = true;
|
||||
setRotation(Deco11, 0F, 0F, 1.570796F);
|
||||
Deco12 = new ModelRenderer(this, 42, 2);
|
||||
Deco12.addBox(0F, 0F, 0F, 6, 1, 1);
|
||||
Deco12.setRotationPoint(3.5F, 16.5F, -4F);
|
||||
Deco12.setTextureSize(64, 32);
|
||||
Deco12.mirror = true;
|
||||
setRotation(Deco12, 0F, 0F, 1.570796F);
|
||||
Deco13 = new ModelRenderer(this, 42, 0);
|
||||
Deco13.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco13.setRotationPoint(-2F, 16.5F, -8F);
|
||||
Deco13.setTextureSize(64, 32);
|
||||
Deco13.mirror = true;
|
||||
setRotation(Deco13, 0F, 0F, 0F);
|
||||
Deco14 = new ModelRenderer(this, 42, 0);
|
||||
Deco14.addBox(0F, 0F, 0F, 5, 1, 1);
|
||||
Deco14.setRotationPoint(-2F, 21.5F, -8F);
|
||||
Deco14.setTextureSize(64, 32);
|
||||
Deco14.mirror = true;
|
||||
setRotation(Deco14, 0F, 0F, 0F);
|
||||
Deco15 = new ModelRenderer(this, 42, 2);
|
||||
Deco15.addBox(0F, 0F, -5F, 6, 1, 1);
|
||||
Deco15.setRotationPoint(-1.5F, 16.5F, -3F);
|
||||
Deco15.setTextureSize(64, 32);
|
||||
Deco15.mirror = true;
|
||||
setRotation(Deco15, 0F, 0F, 1.570796F);
|
||||
Deco16 = new ModelRenderer(this, 42, 2);
|
||||
Deco16.addBox(0F, 0F, -4F, 6, 1, 1);
|
||||
Deco16.setRotationPoint(3.5F, 16.5F, -4F);
|
||||
Deco16.setTextureSize(64, 32);
|
||||
Deco16.mirror = true;
|
||||
setRotation(Deco16, 0F, 0F, 1.570796F);
|
||||
}
|
||||
|
||||
public void render(float f5)
|
||||
{
|
||||
Body.render(f5);
|
||||
Deco1.render(f5);
|
||||
Deco4.render(f5);
|
||||
Deco2.render(f5);
|
||||
Deco3.render(f5);
|
||||
Deco5.render(f5);
|
||||
Deco6.render(f5);
|
||||
Deco7.render(f5);
|
||||
Deco8.render(f5);
|
||||
Deco9.render(f5);
|
||||
Body2.render(f5);
|
||||
Deco11.render(f5);
|
||||
Deco12.render(f5);
|
||||
Deco13.render(f5);
|
||||
Deco14.render(f5);
|
||||
Deco15.render(f5);
|
||||
Deco16.render(f5);
|
||||
Mid = new ModelRenderer(this, 50, 13);
|
||||
Mid.addBox(-3F, -3F, -3F, 6, 6, 6);
|
||||
Mid.setRotationPoint(0F, 16F, 0F);
|
||||
Mid.setTextureSize(128, 32);
|
||||
Mid.mirror = true;
|
||||
setRotation(Mid, 0F, 0F, 0F);
|
||||
RightPipe = new ModelRenderer(this, 25, 0);
|
||||
RightPipe.addBox(0F, -3F, -3F, 4, 6, 6);
|
||||
RightPipe.setRotationPoint(3F, 16F, 0F);
|
||||
RightPipe.setTextureSize(128, 32);
|
||||
RightPipe.mirror = true;
|
||||
setRotation(RightPipe, 0F, 0F, 0F);
|
||||
RightInter = new ModelRenderer(this, 98, 0);
|
||||
RightInter.addBox(0F, -4F, -4F, 1, 8, 8);
|
||||
RightInter.setRotationPoint(2F, 16F, 0F);
|
||||
RightInter.setTextureSize(128, 32);
|
||||
RightInter.mirror = true;
|
||||
setRotation(RightInter, 0F, 0F, 0F);
|
||||
RightConnect = new ModelRenderer(this, 98, 0);
|
||||
RightConnect.addBox(0F, -4F, -4F, 1, 8, 8);
|
||||
RightConnect.setRotationPoint(7F, 16F, 0F);
|
||||
RightConnect.setTextureSize(128, 32);
|
||||
RightConnect.mirror = true;
|
||||
setRotation(RightConnect, 0F, 0F, 0F);
|
||||
LeftInter = new ModelRenderer(this, 98, 0);
|
||||
LeftInter.addBox(-1F, -4F, -4F, 1, 8, 8);
|
||||
LeftInter.setRotationPoint(-2F, 16F, 0F);
|
||||
LeftInter.setTextureSize(128, 32);
|
||||
LeftInter.mirror = true;
|
||||
setRotation(LeftInter, 0F, 0F, 0F);
|
||||
LeftPipe = new ModelRenderer(this, 25, 0);
|
||||
LeftPipe.addBox(-4F, -3F, -3F, 4, 6, 6);
|
||||
LeftPipe.setRotationPoint(-3F, 16F, 0F);
|
||||
LeftPipe.setTextureSize(128, 32);
|
||||
LeftPipe.mirror = true;
|
||||
setRotation(LeftPipe, 0F, 0F, 0F);
|
||||
LeftConnect = new ModelRenderer(this, 98, 0);
|
||||
LeftConnect.addBox(-1F, -4F, -4F, 1, 8, 8);
|
||||
LeftConnect.setRotationPoint(-7F, 16F, 0F);
|
||||
LeftConnect.setTextureSize(128, 32);
|
||||
LeftConnect.mirror = true;
|
||||
setRotation(LeftConnect, 0F, 0F, 0F);
|
||||
TopInter = new ModelRenderer(this, 77, 17);
|
||||
TopInter.addBox(-4F, -1F, -4F, 8, 1, 8);
|
||||
TopInter.setRotationPoint(0F, 14F, 0F);
|
||||
TopInter.setTextureSize(128, 32);
|
||||
TopInter.mirror = true;
|
||||
setRotation(TopInter, 0F, 0F, 0F);
|
||||
TopPipe = new ModelRenderer(this, 50, 0);
|
||||
TopPipe.addBox(-3F, -4F, -3F, 6, 4, 6);
|
||||
TopPipe.setRotationPoint(0F, 13F, 0F);
|
||||
TopPipe.setTextureSize(128, 32);
|
||||
TopPipe.mirror = true;
|
||||
setRotation(TopPipe, 0F, 0F, 0F);
|
||||
TopConnect = new ModelRenderer(this, 77, 17);
|
||||
TopConnect.addBox(-4F, -1F, -4F, 8, 1, 8);
|
||||
TopConnect.setRotationPoint(0F, 9F, 0F);
|
||||
TopConnect.setTextureSize(128, 32);
|
||||
TopConnect.mirror = true;
|
||||
setRotation(TopConnect, 0F, 0F, 0F);
|
||||
BottomPipe = new ModelRenderer(this, 50, 0);
|
||||
BottomPipe.addBox(-3F, 0F, -3F, 6, 4, 6);
|
||||
BottomPipe.setRotationPoint(0F, 19F, 0F);
|
||||
BottomPipe.setTextureSize(128, 32);
|
||||
BottomPipe.mirror = true;
|
||||
setRotation(BottomPipe, 0F, 0F, 0F);
|
||||
BottomInter = new ModelRenderer(this, 77, 17);
|
||||
BottomInter.addBox(-4F, 0F, -4F, 8, 1, 8);
|
||||
BottomInter.setRotationPoint(0F, 18F, 0F);
|
||||
BottomInter.setTextureSize(128, 32);
|
||||
BottomInter.mirror = true;
|
||||
setRotation(BottomInter, 0F, 0F, 0F);
|
||||
BottomConnect = new ModelRenderer(this, 77, 17);
|
||||
BottomConnect.addBox(-4F, 0F, -4F, 8, 1, 8);
|
||||
BottomConnect.setRotationPoint(0F, 23F, 0F);
|
||||
BottomConnect.setTextureSize(128, 32);
|
||||
BottomConnect.mirror = true;
|
||||
setRotation(BottomConnect, 0F, 0F, 0F);
|
||||
BackPipe = new ModelRenderer(this, 0, 0);
|
||||
BackPipe.addBox(-3F, -3F, 0F, 6, 6, 4);
|
||||
BackPipe.setRotationPoint(0F, 16F, 3F);
|
||||
BackPipe.setTextureSize(128, 32);
|
||||
BackPipe.mirror = true;
|
||||
setRotation(BackPipe, 0F, 0F, 0F);
|
||||
BackInter = new ModelRenderer(this, 0, 23);
|
||||
BackInter.addBox(-4F, -4F, 0F, 8, 8, 1);
|
||||
BackInter.setRotationPoint(0F, 16F, 2F);
|
||||
BackInter.setTextureSize(128, 32);
|
||||
BackInter.mirror = true;
|
||||
setRotation(BackInter, 0F, 0F, 0F);
|
||||
BackConnect = new ModelRenderer(this, 0, 23);
|
||||
BackConnect.addBox(-4F, -4F, 0F, 8, 8, 1);
|
||||
BackConnect.setRotationPoint(0F, 16F, 7F);
|
||||
BackConnect.setTextureSize(128, 32);
|
||||
BackConnect.mirror = true;
|
||||
setRotation(BackConnect, 0F, 0F, 0F);
|
||||
FrontInter = new ModelRenderer(this, 0, 23);
|
||||
FrontInter.addBox(-4F, -4F, -1F, 8, 8, 1);
|
||||
FrontInter.setRotationPoint(0F, 16F, -2F);
|
||||
FrontInter.setTextureSize(128, 32);
|
||||
FrontInter.mirror = true;
|
||||
setRotation(FrontInter, 0F, 0F, 0F);
|
||||
FrontPipe = new ModelRenderer(this, 0, 0);
|
||||
FrontPipe.addBox(-3F, -3F, -4F, 6, 6, 4);
|
||||
FrontPipe.setRotationPoint(0F, 16F, -3F);
|
||||
FrontPipe.setTextureSize(128, 32);
|
||||
FrontPipe.mirror = true;
|
||||
setRotation(FrontPipe, 0F, 0F, 0F);
|
||||
FrontConnect = new ModelRenderer(this, 0, 23);
|
||||
FrontConnect.addBox(-4F, -4F, -1F, 8, 8, 1);
|
||||
FrontConnect.setRotationPoint(0F, 16F, -7F);
|
||||
FrontConnect.setTextureSize(128, 32);
|
||||
FrontConnect.mirror = true;
|
||||
setRotation(FrontConnect, 0F, 0F, 0F);
|
||||
}
|
||||
|
||||
public void render(byte side)
|
||||
{
|
||||
float f5 = 0.0625f;
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.DOWN))
|
||||
renderBottom();
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.UP))
|
||||
renderUp();
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.NORTH))
|
||||
renderSouth();
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.SOUTH))
|
||||
renderNorth();
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.WEST))
|
||||
renderEast();
|
||||
if (RenderUtility.canRenderSide(side, ForgeDirection.EAST))
|
||||
renderWest();
|
||||
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
renderMiddle();
|
||||
}
|
||||
|
||||
public void render(boolean[] side)
|
||||
{
|
||||
if (side[0])
|
||||
{
|
||||
if (RenderUtility.canRenderSide(side, dir))
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
RenderUtility.rotateBlockBasedOnDirection(dir);
|
||||
Deco1.render(f5);
|
||||
Deco4.render(f5);
|
||||
Deco2.render(f5);
|
||||
Deco3.render(f5);
|
||||
Deco5.render(f5);
|
||||
Deco6.render(f5);
|
||||
Deco7.render(f5);
|
||||
Deco8.render(f5);
|
||||
Deco9.render(f5);
|
||||
Deco11.render(f5);
|
||||
Deco12.render(f5);
|
||||
Deco13.render(f5);
|
||||
Deco14.render(f5);
|
||||
Deco15.render(f5);
|
||||
Deco16.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
}
|
||||
renderBottom();
|
||||
}
|
||||
if (side[1])
|
||||
{
|
||||
renderUp();
|
||||
}
|
||||
if (side[3])
|
||||
{
|
||||
renderNorth();
|
||||
}
|
||||
if (side[2])
|
||||
{
|
||||
renderSouth();
|
||||
}
|
||||
if (side[5])
|
||||
{
|
||||
renderWest();
|
||||
}
|
||||
if (side[4])
|
||||
{
|
||||
renderEast();
|
||||
}
|
||||
renderMiddle();
|
||||
}
|
||||
|
||||
Body.render(f5);
|
||||
Body2.render(f5);
|
||||
public void renderAll()
|
||||
{
|
||||
this.renderMiddle();
|
||||
this.renderBottom();
|
||||
this.renderUp();
|
||||
this.renderEast();
|
||||
this.renderWest();
|
||||
this.renderSouth();
|
||||
this.renderNorth();
|
||||
|
||||
}
|
||||
|
||||
public void renderMiddle()
|
||||
{
|
||||
Mid.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderBottom()
|
||||
{
|
||||
BottomPipe.render(0.0625F);
|
||||
BottomConnect.render(0.0625F);
|
||||
BottomInter.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderUp()
|
||||
{
|
||||
TopPipe.render(0.0625F);
|
||||
TopConnect.render(0.0625F);
|
||||
TopInter.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderEast()
|
||||
{
|
||||
LeftPipe.render(0.0625F);
|
||||
LeftConnect.render(0.0625F);
|
||||
LeftInter.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderWest()
|
||||
{
|
||||
RightPipe.render(0.0625F);
|
||||
RightConnect.render(0.0625F);
|
||||
RightInter.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderSouth()
|
||||
{
|
||||
BackPipe.render(0.0625F);
|
||||
BackConnect.render(0.0625F);
|
||||
BackInter.render(0.0625F);
|
||||
}
|
||||
|
||||
public void renderNorth()
|
||||
{
|
||||
FrontPipe.render(0.0625F);
|
||||
FrontConnect.render(0.0625F);
|
||||
FrontInter.render(0.0625F);
|
||||
}
|
||||
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraftforge.fluids.FluidTankInfo;
|
|||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import resonantinduction.api.mechanical.fluid.IFluidNetwork;
|
||||
import resonantinduction.api.mechanical.fluid.IFluidPipe;
|
||||
import resonantinduction.core.ResonantInduction;
|
||||
import resonantinduction.core.prefab.part.PartFramedConnection;
|
||||
import resonantinduction.mechanical.Mechanical;
|
||||
import resonantinduction.mechanical.fluid.network.PipeNetwork;
|
||||
|
@ -222,7 +223,7 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
public void drawBreaking(RenderBlocks renderBlocks)
|
||||
{
|
||||
CCRenderState.reset();
|
||||
RenderUtils.renderBlock(sides[6], 0, new Translation(x(), y(), z()), new IconTransformation(renderBlocks.overrideBlockTexture), null);
|
||||
RenderUtils.renderBlock(sides[6], 0, new Translation(x(), y(), z()), new IconTransformation(ResonantInduction.blockMachinePart.getIcon(0, 0)), null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package resonantinduction.mechanical.fluid.pipe;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
|
@ -20,7 +17,6 @@ public class RenderPipe
|
|||
|
||||
public static ModelPipe MODEL_PIPE = new ModelPipe();
|
||||
public static ModelOpenTrough MODEL_TROUGH_PIPE = new ModelOpenTrough();
|
||||
private static HashMap<EnumPipeMaterial, ResourceLocation> TEXTURES = new HashMap<EnumPipeMaterial, ResourceLocation>();
|
||||
public static ResourceLocation TEXTURE = new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH + "pipe.png");
|
||||
|
||||
public void render(PartPipe part, double x, double y, double z, float f)
|
||||
|
@ -29,25 +25,12 @@ public class RenderPipe
|
|||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
|
||||
GL11.glScalef(1.0F, -1F, -1F);
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(getTexture(material));
|
||||
MODEL_PIPE.render(part.getAllCurrentConnections());
|
||||
render(0, part.getAllCurrentConnections());
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static ResourceLocation getTexture(EnumPipeMaterial material)
|
||||
{
|
||||
/*
|
||||
* if (material != null)
|
||||
* {
|
||||
* if (!TEXTURES.containsKey(material))
|
||||
* {
|
||||
* TEXTURES.put(material, new ResourceLocation(Reference.DOMAIN, Reference.MODEL_PATH +
|
||||
* "pipe/" + material.matName + ".png"));
|
||||
* }
|
||||
* return TEXTURES.get(material);
|
||||
* }
|
||||
*/
|
||||
|
||||
return TEXTURE;
|
||||
}
|
||||
|
||||
|
@ -56,7 +39,7 @@ public class RenderPipe
|
|||
if (meta < EnumPipeMaterial.values().length)
|
||||
{
|
||||
RenderUtility.enableBlending();
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(getTexture(EnumPipeMaterial.values()[meta]));
|
||||
RenderUtility.bind((getTexture(EnumPipeMaterial.values()[meta])));
|
||||
MODEL_PIPE.render(sides);
|
||||
RenderUtility.disableBlending();
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 3.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1,014 B After Width: | Height: | Size: 2.2 KiB |
Loading…
Add table
Reference in a new issue