aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-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);