diff --git a/common/mekanism/client/ClientProxy.java b/common/mekanism/client/ClientProxy.java index a45dcc2bb..f8b0c6635 100644 --- a/common/mekanism/client/ClientProxy.java +++ b/common/mekanism/client/ClientProxy.java @@ -155,6 +155,7 @@ public class ClientProxy extends CommonProxy public static int MACHINE_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); public static int TRANSMITTER_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); public static int BASIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); + public static int PLASTIC_RENDER_ID = RenderingRegistry.getNextAvailableRenderId(); @Override public void loadConfiguration() @@ -318,7 +319,6 @@ public class ClientProxy extends CommonProxy ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher()); ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer()); ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine()); - ClientRegistry.registerTileEntity(TileEntityPlasticBlock.class, "PlasticBlock", new RenderPlastic()); } @Override diff --git a/common/mekanism/client/render/tileentity/RenderPlastic.java b/common/mekanism/client/render/tileentity/RenderPlastic.java index ec0436a43..cad9bca5e 100644 --- a/common/mekanism/client/render/tileentity/RenderPlastic.java +++ b/common/mekanism/client/render/tileentity/RenderPlastic.java @@ -17,7 +17,7 @@ import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class RenderPlastic extends TileEntitySpecialRenderer +public class RenderPlastic { public static Model3D toRender; @@ -27,27 +27,6 @@ public class RenderPlastic extends TileEntitySpecialRenderer toRender.setBlockBounds(0,0,0,1,1,1); } - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick) - { - renderAModelAt((TileEntityPlasticBlock) tileEntity, x, y, z, partialTick); - } - - public void renderAModelAt(TileEntityPlasticBlock plastic, double x, double y, double z, float partialTick) - { - GL11.glPushMatrix(); - GL11.glTranslatef((float) x, (float) y, (float) z); - bindTexture(MekanismRenderer.getBlocksTexture()); - - toRender.setTexture(Mekanism.BlockHDPE.getBlockTexture(plastic.worldObj, plastic.xCoord, plastic.yCoord, plastic.zCoord, 0)); - EnumColor color = EnumColor.DYES[plastic.colour]; - float[] colour = {color.getColor(0), color.getColor(1), color.getColor(2)}; - GL11.glColor3f(colour[0], colour[1], colour[2]); - RenderHelper.disableStandardItemLighting(); - MekanismRenderer.renderObject(toRender); - GL11.glPopMatrix(); - } - public static void renderItem(ItemStack stack) { GL11.glPushMatrix(); diff --git a/common/mekanism/common/CommonProxy.java b/common/mekanism/common/CommonProxy.java index 6310ced81..b92b271ab 100644 --- a/common/mekanism/common/CommonProxy.java +++ b/common/mekanism/common/CommonProxy.java @@ -129,7 +129,6 @@ public class CommonProxy GameRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher"); GameRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer"); GameRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber"); - GameRegistry.registerTileEntity(TileEntityPlasticBlock.class, "PlasticBlock"); } /** diff --git a/common/mekanism/common/Mekanism.java b/common/mekanism/common/Mekanism.java index df285f872..5bd7e19a1 100644 --- a/common/mekanism/common/Mekanism.java +++ b/common/mekanism/common/Mekanism.java @@ -126,6 +126,7 @@ import mekanism.common.tile.TileEntityBoundingBlock; import mekanism.common.tile.TileEntityCardboardBox; import mekanism.common.tile.TileEntityElectricBlock; import mekanism.common.tile.TileEntityEnergizedSmelter; +import mekanism.common.tile.TileEntityPlasticBlock; import mekanism.common.tile.TileEntitySalinationTank; import mekanism.common.tile.TileEntitySalinationValve; import mekanism.common.tile.TileEntitySeismicVibrator; @@ -1164,6 +1165,7 @@ public class Mekanism GameRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator"); GameRegistry.registerTileEntity(TileEntitySalinationValve.class, "SalinationValve"); GameRegistry.registerTileEntity(TileEntitySalinationTank.class, "SalinationTank"); + GameRegistry.registerTileEntity(TileEntityPlasticBlock.class, "PlasticBlock"); //Load tile entities that have special renderers. proxy.registerSpecialTileEntities(); diff --git a/common/mekanism/common/block/BlockPlastic.java b/common/mekanism/common/block/BlockPlastic.java index 3618de6f3..95b0fa7e4 100644 --- a/common/mekanism/common/block/BlockPlastic.java +++ b/common/mekanism/common/block/BlockPlastic.java @@ -2,6 +2,8 @@ package mekanism.common.block; import java.util.List; +import mekanism.api.EnumColor; +import mekanism.client.ClientProxy; import mekanism.common.Mekanism; import mekanism.common.tile.TileEntityPlasticBlock; @@ -76,21 +78,11 @@ public class BlockPlastic extends Block } @Override - public boolean renderAsNormalBlock() + public int colorMultiplier(IBlockAccess world, int x, int y, int z) { - return false; - } - - @Override - public boolean isOpaqueCube() - { - return false; - } - - @Override - public int getRenderType() - { - return -1; + TileEntityPlasticBlock plastic = (TileEntityPlasticBlock)world.getBlockTileEntity(x, y, z); + EnumColor colour = EnumColor.DYES[plastic.colour]; + return (int)(colour.getColor(0)*255) << 16 | (int)(colour.getColor(1)*255) << 8 | (int)(colour.getColor(2)*255); } @Override