Fix NEI offset for PRC, gave PRC a model, added specific sides for machines
This commit is contained in:
parent
32303a2b46
commit
0528f1aace
11 changed files with 309 additions and 46 deletions
|
@ -71,6 +71,7 @@ import mekanism.client.render.tileentity.RenderGasTank;
|
||||||
import mekanism.client.render.tileentity.RenderLogisticalSorter;
|
import mekanism.client.render.tileentity.RenderLogisticalSorter;
|
||||||
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
|
import mekanism.client.render.tileentity.RenderMetallurgicInfuser;
|
||||||
import mekanism.client.render.tileentity.RenderObsidianTNT;
|
import mekanism.client.render.tileentity.RenderObsidianTNT;
|
||||||
|
import mekanism.client.render.tileentity.RenderPressurizedReactionChamber;
|
||||||
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
|
import mekanism.client.render.tileentity.RenderRotaryCondensentrator;
|
||||||
import mekanism.client.render.tileentity.RenderSalinationController;
|
import mekanism.client.render.tileentity.RenderSalinationController;
|
||||||
import mekanism.client.render.tileentity.RenderSeismicVibrator;
|
import mekanism.client.render.tileentity.RenderSeismicVibrator;
|
||||||
|
@ -78,7 +79,6 @@ import mekanism.client.render.tileentity.RenderTeleporter;
|
||||||
import mekanism.client.sound.Sound;
|
import mekanism.client.sound.Sound;
|
||||||
import mekanism.client.sound.SoundHandler;
|
import mekanism.client.sound.SoundHandler;
|
||||||
import mekanism.common.CommonProxy;
|
import mekanism.common.CommonProxy;
|
||||||
import mekanism.common.EnergyDisplay.EnergyType;
|
|
||||||
import mekanism.common.IElectricChest;
|
import mekanism.common.IElectricChest;
|
||||||
import mekanism.common.IInvConfiguration;
|
import mekanism.common.IInvConfiguration;
|
||||||
import mekanism.common.Mekanism;
|
import mekanism.common.Mekanism;
|
||||||
|
@ -293,7 +293,7 @@ public class ClientProxy extends CommonProxy
|
||||||
ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher());
|
ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher());
|
||||||
ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer());
|
ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer());
|
||||||
ClientRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator", new RenderSeismicVibrator());
|
ClientRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator", new RenderSeismicVibrator());
|
||||||
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine());
|
ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderPressurizedReactionChamber());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,6 +30,7 @@ public class GuiPRC extends GuiMekanism
|
||||||
tileEntity = tentity;
|
tileEntity = tentity;
|
||||||
|
|
||||||
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png")));
|
guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiPRC.png")));
|
||||||
|
guiElements.add(new GuiConfigurationTab(this, tileEntity, tileEntity.guiLocation));
|
||||||
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
|
guiElements.add(new GuiFluidGauge(new IFluidInfoHandler() {
|
||||||
@Override
|
@Override
|
||||||
public FluidTank getTank()
|
public FluidTank getTank()
|
||||||
|
|
|
@ -0,0 +1,178 @@
|
||||||
|
package mekanism.client.model;
|
||||||
|
|
||||||
|
import net.minecraft.client.model.ModelBase;
|
||||||
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
|
|
||||||
|
public class ModelPressurizedReactionChamber extends ModelBase
|
||||||
|
{
|
||||||
|
ModelRenderer Base;
|
||||||
|
ModelRenderer GasRight;
|
||||||
|
ModelRenderer GasLeft;
|
||||||
|
ModelRenderer GasConnector;
|
||||||
|
ModelRenderer FluidBack;
|
||||||
|
ModelRenderer CoreBase;
|
||||||
|
ModelRenderer Core;
|
||||||
|
ModelRenderer PoleRF;
|
||||||
|
ModelRenderer PoleFL;
|
||||||
|
ModelRenderer PoleLB;
|
||||||
|
ModelRenderer PoleBR;
|
||||||
|
ModelRenderer PoleR;
|
||||||
|
ModelRenderer PoleL;
|
||||||
|
ModelRenderer FrontPanel;
|
||||||
|
ModelRenderer TubeThing;
|
||||||
|
ModelRenderer CenterCore;
|
||||||
|
ModelRenderer BackConnector;
|
||||||
|
ModelRenderer BackCore;
|
||||||
|
ModelRenderer TopPanel;
|
||||||
|
|
||||||
|
public ModelPressurizedReactionChamber()
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
GasRight = new ModelRenderer(this, 64, 12);
|
||||||
|
GasRight.addBox(0F, 0F, 0F, 1, 6, 6);
|
||||||
|
GasRight.setRotationPoint(-8F, 13F, -3F);
|
||||||
|
GasRight.setTextureSize(128, 128);
|
||||||
|
GasRight.mirror = true;
|
||||||
|
setRotation(GasRight, 0F, 0F, 0F);
|
||||||
|
GasLeft = new ModelRenderer(this, 64, 12);
|
||||||
|
GasLeft.addBox(0F, 0F, 0F, 1, 6, 6);
|
||||||
|
GasLeft.setRotationPoint(7F, 13F, -3F);
|
||||||
|
GasLeft.setTextureSize(128, 128);
|
||||||
|
GasLeft.mirror = true;
|
||||||
|
setRotation(GasLeft, 0F, 0F, 0F);
|
||||||
|
GasConnector = new ModelRenderer(this, 22, 38);
|
||||||
|
GasConnector.addBox(0F, 0F, 0F, 14, 2, 2);
|
||||||
|
GasConnector.setRotationPoint(-7F, 15F, -1F);
|
||||||
|
GasConnector.setTextureSize(128, 128);
|
||||||
|
GasConnector.mirror = true;
|
||||||
|
setRotation(GasConnector, 0F, 0F, 0F);
|
||||||
|
FluidBack = new ModelRenderer(this, 50, 24);
|
||||||
|
FluidBack.addBox(0F, 0F, 0F, 8, 8, 1);
|
||||||
|
FluidBack.setRotationPoint(-4F, 12F, 7F);
|
||||||
|
FluidBack.setTextureSize(128, 128);
|
||||||
|
FluidBack.mirror = true;
|
||||||
|
setRotation(FluidBack, 0F, 0F, 0F);
|
||||||
|
CoreBase = new ModelRenderer(this, 64, 0);
|
||||||
|
CoreBase.addBox(0F, 0F, 0F, 10, 1, 11);
|
||||||
|
CoreBase.setRotationPoint(-5F, 22F, -6F);
|
||||||
|
CoreBase.setTextureSize(128, 128);
|
||||||
|
CoreBase.mirror = true;
|
||||||
|
setRotation(CoreBase, 0F, 0F, 0F);
|
||||||
|
Core = new ModelRenderer(this, 0, 17);
|
||||||
|
Core.addBox(0F, 0F, 0F, 12, 8, 13);
|
||||||
|
Core.setRotationPoint(-6F, 14F, -7F);
|
||||||
|
Core.setTextureSize(128, 128);
|
||||||
|
Core.mirror = true;
|
||||||
|
setRotation(Core, 0F, 0F, 0F);
|
||||||
|
PoleRF = new ModelRenderer(this, 38, 42);
|
||||||
|
PoleRF.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||||
|
PoleRF.setRotationPoint(-6F, 8F, -7F);
|
||||||
|
PoleRF.setTextureSize(128, 128);
|
||||||
|
PoleRF.mirror = true;
|
||||||
|
setRotation(PoleRF, 0F, 0F, 0F);
|
||||||
|
PoleFL = new ModelRenderer(this, 38, 42);
|
||||||
|
PoleFL.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||||
|
PoleFL.setRotationPoint(5F, 8F, -7F);
|
||||||
|
PoleFL.setTextureSize(128, 128);
|
||||||
|
PoleFL.mirror = true;
|
||||||
|
setRotation(PoleFL, 0F, 0F, 0F);
|
||||||
|
PoleLB = new ModelRenderer(this, 38, 42);
|
||||||
|
PoleLB.addBox(0F, 0F, 0F, 1, 6, 1);
|
||||||
|
PoleLB.setRotationPoint(5F, 8F, 5F);
|
||||||
|
PoleLB.setTextureSize(128, 128);
|
||||||
|
PoleLB.mirror = true;
|
||||||
|
setRotation(PoleLB, 0F, 0F, 0F);
|
||||||
|
PoleBR = new ModelRenderer(this, 38, 42);
|
||||||
|
PoleBR.addBox(0F, -2F, 0F, 1, 6, 1);
|
||||||
|
PoleBR.setRotationPoint(-6F, 10F, 5F);
|
||||||
|
PoleBR.setTextureSize(128, 128);
|
||||||
|
PoleBR.mirror = true;
|
||||||
|
setRotation(PoleBR, 0F, 0F, 0F);
|
||||||
|
PoleR = new ModelRenderer(this, 0, 57);
|
||||||
|
PoleR.addBox(0F, 0F, 0F, 1, 1, 11);
|
||||||
|
PoleR.setRotationPoint(-6F, 8F, -6F);
|
||||||
|
PoleR.setTextureSize(128, 128);
|
||||||
|
PoleR.mirror = true;
|
||||||
|
setRotation(PoleR, 0F, 0F, 0F);
|
||||||
|
PoleL = new ModelRenderer(this, 0, 57);
|
||||||
|
PoleL.addBox(0F, 0F, 0F, 1, 1, 11);
|
||||||
|
PoleL.setRotationPoint(5F, 8F, -6F);
|
||||||
|
PoleL.setTextureSize(128, 128);
|
||||||
|
PoleL.mirror = true;
|
||||||
|
setRotation(PoleL, 0F, 0F, 0F);
|
||||||
|
FrontPanel = new ModelRenderer(this, 0, 38);
|
||||||
|
FrontPanel.addBox(0F, 0F, 0F, 10, 12, 1);
|
||||||
|
FrontPanel.setRotationPoint(-5F, 9F, -8F);
|
||||||
|
FrontPanel.setTextureSize(128, 128);
|
||||||
|
FrontPanel.mirror = true;
|
||||||
|
setRotation(FrontPanel, 0F, 0F, 0F);
|
||||||
|
TubeThing = new ModelRenderer(this, 22, 42);
|
||||||
|
TubeThing.addBox(0F, 0F, 0F, 2, 2, 6);
|
||||||
|
TubeThing.setRotationPoint(-1F, 12F, -7F);
|
||||||
|
TubeThing.setTextureSize(128, 128);
|
||||||
|
TubeThing.mirror = true;
|
||||||
|
setRotation(TubeThing, 0F, 0F, 0F);
|
||||||
|
CenterCore = new ModelRenderer(this, 84, 12);
|
||||||
|
CenterCore.addBox(0F, 0F, 0F, 4, 1, 4);
|
||||||
|
CenterCore.setRotationPoint(-2F, 13F, -3F);
|
||||||
|
CenterCore.setTextureSize(128, 128);
|
||||||
|
CenterCore.mirror = true;
|
||||||
|
setRotation(CenterCore, 0F, 0F, 0F);
|
||||||
|
BackConnector = new ModelRenderer(this, 78, 12);
|
||||||
|
BackConnector.addBox(0F, 0F, 0F, 2, 5, 1);
|
||||||
|
BackConnector.setRotationPoint(-1F, 13F, 6F);
|
||||||
|
BackConnector.setTextureSize(128, 128);
|
||||||
|
BackConnector.mirror = true;
|
||||||
|
setRotation(BackConnector, 0F, 0F, 0F);
|
||||||
|
BackCore = new ModelRenderer(this, 0, 51);
|
||||||
|
BackCore.addBox(0F, 0F, 0F, 2, 1, 5);
|
||||||
|
BackCore.setRotationPoint(-1F, 13F, 1F);
|
||||||
|
BackCore.setTextureSize(128, 128);
|
||||||
|
BackCore.mirror = true;
|
||||||
|
setRotation(BackCore, 0F, 0F, 0F);
|
||||||
|
TopPanel = new ModelRenderer(this, 0, 69);
|
||||||
|
TopPanel.addBox(0F, 0F, 0F, 10, 1, 13);
|
||||||
|
TopPanel.setRotationPoint(-5F, 8F, -7F);
|
||||||
|
TopPanel.setTextureSize(128, 128);
|
||||||
|
TopPanel.mirror = true;
|
||||||
|
setRotation(TopPanel, 0F, 0F, 0F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(float size)
|
||||||
|
{
|
||||||
|
Base.render(size);
|
||||||
|
GasRight.render(size);
|
||||||
|
GasLeft.render(size);
|
||||||
|
GasConnector.render(size);
|
||||||
|
FluidBack.render(size);
|
||||||
|
CoreBase.render(size);
|
||||||
|
Core.render(size);
|
||||||
|
PoleRF.render(size);
|
||||||
|
PoleFL.render(size);
|
||||||
|
PoleLB.render(size);
|
||||||
|
PoleBR.render(size);
|
||||||
|
PoleR.render(size);
|
||||||
|
PoleL.render(size);
|
||||||
|
FrontPanel.render(size);
|
||||||
|
TubeThing.render(size);
|
||||||
|
CenterCore.render(size);
|
||||||
|
BackConnector.render(size);
|
||||||
|
BackCore.render(size);
|
||||||
|
TopPanel.render(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||||
|
{
|
||||||
|
model.rotateAngleX = x;
|
||||||
|
model.rotateAngleY = y;
|
||||||
|
model.rotateAngleZ = z;
|
||||||
|
}
|
||||||
|
}
|
|
@ -258,9 +258,10 @@ public class PRCRecipeHandler extends BaseRecipeHandler
|
||||||
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
|
public List<String> handleTooltip(GuiRecipe gui, List<String> currenttip, int recipe)
|
||||||
{
|
{
|
||||||
Point point = GuiDraw.getMousePosition();
|
Point point = GuiDraw.getMousePosition();
|
||||||
|
Point offset = gui.getRecipePosition(recipe);
|
||||||
|
|
||||||
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
|
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
|
||||||
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
|
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
|
||||||
|
|
||||||
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11+13 && yAxis <= 69+13)
|
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11+13 && yAxis <= 69+13)
|
||||||
{
|
{
|
||||||
|
@ -282,9 +283,10 @@ public class PRCRecipeHandler extends BaseRecipeHandler
|
||||||
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
|
public boolean keyTyped(GuiRecipe gui, char keyChar, int keyCode, int recipe)
|
||||||
{
|
{
|
||||||
Point point = GuiDraw.getMousePosition();
|
Point point = GuiDraw.getMousePosition();
|
||||||
|
Point offset = gui.getRecipePosition(recipe);
|
||||||
|
|
||||||
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
|
int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
|
||||||
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
|
int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
|
||||||
|
|
||||||
GasStack gas = null;
|
GasStack gas = null;
|
||||||
FluidStack fluid = null;
|
FluidStack fluid = null;
|
||||||
|
@ -344,9 +346,10 @@ public class PRCRecipeHandler extends BaseRecipeHandler
|
||||||
public boolean mouseClicked(GuiRecipe gui, int button, int recipe)
|
public boolean mouseClicked(GuiRecipe gui, int button, int recipe)
|
||||||
{
|
{
|
||||||
Point point = GuiDraw.getMousePosition();
|
Point point = GuiDraw.getMousePosition();
|
||||||
|
Point offset = gui.getRecipePosition(recipe);
|
||||||
|
|
||||||
int xAxis = point.x - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft);
|
int xAxis = point.x - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft)-offset.x;
|
||||||
int yAxis = point.y - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop);
|
int yAxis = point.y - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop)-offset.y;
|
||||||
|
|
||||||
GasStack gas = null;
|
GasStack gas = null;
|
||||||
FluidStack fluid = null;
|
FluidStack fluid = null;
|
||||||
|
|
|
@ -12,6 +12,7 @@ import mekanism.client.model.ModelElectricPump;
|
||||||
import mekanism.client.model.ModelElectrolyticSeparator;
|
import mekanism.client.model.ModelElectrolyticSeparator;
|
||||||
import mekanism.client.model.ModelLogisticalSorter;
|
import mekanism.client.model.ModelLogisticalSorter;
|
||||||
import mekanism.client.model.ModelMetallurgicInfuser;
|
import mekanism.client.model.ModelMetallurgicInfuser;
|
||||||
|
import mekanism.client.model.ModelPressurizedReactionChamber;
|
||||||
import mekanism.client.model.ModelRotaryCondensentrator;
|
import mekanism.client.model.ModelRotaryCondensentrator;
|
||||||
import mekanism.client.model.ModelSeismicVibrator;
|
import mekanism.client.model.ModelSeismicVibrator;
|
||||||
import mekanism.client.render.MekanismRenderer;
|
import mekanism.client.render.MekanismRenderer;
|
||||||
|
@ -45,6 +46,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
public ModelChemicalWasher chemicalWasher = new ModelChemicalWasher();
|
public ModelChemicalWasher chemicalWasher = new ModelChemicalWasher();
|
||||||
public ModelChemicalCrystallizer chemicalCrystallizer = new ModelChemicalCrystallizer();
|
public ModelChemicalCrystallizer chemicalCrystallizer = new ModelChemicalCrystallizer();
|
||||||
public ModelSeismicVibrator seismicVibrator = new ModelSeismicVibrator();
|
public ModelSeismicVibrator seismicVibrator = new ModelSeismicVibrator();
|
||||||
|
public ModelPressurizedReactionChamber pressurizedReactionChamber = new ModelPressurizedReactionChamber();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
|
||||||
|
@ -163,6 +165,14 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler
|
||||||
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SeismicVibrator.png"));
|
Minecraft.getMinecraft().renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "SeismicVibrator.png"));
|
||||||
seismicVibrator.render(0.0625F);
|
seismicVibrator.render(0.0625F);
|
||||||
}
|
}
|
||||||
|
else if(type == MachineType.PRESSURIZED_REACTION_CHAMBER)
|
||||||
|
{
|
||||||
|
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, "PressurizedReactionChamber.png"));
|
||||||
|
pressurizedReactionChamber.render(0.0625F);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
MekanismRenderer.renderItem(renderer, metadata, block);
|
MekanismRenderer.renderItem(renderer, metadata, block);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package mekanism.client.render.tileentity;
|
||||||
|
|
||||||
|
import mekanism.client.model.ModelPressurizedReactionChamber;
|
||||||
|
import mekanism.client.render.MekanismRenderer;
|
||||||
|
import mekanism.common.tile.TileEntityPRC;
|
||||||
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||||
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class RenderPressurizedReactionChamber extends TileEntitySpecialRenderer
|
||||||
|
{
|
||||||
|
private ModelPressurizedReactionChamber model = new ModelPressurizedReactionChamber();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTick)
|
||||||
|
{
|
||||||
|
renderAModelAt((TileEntityPRC)tileEntity, x, y, z, partialTick);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderAModelAt(TileEntityPRC tileEntity, double x, double y, double z, float partialTick)
|
||||||
|
{
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
|
||||||
|
|
||||||
|
bindTexture(MekanismUtils.getResource(ResourceType.RENDER, "PressurizedReactionChamber.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);
|
||||||
|
model.render(0.0625F);
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
|
MekanismRenderer.machineRenderer.renderAModelAt(tileEntity, x, y, z, partialTick);
|
||||||
|
}
|
||||||
|
}
|
|
@ -178,8 +178,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||||
icons[5][2] = register.registerIcon("mekanism:SteelCasing");
|
icons[5][2] = register.registerIcon("mekanism:SteelCasing");
|
||||||
icons[9][0] = register.registerIcon("mekanism:SteelBlock");
|
icons[9][0] = register.registerIcon("mekanism:SteelBlock");
|
||||||
icons[9][1] = register.registerIcon("mekanism:SeismicVibrator");
|
icons[9][1] = register.registerIcon("mekanism:SeismicVibrator");
|
||||||
icons[10][0] = register.registerIcon("mekanism:SteelCasing");
|
|
||||||
icons[10][1] = register.registerIcon("mekanism:PressurizedReactionChamber");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,16 +453,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||||
return icons[meta][0];
|
return icons[meta][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(meta == 10)
|
|
||||||
{
|
|
||||||
if(side == 3)
|
|
||||||
{
|
|
||||||
return icons[meta][1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return icons[meta][0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -608,16 +596,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||||
return icons[metadata][0];
|
return icons[metadata][0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(metadata == 10)
|
|
||||||
{
|
|
||||||
if(side == tileEntity.facing)
|
|
||||||
{
|
|
||||||
return icons[metadata][1];
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return icons[metadata][0];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@ -1153,7 +1131,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer
|
||||||
CHEMICAL_WASHER(Mekanism.MachineBlock2, 7, "ChemicalWasher", 36, 20000, TileEntityChemicalWasher.class, true, false),
|
CHEMICAL_WASHER(Mekanism.MachineBlock2, 7, "ChemicalWasher", 36, 20000, TileEntityChemicalWasher.class, true, false),
|
||||||
CHEMICAL_CRYSTALLIZER(Mekanism.MachineBlock2, 8, "ChemicalCrystallizer", 37, 20000, TileEntityChemicalCrystallizer.class, true, false),
|
CHEMICAL_CRYSTALLIZER(Mekanism.MachineBlock2, 8, "ChemicalCrystallizer", 37, 20000, TileEntityChemicalCrystallizer.class, true, false),
|
||||||
SEISMIC_VIBRATOR(Mekanism.MachineBlock2, 9, "SeismicVibrator", 39, 20000, TileEntitySeismicVibrator.class, true, false),
|
SEISMIC_VIBRATOR(Mekanism.MachineBlock2, 9, "SeismicVibrator", 39, 20000, TileEntitySeismicVibrator.class, true, false),
|
||||||
PRESSURIZED_REACTION_CHAMBER(Mekanism.MachineBlock2, 10, "PressurizedReactionChamber", 40, 20000, TileEntityPRC.class, false, false);
|
PRESSURIZED_REACTION_CHAMBER(Mekanism.MachineBlock2, 10, "PressurizedReactionChamber", 40, 20000, TileEntityPRC.class, true, false);
|
||||||
|
|
||||||
public Block typeBlock;
|
public Block typeBlock;
|
||||||
public int meta;
|
public int meta;
|
||||||
|
|
|
@ -25,6 +25,7 @@ import mekanism.common.tile.component.TileComponentUpgrade;
|
||||||
import mekanism.common.util.ChargeUtils;
|
import mekanism.common.util.ChargeUtils;
|
||||||
import mekanism.common.util.InventoryUtils;
|
import mekanism.common.util.InventoryUtils;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
|
import mekanism.common.util.PipeUtils;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -112,13 +113,13 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl
|
||||||
{
|
{
|
||||||
GasStack toSend = new GasStack(outputGasTank.getGas().getGas(), Math.min(outputGasTank.getStored(), 16));
|
GasStack toSend = new GasStack(outputGasTank.getGas().getGas(), Math.min(outputGasTank.getStored(), 16));
|
||||||
|
|
||||||
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getLeft(facing)).getTileEntity(worldObj);
|
TileEntity tileEntity = Coord4D.get(this).getFromSide(MekanismUtils.getRight(facing)).getTileEntity(worldObj);
|
||||||
|
|
||||||
if(tileEntity instanceof IGasHandler)
|
if(tileEntity instanceof IGasHandler)
|
||||||
{
|
{
|
||||||
if(((IGasHandler)tileEntity).canReceiveGas(MekanismUtils.getLeft(facing).getOpposite(), outputGasTank.getGas().getGas()))
|
if(((IGasHandler)tileEntity).canReceiveGas(MekanismUtils.getLeft(facing), outputGasTank.getGas().getGas()))
|
||||||
{
|
{
|
||||||
outputGasTank.draw(((IGasHandler)tileEntity).receiveGas(MekanismUtils.getLeft(facing).getOpposite(), toSend), true);
|
outputGasTank.draw(((IGasHandler)tileEntity).receiveGas(MekanismUtils.getLeft(facing), toSend), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -340,71 +341,107 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||||
|
{
|
||||||
|
if(from == ForgeDirection.getOrientation(facing).getOpposite())
|
||||||
{
|
{
|
||||||
return inputFluidTank.fill(resource, doFill);
|
return inputFluidTank.fill(resource, doFill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||||
{
|
{
|
||||||
if(inputFluidTank.getFluid() != null && inputFluidTank.getFluid().isFluidEqual(resource))
|
if(from == ForgeDirection.getOrientation(facing).getOpposite() && inputFluidTank.getFluid() != null && inputFluidTank.getFluid().isFluidEqual(resource))
|
||||||
{
|
{
|
||||||
return inputFluidTank.drain(resource.amount, doDrain);
|
return inputFluidTank.drain(resource.amount, doDrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||||
|
{
|
||||||
|
if(from == ForgeDirection.getOrientation(facing).getOpposite())
|
||||||
{
|
{
|
||||||
return inputFluidTank.drain(maxDrain, doDrain);
|
return inputFluidTank.drain(maxDrain, doDrain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||||
|
{
|
||||||
|
if(from == ForgeDirection.getOrientation(facing).getOpposite())
|
||||||
{
|
{
|
||||||
return inputFluidTank.getFluid() == null || inputFluidTank.getFluid().getFluid() == fluid;
|
return inputFluidTank.getFluid() == null || inputFluidTank.getFluid().getFluid() == fluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||||
|
{
|
||||||
|
if(from == ForgeDirection.getOrientation(facing).getOpposite())
|
||||||
{
|
{
|
||||||
return inputFluidTank.getFluid() != null && inputFluidTank.getFluid().getFluid() == fluid;
|
return inputFluidTank.getFluid() != null && inputFluidTank.getFluid().getFluid() == fluid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||||
|
{
|
||||||
|
if(from == ForgeDirection.getOrientation(facing).getOpposite())
|
||||||
{
|
{
|
||||||
return new FluidTankInfo[] {new FluidTankInfo(inputFluidTank)};
|
return new FluidTankInfo[] {new FluidTankInfo(inputFluidTank)};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return PipeUtils.EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int receiveGas(ForgeDirection side, GasStack stack)
|
public int receiveGas(ForgeDirection side, GasStack stack)
|
||||||
|
{
|
||||||
|
if(side == MekanismUtils.getLeft(facing))
|
||||||
{
|
{
|
||||||
return inputGasTank.receive(stack, true);
|
return inputGasTank.receive(stack, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GasStack drawGas(ForgeDirection side, int amount)
|
public GasStack drawGas(ForgeDirection side, int amount)
|
||||||
|
{
|
||||||
|
if(side == MekanismUtils.getRight(facing))
|
||||||
{
|
{
|
||||||
return outputGasTank.draw(amount, true);
|
return outputGasTank.draw(amount, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
public boolean canReceiveGas(ForgeDirection side, Gas type)
|
||||||
{
|
{
|
||||||
return inputGasTank.getGas() == null || inputGasTank.getGas().getGas() == type;
|
return side == MekanismUtils.getLeft(facing) && (inputGasTank.getGas() == null || inputGasTank.getGas().getGas() == type);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrawGas(ForgeDirection side, Gas type)
|
public boolean canDrawGas(ForgeDirection side, Gas type)
|
||||||
{
|
{
|
||||||
return outputGasTank.getGas() != null && outputGasTank.getGas().getGas() == type;
|
return side == MekanismUtils.getRight(facing) && outputGasTank.getGas() != null && outputGasTank.getGas().getGas() == type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canTubeConnect(ForgeDirection side)
|
public boolean canTubeConnect(ForgeDirection side)
|
||||||
{
|
{
|
||||||
return true;
|
return side == MekanismUtils.getLeft(facing) || side == MekanismUtils.getRight(facing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package mekanism.common.tile;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
import mekanism.api.Coord4D;
|
import mekanism.api.Coord4D;
|
||||||
import mekanism.common.IActiveState;
|
import mekanism.common.IActiveState;
|
||||||
|
@ -14,6 +15,7 @@ import mekanism.common.util.ChargeUtils;
|
||||||
import mekanism.common.util.MekanismUtils;
|
import mekanism.common.util.MekanismUtils;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntitySeismicVibrator extends TileEntityElectricBlock implements IActiveState, IRedstoneControl
|
public class TileEntitySeismicVibrator extends TileEntityElectricBlock implements IActiveState, IRedstoneControl
|
||||||
{
|
{
|
||||||
|
@ -160,7 +162,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||||
@Override
|
@Override
|
||||||
public boolean renderUpdate()
|
public boolean renderUpdate()
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -181,6 +183,12 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement
|
||||||
return controlType;
|
return controlType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected EnumSet<ForgeDirection> getConsumingSides()
|
||||||
|
{
|
||||||
|
return EnumSet.of(ForgeDirection.UP);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setControlType(RedstoneControl type)
|
public void setControlType(RedstoneControl type)
|
||||||
{
|
{
|
||||||
|
|
BIN
src/main/resources/assets/mekanism/render/PressurizedReactionChamber.png
Executable file
BIN
src/main/resources/assets/mekanism/render/PressurizedReactionChamber.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 3.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2 KiB |
Loading…
Reference in a new issue