aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-07-11 21:28:28 +0300
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-07-11 21:28:28 +0300
commit8e0570f3e6c87b835b3dd22a0f57744af7ae008d (patch)
treecc4d3b5bb39413aa6398ad179bd65bebe968a1a6 /src/main/java
parentf2c643bc7bd81c134f870c87fcee4c566a19ef76 (diff)
downloadLibGui-4.1.4.tar.gz
LibGui-4.1.4.tar.bz2
LibGui-4.1.4.zip
Fix broken AW by yeeting it, bump version to 4.1.44.1.4
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;
}
}