aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjani270 <69345714+jani270@users.noreply.github.com>2023-12-26 10:26:02 +0100
committerGitHub <noreply@github.com>2023-12-26 10:26:02 +0100
commitd03fbcac25bcc5c2d91fb79b2a54eb7db7f9d8c4 (patch)
tree35016059234215aa54e0f0fd3dc591dd161f7d7e
parent5935206fd2a20eb8d9d17e68ca4e5d5c754f6bd0 (diff)
downloadNotEnoughUpdates-d03fbcac25bcc5c2d91fb79b2a54eb7db7f9d8c4.tar.gz
NotEnoughUpdates-d03fbcac25bcc5c2d91fb79b2a54eb7db7f9d8c4.tar.bz2
NotEnoughUpdates-d03fbcac25bcc5c2d91fb79b2a54eb7db7f9d8c4.zip
Fixed multiple errors in the TrophyReward Overlay (#983)
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java
index e8653d53..d8da016e 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TrophyRewardOverlay.java
@@ -27,6 +27,7 @@ import io.github.moulberry.notenoughupdates.events.ButtonExclusionZoneEvent;
import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent;
import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer;
import io.github.moulberry.notenoughupdates.util.Constants;
+import io.github.moulberry.notenoughupdates.util.ItemUtils;
import io.github.moulberry.notenoughupdates.util.Rectangle;
import io.github.moulberry.notenoughupdates.util.Utils;
import net.minecraft.client.Minecraft;
@@ -81,13 +82,15 @@ public class TrophyRewardOverlay {
@SubscribeEvent(priority = EventPriority.LOW)
public void onItemTooltipLow(ItemTooltipEvent event) {
if (!inTrophyFishingInventory()) return;
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.trophyRewardTooltips) return;
ItemStack itemStack = event.itemStack;
if (itemStack == null) return;
if (!"§aFillet Trophy Fish".equals(itemStack.getDisplayName())) return;
+ if (ItemUtils.getLore(itemStack).contains("§8Sacks")) return;
- event.toolTip.add(4, getToolTip());
- event.toolTip.add(4, "");
+ event.toolTip.add(2, getToolTip());
+ event.toolTip.add(2, "");
}
private String getToolTip() {
@@ -101,12 +104,12 @@ public class TrophyRewardOverlay {
@SubscribeEvent
public void onButtonExclusionZones(ButtonExclusionZoneEvent event) {
- if (inTrophyFishingInventory()) {
+ if (inTrophyFishingInventory() && NotEnoughUpdates.INSTANCE.config.fishing.trophyRewardOverlay) {
event.blockArea(
new Rectangle(
event.getGuiBaseRect().getRight(),
event.getGuiBaseRect().getTop(),
- 168 /*width*/ + 4 /*space*/,
+ 158 /*width*/ + 7 /*space*/,
128
),
ButtonExclusionZoneEvent.PushDirection.TOWARDS_RIGHT
@@ -117,6 +120,7 @@ public class TrophyRewardOverlay {
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onDrawBackground(GuiScreenEvent.BackgroundDrawnEvent event) {
if (!inTrophyFishingInventory()) return;
+ if (!NotEnoughUpdates.INSTANCE.config.fishing.trophyRewardOverlay) return;
GuiScreen screen = Minecraft.getMinecraft().currentScreen;
if (!(screen instanceof GuiChest)) return;
@@ -292,7 +296,6 @@ public class TrophyRewardOverlay {
public static boolean inTrophyFishingInventory() {
if (!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return false;
- if (!NotEnoughUpdates.INSTANCE.config.fishing.trophyRewardOverlay) return false;
Minecraft minecraft = Minecraft.getMinecraft();
if (minecraft == null || minecraft.thePlayer == null) return false;