Compare commits

..

No commits in common. "5afafaa9cb09e833c46528b374bdf495632166d2" and "e622b3d9bb61b7ae9d961aa640867cf54bf2647b" have entirely different histories.

7 changed files with 241 additions and 285 deletions

View file

@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx4G
org.gradle.parallel = true
# Mod Properties
version = 2.0.4
version = 2.0.3
maven_group = pm.c7.scout
archives_base_name = Scout

View file

@ -5,11 +5,12 @@ import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRendererRegistrationCallback;
import net.fabricmc.fabric.api.client.rendering.v1.TooltipComponentCallback;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen;
import net.minecraft.entity.EntityType;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import net.minecraft.util.collection.DefaultedList;
@ -119,114 +120,83 @@ public class ScoutClient implements ClientModInitializer {
return;
}
var handledScreenAccessor = (HandledScreenAccessor<?>) handledScreen;
ScreenHandler handler = handledScreenAccessor.getHandler();
var handledScreenAccessor = (HandledScreenAccessor) handledScreen;
var playerInventory = client.player.getInventory();
int x = 0;
int y = 0;
var sx = handledScreenAccessor.getX();
var sy = handledScreenAccessor.getY();
var sw = handledScreenAccessor.getBackgroundWidth();
var sh = handledScreenAccessor.getBackgroundHeight();
// satchel
var _hotbarSlot1 = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 0).findFirst();
Slot hotbarSlot1 = _hotbarSlot1.isPresent() ? _hotbarSlot1.get() : null;
if (hotbarSlot1 != null) {
if (!hotbarSlot1.isEnabled()) {
for (int i = 0; i < ScoutUtil.MAX_SATCHEL_SLOTS; i++) {
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.SATCHEL_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(Integer.MAX_VALUE);
slot.setY(Integer.MAX_VALUE);
}
}
} else {
x = hotbarSlot1.x;
y = hotbarSlot1.y + 27;
int x = sx;
int y = sy + sh + 2;
for (int i = 0; i < ScoutUtil.MAX_SATCHEL_SLOTS; i++) {
if (i % 9 == 0) {
x = hotbarSlot1.x;
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.SATCHEL_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x);
slot.setY(y);
}
for (int i = 0; i < ScoutUtil.MAX_SATCHEL_SLOTS; i++) {
if (i % 9 == 0) {
x = sx + 8;
}
x += 18;
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.SATCHEL_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x - sx);
slot.setY(y - sy);
}
if ((i + 1) % 9 == 0) {
y += 18;
}
}
x += 18;
if ((i + 1) % 9 == 0) {
y += 18;
}
}
// left pouch
var _topLeftSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 9).findFirst();
Slot topLeftSlot = _topLeftSlot.isPresent() ? _topLeftSlot.get() : null;
if (topLeftSlot != null) {
if (!topLeftSlot.isEnabled()) {
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.LEFT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(Integer.MAX_VALUE);
slot.setY(Integer.MAX_VALUE);
}
}
} else {
x = topLeftSlot.x;
y = topLeftSlot.y - 18;
x = sx + 8;
y = (sy + sh) - 100;
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
if (i % 3 == 0) {
x -= 18;
y += 54;
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.LEFT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x);
slot.setY(y);
}
y -= 18;
}
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
if (i % 3 == 0) {
x -= 18;
y += 54;
}
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.LEFT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x - sx);
slot.setY(y - sy);
}
y -= 18;
}
// right pouch
var _topRightSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 17).findFirst();
Slot topRightSlot = _topRightSlot.isPresent() ? _topRightSlot.get() : null;
if (topRightSlot != null) {
if (!topLeftSlot.isEnabled()) {
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.RIGHT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(Integer.MAX_VALUE);
slot.setY(Integer.MAX_VALUE);
}
}
} else {
x = topRightSlot.x;
y = topRightSlot.y - 18;
x = sx + sw - 24;
y = (sy + sh) - 100;
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
if (i % 3 == 0) {
x += 18;
y += 54;
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.RIGHT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x);
slot.setY(y);
}
y -= 18;
}
for (int i = 0; i < ScoutUtil.MAX_POUCH_SLOTS; i++) {
if (i % 3 == 0) {
x += 18;
y += 54;
}
BagSlot slot = (BagSlot) ScoutUtil.getBagSlot(ScoutUtil.RIGHT_POUCH_SLOT_START - i, client.player.playerScreenHandler);
if (slot != null) {
slot.setX(x - sx);
slot.setY(y - sy);
}
y -= 18;
}
}
});

View file

