Added Chemical Infuser model, still need to add dynamic rendering (shouldn't be too hard since I already have Chemical Oxidizer framework complete

This commit is contained in:
Aidan C. Brady 2013-12-31 22:54:39 -05:00
parent 544d96f3bc
commit c1e40be9ad
6 changed files with 611 additions and 5 deletions

View file

@ -4,7 +4,37 @@ package mekanism.client;
import java.io.File;
import java.util.HashMap;
import mekanism.client.gui.*;
import mekanism.client.gui.GuiChemicalCombiner;
import mekanism.client.gui.GuiChemicalInfuser;
import mekanism.client.gui.GuiChemicalInjectionChamber;
import mekanism.client.gui.GuiChemicalOxidizer;
import mekanism.client.gui.GuiCombiner;
import mekanism.client.gui.GuiConfiguration;
import mekanism.client.gui.GuiCredits;
import mekanism.client.gui.GuiCrusher;
import mekanism.client.gui.GuiDictionary;
import mekanism.client.gui.GuiDigitalMiner;
import mekanism.client.gui.GuiDynamicTank;
import mekanism.client.gui.GuiElectricChest;
import mekanism.client.gui.GuiElectricPump;
import mekanism.client.gui.GuiEnergizedSmelter;
import mekanism.client.gui.GuiEnergyCube;
import mekanism.client.gui.GuiEnrichmentChamber;
import mekanism.client.gui.GuiFactory;
import mekanism.client.gui.GuiGasTank;
import mekanism.client.gui.GuiMetallurgicInfuser;
import mekanism.client.gui.GuiOsmiumCompressor;
import mekanism.client.gui.GuiPasswordEnter;
import mekanism.client.gui.GuiPasswordModify;
import mekanism.client.gui.GuiPortableTeleporter;
import mekanism.client.gui.GuiPurificationChamber;
import mekanism.client.gui.GuiRobitCrafting;
import mekanism.client.gui.GuiRobitInventory;
import mekanism.client.gui.GuiRobitMain;
import mekanism.client.gui.GuiRobitRepair;
import mekanism.client.gui.GuiRobitSmelting;
import mekanism.client.gui.GuiRotaryCondensentrator;
import mekanism.client.gui.GuiTeleporter;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.render.RenderPartTransmitter;
import mekanism.client.render.RenderTickHandler;
@ -17,6 +47,8 @@ import mekanism.client.render.entity.RenderRobit;
import mekanism.client.render.item.ItemRenderingHandler;
import mekanism.client.render.tileentity.RenderBin;
import mekanism.client.render.tileentity.RenderChargepad;
import mekanism.client.render.tileentity.RenderChemicalInfuser;
import mekanism.client.render.tileentity.RenderChemicalOxidizer;
import mekanism.client.render.tileentity.RenderConfigurableMachine;
import mekanism.client.render.tileentity.RenderDigitalMiner;
import mekanism.client.render.tileentity.RenderDynamicTank;
@ -29,7 +61,6 @@ import mekanism.client.render.tileentity.RenderLogisticalTransporter;
import mekanism.client.render.tileentity.RenderMechanicalPipe;
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
import mekanism.client.render.tileentity.RenderObsidianTNT;
import mekanism.client.render.tileentity.RenderChemicalOxidizer;
import mekanism.client.render.tileentity.RenderPressurizedTube;
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
import mekanism.client.render.tileentity.RenderTeleporter;
@ -46,7 +77,40 @@ import mekanism.common.Mekanism;
import mekanism.common.block.BlockMachine.MachineType;
import mekanism.common.inventory.InventoryElectricChest;
import mekanism.common.item.ItemPortableTeleporter;
import mekanism.common.tileentity.*;
import mekanism.common.tileentity.TileEntityAdvancedElectricMachine;
import mekanism.common.tileentity.TileEntityAdvancedFactory;
import mekanism.common.tileentity.TileEntityBin;
import mekanism.common.tileentity.TileEntityChargepad;
import mekanism.common.tileentity.TileEntityChemicalCombiner;
import mekanism.common.tileentity.TileEntityChemicalInfuser;
import mekanism.common.tileentity.TileEntityChemicalInjectionChamber;
import mekanism.common.tileentity.TileEntityChemicalOxidizer;
import mekanism.common.tileentity.TileEntityCombiner;
import mekanism.common.tileentity.TileEntityCrusher;
import mekanism.common.tileentity.TileEntityDigitalMiner;
import mekanism.common.tileentity.TileEntityDiversionTransporter;
import mekanism.common.tileentity.TileEntityDynamicTank;
import mekanism.common.tileentity.TileEntityDynamicValve;
import mekanism.common.tileentity.TileEntityElectricChest;
import mekanism.common.tileentity.TileEntityElectricMachine;
import mekanism.common.tileentity.TileEntityElectricPump;
import mekanism.common.tileentity.TileEntityEliteFactory;
import mekanism.common.tileentity.TileEntityEnergizedSmelter;
import mekanism.common.tileentity.TileEntityEnergyCube;
import mekanism.common.tileentity.TileEntityEnrichmentChamber;
import mekanism.common.tileentity.TileEntityFactory;
import mekanism.common.tileentity.TileEntityGasTank;
import mekanism.common.tileentity.TileEntityLogisticalSorter;
import mekanism.common.tileentity.TileEntityLogisticalTransporter;
import mekanism.common.tileentity.TileEntityMechanicalPipe;
import mekanism.common.tileentity.TileEntityMetallurgicInfuser;
import mekanism.common.tileentity.TileEntityObsidianTNT;
import mekanism.common.tileentity.TileEntityOsmiumCompressor;
import mekanism.common.tileentity.TileEntityPressurizedTube;
import mekanism.common.tileentity.TileEntityPurificationChamber;
import mekanism.common.tileentity.TileEntityRotaryCondensentrator;
import mekanism.common.tileentity.TileEntityTeleporter;
import mekanism.common.tileentity.TileEntityUniversalCable;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
@ -211,7 +275,7 @@ public class ClientProxy extends CommonProxy
ClientRegistry.registerTileEntity(TileEntityRotaryCondensentrator.class, "RotaryCondensentrator", new RenderRotaryCondensentrator());
ClientRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter", new RenderTeleporter());
ClientRegistry.registerTileEntity(TileEntityChemicalOxidizer.class, "ChemicalOxidizer", new RenderChemicalOxidizer());
GameRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser");
ClientRegistry.registerTileEntity(TileEntityChemicalInfuser.class, "ChemicalInfuser", new RenderChemicalInfuser());
GameRegistry.registerTileEntity(TileEntityChemicalCombiner.class, "ChemicalCombiner");
ClientRegistry.registerTileEntity(TileEntityChemicalInjectionChamber.class, "ChemicalInjectionChamber", new RenderConfigurableMachine());
}

