From 98e864cd8d0e7646bc64c6d98605dd53bd8aae50 Mon Sep 17 00:00:00 2001 From: Aidan Brady Date: Wed, 27 Nov 2013 23:42:54 -0500 Subject: [PATCH] Work on that Rotary Condensentrator! --- common/mekanism/api/gas/IGasItem.java | 16 +- common/mekanism/client/ClientProxy.java | 1 + .../mekanism/client/gui/GuiElectricPump.java | 6 +- .../client/gui/GuiRotaryCondensentrator.java | 127 ++++++ common/mekanism/common/CommonProxy.java | 3 +- .../mekanism/common/block/BlockMachine.java | 42 +- .../ContainerAdvancedElectricMachine.java | 11 +- .../container/ContainerElectricPump.java | 3 +- .../ContainerRotaryCondensentrator.java | 95 +++-- .../common/item/ItemBlockGasTank.java | 8 +- .../common/item/ItemBlockMachine.java | 154 +++++++- .../tileentity/TileEntityChargepad.java | 2 +- .../tileentity/TileEntityElectricPump.java | 4 +- .../common/tileentity/TileEntityGasTank.java | 2 +- .../TileEntityRotaryCondensentrator.java | 361 +++++++++++++++++- .../mekanism/gui/GuiRotaryCondensentrator.png | Bin 4305 -> 5476 bytes 16 files changed, 760 insertions(+), 75 deletions(-) create mode 100644 common/mekanism/client/gui/GuiRotaryCondensentrator.java diff --git a/common/mekanism/api/gas/IGasItem.java b/common/mekanism/api/gas/IGasItem.java index e9ae08949..146917b40 100644 --- a/common/mekanism/api/gas/IGasItem.java +++ b/common/mekanism/api/gas/IGasItem.java @@ -13,23 +13,23 @@ public interface IGasItem extends IGasStorage * Gets the rate of transfer this item can handle. * @return */ - public int getRate(); + public int getRate(ItemStack itemstack); /** - * Adds a defined about of a certain gas to a Storage Tank. - * @param itemstack - the itemstack of a Storage Tank to add gas to + * Adds a defined amount of a certain gas to an item. + * @param itemstack - the itemstack to add gas to * @param type - the type of gas to add * @param amount - the amount of gas to add - * @return used gas + * @return the gas that was accepted by the item */ public int addGas(ItemStack itemstack, GasStack stack); /** * Removes the defined amount of a certain gas from the item. - * @param itemstack - the itemstack of a Storage Tank to remove gas from + * @param itemstack - the itemstack to remove gas from * @param type - the type of gas to remove * @param amount - the amount of gas to remove - * @return removed gas + * @return the gas that was removed by the item */ public GasStack removeGas(ItemStack itemstack, int amount); @@ -42,9 +42,9 @@ public interface IGasItem extends IGasStorage public boolean canReceiveGas(ItemStack itemstack, Gas type); /** - * Whether or not this energized item can give a gas receiver a certain amount of gas. + * Whether or not this item can give a gas receiver a certain type of gas. * @param itemstack - the itemstack to check - * @param type - the type of gas the tank can possibly provide + * @param type - the type of gas the tank can provide * @return if the item can provide gas */ public boolean canProvideGas(ItemStack itemstack, Gas type); diff --git a/common/mekanism/client/ClientProxy.java b/common/mekanism/client/ClientProxy.java index a36828231..b2ddd7ecc 100644 --- a/common/mekanism/client/ClientProxy.java +++ b/common/mekanism/client/ClientProxy.java @@ -304,6 +304,7 @@ public class ClientProxy extends CommonProxy return new GuiCrusher(player.inventory, (TileEntityElectricMachine)tileEntity); case 7: //return new GuiRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity); TODO + return null; case 8: return new GuiEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity); case 9: diff --git a/common/mekanism/client/gui/GuiElectricPump.java b/common/mekanism/client/gui/GuiElectricPump.java index 63e8968f3..55717b8cf 100644 --- a/common/mekanism/client/gui/GuiElectricPump.java +++ b/common/mekanism/client/gui/GuiElectricPump.java @@ -70,7 +70,7 @@ public class GuiElectricPump extends GuiMekanism if(tileEntity.getScaledFluidLevel(58) > 0) { - displayGauge(14, 7, tileEntity.getScaledFluidLevel(58), tileEntity.fluidTank.getFluid()); + displayGauge(7, 14, tileEntity.getScaledFluidLevel(58), tileEntity.fluidTank.getFluid()); } } @@ -101,7 +101,7 @@ public class GuiElectricPump extends GuiMekanism } mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture()); - drawTexturedModelRectFromIcon(guiWidth + yPos, guiHeight + xPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining)); + drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining)); start+=16; if(renderRemaining == 0 || scale == 0) @@ -111,6 +111,6 @@ public class GuiElectricPump extends GuiMekanism } mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiElectricPump.png")); - drawTexturedModalRect(guiWidth + yPos, guiHeight + xPos, 176, 52, 16, 60); + drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 52, 16, 60); } } diff --git a/common/mekanism/client/gui/GuiRotaryCondensentrator.java b/common/mekanism/client/gui/GuiRotaryCondensentrator.java new file mode 100644 index 000000000..e710166ce --- /dev/null +++ b/common/mekanism/client/gui/GuiRotaryCondensentrator.java @@ -0,0 +1,127 @@ +package mekanism.client.gui; + +import mekanism.api.gas.GasStack; +import mekanism.client.render.MekanismRenderer; +import mekanism.common.inventory.container.ContainerRotaryCondensentrator; +import mekanism.common.tileentity.TileEntityRotaryCondensentrator; +import mekanism.common.util.MekanismUtils; +import mekanism.common.util.MekanismUtils.ResourceType; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraftforge.fluids.FluidStack; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class GuiRotaryCondensentrator extends GuiMekanism +{ + public TileEntityRotaryCondensentrator tileEntity; + + private int guiWidth; + private int guiHeight; + + public GuiRotaryCondensentrator(InventoryPlayer inventory, TileEntityRotaryCondensentrator tentity) + { + super(new ContainerRotaryCondensentrator(inventory, tentity)); + tileEntity = tentity; + } + + @Override + protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) + { + int xAxis = (mouseX - (width - xSize) / 2); + int yAxis = (mouseY - (height - ySize) / 2); + + fontRenderer.drawString(tileEntity.fullName, 45, 6, 0x404040); + fontRenderer.drawString("Inventory", 8, (ySize - 94) + 2, 0x404040); + fontRenderer.drawString(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), 51, 26, 0x00CD00); + fontRenderer.drawString(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getName() + ": " + tileEntity.fluidTank.getFluid().amount : "No fluid.", 51, 35, 0x00CD00); + fontRenderer.drawString(tileEntity.getVoltage() + "v", 51, 44, 0x00CD00); + + if(xAxis >= 7 && xAxis <= 23 && yAxis >= 14 && yAxis <= 72) + { + drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluid().amount + "mB" : "Empty", xAxis, yAxis); + } + + if(xAxis >= 116 && xAxis <= 168 && yAxis >= 76 && yAxis <= 80) + { + drawCreativeTabHoveringText(MekanismUtils.getEnergyDisplay(tileEntity.getEnergy()), xAxis, yAxis); + } + + super.drawGuiContainerForegroundLayer(mouseX, mouseY); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float partialTick, int mouseX, int mouseY) + { + super.drawGuiContainerBackgroundLayer(partialTick, mouseX, mouseY); + + mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + guiWidth = (width - xSize) / 2; + guiHeight = (height - ySize) / 2; + drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize); + int displayInt; + + displayInt = tileEntity.getScaledEnergyLevel(52); + drawTexturedModalRect(guiWidth + 116, guiHeight + 76, 176, 36, displayInt, 4); + + if(tileEntity.getScaledFluidLevel(58) > 0) + { + displayGauge(26, 14, tileEntity.getScaledFluidLevel(58), tileEntity.fluidTank.getFluid(), null); + } + + if(tileEntity.getScaledGasLevel(58) > 0) + { + displayGauge(134, 14, tileEntity.getScaledGasLevel(58), null, tileEntity.gasTank); + } + } + + public void displayGauge(int xPos, int yPos, int scale, FluidStack fluid, GasStack gas) + { + if(fluid == null) + { + return; + } + + int start = 0; + + while(true) + { + int renderRemaining = 0; + + if(scale > 16) + { + renderRemaining = 16; + scale -= 16; + } + else { + renderRemaining = scale; + scale = 0; + } + + mc.renderEngine.bindTexture(MekanismRenderer.getBlocksTexture()); + + if(fluid != null) + { + drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, fluid.getFluid().getIcon(), 16, 16 - (16 - renderRemaining)); + } + else if(gas != null) + { + drawTexturedModelRectFromIcon(guiWidth + xPos, guiHeight + yPos + 58 - renderRemaining - start, gas.getGas().getIcon(), 16, 16 - (16 - renderRemaining)); + } + + start+=16; + + if(renderRemaining == 0 || scale == 0) + { + break; + } + } + + mc.renderEngine.bindTexture(MekanismUtils.getResource(ResourceType.GUI, "GuiRotaryCondensentrator.png")); + drawTexturedModalRect(guiWidth + xPos, guiHeight + yPos, 176, 40, 16, 60); + } +} diff --git a/common/mekanism/common/CommonProxy.java b/common/mekanism/common/CommonProxy.java index 7d987f7d8..294528ed3 100644 --- a/common/mekanism/common/CommonProxy.java +++ b/common/mekanism/common/CommonProxy.java @@ -18,6 +18,7 @@ import mekanism.common.inventory.container.ContainerRobitInventory; import mekanism.common.inventory.container.ContainerRobitMain; import mekanism.common.inventory.container.ContainerRobitRepair; import mekanism.common.inventory.container.ContainerRobitSmelting; +import mekanism.common.inventory.container.ContainerRotaryCondensentrator; import mekanism.common.inventory.container.ContainerTeleporter; import mekanism.common.tileentity.TileEntityAdvancedElectricMachine; import mekanism.common.tileentity.TileEntityAdvancedFactory; @@ -263,7 +264,7 @@ public class CommonProxy case 6: return new ContainerElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity); case 7: - //return new ContainerRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity); TODO + return new ContainerRotaryCondensentrator(player.inventory, (TileEntityRotaryCondensentrator)tileEntity); case 8: return new ContainerEnergyCube(player.inventory, (TileEntityEnergyCube)tileEntity); case 9: diff --git a/common/mekanism/common/block/BlockMachine.java b/common/mekanism/common/block/BlockMachine.java index 9e876bd57..bcf412fe6 100644 --- a/common/mekanism/common/block/BlockMachine.java +++ b/common/mekanism/common/block/BlockMachine.java @@ -7,6 +7,7 @@ import mekanism.api.IConfigurable; import mekanism.api.IUpgradeManagement; import mekanism.api.Object3D; import mekanism.api.energy.IEnergizedItem; +import mekanism.api.gas.IGasItem; import mekanism.client.ClientProxy; import mekanism.common.IActiveState; import mekanism.common.IBoundingBlock; @@ -77,22 +78,23 @@ import cpw.mods.fml.relauncher.SideOnly; /** * Block class for handling multiple machine block IDs. - * 0: Enrichment Chamber - * 1: Osmium Compressor - * 2: Combiner - * 3: Crusher - * 4: Digital Miner - * 5: Basic Factory - * 6: Advanced Factory - * 7: Elite Factory - * 8: Metallurgic Infuser - * 9: Purification Chamber - * 10: Energized Smelter - * 11: Teleporter - * 12: Electric Pump - * 13: Electric Chest - * 14: Chargepad - * 15: Logistical Sorter + * 0:0: Enrichment Chamber + * 0:1: Osmium Compressor + * 0:2: Combiner + * 0:3: Crusher + * 0:4: Digital Miner + * 0:5: Basic Factory + * 0:6: Advanced Factory + * 0:7: Elite Factory + * 0:8: Metallurgic Infuser + * 0:9: Purification Chamber + * 0:10: Energized Smelter + * 0:11: Teleporter + * 0:12: Electric Pump + * 0:13: Electric Chest + * 0:14: Chargepad + * 0:15: Logistical Sorter + * 1:0: Rotary Condensentrator * @author AidanBrady * */ @@ -223,7 +225,7 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds { TileEntityBasicBlock tileEntity = (TileEntityBasicBlock)world.getBlockTileEntity(x, y, z); - if(MekanismUtils.isActive(world, x, y, z) && !(tileEntity instanceof TileEntityChargepad) && !(tileEntity instanceof TileEntityLogisticalSorter) && !(tileEntity instanceof TileEntityCrusher)) + if(MekanismUtils.isActive(world, x, y, z) && ((IActiveState)tileEntity).renderUpdate()) { float xRandom = (float)x + 0.5F; float yRandom = (float)y + 0.0F + random.nextFloat() * 6.0F / 16.0F; @@ -920,6 +922,12 @@ public class BlockMachine extends BlockContainer implements ISpecialBounds factoryItem.setRecipeType(((TileEntityFactory)tileEntity).recipeType, itemStack); } + if(tileEntity instanceof TileEntityRotaryCondensentrator) + { + IGasItem gasItem = (IGasItem)itemStack.getItem(); + gasItem.setGas(((TileEntityRotaryCondensentrator)tileEntity).getGas(), itemStack); + } + return itemStack; } diff --git a/common/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java b/common/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java index 55ca9582e..28510acc1 100644 --- a/common/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java +++ b/common/mekanism/common/inventory/container/ContainerAdvancedElectricMachine.java @@ -28,6 +28,7 @@ public class ContainerAdvancedElectricMachine extends Container addSlotToContainer(new SlotOutput(tentity, 2, 116, 35)); addSlotToContainer(new SlotDischarge(tentity, 3, 31, 35)); addSlotToContainer(new SlotMachineUpgrade(tentity, 4, 180, 11)); + int slotX; for(slotX = 0; slotX < 3; ++slotX) @@ -82,7 +83,7 @@ public class ContainerAdvancedElectricMachine extends Container } else if(ChargeUtils.canBeDischarged(slotStack)) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) + if(slotID != 3) { if(!mergeItemStack(slotStack, 3, 4, false)) { @@ -98,7 +99,7 @@ public class ContainerAdvancedElectricMachine extends Container } else if(tileEntity.getFuelTicks(slotStack) > 0) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) + if(slotID != 1) { if(!mergeItemStack(slotStack, 1, 2, false)) { @@ -114,9 +115,9 @@ public class ContainerAdvancedElectricMachine extends Container } else if(RecipeHandler.getOutput(slotStack, false, tileEntity.getRecipes()) != null) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3) + if(slotID != 0) { - if (!mergeItemStack(slotStack, 0, 1, false)) + if(!mergeItemStack(slotStack, 0, 1, false)) { return null; } @@ -130,7 +131,7 @@ public class ContainerAdvancedElectricMachine extends Container } else if(slotStack.getItem() instanceof ItemMachineUpgrade) { - if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4) + if(slotID != 4) { if(!mergeItemStack(slotStack, 4, 5, false)) { diff --git a/common/mekanism/common/inventory/container/ContainerElectricPump.java b/common/mekanism/common/inventory/container/ContainerElectricPump.java index a4668c9b0..4f2b45fd9 100644 --- a/common/mekanism/common/inventory/container/ContainerElectricPump.java +++ b/common/mekanism/common/inventory/container/ContainerElectricPump.java @@ -75,8 +75,7 @@ public class ContainerElectricPump extends Container return null; } } - else if(slotID == 2) - { + else { if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true)) { return null; diff --git a/common/mekanism/common/inventory/container/ContainerRotaryCondensentrator.java b/common/mekanism/common/inventory/container/ContainerRotaryCondensentrator.java index 3f216ecf9..7fd812542 100644 --- a/common/mekanism/common/inventory/container/ContainerRotaryCondensentrator.java +++ b/common/mekanism/common/inventory/container/ContainerRotaryCondensentrator.java @@ -1,8 +1,11 @@ package mekanism.common.inventory.container; +import mekanism.api.gas.IGasItem; +import mekanism.common.inventory.slot.SlotEnergy.SlotDischarge; import mekanism.common.inventory.slot.SlotOutput; import mekanism.common.inventory.slot.SlotStorageTank; import mekanism.common.tileentity.TileEntityRotaryCondensentrator; +import mekanism.common.util.ChargeUtils; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -17,10 +20,12 @@ public class ContainerRotaryCondensentrator extends Container public ContainerRotaryCondensentrator(InventoryPlayer inventory, TileEntityRotaryCondensentrator tentity) { tileEntity = tentity; - addSlotToContainer(new SlotStorageTank(tentity, null, true, 0, 8, 8)); - addSlotToContainer(new SlotStorageTank(tentity, null, true, 1, 8, 40)); - addSlotToContainer(new Slot(tentity, 0, 146, 20)); - addSlotToContainer(new SlotOutput(tentity, 1, 146, 51)); + addSlotToContainer(new SlotStorageTank(tentity, null, true, 0, 5, 25)); + addSlotToContainer(new SlotStorageTank(tentity, null, true, 1, 5, 56)); + addSlotToContainer(new Slot(tentity, 2, 155, 25)); + addSlotToContainer(new SlotOutput(tentity, 3, 155, 56)); + addSlotToContainer(new SlotDischarge(tentity, 4, 155, 5)); + int slotX; for(slotX = 0; slotX < 3; ++slotX) @@ -66,39 +71,81 @@ public class ContainerRotaryCondensentrator extends Container ItemStack slotStack = currentSlot.getStack(); stack = slotStack.copy(); - if(FluidContainerRegistry.isEmptyContainer(slotStack) || FluidContainerRegistry.isFilledContainer(slotStack)) + if(ChargeUtils.canBeDischarged(slotStack)) { - if(slotID != 0 && slotID != 1) + if(slotID != 4) + { + if(!mergeItemStack(slotStack, 4, 5, false)) + { + return null; + } + } + else { + if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + { + return null; + } + } + } + else if(FluidContainerRegistry.isEmptyContainer(slotStack) || FluidContainerRegistry.isFilledContainer(slotStack)) + { + if(slotID != 2 && slotID != 3) { - if(!mergeItemStack(slotStack, 0, 1, false)) + if(!mergeItemStack(slotStack, 2, 3, false)) { return null; } } else { - if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) + if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) { return null; } } } + else if(slotStack.getItem() instanceof IGasItem) + { + if(slotID != 0 && slotID != 1) + { + if(((IGasItem)slotStack.getItem()).canProvideGas(slotStack, tileEntity.gasTank != null ? tileEntity.gasTank.getGas() : null)) + { + if(!mergeItemStack(slotStack, 0, 1, false)) + { + return null; + } + } + else if(((IGasItem)slotStack.getItem()).canReceiveGas(slotStack, tileEntity.gasTank != null ? tileEntity.gasTank.getGas() : null)) + { + if(!mergeItemStack(slotStack, 1, 2, false)) + { + return null; + } + } + } + else { + if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) + { + return null; + } + } + } else { - if(slotID >= 2 && slotID <= 8) - { - if(!mergeItemStack(slotStack, 29, inventorySlots.size(), false)) - { - return null; - } - } - else if(slotID > 28) - { - if(!mergeItemStack(slotStack, 2, 28, false)) - { - return null; - } - } - else { - if(!mergeItemStack(slotStack, 2, inventorySlots.size(), true)) + if(slotID >= 5 && slotID <= 31) + { + if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false)) + { + return null; + } + } + else if(slotID > 31) + { + if(!mergeItemStack(slotStack, 5, 31, false)) + { + return null; + } + } + else { + if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true)) { return null; } diff --git a/common/mekanism/common/item/ItemBlockGasTank.java b/common/mekanism/common/item/ItemBlockGasTank.java index 3d019f9c9..b87851374 100644 --- a/common/mekanism/common/item/ItemBlockGasTank.java +++ b/common/mekanism/common/item/ItemBlockGasTank.java @@ -30,7 +30,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI public int MAX_GAS = 96000; /** How fast this tank can transfer gas. */ - public int TRANSFER_RATE = 16; + public static final int TRANSFER_RATE = 16; public ItemBlockGasTank(int id, Block block) { @@ -190,7 +190,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI } @Override - public int getRate() + public int getRate(ItemStack itemstack) { return TRANSFER_RATE; } @@ -203,7 +203,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI return 0; } - int toUse = Math.min(getMaxGas(itemstack)-getStored(itemstack), Math.min(getRate(), stack.amount)); + int toUse = Math.min(getMaxGas(itemstack)-getStored(itemstack), Math.min(getRate(itemstack), stack.amount)); setGas(new GasStack(stack.getGas(), getStored(itemstack)+toUse), itemstack); return toUse; @@ -219,7 +219,7 @@ public class ItemBlockGasTank extends ItemBlock implements IGasItem, ISustainedI Gas type = getGas(itemstack).getGas(); - int gasToUse = Math.min(getStored(itemstack), Math.min(getRate(), amount)); + int gasToUse = Math.min(getStored(itemstack), Math.min(getRate(itemstack), amount)); setGas(new GasStack(type, getStored(itemstack)-gasToUse), itemstack); return new GasStack(type, gasToUse); diff --git a/common/mekanism/common/item/ItemBlockMachine.java b/common/mekanism/common/item/ItemBlockMachine.java index 4b9509214..0db01f091 100644 --- a/common/mekanism/common/item/ItemBlockMachine.java +++ b/common/mekanism/common/item/ItemBlockMachine.java @@ -12,6 +12,9 @@ import mekanism.api.IConfigurable; import mekanism.api.IUpgradeManagement; import mekanism.api.energy.EnergizedItemManager; import mekanism.api.energy.IEnergizedItem; +import mekanism.api.gas.Gas; +import mekanism.api.gas.GasStack; +import mekanism.api.gas.IGasItem; import mekanism.common.IElectricChest; import mekanism.common.IFactory; import mekanism.common.IRedstoneControl; @@ -32,6 +35,7 @@ import mekanism.common.tileentity.TileEntityElectricBlock; import mekanism.common.tileentity.TileEntityElectricChest; import mekanism.common.tileentity.TileEntityFactory; import mekanism.common.tileentity.TileEntityLogisticalSorter; +import mekanism.common.tileentity.TileEntityRotaryCondensentrator; import mekanism.common.transporter.TransporterFilter; import mekanism.common.util.MekanismUtils; import mekanism.common.util.TransporterUtils; @@ -78,7 +82,7 @@ import cpw.mods.fml.relauncher.SideOnly; * @author AidanBrady * */ -public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItemElectric, ISpecialElectricItem, IUpgradeManagement, IFactory, ISustainedInventory, ISustainedTank, IElectricChest, IEnergyContainerItem +public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItemElectric, ISpecialElectricItem, IUpgradeManagement, IFactory, ISustainedInventory, ISustainedTank, IElectricChest, IEnergyContainerItem, IGasItem { public Block metaBlock; @@ -144,6 +148,13 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem } } + GasStack gasStack = getGas(itemstack); + + if(gasStack != null) + { + list.add(EnumColor.YELLOW + "Stored " + gasStack.getGas().getLocalizedName() + ": " + EnumColor.GREY + gasStack.amount); + } + if(supportsUpgrades(itemstack)) { list.add(EnumColor.PURPLE + "Energy: " + EnumColor.GREY + "x" + (getEnergyMultiplier(itemstack)+1)); @@ -297,6 +308,11 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem ((TileEntityElectricChest)tileEntity).password = getPassword(stack); } + if(tileEntity instanceof TileEntityRotaryCondensentrator) + { + ((TileEntityRotaryCondensentrator)tileEntity).setGas(getGas(stack)); + } + ((ISustainedInventory)tileEntity).setInventory(getInventory(stack)); tileEntity.electricityStored = getEnergy(stack); @@ -403,6 +419,7 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem public boolean onEntityItemUpdate(EntityItem entityItem) { onUpdate(entityItem.getEntityItem(), null, entityItem, 0, false); + return false; } @@ -479,9 +496,10 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem { if(data[0] instanceof ItemStack) { - int meta = ((ItemStack)data[0]).getItemDamage(); + MachineType type = MachineType.get((ItemStack)data[0]); - if(meta != 11 && meta != 12 && meta != 13 && meta != 14 && meta != 15) + if(type != MachineType.TELEPORTER && type != MachineType.ELECTRIC_PUMP && type != MachineType.ELECTRIC_CHEST && type != MachineType.CHARGEPAD && type != MachineType.LOGISTICAL_SORTER && + type != MachineType.ROTARY_CONDENSENTRATOR) { return true; } @@ -616,7 +634,8 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem @Override public boolean hasTank(Object... data) { - return data[0] instanceof ItemStack && ((ItemStack)data[0]).getItem() instanceof ISustainedTank && MachineType.get((ItemStack)data[0]) == MachineType.ELECTRIC_PUMP; + return data[0] instanceof ItemStack && ((ItemStack)data[0]).getItem() instanceof ISustainedTank && (MachineType.get((ItemStack)data[0]) == MachineType.ELECTRIC_PUMP + || MachineType.get((ItemStack)data[0]) == MachineType.ROTARY_CONDENSENTRATOR); } @Override @@ -895,4 +914,131 @@ public class ItemBlockMachine extends ItemBlock implements IEnergizedItem, IItem { return IC2ItemManager.getManager(this); } + + @Override + public int getMaxGas(Object... data) + { + if(data[0] instanceof ItemStack) + { + if(MachineType.get((ItemStack)data[0]) == MachineType.ROTARY_CONDENSENTRATOR) + { + return TileEntityRotaryCondensentrator.MAX_GAS; + } + } + + return 0; + } + + @Override + public int getRate(ItemStack itemstack) + { + return ItemBlockGasTank.TRANSFER_RATE; + } + + @Override + public int addGas(ItemStack itemstack, GasStack stack) + { + if(MachineType.get(itemstack) != MachineType.ROTARY_CONDENSENTRATOR || (getGas(itemstack) != null && getGas(itemstack).getGas() != stack.getGas())) + { + return 0; + } + + int toUse = Math.min(getMaxGas(itemstack)-getStored(itemstack), Math.min(getRate(itemstack), stack.amount)); + setGas(new GasStack(stack.getGas(), getStored(itemstack)+toUse), itemstack); + + return toUse; + } + + @Override + public GasStack removeGas(ItemStack itemstack, int amount) + { + if(MachineType.get(itemstack) != MachineType.ROTARY_CONDENSENTRATOR || getGas(itemstack) == null) + { + return null; + } + + Gas type = getGas(itemstack).getGas(); + + int gasToUse = Math.min(getStored(itemstack), Math.min(getRate(itemstack), amount)); + setGas(new GasStack(type, getStored(itemstack)-gasToUse), itemstack); + + return new GasStack(type, gasToUse); + } + + private int getStored(ItemStack itemstack) + { + return getGas(itemstack) != null ? getGas(itemstack).amount : 0; + } + + @Override + public boolean canReceiveGas(ItemStack itemstack, Gas type) + { + return MachineType.get(itemstack) == MachineType.ROTARY_CONDENSENTRATOR && (getGas(itemstack) == null || getGas(itemstack).getGas() == type); + } + + @Override + public boolean canProvideGas(ItemStack itemstack, Gas type) + { + return false; + } + + @Override + public GasStack getGas(Object... data) + { + if(data[0] instanceof ItemStack) + { + ItemStack itemstack = (ItemStack)data[0]; + + if(MachineType.get(itemstack) != MachineType.ROTARY_CONDENSENTRATOR || itemstack.stackTagCompound == null) + { + return null; + } + + GasStack stored = GasStack.readFromNBT(itemstack.stackTagCompound.getCompoundTag("stored")); + + if(stored == null) + { + itemstack.setItemDamage(100); + } + else { + itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)stored.amount/getMaxGas(itemstack))*100)-100)))); + } + + return stored; + } + + return null; + } + + @Override + public void setGas(GasStack stack, Object... data) + { + if(data[0] instanceof ItemStack) + { + ItemStack itemstack = (ItemStack)data[0]; + + if(MachineType.get(itemstack) != MachineType.ROTARY_CONDENSENTRATOR) + { + return; + } + + if(itemstack.stackTagCompound == null) + { + itemstack.setTagCompound(new NBTTagCompound()); + } + + if(stack == null || stack.amount == 0) + { + itemstack.setItemDamage(100); + itemstack.stackTagCompound.removeTag("stored"); + } + else { + int amount = Math.max(0, Math.min(stack.amount, getMaxGas(itemstack))); + GasStack gasStack = new GasStack(stack.getGas(), amount); + + itemstack.setItemDamage((int)Math.max(1, (Math.abs((((float)amount/getMaxGas(itemstack))*100)-100)))); + itemstack.stackTagCompound.setCompoundTag("stored", gasStack.write(new NBTTagCompound())); + } + } + } } diff --git a/common/mekanism/common/tileentity/TileEntityChargepad.java b/common/mekanism/common/tileentity/TileEntityChargepad.java index 4c43cdd25..2847180a1 100644 --- a/common/mekanism/common/tileentity/TileEntityChargepad.java +++ b/common/mekanism/common/tileentity/TileEntityChargepad.java @@ -241,7 +241,7 @@ public class TileEntityChargepad extends TileEntityElectricBlock implements IAct @Override public boolean renderUpdate() { - return true; + return false; } @Override diff --git a/common/mekanism/common/tileentity/TileEntityElectricPump.java b/common/mekanism/common/tileentity/TileEntityElectricPump.java index 54edb6a84..a9b7a7009 100644 --- a/common/mekanism/common/tileentity/TileEntityElectricPump.java +++ b/common/mekanism/common/tileentity/TileEntityElectricPump.java @@ -475,7 +475,7 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { - if(fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() != resource.getFluid() && from == ForgeDirection.getOrientation(1)) + if(fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() == resource.getFluid() && from == ForgeDirection.getOrientation(1)) { return drain(from, resource.amount, doDrain); } @@ -509,6 +509,6 @@ public class TileEntityElectricPump extends TileEntityElectricBlock implements I @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - return true; + return from == ForgeDirection.getOrientation(1); } } diff --git a/common/mekanism/common/tileentity/TileEntityGasTank.java b/common/mekanism/common/tileentity/TileEntityGasTank.java index 40d2f7075..6e7a31e5b 100644 --- a/common/mekanism/common/tileentity/TileEntityGasTank.java +++ b/common/mekanism/common/tileentity/TileEntityGasTank.java @@ -61,7 +61,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasS } } - if(!worldObj.isRemote && gasStored != null && MekanismUtils.canFunction(this)) + if(!worldObj.isRemote && getGas() != null && MekanismUtils.canFunction(this)) { GasStack toSend = new GasStack(getGas().getGas(), Math.min(getGas().amount, output)); setGas(new GasStack(getGas().getGas(), getGas().amount - GasTransmission.emitGasToNetwork(toSend, this, ForgeDirection.getOrientation(facing)))); diff --git a/common/mekanism/common/tileentity/TileEntityRotaryCondensentrator.java b/common/mekanism/common/tileentity/TileEntityRotaryCondensentrator.java index 670500b7e..5a39e1a70 100644 --- a/common/mekanism/common/tileentity/TileEntityRotaryCondensentrator.java +++ b/common/mekanism/common/tileentity/TileEntityRotaryCondensentrator.java @@ -1,13 +1,368 @@ package mekanism.common.tileentity; -import mekanism.common.block.BlockMachine.MachineType; -import net.minecraft.item.ItemStack; +import java.util.ArrayList; -public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock +import mekanism.api.Object3D; +import mekanism.api.gas.Gas; +import mekanism.api.gas.GasRegistry; +import mekanism.api.gas.GasStack; +import mekanism.api.gas.GasTransmission; +import mekanism.api.gas.IGasAcceptor; +import mekanism.api.gas.IGasStorage; +import mekanism.api.gas.ITubeConnection; +import mekanism.common.IActiveState; +import mekanism.common.ISustainedTank; +import mekanism.common.PacketHandler; +import mekanism.common.PacketHandler.Transmission; +import mekanism.common.block.BlockMachine.MachineType; +import mekanism.common.network.PacketTileEntity; +import mekanism.common.util.ChargeUtils; +import mekanism.common.util.MekanismUtils; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + +import com.google.common.io.ByteArrayDataInput; + +public class TileEntityRotaryCondensentrator extends TileEntityElectricBlock implements IActiveState, ISustainedTank, IFluidHandler, IGasStorage, IGasAcceptor, ITubeConnection { + public GasStack gasTank; + + public FluidTank fluidTank; + + public static final int MAX_GAS = 10000; + + public int updateDelay; + + /** 0: gas -> fluid; 1: fluid -> gas */ + public int mode; + + public int gasOutput = 16; + + public boolean isActive; + + public boolean clientActive; + public TileEntityRotaryCondensentrator() { super("RotaryCondensentrator", MachineType.ROTARY_CONDENSENTRATOR.baseEnergy); + fluidTank = new FluidTank(10000); inventory = new ItemStack[5]; } + + @Override + public void onUpdate() + { + if(worldObj.isRemote) + { + if(updateDelay > 0) + { + updateDelay--; + + if(updateDelay == 0 && clientActive != isActive) + { + isActive = clientActive; + MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); + } + } + } + + if(!worldObj.isRemote) + { + if(updateDelay > 0) + { + updateDelay--; + + if(updateDelay == 0 && clientActive != isActive) + { + PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Object3D.get(this), getNetworkedData(new ArrayList()))); + } + } + + ChargeUtils.discharge(4, this); + + if(mode == 1 && getGas() != null) + { + GasStack toSend = new GasStack(getGas().getGas(), Math.min(getGas().amount, gasOutput)); + setGas(new GasStack(getGas().getGas(), getGas().amount - GasTransmission.emitGasToNetwork(toSend, this, MekanismUtils.getLeft(facing)))); + + TileEntity tileEntity = Object3D.get(this).getFromSide(MekanismUtils.getLeft(facing)).getTileEntity(worldObj); + + if(tileEntity instanceof IGasAcceptor) + { + if(((IGasAcceptor)tileEntity).canReceiveGas(MekanismUtils.getLeft(facing).getOpposite(), getGas().getGas())) + { + int added = ((IGasAcceptor)tileEntity).receiveGas(new GasStack(getGas().getGas(), Math.min(getGas().amount, gasOutput))); + + setGas(new GasStack(getGas().getGas(), getGas().amount - added)); + } + } + } + } + } + + @Override + public void handlePacketData(ByteArrayDataInput dataStream) + { + super.handlePacketData(dataStream); + + mode = dataStream.readInt(); + + if(dataStream.readInt() == 1) + { + fluidTank.setFluid(new FluidStack(dataStream.readInt(), dataStream.readInt())); + } + else { + fluidTank.setFluid(null); + } + + if(dataStream.readBoolean()) + { + gasTank = new GasStack(GasRegistry.getGas(dataStream.readInt()), dataStream.readInt()); + } + else { + gasTank = null; + } + + + MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); + } + + @Override + public ArrayList getNetworkedData(ArrayList data) + { + super.getNetworkedData(data); + + data.add(mode); + + if(fluidTank.getFluid() != null) + { + data.add(1); + data.add(fluidTank.getFluid().fluidID); + data.add(fluidTank.getFluid().amount); + } + else { + data.add(0); + } + + if(gasTank != null) + { + data.add(true); + data.add(gasTank.getGas().getID()); + data.add(gasTank.amount); + } + else { + data.add(false); + } + + return data; + } + + @Override + public void readFromNBT(NBTTagCompound nbtTags) + { + super.readFromNBT(nbtTags); + + mode = nbtTags.getInteger("mode"); + gasTank = GasStack.readFromNBT(nbtTags.getCompoundTag("gasTank")); + + if(nbtTags.hasKey("fluidTank")) + { + fluidTank.readFromNBT(nbtTags.getCompoundTag("fluidTank")); + } + } + + @Override + public void writeToNBT(NBTTagCompound nbtTags) + { + super.writeToNBT(nbtTags); + + nbtTags.setInteger("mode", mode); + + if(gasTank != null) + { + nbtTags.setCompoundTag("gasTank", gasTank.write(new NBTTagCompound())); + } + + if(fluidTank.getFluid() != null) + { + nbtTags.setTag("fluidTank", fluidTank.writeToNBT(new NBTTagCompound())); + } + } + + public int getScaledFluidLevel(int i) + { + return fluidTank.getFluid() != null ? fluidTank.getFluid().amount*i / 10000 : 0; + } + + public int getScaledGasLevel(int i) + { + return gasTank != null ? gasTank.amount*i / MAX_GAS : 0; + } + + @Override + public void setActive(boolean active) + { + isActive = active; + + if(clientActive != active && updateDelay == 0) + { + PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Object3D.get(this), getNetworkedData(new ArrayList()))); + + updateDelay = 10; + clientActive = active; + } + } + + @Override + public boolean getActive() + { + return isActive; + } + + @Override + public boolean renderUpdate() + { + return false; + } + + @Override + public boolean lightUpdate() + { + return true; + } + + @Override + public boolean canTubeConnect(ForgeDirection side) + { + return side == MekanismUtils.getLeft(facing); + } + + @Override + public int receiveGas(GasStack stack) + { + if(gasTank == null || (gasTank != null && gasTank.getGas() == stack.getGas())) + { + int stored = getGas() != null ? getGas().amount : 0; + int toUse = Math.min(getMaxGas()-stored, stack.amount); + + setGas(new GasStack(stack.getGas(), stored + toUse)); + + return toUse; + } + + return 0; + } + + @Override + public boolean canReceiveGas(ForgeDirection side, Gas type) + { + return mode == 0 && (getGas() == null || getGas().getGas() == type) && side == MekanismUtils.getLeft(facing); + } + + @Override + public GasStack getGas(Object... data) + { + return gasTank; + } + + @Override + public void setGas(GasStack stack, Object... data) + { + if(stack == null || stack.amount == 0) + { + gasTank = null; + } + else { + gasTank = new GasStack(stack.getGas(), Math.max(Math.min(stack.amount, getMaxGas()), 0)); + } + + MekanismUtils.saveChunk(this); + } + + @Override + public int getMaxGas(Object... data) + { + return MAX_GAS; + } + + @Override + public void setFluidStack(FluidStack fluidStack, Object... data) + { + fluidTank.setFluid(fluidStack); + } + + @Override + public FluidStack getFluidStack(Object... data) + { + return fluidTank.getFluid(); + } + + @Override + public boolean hasTank(Object... data) + { + return true; + } + + @Override + public int fill(ForgeDirection from, FluidStack resource, boolean doFill) + { + if(canFill(from, resource.getFluid())) + { + return fluidTank.fill(resource, doFill); + } + + return 0; + } + + @Override + public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) + { + if(fluidTank.getFluid() != null && fluidTank.getFluid().getFluid() == resource.getFluid()) + { + return drain(from, resource.amount, doDrain); + } + + return null; + } + + @Override + public boolean canFill(ForgeDirection from, Fluid fluid) + { + return mode == 1 && from == MekanismUtils.getRight(facing); + } + + @Override + public boolean canDrain(ForgeDirection from, Fluid fluid) + { + return mode == 0 && from == MekanismUtils.getRight(facing); + } + + @Override + public FluidTankInfo[] getTankInfo(ForgeDirection from) + { + if(from == MekanismUtils.getRight(facing)) + { + return new FluidTankInfo[] {fluidTank.getInfo()}; + } + + return null; + } + + @Override + public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) + { + if(canDrain(from, null)) + { + return fluidTank.drain(maxDrain, doDrain); + } + + return null; + } } diff --git a/resources/assets/mekanism/gui/GuiRotaryCondensentrator.png b/resources/assets/mekanism/gui/GuiRotaryCondensentrator.png index 4348e6402920253120b063a101e9cb154b894fc8..e1317a29ef5301285d34b0b74f97f4d0a6c82dc3 100644 GIT binary patch delta 4411 zcmcIndonC6`Pc zx#wOk6Gnw1mr#gA8J9SX86jfkH=Xxg@4MFfuJyb8arPg3t-bfNK6^jU=kq*!@7JnR z*h)79g!*oO$in?s*dOoBlE>PWIzqmfl^u~lVeC%SUyxUI+R}m)4@MuL{$!ova9Lso zowF_YH(7DGQOG22FB}%9^iuSh%>+(&H$r>?*h}xI{!Kq_DtegtezD`tSV-Orwv>Ok zax)^I%?p{<%P~*1QjT!;-j+J=(vA}I^m9J!1Nn9Y(Xt$4Wzd0+nN*rSFY(4c5z zL^fil0`1%43GQ?@wFeQGY#v*wA8K5cq_d}uA6&O1*H?}iedbWnR>8(+&LiqtQkEQx z1ofzxMTHskh{07Qb}1>LBRJ#Qe@{+EBT6jLv@ksGic#mlde;flyRy$F$szmdwe-(p zTRah2vEkt^3ndCET;1)!eXZ-oJITcR`XX?fiSedrO4z5~y78#e`p}u4r|X}pveptl zwp&D|tEBm_Rll#`M6*ZuA3t88L?YuupoVz7j?F0p$bWif<;>4uDm{`ne~f@0rW`Oe z)k=Tle6gE)B_ZJi_mAsKCF+%KJv)+hu6JDzQ4lM5n2?)mQB|X7HveJ0r*e4ogHb7E z%^tj{9virY z1@MT!rBaF46SAZA{5NW9T+p%z-6npEmdNwK>llxmD>tOU&frWoal${5^J-y%3Tgk= zvN8F`owKFQ3u(68@$s*XFxJJ%#Kgqw(TG;Tc2KP` zU8z^xSs~%8!sq7mA4Ymdzy`~XaRlAf7xM1TEs)*)H&RoVN(qb}!h4CqTv%wvM0=8A zw<0kH2g7jTQfASmSOL`H$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