diff options
author | Isaiah <73615108+lightningik@users.noreply.github.com> | 2023-10-02 08:36:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 17:36:59 +0200 |
commit | f402113f950150236108207cb566bd627f7257d3 (patch) | |
tree | 71dab7ecdb7110c7d819349afde8abdfe16f9bee /src/main | |
parent | f4f7ec10fd724b05d922204ac1739536b1ec9caa (diff) | |
download | NotEnoughUpdates-f402113f950150236108207cb566bd627f7257d3.tar.gz NotEnoughUpdates-f402113f950150236108207cb566bd627f7257d3.tar.bz2 NotEnoughUpdates-f402113f950150236108207cb566bd627f7257d3.zip |
Add separate locked slots for rift and overworld. (#848)
* Add separate locked slots for rift and overworld.
* Remove unnecessary currentProfile int.
* Fix errors from removing currentProfile
---------
Co-authored-by: LightningYTlol <unconfigured@null.spigotmc.org>
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java | 20 |
1 files changed, 13 insertions, 7 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 b447cf61..c8ac39b2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -72,6 +72,7 @@ public class SlotLocking { private static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); private static final LockedSlot DEFAULT_LOCKED_SLOT = new LockedSlot(); + private final ResourceLocation LOCK = new ResourceLocation("notenoughupdates:slotlocking/lock.png"); private final ResourceLocation BOUND = new ResourceLocation("notenoughupdates:slotlocking/bound.png"); @@ -82,16 +83,17 @@ public class SlotLocking { public static class LockedSlot { public boolean locked = false; public int boundTo = -1; + } public static class SlotLockData { public LockedSlot[] lockedSlots = new LockedSlot[40]; + public LockedSlot[] riftLockedSlots = new LockedSlot[40]; } public static class SlotLockProfile { - int currentProfile = 0; - public SlotLockData[] slotLockData = new SlotLockData[9]; + public SlotLockData[] slotLockData = new SlotLockData[1]; } public static class SlotLockingConfig { @@ -189,14 +191,17 @@ public class SlotLocking { k -> new SlotLockProfile() ); - if (profile.currentProfile < 0) profile.currentProfile = 0; - if (profile.currentProfile >= 9) profile.currentProfile = 8; - if (profile.slotLockData[profile.currentProfile] == null) { - profile.slotLockData[profile.currentProfile] = new SlotLockData(); + if (profile.slotLockData[0] == null) { + profile.slotLockData[0] = new SlotLockData(); } - return profile.slotLockData[profile.currentProfile].lockedSlots; + + if (!"rift".equals(SBInfo.getInstance().getLocation())) { + return profile.slotLockData[0].lockedSlots; + } else { + return profile.slotLockData[0].riftLockedSlots; + } } private LockedSlot getLockedSlot(LockedSlot[] lockedSlots, int index) { @@ -204,6 +209,7 @@ public class SlotLocking { return DEFAULT_LOCKED_SLOT; } + LockedSlot slot = lockedSlots[index]; if (slot == null) { |