aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotLockedInput.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/slots/SlotLockedInput.java')
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotLockedInput.java57
1 files changed, 0 insertions, 57 deletions
diff --git a/src/Java/gtPlusPlus/core/slots/SlotLockedInput.java b/src/Java/gtPlusPlus/core/slots/SlotLockedInput.java
deleted file mode 100644
index c67f8acfeb..0000000000
--- a/src/Java/gtPlusPlus/core/slots/SlotLockedInput.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package gtPlusPlus.core.slots;
-
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-
-import gtPlusPlus.core.util.reflect.ReflectionUtils;
-import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_TieredChest;
-
-public class SlotLockedInput extends Slot {
-
- private ItemStack mLockStack;
- private final IGregTechTileEntity mEntity;
- private boolean mChecked = false;
-
- public SlotLockedInput(final IGregTechTileEntity inventory, final int index, final int x, final int y, ItemStack lockStack) {
- super(inventory, index, x, y);
- mLockStack = lockStack;
- mEntity = inventory;
- }
-
- @Override
- public boolean isItemValid(final ItemStack itemstack) {
- if (mEntity == null) {
- return false;
- }
- else {
- if (!mChecked) {
- try {
- mLockStack = (ItemStack) ReflectionUtils.getField(this.mEntity.getMetaTileEntity().getClass(), "mItemStack").get(this.mEntity.getMetaTileEntity());
- }
- catch (Throwable t) {
- t.printStackTrace();
- mLockStack = null;
- }
- mChecked = true;
- }
- }
-
- if (mLockStack == null) {
- return true;
- }
- else {
- if (ItemStack.areItemStacksEqual(itemstack, mLockStack)) {
- return true;
- }
- }
- return false;
- }
-
- @Override
- public int getSlotStackLimit() {
- return mLockStack == null ? 64 : mLockStack.getMaxStackSize();
- }
-
-}