diff --git a/src/main/java/mekanism/client/ClientProxy.java b/src/main/java/mekanism/client/ClientProxy.java index a1d4b6520..e20ccb58e 100644 --- a/src/main/java/mekanism/client/ClientProxy.java +++ b/src/main/java/mekanism/client/ClientProxy.java @@ -71,6 +71,7 @@ import mekanism.client.render.tileentity.RenderGasTank; import mekanism.client.render.tileentity.RenderLogisticalSorter; import mekanism.client.render.tileentity.RenderMetallurgicInfuser; import mekanism.client.render.tileentity.RenderObsidianTNT; +import mekanism.client.render.tileentity.RenderPressurizedReactionChamber; import mekanism.client.render.tileentity.RenderRotaryCondensentrator; import mekanism.client.render.tileentity.RenderSalinationController; 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.SoundHandler; import mekanism.common.CommonProxy; -import mekanism.common.EnergyDisplay.EnergyType; import mekanism.common.IElectricChest; import mekanism.common.IInvConfiguration; import mekanism.common.Mekanism; @@ -293,7 +293,7 @@ public class ClientProxy extends CommonProxy ClientRegistry.registerTileEntity(TileEntityChemicalWasher.class, "ChemicalWasher", new RenderChemicalWasher()); ClientRegistry.registerTileEntity(TileEntityChemicalCrystallizer.class, "ChemicalCrystallizer", new RenderChemicalCrystallizer()); ClientRegistry.registerTileEntity(TileEntitySeismicVibrator.class, "SeismicVibrator", new RenderSeismicVibrator()); - ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderConfigurableMachine()); + ClientRegistry.registerTileEntity(TileEntityPRC.class, "PressurizedReactionChamber", new RenderPressurizedReactionChamber()); } @Override diff --git a/src/main/java/mekanism/client/gui/GuiPRC.java b/src/main/java/mekanism/client/gui/GuiPRC.java index 066882683..ef9832ac5 100644 --- a/src/main/java/mekanism/client/gui/GuiPRC.java +++ b/src/main/java/mekanism/client/gui/GuiPRC.java @@ -30,6 +30,7 @@ public class GuiPRC extends GuiMekanism tileEntity = tentity; 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() { @Override public FluidTank getTank() diff --git a/src/main/java/mekanism/client/model/ModelPressurizedReactionChamber.java b/src/main/java/mekanism/client/model/ModelPressurizedReactionChamber.java new file mode 100644 index 000000000..7e9c8ad59 --- /dev/null +++ b/src/main/java/mekanism/client/model/ModelPressurizedReactionChamber.java @@ -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; + } +} diff --git a/src/main/java/mekanism/client/nei/PRCRecipeHandler.java b/src/main/java/mekanism/client/nei/PRCRecipeHandler.java index b2580d55f..eee82f2cc 100644 --- a/src/main/java/mekanism/client/nei/PRCRecipeHandler.java +++ b/src/main/java/mekanism/client/nei/PRCRecipeHandler.java @@ -258,9 +258,10 @@ public class PRCRecipeHandler extends BaseRecipeHandler public List handleTooltip(GuiRecipe gui, List currenttip, int recipe) { Point point = GuiDraw.getMousePosition(); + Point offset = gui.getRecipePosition(recipe); - int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft); - int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop); + 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)-offset.y; 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) { Point point = GuiDraw.getMousePosition(); + Point offset = gui.getRecipePosition(recipe); - int xAxis = point.x-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft); - int yAxis = point.y-(Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop); + 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)-offset.y; GasStack gas = null; FluidStack fluid = null; @@ -344,9 +346,10 @@ public class PRCRecipeHandler extends BaseRecipeHandler public boolean mouseClicked(GuiRecipe gui, int button, int recipe) { Point point = GuiDraw.getMousePosition(); + Point offset = gui.getRecipePosition(recipe); - int xAxis = point.x - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiLeft); - int yAxis = point.y - (Integer)MekanismUtils.getPrivateValue(gui, GuiContainer.class, ObfuscatedNames.GuiContainer_guiTop); + 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)-offset.y; GasStack gas = null; FluidStack fluid = null; diff --git a/src/main/java/mekanism/client/render/block/MachineRenderingHandler.java b/src/main/java/mekanism/client/render/block/MachineRenderingHandler.java index b6a67d581..239dee376 100644 --- a/src/main/java/mekanism/client/render/block/MachineRenderingHandler.java +++ b/src/main/java/mekanism/client/render/block/MachineRenderingHandler.java @@ -12,6 +12,7 @@ import mekanism.client.model.ModelElectricPump; import mekanism.client.model.ModelElectrolyticSeparator; import mekanism.client.model.ModelLogisticalSorter; import mekanism.client.model.ModelMetallurgicInfuser; +import mekanism.client.model.ModelPressurizedReactionChamber; import mekanism.client.model.ModelRotaryCondensentrator; import mekanism.client.model.ModelSeismicVibrator; import mekanism.client.render.MekanismRenderer; @@ -45,6 +46,7 @@ public class MachineRenderingHandler implements ISimpleBlockRenderingHandler public ModelChemicalWasher chemicalWasher = new ModelChemicalWasher(); public ModelChemicalCrystallizer chemicalCrystallizer = new ModelChemicalCrystallizer(); public ModelSeismicVibrator seismicVibrator = new ModelSeismicVibrator(); + public ModelPressurizedReactionChamber pressurizedReactionChamber = new ModelPressurizedReactionChamber(); @Override 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")); 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 { MekanismRenderer.renderItem(renderer, metadata, block); } diff --git a/src/main/java/mekanism/client/render/tileentity/RenderPressurizedReactionChamber.java b/src/main/java/mekanism/client/render/tileentity/RenderPressurizedReactionChamber.java new file mode 100644 index 000000000..ba955e013 --- /dev/null +++ b/src/main/java/mekanism/client/render/tileentity/RenderPressurizedReactionChamber.java @@ -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); + } +} \ No newline at end of file diff --git a/src/main/java/mekanism/common/block/BlockMachine.java b/src/main/java/mekanism/common/block/BlockMachine.java index c915efb9b..97089f5f3 100644 --- a/src/main/java/mekanism/common/block/BlockMachine.java +++ b/src/main/java/mekanism/common/block/BlockMachine.java @@ -178,8 +178,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer icons[5][2] = register.registerIcon("mekanism:SteelCasing"); icons[9][0] = register.registerIcon("mekanism:SteelBlock"); 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]; } } - else if(meta == 10) - { - if(side == 3) - { - return icons[meta][1]; - } - else { - return icons[meta][0]; - } - } } return null; @@ -608,16 +596,6 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds, IPer return icons[metadata][0]; } } - else if(metadata == 10) - { - if(side == tileEntity.facing) - { - return icons[metadata][1]; - } - else { - return icons[metadata][0]; - } - } } 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_CRYSTALLIZER(Mekanism.MachineBlock2, 8, "ChemicalCrystallizer", 37, 20000, TileEntityChemicalCrystallizer.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 int meta; diff --git a/src/main/java/mekanism/common/tile/TileEntityPRC.java b/src/main/java/mekanism/common/tile/TileEntityPRC.java index a2ccfd08f..9b3e3fc3e 100644 --- a/src/main/java/mekanism/common/tile/TileEntityPRC.java +++ b/src/main/java/mekanism/common/tile/TileEntityPRC.java @@ -25,6 +25,7 @@ import mekanism.common.tile.component.TileComponentUpgrade; import mekanism.common.util.ChargeUtils; import mekanism.common.util.InventoryUtils; import mekanism.common.util.MekanismUtils; +import mekanism.common.util.PipeUtils; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; 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)); - 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(((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); } } } @@ -341,70 +342,106 @@ public class TileEntityPRC extends TileEntityBasicMachine implements IFluidHandl @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { - return inputFluidTank.fill(resource, doFill); + if(from == ForgeDirection.getOrientation(facing).getOpposite()) + { + return inputFluidTank.fill(resource, doFill); + } + + return 0; } @Override 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 null; } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { - return inputFluidTank.drain(maxDrain, doDrain); + if(from == ForgeDirection.getOrientation(facing).getOpposite()) + { + return inputFluidTank.drain(maxDrain, doDrain); + } + + return null; } @Override public boolean canFill(ForgeDirection from, Fluid fluid) { - return inputFluidTank.getFluid() == null || inputFluidTank.getFluid().getFluid() == fluid; + if(from == ForgeDirection.getOrientation(facing).getOpposite()) + { + return inputFluidTank.getFluid() == null || inputFluidTank.getFluid().getFluid() == fluid; + } + + return false; } @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - return inputFluidTank.getFluid() != null && inputFluidTank.getFluid().getFluid() == fluid; + if(from == ForgeDirection.getOrientation(facing).getOpposite()) + { + return inputFluidTank.getFluid() != null && inputFluidTank.getFluid().getFluid() == fluid; + } + + return false; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { - return new FluidTankInfo[] {new FluidTankInfo(inputFluidTank)}; + if(from == ForgeDirection.getOrientation(facing).getOpposite()) + { + return new FluidTankInfo[] {new FluidTankInfo(inputFluidTank)}; + } + + return PipeUtils.EMPTY; } @Override public int receiveGas(ForgeDirection side, GasStack stack) { - return inputGasTank.receive(stack, true); + if(side == MekanismUtils.getLeft(facing)) + { + return inputGasTank.receive(stack, true); + } + + return 0; } @Override public GasStack drawGas(ForgeDirection side, int amount) { - return outputGasTank.draw(amount, true); + if(side == MekanismUtils.getRight(facing)) + { + return outputGasTank.draw(amount, true); + } + + return null; } @Override 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 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 public boolean canTubeConnect(ForgeDirection side) { - return true; + return side == MekanismUtils.getLeft(facing) || side == MekanismUtils.getRight(facing); } } diff --git a/src/main/java/mekanism/common/tile/TileEntitySeismicVibrator.java b/src/main/java/mekanism/common/tile/TileEntitySeismicVibrator.java index 3c5f73942..6fb13fd9f 100644 --- a/src/main/java/mekanism/common/tile/TileEntitySeismicVibrator.java +++ b/src/main/java/mekanism/common/tile/TileEntitySeismicVibrator.java @@ -3,6 +3,7 @@ package mekanism.common.tile; import io.netty.buffer.ByteBuf; import java.util.ArrayList; +import java.util.EnumSet; import mekanism.api.Coord4D; import mekanism.common.IActiveState; @@ -14,6 +15,7 @@ import mekanism.common.util.ChargeUtils; import mekanism.common.util.MekanismUtils; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; public class TileEntitySeismicVibrator extends TileEntityElectricBlock implements IActiveState, IRedstoneControl { @@ -160,7 +162,7 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement @Override public boolean renderUpdate() { - return true; + return false; } @Override @@ -180,6 +182,12 @@ public class TileEntitySeismicVibrator extends TileEntityElectricBlock implement { return controlType; } + + @Override + protected EnumSet getConsumingSides() + { + return EnumSet.of(ForgeDirection.UP); + } @Override public void setControlType(RedstoneControl type) diff --git a/src/main/resources/assets/mekanism/render/PressurizedReactionChamber.png b/src/main/resources/assets/mekanism/render/PressurizedReactionChamber.png new file mode 100755 index 000000000..bb09dc60e Binary files /dev/null and b/src/main/resources/assets/mekanism/render/PressurizedReactionChamber.png differ diff --git a/src/main/resources/assets/mekanism/textures/blocks/PressurizedReactionChamber.png b/src/main/resources/assets/mekanism/textures/blocks/PressurizedReactionChamber.png deleted file mode 100644 index 248aff1db..000000000 Binary files a/src/main/resources/assets/mekanism/textures/blocks/PressurizedReactionChamber.png and /dev/null differ