aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2020-08-25 16:41:13 -0400
committerbowser0000 <bowser0000@gmail.com>2020-08-25 16:41:13 -0400
commitd7ca24feedb3ec7226c2832da48bf9f5b1df8054 (patch)
tree867696fa07b70556a685c12386f9341c0199800e
parent09462affe26d0b9d6d460d062f7dfe9c9d09df4b (diff)
downloadSkyblockMod-d7ca24feedb3ec7226c2832da48bf9f5b1df8054.tar.gz
SkyblockMod-d7ca24feedb3ec7226c2832da48bf9f5b1df8054.tar.bz2
SkyblockMod-d7ca24feedb3ec7226c2832da48bf9f5b1df8054.zip
Fix pet colour when chest isn't 6 rows
-rw-r--r--src/main/java/me/Danker/TheMod.java4
-rw-r--r--src/main/java/me/Danker/utils/Utils.java8
2 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/me/Danker/TheMod.java b/src/main/java/me/Danker/TheMod.java
index 454cb9c..770a77d 100644
--- a/src/main/java/me/Danker/TheMod.java
+++ b/src/main/java/me/Danker/TheMod.java
@@ -41,9 +41,7 @@ import me.Danker.handlers.TextRenderer;
import me.Danker.utils.Utils;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
-import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.inventory.GuiChest;
-import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.event.ClickEvent;
@@ -1460,7 +1458,7 @@ public class TheMod
} else {
colour = 0xBFFEBBD1; // Pink
}
- Utils.drawOnSlot(slot.xDisplayPosition, slot.yDisplayPosition, colour);
+ Utils.drawOnSlot(inventory.inventorySlots.inventorySlots.size(), slot.xDisplayPosition, slot.yDisplayPosition, colour);
}
}
}
diff --git a/src/main/java/me/Danker/utils/Utils.java b/src/main/java/me/Danker/utils/Utils.java
index 16f790a..0a6cebc 100644
--- a/src/main/java/me/Danker/utils/Utils.java
+++ b/src/main/java/me/Danker/utils/Utils.java
@@ -12,11 +12,9 @@ import me.Danker.handlers.TextRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.ScaledResolution;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
import net.minecraft.scoreboard.ScoreObjective;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.StringUtils;
@@ -126,12 +124,14 @@ public class Utils {
return result;
}
- public static void drawOnSlot(int xSlotPos, int ySlotPos, int colour) {
+ public static void drawOnSlot(int size, int xSlotPos, int ySlotPos, int colour) {
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
int guiLeft = (sr.getScaledWidth() - 176) / 2;
int guiTop = (sr.getScaledHeight() - 221) / 2;
int x = guiLeft + xSlotPos;
int y = guiTop + ySlotPos;
+ // Move down when chest isn't 6 rows
+ if (size != 90) y += (6 - (size - 36) / 9) * 9;
GL11.glTranslated(0, 0, 1);
Gui.drawRect(x, y, x + 16, y + 16, colour);