2013-08-27 00:57:08 +02:00
|
|
|
package mekanism.client.render.block;
|
2012-11-28 16:33:34 +01:00
|
|
|
|
2014-01-03 03:09:21 +01:00
|
|
|
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.ClientProxy;
|
2014-01-03 03:09:21 +01:00
|
|
|
import mekanism.client.model.*;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.client.render.MekanismRenderer;
|
2013-08-27 00:49:32 +02:00
|
|
|
import mekanism.common.block.BlockMachine.MachineType;
|
2013-08-27 00:57:08 +02:00
|
|
|
import mekanism.common.util.MekanismUtils;
|
|
|
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.block.Block;
|
2013-07-20 18:10:14 +02:00
|
|
|
import net.minecraft.client.Minecraft;
|
2012-12-20 22:53:39 +01:00
|
|
|
import net.minecraft.client.renderer.RenderBlocks;
|
2012-12-23 20:46:11 +01:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
2012-12-20 22:53:39 +01:00
|
|
|
import org.lwjgl.opengl.GL11;
|
|
|
|
|
2013-04-13 16:33:37 +02:00
|
|
|
@SideOnly(Side.CLIENT)
|
2013-05-20 00:43:01 +02:00
|
|
|
public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
2012-11-28 16:33:34 +01:00
|
|
|
{
|
2013-04-05 22:26:48 +02:00
|
|
|
public ModelElectricPump electricPump = new ModelElectricPump();
|
|
|
|
public ModelMetallurgicInfuser metallurgicInfuser = new ModelMetallurgicInfuser();
|
2013-05-20 00:43:01 +02:00
|
|
|
public ModelChargepad chargepad = new ModelChargepad();
|
2013-11-02 03:36:06 +01:00
|
|
|
public ModelLogisticalSorter logisticalSorter = new ModelLogisticalSorter();
|
2013-11-21 02:28:06 +01:00
|
|
|
public ModelDigitalMiner digitalMiner = new ModelDigitalMiner();
|
2013-11-28 00:17:44 +01:00
|
|
|
public ModelRotaryCondensentrator rotaryCondensentrator = new ModelRotaryCondensentrator();
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
public ModelChemicalOxidizer chemicalOxidizer = new ModelChemicalOxidizer();
|
2014-01-01 04:54:39 +01:00
|
|
|
public ModelChemicalInfuser chemicalInfuser = new ModelChemicalInfuser();
|
2014-01-03 03:09:21 +01:00
|
|
|
public ModelElectrolyticSeparator electrolyticSeparator = new ModelElectrolyticSeparator();
|
|
|
|
|
|
|
|
|
2012-11-28 16:33:34 +01:00
|
|
|
@Override
|
2012-12-23 20:46:11 +01:00
|
|
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
2012-11-28 16:33:34 +01:00
|
|
|
{
|
2013-11-15 20:59:26 +01:00
|
|
|
if(block == null || renderer == null || MachineType.get(block.blockID, metadata) == null)
|
2013-05-23 19:30:12 +02:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-12-23 20:46:11 +01:00
|
|
|
GL11.glPushMatrix();
|
|
|
|
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
|
|
|
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
MachineType type = MachineType.get(block.blockID, metadata);
|
|
|
|
|
|
|
|
if(type == MachineType.ELECTRIC_PUMP)
|
2013-11-15 20:59:26 +01:00
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(90F, 0.0F, -1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(0.0F, -0.85F, 0.0F);
|
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectricPump.png"));
|
|
|
|
electricPump.render(0.0560F);
|
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.METALLURGIC_INFUSER)
|
2013-11-15 20:59:26 +01:00
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "MetallurgicInfuser.png"));
|
|
|
|
metallurgicInfuser.render(0.0625F);
|
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.CHARGEPAD)
|
2013-11-15 20:59:26 +01:00
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(0.0F, -1.1F, 0.0F);
|
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "Chargepad.png"));
|
|
|
|
chargepad.render(0.0625F);
|
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.LOGISTICAL_SORTER)
|
2013-11-15 20:59:26 +01:00
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(0.0F, -0.85F, -0.15F);
|
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "LogisticalSorter.png"));
|
|
|
|
logisticalSorter.render(0.0625F, false);
|
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.DIGITAL_MINER)
|
2013-11-21 02:28:06 +01:00
|
|
|
{
|
2013-11-21 03:17:23 +01:00
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
|
|
|
|
GL11.glTranslatef(-0.2F, -0.3F, 0.0F);
|
2013-11-21 02:28:06 +01:00
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "DigitalMiner.png"));
|
2013-11-21 03:17:23 +01:00
|
|
|
digitalMiner.render(0.03125F, false);
|
2013-11-21 02:28:06 +01:00
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.ROTARY_CONDENSENTRATOR)
|
2013-11-28 00:17:44 +01:00
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glRotatef(270F, 0.0F, -1.0F, 0.0F);
|
2013-12-09 03:40:00 +01:00
|
|
|
GL11.glTranslatef(0.0F, -1.06F, 0.05F);
|
2013-11-28 00:17:44 +01:00
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "RotaryCondensentrator.png"));
|
|
|
|
rotaryCondensentrator.render(0.0625F);
|
|
|
|
}
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
else if(type == MachineType.CHEMICAL_OXIDIZER)
|
|
|
|
{
|
|
|
|
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, "ChemicalOxidizer.png"));
|
|
|
|
chemicalOxidizer.render(0.0625F);
|
2013-12-31 22:51:02 +01:00
|
|
|
chemicalOxidizer.renderGlass(0.0625F);
|
Rename Oxidation Chamber to Chemical Oxidizer and added model, will explain why below. This means a minor lang update @crafteverywhere, @VeryBigBro, @Vexatos
Notice that all Mekanism machines that perform similar tasks have a similar ending word; for example, the Metallurgic Infuser infuses alloys into ingots, and the Chemical Infuser infuses chemicals into other chemicals. Every ore processing machine has "Chamber" as the final word, and as this is not directly linked to ore processing, it would be best to move the "Oxidation" side of the machine to the end. Furthermore, for this chemical line, I am trying to keep "Chemical" as the first word in each machine title: Chemical Infuser, Chemical Oxidizer, Chemical Injection Chamber, etc. Hope that makes sense!
2013-12-31 21:07:09 +01:00
|
|
|
}
|
2014-01-01 04:54:39 +01:00
|
|
|
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);
|
|
|
|
}
|
2014-01-03 03:09:21 +01:00
|
|
|
else if(type == MachineType.ELECTROLYTIC_SEPARATOR)
|
|
|
|
{
|
|
|
|
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
|
|
|
GL11.glTranslated(0.0F, -1.0F, 0.0F);
|
2014-01-03 05:34:52 +01:00
|
|
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "ElectrolyticSeparator.png"));
|
2014-01-03 03:09:21 +01:00
|
|
|
electrolyticSeparator.render(0.0625F);
|
|
|
|
}
|
2013-11-15 20:59:26 +01:00
|
|
|
else {
|
|
|
|
MekanismRenderer.renderItem(renderer, metadata, block);
|
|
|
|
}
|
2012-12-23 20:46:11 +01:00
|
|
|
|
|
|
|
GL11.glPopMatrix();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
|
|
|
|
{
|
2013-11-15 20:59:26 +01:00
|
|
|
int metadata = world.getBlockMetadata(x, y, z);
|
|
|
|
|
|
|
|
if(MachineType.get(block.blockID, metadata) != null)
|
2012-12-23 20:46:11 +01:00
|
|
|
{
|
2013-11-15 20:59:26 +01:00
|
|
|
if(!MachineType.get(block.blockID, metadata).hasModel)
|
2012-12-23 20:46:11 +01:00
|
|
|
{
|
|
|
|
renderer.renderStandardBlock(block, x, y, z);
|
2013-01-21 02:15:59 +01:00
|
|
|
renderer.setRenderBoundsFromBlock(block);
|
2012-12-23 20:46:11 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
2012-11-28 16:33:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-12-23 20:46:11 +01:00
|
|
|
public boolean shouldRender3DInInventory()
|
2012-11-28 16:33:34 +01:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2012-12-23 20:46:11 +01:00
|
|
|
public int getRenderId()
|
2012-11-28 16:33:34 +01:00
|
|
|
{
|
2013-04-28 21:23:08 +02:00
|
|
|
return ClientProxy.MACHINE_RENDER_ID;
|
2012-11-28 16:33:34 +01:00
|
|
|
}
|
|
|
|
}
|