diff options
| author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:06:25 -0400 |
|---|---|---|
| committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 22:06:25 -0400 |
| commit | 9353aa711b1d750ff945acdfed2d3b956291b615 (patch) | |
| tree | d6ca62ab093dede52afef0d82ac29d32c56fb29b /src/main/java/gregtech/api/gui | |
| parent | 445e6c3f25714ecf15c07dcd3462375d65b6dc92 (diff) | |
| download | GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.gz GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.tar.bz2 GT5-Unofficial-9353aa711b1d750ff945acdfed2d3b956291b615.zip | |
Reformat code
Diffstat (limited to 'src/main/java/gregtech/api/gui')
25 files changed, 929 insertions, 853 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java index dc5e59d7d4..614d459cb9 100644 --- a/src/main/java/gregtech/api/gui/GT_Container.java +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -3,10 +3,6 @@ package gregtech.api.gui; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Log; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.machines.multi.GT_MetaTileEntity_FusionComputer; - -import java.util.List; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -15,71 +11,73 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import java.util.List; + /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! - * + * <p/> * Main Container-Class, used for all my GUIs */ public class GT_Container extends Container { public IGregTechTileEntity mTileEntity; - public InventoryPlayer mPlayerInventory; - - public GT_Container (InventoryPlayer aPlayerInventory, IGregTechTileEntity aTileEntityInventory) { - + public InventoryPlayer mPlayerInventory; + + public GT_Container(InventoryPlayer aPlayerInventory, IGregTechTileEntity aTileEntityInventory) { + mTileEntity = aTileEntityInventory; mPlayerInventory = aPlayerInventory; } - + /** * To add the Slots to your GUI */ public void addSlots(InventoryPlayer aPlayerInventory) { - // + // } - + /** * Amount of regular Slots in the GUI (so, non-HoloSlots) */ public int getSlotCount() { - return 0; + return 0; } - + /** * Amount of ALL Slots in the GUI including HoloSlots and ArmorSlots, but excluding regular Player Slots */ protected final int getAllSlotCount() { - if (inventorySlots != null) { - if (doesBindPlayerInventory()) return inventorySlots.size()-36; - return inventorySlots.size(); - } - return getSlotCount(); + if (inventorySlots != null) { + if (doesBindPlayerInventory()) return inventorySlots.size() - 36; + return inventorySlots.size(); + } + return getSlotCount(); } - + /** * Start-Index of the usable Slots (the first non-HoloSlot) */ public int getSlotStartIndex() { - return 0; + return 0; } - + public int getShiftClickStartIndex() { - return getSlotStartIndex(); + return getSlotStartIndex(); } - + /** * Amount of Slots in the GUI the player can Shift-Click into. Uses also getSlotStartIndex */ public int getShiftClickSlotCount() { - return 0; + return 0; } /** * Is Player-Inventory visible? */ public boolean doesBindPlayerInventory() { - return true; + return true; } - + /** * Override this Function with something like "return mTileEntity.isUseableByPlayer(aPlayer);" */ @@ -87,42 +85,48 @@ public class GT_Container extends Container { public boolean canInteractWith(EntityPlayer aPlayer) { return false; } - - protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { + + protected void bindPlayerInventory(InventoryPlayer aInventoryPlayer) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); + addSlotToContainer(new Slot(aInventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } - + for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(aInventoryPlayer, i, 8 + i * 18, 142)); } } - + @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { mTileEntity.markDirty(); - - if (aSlotIndex >= 0) { - if (inventorySlots.get(aSlotIndex) == null || inventorySlots.get(aSlotIndex) instanceof GT_Slot_Holo) return null; - if (!(inventorySlots.get(aSlotIndex) instanceof GT_Slot_Armor)) if (aSlotIndex < getAllSlotCount()) if (aSlotIndex < getSlotStartIndex() || aSlotIndex >= getSlotStartIndex() + getSlotCount()) return null; - } - - try {return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer);} catch (Throwable e) {e.printStackTrace(GT_Log.err);} - + + if (aSlotIndex >= 0) { + if (inventorySlots.get(aSlotIndex) == null || inventorySlots.get(aSlotIndex) instanceof GT_Slot_Holo) + return null; + if (!(inventorySlots.get(aSlotIndex) instanceof GT_Slot_Armor)) if (aSlotIndex < getAllSlotCount()) + if (aSlotIndex < getSlotStartIndex() || aSlotIndex >= getSlotStartIndex() + getSlotCount()) return null; + } + + try { + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + ItemStack rStack = null; InventoryPlayer aPlayerInventory = aPlayer.inventory; Slot aSlot; ItemStack tTempStack; int tTempStackSize; ItemStack aHoldStack; - + if ((aShifthold == 0 || aShifthold == 1) && (aMouseclick == 0 || aMouseclick == 1)) { if (aSlotIndex == -999) { if (aPlayerInventory.getItemStack() != null && aSlotIndex == -999) { if (aMouseclick == 0) { - aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack(), true); + aPlayer.dropPlayerItemWithRandomChoice(aPlayerInventory.getItemStack(), true); aPlayerInventory.setItemStack(null); } if (aMouseclick == 1) { @@ -133,7 +137,7 @@ public class GT_Container extends Container { } } } else if (aShifthold == 1) { - aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + aSlot = (Slot) this.inventorySlots.get(aSlotIndex); if (aSlot != null && aSlot.canTakeStack(aPlayer)) { tTempStack = this.transferStackInSlot(aPlayer, aSlotIndex); if (tTempStack != null) { @@ -147,7 +151,7 @@ public class GT_Container extends Container { if (aSlotIndex < 0) { return null; } - aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + aSlot = (Slot) this.inventorySlots.get(aSlotIndex); if (aSlot != null) { tTempStack = aSlot.getStack(); ItemStack var13 = aPlayerInventory.getItemStack(); @@ -163,7 +167,7 @@ public class GT_Container extends Container { aSlot.putStack(var13.splitStack(tTempStackSize)); if (var13.stackSize == 0) { - aPlayerInventory.setItemStack((ItemStack)null); + aPlayerInventory.setItemStack((ItemStack) null); } } } else if (aSlot.canTakeStack(aPlayer)) { @@ -172,7 +176,7 @@ public class GT_Container extends Container { aHoldStack = aSlot.decrStackSize(tTempStackSize); aPlayerInventory.setItemStack(aHoldStack); if (tTempStack.stackSize == 0) { - aSlot.putStack((ItemStack)null); + aSlot.putStack((ItemStack) null); } aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); } else if (aSlot.isItemValid(var13)) { @@ -186,7 +190,7 @@ public class GT_Container extends Container { } var13.splitStack(tTempStackSize); if (var13.stackSize == 0) { - aPlayerInventory.setItemStack((ItemStack)null); + aPlayerInventory.setItemStack((ItemStack) null); } tTempStack.stackSize += tTempStackSize; } else if (var13.stackSize <= aSlot.getSlotStackLimit()) { @@ -201,7 +205,7 @@ public class GT_Container extends Container { tTempStack = aSlot.decrStackSize(tTempStackSize); if (tTempStack.stackSize == 0) { - aSlot.putStack((ItemStack)null); + aSlot.putStack((ItemStack) null); } aSlot.onPickupFromSlot(aPlayer, aPlayerInventory.getItemStack()); @@ -212,7 +216,7 @@ public class GT_Container extends Container { } } } else if (aShifthold == 2 && aMouseclick >= 0 && aMouseclick < 9) { - aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + aSlot = (Slot) this.inventorySlots.get(aSlotIndex); if (aSlot.canTakeStack(aPlayer)) { tTempStack = aPlayerInventory.getStackInSlot(aMouseclick); @@ -232,7 +236,7 @@ public class GT_Container extends Container { if (tTempStackSize > -1) { aPlayerInventory.addItemStackToInventory(tTempStack); aSlot.decrStackSize(aHoldStack.stackSize); - aSlot.putStack((ItemStack)null); + aSlot.putStack((ItemStack) null); aSlot.onPickupFromSlot(aPlayer, aHoldStack); } } else { @@ -241,12 +245,12 @@ public class GT_Container extends Container { aSlot.onPickupFromSlot(aPlayer, aHoldStack); } } else if (!aSlot.getHasStack() && tTempStack != null && aSlot.isItemValid(tTempStack)) { - aPlayerInventory.setInventorySlotContents(aMouseclick, (ItemStack)null); + aPlayerInventory.setInventorySlotContents(aMouseclick, (ItemStack) null); aSlot.putStack(tTempStack); } } } else if (aShifthold == 3 && aPlayer.capabilities.isCreativeMode && aPlayerInventory.getItemStack() == null && aSlotIndex >= 0) { - aSlot = (Slot)this.inventorySlots.get(aSlotIndex); + aSlot = (Slot) this.inventorySlots.get(aSlotIndex); if (aSlot != null && aSlot.getHasStack()) { tTempStack = GT_Utility.copy(aSlot.getStack()); tTempStack.stackSize = tTempStack.getMaxStackSize(); @@ -254,28 +258,28 @@ public class GT_Container extends Container { } } return rStack; - } - + } + @Override - public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { + public ItemStack transferStackInSlot(EntityPlayer aPlayer, int aSlotIndex) { ItemStack stack = null; - Slot slotObject = (Slot)inventorySlots.get(aSlotIndex); - + Slot slotObject = (Slot) inventorySlots.get(aSlotIndex); + mTileEntity.markDirty(); - + //null checks and checks if the item can be stacked (maxStackSize > 1) if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) { ItemStack stackInSlot = slotObject.getStack(); stack = GT_Utility.copy(stackInSlot); - + //TileEntity -> Player if (aSlotIndex < getAllSlotCount()) { - if (doesBindPlayerInventory()) - if (!mergeItemStack(stackInSlot, getAllSlotCount(), getAllSlotCount()+36, true)) { - return null; - } - //Player -> TileEntity - } else if (!mergeItemStack(stackInSlot, getShiftClickStartIndex(), getShiftClickStartIndex()+getShiftClickSlotCount(), false)) { + if (doesBindPlayerInventory()) + if (!mergeItemStack(stackInSlot, getAllSlotCount(), getAllSlotCount() + 36, true)) { + return null; + } + //Player -> TileEntity + } else if (!mergeItemStack(stackInSlot, getShiftClickStartIndex(), getShiftClickStartIndex() + getShiftClickSlotCount(), false)) { return null; } @@ -286,8 +290,8 @@ public class GT_Container extends Container { } } return stack; - } - + } + /** * merges provided ItemStack with the first avaliable one in the container/player inventory */ @@ -295,9 +299,9 @@ public class GT_Container extends Container { protected boolean mergeItemStack(ItemStack aStack, int aStartIndex, int aSlotCount, boolean par4) { boolean var5 = false; int var6 = aStartIndex; - + mTileEntity.markDirty(); - + if (par4) { var6 = aSlotCount - 1; } @@ -307,9 +311,9 @@ public class GT_Container extends Container { if (aStack.isStackable()) { while (aStack.stackSize > 0 && (!par4 && var6 < aSlotCount || par4 && var6 >= aStartIndex)) { - var7 = (Slot)this.inventorySlots.get(var6); + var7 = (Slot) this.inventorySlots.get(var6); var8 = var7.getStack(); - + if (!(var7 instanceof GT_Slot_Holo) && !(var7 instanceof GT_Slot_Output) && var8 != null && var8.getItem() == aStack.getItem() && (!aStack.getHasSubtypes() || aStack.getItemDamage() == var8.getItemDamage()) && ItemStack.areItemStackTagsEqual(aStack, var8)) { int var9 = var8.stackSize + aStack.stackSize; @@ -325,7 +329,7 @@ public class GT_Container extends Container { var5 = true; } } - + if (par4) { --var6; } else { @@ -334,24 +338,18 @@ public class GT_Container extends Container { } } - if (aStack.stackSize > 0) - { - if (par4) - { + if (aStack.stackSize > 0) { + if (par4) { var6 = aSlotCount - 1; - } - else - { + } else { var6 = aStartIndex; } - while (!par4 && var6 < aSlotCount || par4 && var6 >= aStartIndex) - { - var7 = (Slot)this.inventorySlots.get(var6); + while (!par4 && var6 < aSlotCount || par4 && var6 >= aStartIndex) { + var7 = (Slot) this.inventorySlots.get(var6); var8 = var7.getStack(); - if (var8 == null) - { + if (var8 == null) { var7.putStack(GT_Utility.copy(aStack)); var7.onSlotChanged(); aStack.stackSize = 0; @@ -359,12 +357,9 @@ public class GT_Container extends Container { break; } - if (par4) - { + if (par4) { --var6; - } - else - { + } else { ++var6; } } @@ -372,193 +367,193 @@ public class GT_Container extends Container { return var5; } - + @Override protected Slot addSlotToContainer(Slot par1Slot) { - try { - return super.addSlotToContainer(par1Slot); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return par1Slot; + try { + return super.addSlotToContainer(par1Slot); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return par1Slot; } @Override public void addCraftingToCrafters(ICrafting par1ICrafting) { - try { - super.addCraftingToCrafters(par1ICrafting); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + try { + super.addCraftingToCrafters(par1ICrafting); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public List getInventory() { - try { - return super.getInventory(); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return null; - } - + try { + return super.getInventory(); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return null; + } + @Override public void removeCraftingFromCrafters(ICrafting par1ICrafting) { - try { + try { super.removeCraftingFromCrafters(par1ICrafting); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void detectAndSendChanges() { - try { + try { super.detectAndSendChanges(); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public boolean enchantItem(EntityPlayer par1EntityPlayer, int par2) { - try { + try { return super.enchantItem(par1EntityPlayer, par2); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return false; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return false; } - + @Override public Slot getSlotFromInventory(IInventory par1IInventory, int par2) { - try { + try { return super.getSlotFromInventory(par1IInventory, par2); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return null; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return null; } - + @Override public Slot getSlot(int par1) { - try { - if (this.inventorySlots.size() > par1) return super.getSlot(par1); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + try { + if (this.inventorySlots.size() > par1) return super.getSlot(par1); + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } return null; } - + @Override public boolean func_94530_a(ItemStack par1ItemStack, Slot par2Slot) { - try { + try { return super.func_94530_a(par1ItemStack, par2Slot); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } return true; } - + @Override protected void retrySlotClick(int par1, int par2, boolean par3, EntityPlayer par4EntityPlayer) { - try { + try { super.retrySlotClick(par1, par2, par3, par4EntityPlayer); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { - try { + try { super.onContainerClosed(par1EntityPlayer); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void onCraftMatrixChanged(IInventory par1IInventory) { - try { + try { super.onCraftMatrixChanged(par1IInventory); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void putStackInSlot(int par1, ItemStack par2ItemStack) { - try { + try { super.putStackInSlot(par1, par2ItemStack); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void putStacksInSlots(ItemStack[] par1ArrayOfItemStack) { - try { + try { super.putStacksInSlots(par1ArrayOfItemStack); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public void updateProgressBar(int par1, int par2) { - try { + try { super.updateProgressBar(par1, par2); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public short getNextTransactionID(InventoryPlayer par1InventoryPlayer) { - try { + try { return super.getNextTransactionID(par1InventoryPlayer); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return 0; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return 0; } - + @Override public boolean isPlayerNotUsingContainer(EntityPlayer par1EntityPlayer) { - try { + try { return super.isPlayerNotUsingContainer(par1EntityPlayer); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return true; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return true; } - + @Override public void setPlayerIsPresent(EntityPlayer par1EntityPlayer, boolean par2) { - try { + try { super.setPlayerIsPresent(par1EntityPlayer, par2); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override protected void func_94533_d() { - try { + try { super.func_94533_d(); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } } - + @Override public boolean canDragIntoSlot(Slot par1Slot) { - try { + try { return super.canDragIntoSlot(par1Slot); - } catch(Throwable e) { - e.printStackTrace(GT_Log.err); - } - return true; + } catch (Throwable e) { + e.printStackTrace(GT_Log.err); + } + return true; } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java index d4fc27aaf9..c2fa1ab8ad 100644 --- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -1,95 +1,94 @@ package gregtech.api.gui; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - -import java.util.Iterator; - import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; + +import java.util.Iterator; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! - * + * <p/> * The Container I use for all my MetaTileEntities */ public class GT_ContainerMetaTile_Machine extends GT_Container { - + + public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; + private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0, mTimer = 0; + + public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - - mTileEntity = aTileEntity; - - if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { + super(aInventoryPlayer, aTileEntity); + + mTileEntity = aTileEntity; + + if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { addSlots(aInventoryPlayer); if (doesBindPlayerInventory()) bindPlayerInventory(aInventoryPlayer); detectAndSendChanges(); - } else { - aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; - } + } else { + aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; + } } - public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean doesBindInventory){ - super(aInventoryPlayer, aTileEntity); - mTileEntity = aTileEntity; - - if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { + public GT_ContainerMetaTile_Machine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, boolean doesBindInventory) { + super(aInventoryPlayer, aTileEntity); + mTileEntity = aTileEntity; + + if (mTileEntity != null && mTileEntity.getMetaTileEntity() != null) { addSlots(aInventoryPlayer); - if (doesBindPlayerInventory()&&doesBindInventory) bindPlayerInventory(aInventoryPlayer); + if (doesBindPlayerInventory() && doesBindInventory) bindPlayerInventory(aInventoryPlayer); detectAndSendChanges(); - } else { - aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; - } + } else { + aInventoryPlayer.player.openContainer = aInventoryPlayer.player.inventoryContainer; + } } - - - public int mActive = 0, mMaxProgressTime = 0, mProgressTime = 0, mEnergy = 0, mSteam = 0, mSteamStorage = 0, mStorage = 0, mOutput = 0, mInput = 0, mID = 0, mDisplayErrorCode = 0; - private int oActive = 0, oMaxProgressTime = 0, oProgressTime = 0, oEnergy = 0, oSteam = 0, oSteamStorage = 0, oStorage = 0, oOutput = 0, oInput = 0, oID = 0, oDisplayErrorCode = 0, mTimer = 0; - + @Override public void detectAndSendChanges() { super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) return; - mStorage = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getEUCapacity()); - mEnergy = (int)Math.min(Integer.MAX_VALUE, mTileEntity.getStoredEU()); |