View file

@ -0,0 +1,345 @@
package mekanism.client.model;
import mekanism.client.render.MekanismRenderer;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import org.lwjgl.opengl.GL11;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class ModelChemicalInfuser extends ModelBase
{
ModelRenderer Base;
ModelRenderer GasExit;
ModelRenderer GasLeft;
ModelRenderer GasRight;
ModelRenderer MachineCore;
ModelRenderer TopPanel;
ModelRenderer SidePanel;
ModelRenderer LPanelNW;
ModelRenderer RPanelNW;
ModelRenderer RPanelNE;
ModelRenderer LPanelSW;
ModelRenderer RPanelSW;
ModelRenderer RPanelSE;
ModelRenderer LPanelNE;
ModelRenderer LPanelSE;
ModelRenderer LTopS;
ModelRenderer RTopN;
ModelRenderer LTopN;
ModelRenderer RTopS;
ModelRenderer RTopW;
ModelRenderer RTopE;
ModelRenderer LTopE;
ModelRenderer LTopW;
ModelRenderer FrontPanel;
ModelRenderer FrontConnection;
ModelRenderer RightConnection;
ModelRenderer LeftConnection;
ModelRenderer LGlassT;
ModelRenderer RGlassT;
ModelRenderer LGlassS;
ModelRenderer RGlassS;
ModelRenderer RGlassN;
ModelRenderer LGlassN;
ModelRenderer LGlassL;
ModelRenderer RGlassR;
ModelRenderer RGlassL;
ModelRenderer LGlassR;
public ModelChemicalInfuser()
{
textureWidth = 128;
textureHeight = 128;
Base = new ModelRenderer(this, 0, 0);
Base.addBox(0F, 0F, 0F, 16, 1, 16);
Base.setRotationPoint(-8F, 23F, -8F);
Base.setTextureSize(128, 128);
Base.mirror = true;
setRotation(Base, 0F, 0F, 0F);
GasExit = new ModelRenderer(this, 0, 17);
GasExit.addBox(0F, 0F, 0F, 6, 6, 1);
GasExit.setRotationPoint(-3F, 13F, -8F);
GasExit.setTextureSize(128, 128);
GasExit.mirror = true;
setRotation(GasExit, 0F, 0F, 0F);
GasLeft = new ModelRenderer(this, 64, 0);
GasLeft.addBox(0F, 0F, 0F, 1, 6, 6);
GasLeft.setRotationPoint(-8F, 13F, -3F);
GasLeft.setTextureSize(128, 128);
GasLeft.mirror = true;
setRotation(GasLeft, 0F, 0F, 0F);
GasRight = new ModelRenderer(this, 64, 0);
GasRight.addBox(0F, 0F, 0F, 1, 6, 6);
GasRight.setRotationPoint(7F, 13F, -3F);
GasRight.setTextureSize(128, 128);
GasRight.mirror = true;
setRotation(GasRight, 0F, 0F, 0F);
MachineCore = new ModelRenderer(this, 0, 24);
MachineCore.addBox(0F, 0F, 0F, 10, 11, 5);
MachineCore.setRotationPoint(-5F, 12F, -4F);
MachineCore.setTextureSize(128, 128);
MachineCore.mirror = true;
setRotation(MachineCore, 0F, 0F, 0F);
TopPanel = new ModelRenderer(this, 0, 40);
TopPanel.addBox(0F, 0F, 0F, 2, 1, 8);
TopPanel.setRotationPoint(-1F, 11F, -3F);
TopPanel.setTextureSize(128, 128);
TopPanel.mirror = true;
setRotation(TopPanel, 0F, 0F, 0F);
SidePanel = new ModelRenderer(this, 30, 17);
SidePanel.addBox(0F, 0F, 0F, 2, 11, 1);
SidePanel.setRotationPoint(-1F, 12F, 4F);
SidePanel.setTextureSize(128, 128);
SidePanel.mirror = true;
setRotation(SidePanel, 0F, 0F, 0F);
LPanelNW = new ModelRenderer(this, 78, 0);
LPanelNW.addBox(0F, 0F, 0F, 1, 15, 1);
LPanelNW.setRotationPoint(-6F, 8F, 1F);
LPanelNW.setTextureSize(128, 128);
LPanelNW.mirror = true;
setRotation(LPanelNW, 0F, 0F, 0F);
RPanelNW = new ModelRenderer(this, 78, 0);
RPanelNW.addBox(0F, 0F, 0F, 1, 15, 1);
RPanelNW.setRotationPoint(1F, 8F, 1F);
RPanelNW.setTextureSize(128, 128);
RPanelNW.mirror = true;
setRotation(RPanelNW, 0F, 0F, 0F);
RPanelNE = new ModelRenderer(this, 78, 0);
RPanelNE.addBox(7F, 0F, 0F, 1, 15, 1);
RPanelNE.setRotationPoint(-2F, 8F, 1F);
RPanelNE.setTextureSize(128, 128);
RPanelNE.mirror = true;
setRotation(RPanelNE, 0F, 0F, 0F);
LPanelSW = new ModelRenderer(this, 78, 0);
LPanelSW.addBox(0F, 0F, 0F, 1, 15, 1);
LPanelSW.setRotationPoint(-6F, 8F, 5F);
LPanelSW.setTextureSize(128, 128);
LPanelSW.mirror = true;
setRotation(LPanelSW, 0F, 0F, 0F);
RPanelSW = new ModelRenderer(this, 78, 0);
RPanelSW.addBox(0F, 0F, 0F, 1, 15, 1);
RPanelSW.setRotationPoint(1F, 8F, 5F);
RPanelSW.setTextureSize(128, 128);
RPanelSW.mirror = true;
setRotation(RPanelSW, 0F, 0F, 0F);
RPanelSE = new ModelRenderer(this, 78, 0);
RPanelSE.addBox(0F, 0F, 0F, 1, 15, 1);
RPanelSE.setRotationPoint(5F, 8F, 5F);
RPanelSE.setTextureSize(128, 128);
RPanelSE.mirror = true;
setRotation(RPanelSE, 0F, 0F, 0F);
LPanelNE = new ModelRenderer(this, 78, 0);
LPanelNE.addBox(0F, 0F, 0F, 1, 15, 1);
LPanelNE.setRotationPoint(-2F, 8F, 1F);
LPanelNE.setTextureSize(128, 128);
LPanelNE.mirror = true;
setRotation(LPanelNE, 0F, 0F, 0F);
LPanelSE = new ModelRenderer(this, 78, 0);
LPanelSE.addBox(0F, 0F, 0F, 1, 15, 1);
LPanelSE.setRotationPoint(-2F, 8F, 5F);
LPanelSE.setTextureSize(128, 128);
LPanelSE.mirror = true;
setRotation(LPanelSE, 0F, 0F, 0F);
LTopS = new ModelRenderer(this, 82, 0);
LTopS.addBox(0F, 0F, 4F, 3, 1, 1);
LTopS.setRotationPoint(-5F, 8F, 1F);
LTopS.setTextureSize(128, 128);
LTopS.mirror = true;
setRotation(LTopS, 0F, 0F, 0F);
RTopN = new ModelRenderer(this, 82, 0);
RTopN.addBox(0F, 0F, 0F, 3, 1, 1);
RTopN.setRotationPoint(2F, 8F, 1F);
RTopN.setTextureSize(128, 128);
RTopN.mirror = true;
setRotation(RTopN, 0F, 0F, 0F);
LTopN = new ModelRenderer(this, 82, 0);
LTopN.addBox(0F, 0F, 0F, 3, 1, 1);
LTopN.setRotationPoint(-5F, 8F, 1F);
LTopN.setTextureSize(128, 128);
LTopN.mirror = true;
setRotation(LTopN, 0F, 0F, 0F);
RTopS = new ModelRenderer(this, 82, 0);
RTopS.addBox(0F, 0F, 4F, 3, 1, 1);
RTopS.setRotationPoint(2F, 8F, 1F);
RTopS.setTextureSize(128, 128);
RTopS.mirror = true;
setRotation(RTopS, 0F, 0F, 0F);
RTopW = new ModelRenderer(this, 90, 0);
RTopW.addBox(0F, 0F, 0F, 1, 1, 3);
RTopW.setRotationPoint(1F, 8F, 2F);
RTopW.setTextureSize(128, 128);
RTopW.mirror = true;
setRotation(RTopW, 0F, 0F, 0F);
RTopE = new ModelRenderer(this, 90, 0);
RTopE.addBox(0F, 1F, 0F, 1, 1, 3);
RTopE.setRotationPoint(5F, 7F, 2F);
RTopE.setTextureSize(128, 128);
RTopE.mirror = true;
setRotation(RTopE, 0F, 0F, 0F);
LTopE = new ModelRenderer(this, 90, 0);
LTopE.addBox(0F, 0F, 0F, 1, 1, 3);
LTopE.setRotationPoint(-2F, 8F, 2F);
LTopE.setTextureSize(128, 128);
LTopE.mirror = true;
setRotation(LTopE, 0F, 0F, 0F);
LTopW = new ModelRenderer(this, 90, 0);
LTopW.addBox(0F, 0F, 0F, 1, 1, 3);
LTopW.setRotationPoint(-6F, 8F, 2F);
LTopW.setTextureSize(128, 128);
LTopW.mirror = true;
setRotation(LTopW, 0F, 0F, 0F);
FrontPanel = new ModelRenderer(this, 0, 49);
FrontPanel.addBox(0F, 0F, 0F, 8, 9, 1);
FrontPanel.setRotationPoint(-4F, 13F, -5F);
FrontPanel.setTextureSize(128, 128);
FrontPanel.mirror = true;
setRotation(FrontPanel, 0F, 0F, 0F);
FrontConnection = new ModelRenderer(this, 0, 59);
FrontConnection.addBox(0F, 0F, 0F, 4, 4, 2);
FrontConnection.setRotationPoint(-2F, 14F, -7F);
FrontConnection.setTextureSize(128, 128);
FrontConnection.mirror = true;
setRotation(FrontConnection, 0F, 0F, 0F);
RightConnection = new ModelRenderer(this, 98, 0);
RightConnection.addBox(0F, 0F, 0F, 2, 4, 4);
RightConnection.setRotationPoint(5F, 14F, -2F);
RightConnection.setTextureSize(128, 128);
RightConnection.mirror = true;
setRotation(RightConnection, 0F, 0F, 0F);
LeftConnection = new ModelRenderer(this, 98, 0);
LeftConnection.addBox(0F, 0F, 0F, 2, 4, 4);
LeftConnection.setRotationPoint(-7F, 14F, -2F);
LeftConnection.setTextureSize(128, 128);
LeftConnection.mirror = true;
setRotation(LeftConnection, 0F, 0F, 0F);
LGlassT = new ModelRenderer(this, 36, 17);
LGlassT.addBox(0F, 0F, 0F, 3, 1, 3);
LGlassT.setRotationPoint(-5F, 8F, 2F);
LGlassT.setTextureSize(128, 128);
LGlassT.mirror = true;
setRotation(LGlassT, 0F, 0F, 0F);
RGlassT = new ModelRenderer(this, 36, 17);
RGlassT.addBox(0F, 0F, 0F, 3, 1, 3);
RGlassT.setRotationPoint(2F, 8F, 2F);
RGlassT.setTextureSize(128, 128);
RGlassT.mirror = true;
setRotation(RGlassT, 0F, 0F, 0F);
LGlassS = new ModelRenderer(this, 48, 17);
LGlassS.addBox(0F, 0F, 0F, 3, 14, 1);
LGlassS.setRotationPoint(-5F, 9F, 5F);
LGlassS.setTextureSize(128, 128);
LGlassS.mirror = true;
setRotation(LGlassS, 0F, 0F, 0F);
RGlassS = new ModelRenderer(this, 48, 17);
RGlassS.addBox(0F, 0F, 0F, 3, 14, 1);
RGlassS.setRotationPoint(2F, 9F, 5F);
RGlassS.setTextureSize(128, 128);
RGlassS.mirror = true;
setRotation(RGlassS, 0F, 0F, 0F);
RGlassN = new ModelRenderer(this, 48, 17);
RGlassN.addBox(0F, 0F, 0F, 3, 14, 1);
RGlassN.setRotationPoint(2F, 9F, 1F);
RGlassN.setTextureSize(128, 128);
RGlassN.mirror = true;
setRotation(RGlassN, 0F, 0F, 0F);
LGlassN = new ModelRenderer(this, 48, 17);
LGlassN.addBox(0F, 0F, 0F, 3, 14, 1);
LGlassN.setRotationPoint(-5F, 9F, 1F);
LGlassN.setTextureSize(128, 128);
LGlassN.mirror = true;
setRotation(LGlassN, 0F, 0F, 0F);
LGlassL = new ModelRenderer(this, 0, 65);
LGlassL.addBox(0F, 0F, 0F, 1, 14, 3);
LGlassL.setRotationPoint(-6F, 9F, 2F);
LGlassL.setTextureSize(128, 128);
LGlassL.mirror = true;
setRotation(LGlassL, 0F, 0F, 0F);
RGlassR = new ModelRenderer(this, 0, 65);
RGlassR.addBox(0F, 0F, 0F, 1, 14, 3);
RGlassR.setRotationPoint(5F, 9F, 2F);
RGlassR.setTextureSize(128, 128);
RGlassR.mirror = true;
setRotation(RGlassR, 0F, 0F, 0F);
RGlassL = new ModelRenderer(this, 0, 65);
RGlassL.addBox(0F, 0F, 0F, 1, 14, 3);
RGlassL.setRotationPoint(1F, 9F, 2F);
RGlassL.setTextureSize(128, 128);
RGlassL.mirror = true;
setRotation(RGlassL, 0F, 0F, 0F);
LGlassR = new ModelRenderer(this, 0, 65);
LGlassR.addBox(0F, 0F, 0F, 1, 14, 3);
LGlassR.setRotationPoint(-2F, 9F, 2F);
LGlassR.setTextureSize(128, 128);
LGlassR.mirror = true;
setRotation(LGlassR, 0F, 0F, 0F);
}
public void render(float size)
{
Base.render(size);
GasExit.render(size);
GasLeft.render(size);
GasRight.render(size);
MachineCore.render(size);
TopPanel.render(size);
SidePanel.render(size);
LPanelNW.render(size);
RPanelNW.render(size);
RPanelNE.render(size);
LPanelSW.render(size);
RPanelSW.render(size);
RPanelSE.render(size);
LPanelNE.render(size);
LPanelSE.render(size);
LTopS.render(size);
RTopN.render(size);
LTopN.render(size);
RTopS.render(size);
RTopW.render(size);
RTopE.render(size);
LTopE.render(size);
LTopW.render(size);
FrontPanel.render(size);
FrontConnection.render(size);
GL11.glPushMatrix();
GL11.glScalef(0.999F, 0.999F, 0.999F);
RightConnection.render(size);
LeftConnection.render(size);
GL11.glPopMatrix();
}
public void renderGlass(float size)
{
GL11.glPushMatrix();
MekanismRenderer.blendOn();
GL11.glColor4f(1, 1, 1, 0.2F);
LGlassT.render(size);
RGlassT.render(size);
LGlassS.render(size);
RGlassS.render(size);
RGlassN.render(size);
LGlassN.render(size);
LGlassL.render(size);
RGlassR.render(size);
RGlassL.render(size);
LGlassR.render(size);
MekanismRenderer.blendOff();
GL11.glColor4f(1, 1, 1, 1);
GL11.glPopMatrix();
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}

View file

@ -2,6 +2,7 @@ package mekanism.client.render.block;
import mekanism.client.ClientProxy;
import mekanism.client.model.ModelChargepad;
import mekanism.client.model.ModelChemicalInfuser;
import mekanism.client.model.ModelChemicalOxidizer;
import mekanism.client.model.ModelDigitalMiner;
import mekanism.client.model.ModelElectricPump;
@ -33,6 +34,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
public ModelDigitalMiner digitalMiner = new ModelDigitalMiner();
public ModelRotaryCondensentrator rotaryCondensentrator = new ModelRotaryCondensentrator();
public ModelChemicalOxidizer chemicalOxidizer = new ModelChemicalOxidizer();
public ModelChemicalInfuser chemicalInfuser = new ModelChemicalInfuser();
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
@ -103,6 +105,15 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
chemicalOxidizer.render(0.0625F);
chemicalOxidizer.renderGlass(0.0625F);
}
else if(type == MachineType.CHEMICAL_INFUSER)
{
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
GL11.glTranslatef(0.0F, -1.06F, 0.05F);
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalInfuser.png"));
chemicalInfuser.render(0.0625F);
chemicalInfuser.renderGlass(0.0625F);
}
else {
MekanismRenderer.renderItem(renderer, metadata, block);
}

