diff options
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java b/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java index fbc9fb17..28898cdc 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/auction/AuctionHouseScreenHandler.java @@ -15,22 +15,22 @@ public class AuctionHouseScreenHandler extends GenericContainerScreenHandler { int yOffset = (rows - 4) * 18; // Shift player inventory by 2 pixels and also remove the yOffset - for (int i = rows*9; i < slots.size(); i++) { + for (int i = rows * 9; i < slots.size(); i++) { Slot slot = slots.get(i); SlotAccessor slotAccessor = (SlotAccessor) slot; - slotAccessor.setY(slot.y+2-yOffset); + slotAccessor.setY(slot.y + 2 - yOffset); } // disable ALL THE OTHER SLOTS MWAHAHAHA and also move the good ones around and stuff - for (int i = 0; i < rows*9; i++) { + for (int i = 0; i < rows * 9; i++) { int lineI = i % 9; Slot slot = slots.get(i); - if (!isView && i>9 && i<(rows-1)*9 && lineI > 1 && lineI < 8) { - int miniInventorySlot = lineI - 2 + (i/9 - 1)*6; + if (!isView && i > 9 && i < (rows - 1) * 9 && lineI > 1 && lineI < 8) { + int miniInventorySlot = lineI - 2 + (i / 9 - 1) * 6; SlotAccessor slotAccessor = (SlotAccessor) slot; - slotAccessor.setX(8 + miniInventorySlot%8 * 18); - slotAccessor.setY(18 + miniInventorySlot/8 * 18); + slotAccessor.setX(8 + miniInventorySlot % 8 * 18); + slotAccessor.setY(18 + miniInventorySlot / 8 * 18); } else { - slots.set(i, new Slot(slot.inventory, slot.getIndex(), slot.x, slot.y){ + slots.set(i, new Slot(slot.inventory, slot.getIndex(), slot.x, slot.y) { @Override public boolean isEnabled() { return false; @@ -39,8 +39,9 @@ public class AuctionHouseScreenHandler extends GenericContainerScreenHandler { } } } - + public static AuctionHouseScreenHandler of(GenericContainerScreenHandler original, boolean isView) { + assert MinecraftClient.getInstance().player != null; return new AuctionHouseScreenHandler(original.getType(), original.syncId, MinecraftClient.getInstance().player.getInventory(), |