From b4592db62a047900dd814cc2e21ede6d7aa3d74c Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 23 Jan 2024 20:16:24 +0100 Subject: Hide OldSBMenu and PetOverlay while being in the rift (#1008) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Hide OldSBMenu and PetOverlay while being in the rift * Update src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java Co-authored-by: Linnea Gräf * change: == to .equals --------- Co-authored-by: Linnea Gräf --- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 4 +++- .../github/moulberry/notenoughupdates/miscfeatures/OldSkyBlockMenu.kt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java index 557ecf84..505124d7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -37,6 +37,7 @@ import io.github.moulberry.notenoughupdates.overlays.TextOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlayStyle; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.PetLeveling; +import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.Utils; import io.github.moulberry.notenoughupdates.util.XPInformation; import net.minecraft.client.Minecraft; @@ -368,7 +369,8 @@ public class PetInfoOverlay extends TextOverlay { @Override public void updateFrequent() { Pet currentPet = getCurrentPet(); - if (!NotEnoughUpdates.INSTANCE.config.petOverlay.enablePetInfo || currentPet == null) { + if (!NotEnoughUpdates.INSTANCE.config.petOverlay.enablePetInfo || currentPet == null || + Objects.equals(SBInfo.getInstance().getLocation(), "rift")) { overlayStrings = null; } else { firstPetLines = 0; diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/OldSkyBlockMenu.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/OldSkyBlockMenu.kt index 4782ab0f..79167696 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/OldSkyBlockMenu.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/OldSkyBlockMenu.kt @@ -24,6 +24,7 @@ import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe import io.github.moulberry.notenoughupdates.events.ReplaceItemEvent import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.ItemUtils +import io.github.moulberry.notenoughupdates.util.SBInfo import io.github.moulberry.notenoughupdates.util.Utils import net.minecraft.client.player.inventory.ContainerLocalMenu import net.minecraft.init.Items @@ -51,6 +52,7 @@ object OldSkyBlockMenu { fun replaceItem(event: ReplaceItemEvent) { if (!isRightInventory()) return if (event.inventory !is ContainerLocalMenu) return + if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("rift")) return val skyBlockButton = map[event.slotNumber] ?: return val showWarning = skyBlockButton.requiresBoosterCookie && !CookieWarning.hasActiveBoosterCookie() @@ -75,6 +77,7 @@ object OldSkyBlockMenu { @SubscribeEvent(priority = EventPriority.HIGH) fun onStackClick(event: SlotClickEvent) { if (!isRightInventory()) return + if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("rift")) return val skyBlockButton = map[event.slotId] ?: return event.isCanceled = true -- cgit