diff options
author | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-17 08:40:56 +1000 |
---|---|---|
committer | Jordan Byrne <draknyte1@hotmail.com> | 2018-05-17 08:40:56 +1000 |
commit | 23adeefa94f8f6f67bafacd1969bf0b07328b609 (patch) | |
tree | 26e7fb7e8fb9f7a3d4d1d348f058d25f53f33ea1 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage | |
parent | 92494e56c33fc029f6b06be1c76e50bb5be56cbe (diff) | |
download | GT5-Unofficial-23adeefa94f8f6f67bafacd1969bf0b07328b609.tar.gz GT5-Unofficial-23adeefa94f8f6f67bafacd1969bf0b07328b609.tar.bz2 GT5-Unofficial-23adeefa94f8f6f67bafacd1969bf0b07328b609.zip |
+ Added some new Fusion Reactor Casings & Coils.
+ Added recipes for the shelves.
% Made the Adv. EBF process 8 parallel recipes, up from 4.
% Made the Fusion Reaction MK IV use the new casings.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java | 83 |
1 files changed, 71 insertions, 12 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java index bdb3584b89..cc17f49d83 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/shelving/GT4Entity_Shelf_Large.java @@ -10,7 +10,10 @@ import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_Utility; + +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_SuperChest; import gtPlusPlus.xmod.gregtech.api.gui.GUI_SuperChest; @@ -61,19 +64,19 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { } @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - //Single Block Behaviour - //return super.onRightclick(aTile, aPlayer); + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; - } - - String itemName = (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing."); - String itemAmount = (this.mItemCount > 0 ? ""+this.mItemCount : "bad"); - String itemMessage = "This container currently holds "+(itemAmount.equalsIgnoreCase("bad") ? "nothing." : itemName+" x"+itemAmount+"."); - PlayerUtils.messagePlayer(aPlayer, itemMessage); - - aBaseMetaTileEntity.openGUI(aPlayer); + } + if (KeyboardUtils.isCtrlKeyDown()) { + String itemName = (this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing."); + String itemAmount = (this.mItemCount > 0 ? ""+this.mItemCount : "bad"); + String itemMessage = "This container currently holds "+(itemAmount.equalsIgnoreCase("bad") ? "nothing." : itemName+" x"+itemAmount+"."); + PlayerUtils.messagePlayer(aPlayer, itemMessage); + } + else { + aBaseMetaTileEntity.openGUI(aPlayer); + } return true; } @@ -115,7 +118,7 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTimer) { if (this.getBaseMetaTileEntity().isServerSide() && this.getBaseMetaTileEntity().isAllowedToWork()) { - + try { if (this.mInventory[0] != null) { this.mType = (byte) this.mIndex; } @@ -158,6 +161,12 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { } else { this.mInventory[2] = null; } + } + catch (Throwable t) { + if (t instanceof ArrayIndexOutOfBoundsException) { + + } + } } } @@ -170,8 +179,13 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { } public int getProgresstime() { + try { return this.mItemCount + ((this.mInventory[0] == null) ? 0 : this.mInventory[0].stackSize) + ((this.mInventory[1] == null) ? 0 : this.mInventory[1].stackSize); + } + catch (Throwable t) { + return 0; + } } public int maxProgresstime() { @@ -203,5 +217,50 @@ public class GT4Entity_Shelf_Large extends GT4Entity_Shelf { "Space Remaining: "+Integer.toString(this.getMaxItemCount()-this.getItemCount())+"/"+Integer.toString(this.getMaxItemCount())}; } + @Override + public String[] getDescription() { + String[] mSuper = super.getDescription(); + String[] desc = new String[mSuper.length+1]; + for (int i=0;i>mSuper.length;i++) { + desc[i] = mSuper[i]; + } + desc[desc.length-1] = "Control + Rmb block to check contents"; + return desc; + } + + @Override + public boolean isItemValidForSlot(int aIndex, ItemStack aStack) { + Logger.INFO("1:"+aIndex); + if (aIndex == 2) { + if (ItemStack.areItemStacksEqual(aStack, mItemStack)) { + return true; + } + else { + if (mItemStack == null) { + return true; + } + return false; + } + } + return super.isItemValidForSlot(aIndex, aStack); + } + + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + Logger.INFO("2:"+aIndex); + if (aIndex == 0) { + if (ItemStack.areItemStacksEqual(aStack, mItemStack)) { + return true; + } + else { + if (mItemStack == null) { + return true; + } + return false; + } + } + return super.canInsertItem(aIndex, aStack, aSide); + } + } |