aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java20
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/SlotLocking.java8
2 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
index f3757243..8f11f5c7 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java
@@ -62,6 +62,8 @@ import org.lwjgl.util.vector.Vector2f;
import java.io.File;
import java.util.Arrays;
import java.util.HashMap;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
@NEUAutoSubscribe
public class SlotLocking {
@@ -156,11 +158,29 @@ public class SlotLocking {
ConfigUtil.saveConfig(config, file, GSON);
}
+
+ private static final Pattern WINDOW_REGEX = Pattern.compile(".+ Backpack (?:✦ )?\\(Slot #(\\d+)\\)");
+ private static final Pattern ECHEST_WINDOW_REGEX = Pattern.compile("Ender Chest \\((\\d+)/(\\d+)\\)");
+
+
private LockedSlot[] getDataForProfile() {
if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ||
!NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotLocking)
return null;
+ if (NotEnoughUpdates.INSTANCE.config.slotLocking.disableInStorage) {
+ if (StorageManager.getInstance().isStorageOpen) return null;
+ String openChestName = Utils.getOpenChestName();
+ if (openChestName.trim().equals("Storage")) return null;
+
+ Matcher matcher = WINDOW_REGEX.matcher(openChestName);
+ Matcher matcherEchest = ECHEST_WINDOW_REGEX.matcher(openChestName);
+
+ if (matcher.matches() || matcherEchest.matches()) {
+ return null;
+ }
+ }
+
String profileName = SBInfo.getInstance().currentProfile;
if (profileName == null) profileName = "generic";
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/SlotLocking.java
index 45422347..e373747f 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/SlotLocking.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/SlotLocking.java
@@ -78,6 +78,14 @@ public class SlotLocking {
public boolean lockSlotsInTrade = true;
@Expose
+ @ConfigOption(
+ name = "Disable Locking in Storage",
+ desc = "Disables slot locking and binding in the storage gui"
+ )
+ @ConfigEditorBoolean
+ public boolean disableInStorage = false;
+
+ @Expose
/*@ConfigOption(
name = "Item Swap drop delay",
desc = "Set the delay between swapping to another item and being able to drop it.\n"+