View file

@ -0,0 +1,186 @@
package mekanism.client.render.tileentity;
import java.util.HashMap;
import java.util.Map;
import mekanism.api.gas.Gas;
import mekanism.client.model.ModelChemicalInfuser;
import mekanism.client.render.MekanismRenderer;
import mekanism.client.render.MekanismRenderer.DisplayInteger;
import mekanism.client.render.MekanismRenderer.Model3D;
import mekanism.common.tileentity.TileEntityChemicalInfuser;
import mekanism.common.util.MekanismUtils;
import mekanism.common.util.MekanismUtils.ResourceType;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.opengl.GL11;
public class RenderChemicalInfuser extends TileEntitySpecialRenderer
{
private ModelChemicalInfuser model = new ModelChemicalInfuser();
private static final double offset = 0.001;
private Map<ForgeDirection, HashMap<Gas, DisplayInteger>> cachedGasses = new HashMap<ForgeDirection, HashMap<Gas, DisplayInteger>>();
@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
{
renderAModelAt((TileEntityChemicalInfuser)tileEntity, x, y, z, partialTick);
}
private void renderAModelAt(TileEntityChemicalInfuser tileEntity, double x, double y, double z, float partialTick)
{
render(false, x, y, z, tileEntity);
/*if(tileEntity.gasTank.getGas() != null)
{
push();
GL11.glTranslatef((float)x, (float)y, (float)z);
GL11.glColor4f(1.0F, 1.0F, 1.0F, (float)tileEntity.gasTank.getStored()/tileEntity.gasTank.getMaxGas());
bindTexture(MekanismRenderer.getBlocksTexture());
getListAndRender(ForgeDirection.getOrientation(tileEntity.facing), tileEntity.gasTank.getGas().getGas()).render();
GL11.glColor4f(1, 1, 1, 1);
pop();
}*/
render(true, x, y, z, tileEntity);
}
/*
* 0: casing, 1: glass
*/
private void render(boolean glass, double x, double y, double z, TileEntityChemicalInfuser tileEntity)
{
GL11.glPushMatrix();
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ChemicalInfuser.png"));
switch(tileEntity.facing)
{
case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break;
case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break;
case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break;
case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break;
}
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if(!glass)
{
model.render(0.0625F);
}
else {
model.renderGlass(0.0625F);
}
GL11.glPopMatrix();
}
@SuppressWarnings("incomplete-switch")
private DisplayInteger getListAndRender(ForgeDirection side, Gas gas)
{
if(gas == null || gas.getIcon() == null)
{
return null;
}
if(cachedGasses.containsKey(side) && cachedGasses.get(side).containsKey(gas))
{
return cachedGasses.get(side).get(gas);
}
Model3D toReturn = new Model3D();
toReturn.baseBlock = Block.waterStill;
toReturn.setTexture(gas.getIcon());
DisplayInteger display = DisplayInteger.createAndStart();
if(cachedGasses.containsKey(side))
{
cachedGasses.get(side).put(gas, display);
}
else {
HashMap<Gas, DisplayInteger> map = new HashMap<Gas, DisplayInteger>();
map.put(gas, display);
cachedGasses.put(side, map);
}
switch(side)
{
case NORTH:
{
toReturn.minX = 0.125 + offset;
toReturn.minY = 0.0625 + offset;
toReturn.minZ = 0.3125 + offset;
toReturn.maxX = 0.5 - offset;
toReturn.maxY = 0.9375 - offset;
toReturn.maxZ = 0.6875 - offset;
break;
}
case SOUTH:
{
toReturn.minX = 0.5 + offset;
toReturn.minY = 0.0625 + offset;
toReturn.minZ = 0.3125 + offset;
toReturn.maxX = 0.875 - offset;
toReturn.maxY = 0.9375 - offset;
toReturn.maxZ = 0.6875 - offset;
break;
}
case WEST:
{
toReturn.minX = 0.3125 + offset;
toReturn.minY = 0.0625 + offset;
toReturn.minZ = 0.5 + offset;
toReturn.maxX = 0.6875 - offset;
toReturn.maxY = 0.9375 - offset;
toReturn.maxZ = 0.875 - offset;
break;
}
case EAST:
{
toReturn.minX = 0.3125 + offset;
toReturn.minY = 0.0625 + offset;
toReturn.minZ = 0.125 + offset;
toReturn.maxX = 0.6875 - offset;
toReturn.maxY = 0.9375 - offset;
toReturn.maxZ = 0.5 - offset;
break;
}
}
MekanismRenderer.renderObject(toReturn);
display.endList();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
return display;
}
private void pop()
{
GL11.glPopAttrib();
GL11.glPopMatrix();
}
private void push()
{
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
}
}

View file

@ -1090,7 +1090,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds
LOGISTICAL_SORTER(Mekanism.machineBlockID, 15, "LogisticalSorter", -1, 0, TileEntityLogisticalSorter.class, true),
ROTARY_CONDENSENTRATOR(Mekanism.machineBlock2ID, 0, "RotaryCondensentrator", 7, 20000, TileEntityRotaryCondensentrator.class, true),
CHEMICAL_OXIDIZER(Mekanism.machineBlock2ID, 1, "ChemicalOxidizer", 29, 20000, TileEntityChemicalOxidizer.class, true),
CHEMICAL_INFUSER(Mekanism.machineBlock2ID, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, false),
CHEMICAL_INFUSER(Mekanism.machineBlock2ID, 2, "ChemicalInfuser", 30, 20000, TileEntityChemicalInfuser.class, true),
CHEMICAL_COMBINER(Mekanism.machineBlock2ID, 4, "ChemicalCombiner", 32, 20000, TileEntityChemicalCombiner.class, false),
CHEMICAL_INJECTION_CHAMBER(Mekanism.machineBlock2ID, 3, "ChemicalInjectionChamber", 31, Mekanism.chemicalInjectionChamberUsage*400, TileEntityChemicalInjectionChamber.class, false);

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB