Work on the new upgrade system, specifically with GUI changes
|
@ -1,15 +1,16 @@
|
|||
package mekanism.client.gui;
|
||||
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.client.sound.SoundHandler;
|
||||
import mekanism.common.IUpgradeTile;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.network.PacketRemoveUpgrade.RemoveUpgradeMessage;
|
||||
import mekanism.common.network.PacketSimpleGui.SimpleGuiMessage;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import codechicken.lib.vec.Rectangle4i;
|
||||
|
||||
public class GuiUpgradeTab extends GuiElement
|
||||
{
|
||||
|
@ -17,7 +18,7 @@ public class GuiUpgradeTab extends GuiElement
|
|||
|
||||
public GuiUpgradeTab(IGuiWrapper gui, TileEntity tile, ResourceLocation def)
|
||||
{
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeManagement.png"), gui, def);
|
||||
super(MekanismUtils.getResource(ResourceType.GUI_ELEMENT, "GuiUpgradeTab.png"), gui, def);
|
||||
|
||||
tileEntity = tile;
|
||||
}
|
||||
|
@ -25,7 +26,7 @@ public class GuiUpgradeTab extends GuiElement
|
|||
@Override
|
||||
public Rectangle4i getBounds(int guiWidth, int guiHeight)
|
||||
{
|
||||
return new Rectangle4i(guiWidth + 176, guiHeight + 6, 26, 63);
|
||||
return new Rectangle4i(guiWidth + 176, guiHeight + 6, 26, 26);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -50,52 +51,25 @@ public class GuiUpgradeTab extends GuiElement
|
|||
|
||||
IUpgradeTile upgradeTile = (IUpgradeTile)tileEntity;
|
||||
|
||||
if(getFontRenderer() != null)
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
|
||||
{
|
||||
getFontRenderer().drawString("S:" + (upgradeTile.getSpeedMultiplier()+1) + "x", 179, 47, 0x404040);
|
||||
getFontRenderer().drawString("E:" + (upgradeTile.getEnergyMultiplier()+1) + "x", 179, 57, 0x404040);
|
||||
displayTooltip(MekanismUtils.localize("gui.upgrades"), xAxis, yAxis);
|
||||
}
|
||||
|
||||
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54)
|
||||
{
|
||||
displayTooltip(MekanismUtils.localize("gui.removeSpeedUpgrade"), xAxis, yAxis);
|
||||
}
|
||||
|
||||
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 57 && yAxis <= 64)
|
||||
{
|
||||
displayTooltip(MekanismUtils.localize("gui.removeEnergyUpgrade"), xAxis, yAxis);
|
||||
}
|
||||
|
||||
mc.renderEngine.bindTexture(defaultLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preMouseClicked(int xAxis, int yAxis, int button)
|
||||
{
|
||||
if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27)
|
||||
{
|
||||
offsetX(26);
|
||||
}
|
||||
}
|
||||
public void preMouseClicked(int xAxis, int yAxis, int button) {}
|
||||
|
||||
@Override
|
||||
public void mouseClicked(int xAxis, int yAxis, int button)
|
||||
{
|
||||
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 47 && yAxis <= 54)
|
||||
if(xAxis >= 179 && xAxis <= 197 && yAxis >= 10 && yAxis <= 28)
|
||||
{
|
||||
Mekanism.packetHandler.sendToServer(new SimpleGuiMessage(Coord4D.get(tileEntity), 9));
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tileEntity), (byte)0));
|
||||
}
|
||||
|
||||
if(xAxis >= 179 && xAxis <= 198 && yAxis >= 57 && yAxis <= 64)
|
||||
{
|
||||
SoundHandler.playSound("gui.button.press");
|
||||
Mekanism.packetHandler.sendToServer(new RemoveUpgradeMessage(Coord4D.get(tileEntity), (byte)1));
|
||||
}
|
||||
|
||||
if(xAxis >= 180 && xAxis <= 196 && yAxis >= 11 && yAxis <= 27)
|
||||
{
|
||||
offsetX(-26);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
addSlotToContainer(new Slot(tentity, 1, 56, 53));
|
||||
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 3, 31, 35));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 4, 180, 11));
|
||||
|
||||
int slotX;
|
||||
|
||||
|
@ -75,7 +74,7 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
|
||||
if(slotID == 2)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -90,7 +89,7 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -106,7 +105,7 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -122,45 +121,29 @@ public class ContainerAdvancedElectricMachine extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 4)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, 5, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 5 && slotID <= 31)
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 31)
|
||||
else if(slotID > 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, 31, false))
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -23,19 +23,18 @@ public class ContainerChanceMachine extends Container
|
|||
addSlotToContainer(new Slot(tentity, 0, 56, 17));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53));
|
||||
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11));
|
||||
addSlotToContainer(new SlotOutput(tentity, 4, 132, 35));
|
||||
int slotX;
|
||||
|
||||
for(slotX = 0; slotX < 3; ++slotX)
|
||||
for(slotX = 0; slotX < 3; slotX++)
|
||||
{
|
||||
for(int slotY = 0; slotY < 9; ++slotY)
|
||||
for(int slotY = 0; slotY < 9; slotY++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 84 + slotX * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(slotX = 0; slotX < 9; ++slotX)
|
||||
for(slotX = 0; slotX < 9; slotX++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 142));
|
||||
}
|
||||
|
@ -70,9 +69,9 @@ public class ContainerChanceMachine extends Container
|
|||
ItemStack slotStack = currentSlot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
if(slotID == 2 || slotID == 4)
|
||||
if(slotID == 2 || slotID == 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -88,7 +87,7 @@ public class ContainerChanceMachine extends Container
|
|||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -96,7 +95,7 @@ public class ContainerChanceMachine extends Container
|
|||
}
|
||||
else if(RecipeHandler.getChanceOutput(slotStack, false, tileEntity.getRecipes()) != null)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4)
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 0, 1, false))
|
||||
{
|
||||
|
@ -104,45 +103,29 @@ public class ContainerChanceMachine extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 3, 4, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 5 && slotID <= 31)
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 31)
|
||||
else if(slotID > 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, 31, false))
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,6 @@ public class ContainerChemicalCrystallizer extends Container
|
|||
addSlotToContainer(new SlotStorageTank(tentity, 0, 6, 65));
|
||||
addSlotToContainer(new SlotOutput(tentity, 1, 131, 57));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 2, 155, 5));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11));
|
||||
|
||||
int slotY;
|
||||
|
||||
|
@ -81,7 +80,7 @@ public class ContainerChemicalCrystallizer extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -89,7 +88,7 @@ public class ContainerChemicalCrystallizer extends Container
|
|||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -105,45 +104,29 @@ public class ContainerChemicalCrystallizer extends Container
|
|||
}
|
||||
else if(slotID == 2)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 3, 4, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
if(slotID >= 3 && slotID <= 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 30)
|
||||
else if(slotID > 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
if(!mergeItemStack(slotStack, 3, 29, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ public class ContainerChemicalDissolutionChamber extends Container
|
|||
addSlotToContainer(new Slot(tentity, 1, 26, 36));
|
||||
addSlotToContainer(new SlotStorageTank(tentity, 2, 155, 25));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 3, 155, 5));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 4, 180, 11));
|
||||
|
||||
int slotY;
|
||||
|
||||
|
@ -83,7 +82,7 @@ public class ContainerChemicalDissolutionChamber extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -100,7 +99,7 @@ public class ContainerChemicalDissolutionChamber extends Container
|
|||
}
|
||||
else if(slotID == 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -119,45 +118,29 @@ public class ContainerChemicalDissolutionChamber extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3 && slotID != 4)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, 5, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 5 && slotID <= 31)
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 32, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 31)
|
||||
else if(slotID > 30)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 5, 31, false))
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 5, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ public class ContainerChemicalOxidizer extends Container
|
|||
addSlotToContainer(new Slot(tentity, 0, 26, 36));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 1, 155, 5));
|
||||
addSlotToContainer(new SlotStorageTank(tentity, 2, 155, 25));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11));
|
||||
|
||||
int slotX;
|
||||
|
||||
|
@ -90,7 +89,7 @@ public class ContainerChemicalOxidizer extends Container
|
|||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -106,45 +105,29 @@ public class ContainerChemicalOxidizer extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 3, 4, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
if(slotID >= 3 && slotID <= 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 30)
|
||||
else if(slotID > 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
if(!mergeItemStack(slotStack, 3, 29, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -28,19 +28,18 @@ public class ContainerDigitalMiner extends Container
|
|||
}
|
||||
|
||||
addSlotToContainer(new SlotDischarge(tentity, 27, 152, 6));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 28, 180, 11));
|
||||
|
||||
int slotX;
|
||||
|
||||
for(slotX = 0; slotX < 3; ++slotX)
|
||||
for(slotX = 0; slotX < 3; slotX++)
|
||||
{
|
||||
for(int slotY = 0; slotY < 9; ++slotY)
|
||||
for(int slotY = 0; slotY < 9; slotY++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotY + slotX * 9 + 9, 8 + slotY * 18, 148 + slotX * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(slotX = 0; slotX < 9; ++slotX)
|
||||
for(slotX = 0; slotX < 9; slotX++)
|
||||
{
|
||||
addSlotToContainer(new Slot(inventory, slotX, 8 + slotX * 18, 206));
|
||||
}
|
||||
|
@ -86,23 +85,7 @@ public class ContainerDigitalMiner extends Container
|
|||
}
|
||||
else if(slotID == 27)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 27 && slotID != 28)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 28, 29, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 28, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -111,7 +94,7 @@ public class ContainerDigitalMiner extends Container
|
|||
else {
|
||||
if(slotID < 27)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 29, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 28, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ public class ContainerElectricMachine extends Container
|
|||
addSlotToContainer(new Slot(tentity, 0, 56, 17));
|
||||
addSlotToContainer(new SlotDischarge(tentity, 1, 56, 53));
|
||||
addSlotToContainer(new SlotOutput(tentity, 2, 116, 35));
|
||||
addSlotToContainer(new SlotMachineUpgrade(tentity, 3, 180, 11));
|
||||
int slotX;
|
||||
|
||||
for(slotX = 0; slotX < 3; slotX++)
|
||||
|
@ -71,14 +70,14 @@ public class ContainerElectricMachine extends Container
|
|||
|
||||
if(slotID == 2)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(RecipeHandler.getOutput(slotStack, false, tileEntity.getRecipes()) != null)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 0, 1, false))
|
||||
{
|
||||
|
@ -86,7 +85,7 @@ public class ContainerElectricMachine extends Container
|
|||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -103,45 +102,29 @@ public class ContainerElectricMachine extends Container
|
|||
}
|
||||
else if(slotID == 1)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(slotID != 0 && slotID != 1 && slotID != 2 && slotID != 3)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 3, 4, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(slotID >= 4 && slotID <= 30)
|
||||
if(slotID >= 3 && slotID <= 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 31, inventorySlots.size(), false))
|
||||
if(!mergeItemStack(slotStack, 30, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 30)
|
||||
else if(slotID > 29)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 4, 30, false))
|
||||
if(!mergeItemStack(slotStack, 3, 29, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 4, inventorySlots.size(), true))
|
||||
if(!mergeItemStack(slotStack, 3, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package mekanism.common.inventory.container;
|
|||
|
||||
import mekanism.common.IUpgradeTile;
|
||||
import mekanism.common.inventory.slot.SlotMachineUpgrade;
|
||||
import mekanism.common.item.ItemMachineUpgrade;
|
||||
import mekanism.common.tile.TileEntityContainerBlock;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -16,7 +17,7 @@ public class ContainerUpgradeManagement extends Container
|
|||
public ContainerUpgradeManagement(InventoryPlayer inventory, IUpgradeTile tile)
|
||||
{
|
||||
tileEntity = tile;
|
||||
addSlotToContainer(new SlotMachineUpgrade((TileEntityContainerBlock)tile, 3, 180, 11));
|
||||
addSlotToContainer(new SlotMachineUpgrade((TileEntityContainerBlock)tile, tileEntity.getComponent().getUpgradeSlot(), 154, 7));
|
||||
|
||||
int slotX;
|
||||
|
||||
|
@ -63,24 +64,42 @@ public class ContainerUpgradeManagement extends Container
|
|||
ItemStack slotStack = currentSlot.getStack();
|
||||
stack = slotStack.copy();
|
||||
|
||||
if(slotID >= 0 && slotID <= 26)
|
||||
if(slotStack.getItem() instanceof ItemMachineUpgrade)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 27, inventorySlots.size(), false))
|
||||
if(slotID != 0)
|
||||
{
|
||||
return null;
|
||||
if(!mergeItemStack(slotStack, 0, 1, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(slotID > 26)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 0, 26, false))
|
||||
{
|
||||
return null;
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 1, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 0, inventorySlots.size(), true))
|
||||
if(slotID >= 1 && slotID <= 27)
|
||||
{
|
||||
return null;
|
||||
if(!mergeItemStack(slotStack, 28, inventorySlots.size(), false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if(slotID > 27)
|
||||
{
|
||||
if(!mergeItemStack(slotStack, 1, 27, false))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(!mergeItemStack(slotStack, 1, inventorySlots.size(), true))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,11 @@ public class TileComponentUpgrade implements ITileComponent
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getUpgradeSlot()
|
||||
{
|
||||
return upgradeSlot;
|
||||
}
|
||||
|
||||
public int getScaledUpgradeProgress(int i)
|
||||
{
|
||||
|
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.4 KiB |
|
@ -349,6 +349,8 @@ gui.id=ID
|
|||
gui.finished=Finished
|
||||
gui.well=All is well!
|
||||
|
||||
gui.upgrades=Upgrades
|
||||
|
||||
gui.chemicalInfuser.short=C. Infuser
|
||||
gui.chemicalDissolutionChamber.short=C. Dissolution Chamber
|
||||
|
||||
|
|