diff options
| author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-07-20 13:24:57 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-20 13:24:57 +0200 |
| commit | 8209ae8cc7dc6476a96547534efe991049e8b49b (patch) | |
| tree | 729c6f7de3f92046d0e24d4fad5f62e0e9cdb0d5 /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java | |
| parent | e91d0907148e08352f3679324dc3e6460de1be38 (diff) | |
| download | notenoughupdates-8209ae8cc7dc6476a96547534efe991049e8b49b.tar.gz notenoughupdates-8209ae8cc7dc6476a96547534efe991049e8b49b.tar.bz2 notenoughupdates-8209ae8cc7dc6476a96547534efe991049e8b49b.zip | |
Added trophy reward overlay (#192)
* added trophy reward overlay
* (hopefully) fixed infer "no crash" ~ jani
* fix efe code
Co-authored-by: Lorenz <ESs95s3P5z8Pheb>
Co-authored-by: nopo <noahogno@gmail.com>
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java index 03f19bd8..e1024eab 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionProfit.java @@ -20,13 +20,13 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.miscfeatures.entityviewer.InvisibleModifier; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.Container; import net.minecraft.inventory.ContainerChest; @@ -46,11 +46,12 @@ public class AuctionProfit { @SubscribeEvent public void onDrawBackground(GuiScreenEvent.BackgroundDrawnEvent event) { - if(!inAuctionPage()) return; + if (!inAuctionPage()) return; Minecraft minecraft = Minecraft.getMinecraft(); Container inventoryContainer = minecraft.thePlayer.openContainer; + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) return; Gui gui = event.gui; int xSize = ((AccessorGuiContainer) gui).getXSize(); int guiLeft = ((AccessorGuiContainer) gui).getGuiLeft(); @@ -172,6 +173,6 @@ public class AuctionProfit { if (!(inventoryContainer instanceof ContainerChest)) return false; ContainerChest containerChest = (ContainerChest) inventoryContainer; return containerChest.getLowerChestInventory().getDisplayName() - .getUnformattedText().equalsIgnoreCase("Manage Auctions"); + .getUnformattedText().equalsIgnoreCase("Manage Auctions"); } } |