@ -4,7 +4,9 @@ import org.jetbrains.annotations.Nullable;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.BeaconScreen;
import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen;
import net.minecraft.client.gui.screen.ingame.MerchantScreen;
import net.minecraft.screen.PlayerScreenHandler;
public class ScoutUtilClient {
@ -19,6 +21,8 @@ public class ScoutUtilClient {
// FIXME: registry system for mods to register their own blacklisted screens
public static boolean isScreenBlacklisted(Screen screen) {
return screen instanceof CreativeInventoryScreen;
return screen instanceof CreativeInventoryScreen
|| screen instanceof MerchantScreen // FIXME: needs repositioning
|| screen instanceof BeaconScreen; // FIXME: needs repositioning
}
}

View file

@ -4,10 +4,10 @@ import dev.emi.emi.api.EmiPlugin;
import dev.emi.emi.api.EmiRegistry;
import dev.emi.emi.api.widget.Bounds;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
import pm.c7.scout.ScoutUtil;
import pm.c7.scout.client.ScoutUtilClient;
import pm.c7.scout.item.BaseBagItem;
@ -23,34 +23,30 @@ public class ScoutEmiPlugin implements EmiPlugin {
MinecraftClient client = MinecraftClient.getInstance();
var handledScreenAccessor = (HandledScreenAccessor<?>) handledScreen;
ScreenHandler handler = handledScreenAccessor.getHandler();
var handledScreenAccessor = (HandledScreenAccessor) handledScreen;
var sx = handledScreenAccessor.getX();
var sy = handledScreenAccessor.getY();
var sw = handledScreenAccessor.getBackgroundWidth();
var sh = handledScreenAccessor.getBackgroundHeight();
var playerInventory = client.player.getInventory();
ItemStack satchelStack = ScoutUtil.findBagItem(client.player, BagType.SATCHEL, false);
if (!satchelStack.isEmpty()) {
BaseBagItem bagItem = (BaseBagItem) satchelStack.getItem();
int slots = bagItem.getSlotCount();
int rows = (int) Math.ceil(slots / 9);
var _hotbarSlot1 = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 0).findFirst();
Slot hotbarSlot1 = _hotbarSlot1.isPresent() ? _hotbarSlot1.get() : null;
if (hotbarSlot1 != null) {
if (hotbarSlot1.isEnabled()) {
int x = sx + hotbarSlot1.x - 8;
int y = sy + hotbarSlot1.y + 22;
int x = sx;
int y = sy + sh;
int w = 176;
int h = (rows * 18) + 8;
consumer.accept(new Bounds(x, y, w, h));
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
int w = sw;
int h = (rows * 18) + 8;
consumer.accept(new Bounds(x, y, w, h));
}
ItemStack leftPouchStack = ScoutUtil.findBagItem(client.player, BagType.POUCH, false);
@ -59,19 +55,17 @@ public class ScoutEmiPlugin implements EmiPlugin {
int slots = bagItem.getSlotCount();
int columns = (int) Math.ceil(slots / 3);
var _topLeftSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 9).findFirst();
Slot topLeftSlot = _topLeftSlot.isPresent() ? _topLeftSlot.get() : null;
if (topLeftSlot != null) {
if (topLeftSlot.isEnabled()) {
int x = sx + topLeftSlot.x - 7 - (columns * 18);
int y = sy + topLeftSlot.y;
int x = sx - (columns * 18);
int y = (sy + sh) - 100;
int w = (columns * 18) + 7;
int h = 68;
consumer.accept(new Bounds(x, y, w, h));
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
int w = (columns * 18);
int h = 68;
consumer.accept(new Bounds(x, y, w, h));
}
ItemStack rightPouchStack = ScoutUtil.findBagItem(client.player, BagType.POUCH, true);
@ -80,19 +74,17 @@ public class ScoutEmiPlugin implements EmiPlugin {
int slots = bagItem.getSlotCount();
int columns = (int) Math.ceil(slots / 3);
var _topRightSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 17).findFirst();
Slot topRightSlot = _topRightSlot.isPresent() ? _topRightSlot.get() : null;
if (topRightSlot != null) {
if (topRightSlot.isEnabled()) {
int x = sx + topRightSlot.x;
int y = sy + topRightSlot.y;
int x = sx + sw;
int y = (sy + sh) - 100;
int w = (columns * 18) + 7;
int h = 68;
consumer.accept(new Bounds(x, y, w, h));
}
if (screen instanceof GenericContainerScreen || screen instanceof ShulkerBoxScreen) {
y -= 1;
}
int w = (columns * 18);
int h = 68;
consumer.accept(new Bounds(x, y, w, h));
}
});
}

View file

@ -9,7 +9,6 @@ import net.minecraft.screen.slot.SlotActionType;
import net.minecraft.util.collection.DefaultedList;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Dynamic;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
@ -46,7 +45,6 @@ public abstract class ScreenHandlerMixin {
}
}
@Dynamic("Workaround for Debugify. Other calls are modified via the attached transformer class.")
@Redirect(method = "internalOnSlotClick", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/collection/DefaultedList;get(I)Ljava/lang/Object;", ordinal = 5))
public Object scout$fixSlotIndexing(DefaultedList<Slot> self, int index, int slotIndex, int button, SlotActionType actionType, PlayerEntity player) {
if (ScoutUtil.isBagSlot(index)) {

View file

@ -3,14 +3,12 @@ package pm.c7.scout.mixin.client;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.screen.ScreenHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;
@Environment(EnvType.CLIENT)
@Mixin(HandledScreen.class)
public interface HandledScreenAccessor<T extends ScreenHandler> {
public interface HandledScreenAccessor {
@Accessor("x")
int getX();
@Accessor("y")
@ -19,6 +17,4 @@ public interface HandledScreenAccessor<T extends ScreenHandler> {
int getBackgroundWidth();
@Accessor("backgroundHeight")
int getBackgroundHeight();
@Accessor("handler")
T getHandler();
}

View file

@ -4,8 +4,10 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.ingame.GenericContainerScreen;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
import net.minecraft.client.gui.screen.ingame.ShulkerBoxScreen;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.slot.Slot;
@ -41,58 +43,54 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
protected int backgroundWidth;
@Shadow
protected int backgroundHeight;
@Shadow
protected T handler;
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/ingame/HandledScreen;drawBackground(Lnet/minecraft/client/gui/DrawContext;FII)V"))
private void scout$drawSatchelRow(DrawContext graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (this.client != null && this.client.player != null && !ScoutUtilClient.isScreenBlacklisted(this)) {
var playerInventory = this.client.player.getInventory();
ItemStack backStack = ScoutUtil.findBagItem(this.client.player, BaseBagItem.BagType.SATCHEL, false);
if (!backStack.isEmpty()) {
BaseBagItem bagItem = (BaseBagItem) backStack.getItem();
int slots = bagItem.getSlotCount();
var _hotbarSlot1 = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 0).findFirst();
Slot hotbarSlot1 = _hotbarSlot1.isPresent() ? _hotbarSlot1.get() : null;
if (hotbarSlot1 != null) {
int x = this.x + hotbarSlot1.x - 8;
int y = this.y + hotbarSlot1.y + 22;
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
int x = this.x;
int y = this.y + this.backgroundHeight - 3;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 32, 176, 4);
y += 4;
if ((Object) this instanceof GenericContainerScreen || (Object) this instanceof ShulkerBoxScreen) {
y -= 1;
}
int u = 0;
int v = 36;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 32, 176, 4);
y += 4;
for (int slot = 0; slot < slots; slot++) {
if (slot % 9 == 0) {
x = this.x + hotbarSlot1.x - 8;
u = 0;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 7, 18);
x += 7;
u += 7;
}
int u = 0;
int v = 36;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 18, 18);
x += 18;
u += 18;
if ((slot + 1) % 9 == 0) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 7, 18);
y += 18;
}
for (int slot = 0; slot < slots; slot++) {
if (slot % 9 == 0) {
x = this.x;
u = 0;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 7, 18);
x += 7;
u += 7;
}
x = this.x + hotbarSlot1.x - 8;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 54, 176, 7);
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 18, 18);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
x += 18;
u += 18;
if ((slot + 1) % 9 == 0) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, u, v, 7, 18);
y += 18;
}
}
x = this.x;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 54, 176, 7);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
}
}
}
@ -100,72 +98,70 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;disableDepthTest()V", remap = false))
private void scout$drawPouchSlots(DrawContext graphics, int mouseX, int mouseY, float delta, CallbackInfo ci) {
if (this.client != null && this.client.player != null && !ScoutUtilClient.isScreenBlacklisted(this)) {
var playerInventory = this.client.player.getInventory();
ItemStack leftPouchStack = ScoutUtil.findBagItem(this.client.player, BaseBagItem.BagType.POUCH, false);
if (!leftPouchStack.isEmpty()) {
BaseBagItem bagItem = (BaseBagItem) leftPouchStack.getItem();
int slots = bagItem.getSlotCount();
int columns = (int) Math.ceil(slots / 3);
var _topLeftSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 9).findFirst();
Slot topLeftSlot = _topLeftSlot.isPresent() ? _topLeftSlot.get() : null;
if (topLeftSlot != null) {
int x = this.x + topLeftSlot.x - 8;
int y = this.y + topLeftSlot.y + 53;
int x = this.x;
int y = (this.y + this.backgroundHeight) - 29;
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 18, 25, 7, 7);
for (int i = 0; i < columns; i++) {
x -= 11;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 11, 7);
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 7, 7);
}
}
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 25, 7, 7);
x = this.x + topLeftSlot.x - 1;
y -= 54;
for (int slot = 0; slot < slots; slot++) {
if (slot % 3 == 0) {
x -= 18;
y += 54;
}
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 7, 18, 18);
}
x -= 7;
y += 54;
for (int i = 0; i < 3; i++) {
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 7, 7, 18);
}
x = this.x + topLeftSlot.x - 8;
y -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 18, 0, 7, 7);
for (int i = 0; i < columns; i++) {
x -= 11;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 11, 7);
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 7, 7);
}
}
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 0, 7, 7);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
if ((Object) this instanceof GenericContainerScreen || (Object) this instanceof ShulkerBoxScreen) {
y -= 1;
}
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 18, 25, 7, 7);
for (int i = 0; i < columns; i++) {
x -= 11;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 11, 7);
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 7, 7);
}
}
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 25, 7, 7);
x = this.x + 7;
y -= 54;
for (int slot = 0; slot < slots; slot++) {
if (slot % 3 == 0) {
x -= 18;
y += 54;
}
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 7, 18, 18);
}
x -= 7;
y += 54;
for (int i = 0; i < 3; i++) {
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 7, 7, 18);
}
x = this.x;
y -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 18, 0, 7, 7);
for (int i = 0; i < columns; i++) {
x -= 11;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 11, 7);
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 7, 7);
}
}
x -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 0, 0, 7, 7);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
}
ItemStack rightPouchStack = ScoutUtil.findBagItem(this.client.player, BaseBagItem.BagType.POUCH, true);
@ -174,64 +170,64 @@ public abstract class HandledScreenMixin<T extends ScreenHandler> extends Screen
int slots = bagItem.getSlotCount();
int columns = (int) Math.ceil(slots / 3);
var _topRightSlot = handler.slots.stream().filter(slot->slot.inventory.equals(playerInventory) && slot.getIndex() == 17).findFirst();
Slot topRightSlot = _topRightSlot.isPresent() ? _topRightSlot.get() : null;
if (topRightSlot != null) {
int x = this.x + topRightSlot.x + 17;
int y = this.y + topRightSlot.y + 53;
int x = this.x + this.backgroundWidth - 7;
int y = (this.y + this.backgroundHeight) - 29;
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 25, 25, 7, 7);
x += 7;
for (int i = 0; i < columns; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 11, 7);
x += 11;
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 7, 7);
x += 7;
}
}
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 25, 7, 7);
x = this.x + topRightSlot.x - 1;
y -= 54;
for (int slot = 0; slot < slots; slot++) {
if (slot % 3 == 0) {
x += 18;
y += 54;
}
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 7, 18, 18);
}
x += 18;
y += 54;
for (int i = 0; i < 3; i++) {
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 7, 7, 18);
}
x = this.x + topRightSlot.x + 17;
y -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 25, 0, 7, 7);
x += 7;
for (int i = 0; i < columns; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 11, 7);
x += 11;
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 7, 7);
x += 7;
}
}
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 0, 7, 7);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
if ((Object) this instanceof GenericContainerScreen || (Object) this instanceof ShulkerBoxScreen) {
y -= 1;
}
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 25, 25, 7, 7);
x += 7;
for (int i = 0; i < columns; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 11, 7);
x += 11;
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 25, 7, 7);
x += 7;
}
}
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 25, 7, 7);
x = this.x + this.backgroundWidth - 25;
y -= 54;
for (int slot = 0; slot < slots; slot++) {
if (slot % 3 == 0) {
x += 18;
y += 54;
}
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 7, 18, 18);
}
x += 18;
y += 54;
for (int i = 0; i < 3; i++) {
y -= 18;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 7, 7, 18);
}
x = this.x + this.backgroundWidth - 7;
y -= 7;
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 25, 0, 7, 7);
x += 7;
for (int i = 0; i < columns; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 11, 7);
x += 11;
}
if (columns > 1) {
for (int i = 0; i < columns - 1; i++) {
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 7, 0, 7, 7);
x += 7;
}
}
graphics.drawTexture(ScoutUtil.SLOT_TEXTURE, x, y, 32, 0, 7, 7);
graphics.setShaderColor(1.0f, 1.0f, 1.0f, 1.0f);
}
}
}