aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
index b7bdfcb..16efebd 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
@@ -16,8 +16,6 @@ import java.util.function.Predicate;
public class ValidatedSlot extends Slot {
private static final VisualLogger LOGGER = new VisualLogger(ValidatedSlot.class);
private final int slotNumber;
- // Original positions that will be restored when this slot is reshown
- private final int originalX, originalY;
private boolean insertingAllowed = true;
private boolean takingAllowed = true;
private Predicate<ItemStack> filter;
@@ -28,8 +26,6 @@ public class ValidatedSlot extends Slot {
super(inventory, index, x, y);
if (inventory==null) throw new IllegalArgumentException("Can't make an itemslot from a null inventory!");
this.slotNumber = index;
- this.originalX = x;
- this.originalY = y;
}
@Override
@@ -148,6 +144,11 @@ public class ValidatedSlot extends Slot {
listeners.put(owner, listener);
}
+ @Override
+ public boolean isEnabled() {
+ return isVisible();
+ }
+
/**
* Tests whether this slot is visible.
*
@@ -165,16 +166,6 @@ public class ValidatedSlot extends Slot {
* @since 3.0.0
*/
public void setVisible(boolean visible) {
- if (this.visible != visible) {
- this.visible = visible;
-
- if (visible) {
- x = originalX;
- y = originalY;
- } else {
- x = -100000;
- y = -100000;
- }
- }
+ this.visible = visible;
}
}