aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-12-29 14:06:37 +0100
committerCow <cow@volloeko.de>2020-12-29 14:06:37 +0100
commit91975bf22481edb0f74c204a7b847baac3830736 (patch)
tree43bc001237f4ec874a4934dffedb8232d29fffe3 /src/main/java/de/cowtipper/cowlection/util/GuiHelper.java
parente1c46e5fbad592241dc21b7297f8a982ea4b347f (diff)
downloadCowlection-91975bf22481edb0f74c204a7b847baac3830736.tar.gz
Cowlection-91975bf22481edb0f74c204a7b847baac3830736.tar.bz2
Cowlection-91975bf22481edb0f74c204a7b847baac3830736.zip
Added quick lookup for item prices and wiki
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/util/GuiHelper.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/util/GuiHelper.java26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java b/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java
index 44bfe13..8ce23e5 100644
--- a/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java
+++ b/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java
@@ -49,9 +49,9 @@ public final class GuiHelper extends GuiScreen {
return instance;
}
- public static Slot getSlotUnderMouse(GuiChest guiChest) {
+ public static Slot getSlotUnderMouse(GuiContainer guiContainer) {
try {
- return ReflectionHelper.getPrivateValue(GuiContainer.class, guiChest, "theSlot", "field_147006_u");
+ return ReflectionHelper.getPrivateValue(GuiContainer.class, guiContainer, "theSlot", "field_147006_u");
} catch (ReflectionHelper.UnableToAccessFieldException e) {
e.printStackTrace();
return null;
@@ -94,6 +94,17 @@ public final class GuiHelper extends GuiScreen {
tessellator.draw();
}
+ public static void drawHoveringTextWithGraph(List<String> toolTip) {
+ int mouseX = Mouse.getX() * getInstance().width / getInstance().mc.displayWidth;
+ int mouseY = getInstance().height - Mouse.getY() * getInstance().height / getInstance().mc.displayHeight - 1;
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
+
+ getInstance().width = scaledResolution.getScaledWidth();
+ getInstance().height = scaledResolution.getScaledHeight();
+
+ getInstance().drawHoveringText(toolTip, mouseX, mouseY, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), -1, true);
+ }
+
public static void drawHoveringText(List<String> textLines, int mouseX, int mouseY, int screenWidth, int screenHeight, int maxTextWidth) {
if (ForgeVersion.getBuildVersion() < 1808) {
// we're running a forge version from before 24 March 2016 (http://files.minecraftforge.net/maven/net/minecraftforge/forge/index_1.8.9.html for reference)
@@ -107,17 +118,6 @@ public final class GuiHelper extends GuiScreen {
}
}
- public static void drawHoveringTextWithGraph(List<String> toolTip) {
- int mouseX = Mouse.getX() * getInstance().width / getInstance().mc.displayWidth;
- int mouseY = getInstance().height - Mouse.getY() * getInstance().height / getInstance().mc.displayHeight - 1;
- ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
-
- getInstance().width = scaledResolution.getScaledWidth();
- getInstance().height = scaledResolution.getScaledHeight();
-
- getInstance().drawHoveringText(toolTip, mouseX, mouseY, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight(), -1, true);
- }
-
/**
* Fixed method for forge versions older than 1.8.9-11.15.1.1808
*