aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 14:00:21 +1000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2018-05-29 14:00:21 +1000
commita2377acf4dc0dedc087fe83ca5665d142ab26ba1 (patch)
tree91664db8d5a3cdd781b6f87ab4d4296d5f68f40f /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage
parent524a1242befd9b1ddb3dc591ac7a16148b272ea8 (diff)
downloadGT5-Unofficial-a2377acf4dc0dedc087fe83ca5665d142ab26ba1.tar.gz
GT5-Unofficial-a2377acf4dc0dedc087fe83ca5665d142ab26ba1.tar.bz2
GT5-Unofficial-a2377acf4dc0dedc087fe83ca5665d142ab26ba1.zip
+ Attempted to make some server friendly threaded Super Buffers.
+ Initial work on an infinite item holder, for test setups. % Renamed GregtechSuperTanks.java to GregtechSuperChests.java.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java87
1 files changed, 87 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java
new file mode 100644
index 0000000000..5aa004637c
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/creative/GT_MetaTileEntity_InfiniteItemHolder.java
@@ -0,0 +1,87 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.storage.creative;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.item.ItemStack;
+
+import gregtech.api.interfaces.ITexture;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
+
+import gtPlusPlus.core.util.minecraft.PlayerUtils;
+import gtPlusPlus.core.util.sys.KeyboardUtils;
+import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
+
+public class GT_MetaTileEntity_InfiniteItemHolder extends GT_MetaTileEntity_TieredChest {
+
+ public GT_MetaTileEntity_InfiniteItemHolder(int aID, String aName, String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier);
+ }
+
+ public GT_MetaTileEntity_InfiniteItemHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, aDescription, aTextures);
+ }
+
+ @Override
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+
+ if (aPlayer.worldObj.isRemote) {
+ return false;
+ }
+
+ if (!KeyboardUtils.isShiftKeyDown()) {
+ if (this.mItemStack == null) {
+ if (aPlayer.getHeldItem() != null) {
+ this.mItemStack = aPlayer.getHeldItem().copy();
+ this.mItemCount = Short.MAX_VALUE;
+ }
+ }
+ else {
+ if (aPlayer.getHeldItem() == null) {
+ this.mItemStack = null;
+ this.mItemCount = 0;
+ }
+ }
+ }
+ else {
+ PlayerUtils.messagePlayer(aPlayer, "Currently holding: "+(this.mItemStack != null ? this.mItemStack.getDisplayName() : "Nothing")+" x"+this.mItemCount);
+ }
+ return super.onRightclick(aBaseMetaTileEntity, aPlayer);
+ }
+
+ @Override
+ public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
+ return null;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTimer) {
+ super.onPostTick(aBaseMetaTileEntity, aTimer);
+ }
+
+ @Override
+ public void setItemCount(int aCount) {
+ super.setItemCount(Short.MAX_VALUE);
+ }
+
+ @Override
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return super.allowPullStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ // TODO Auto-generated method stub
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack);
+ }
+
+
+
+
+
+}