package info.u_team.u_team_core.menu;

import info.u_team.u_team_core.inventory.UItemStackHandler;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.SlotItemHandler;

public class ItemSlot extends SlotItemHandler {
	
	private final IItemHandler itemHandler;
	private final int slot;
	
	public ItemSlot(IItemHandler itemHandler, int slot, int x, int y) {
		super(itemHandler, slot, x, y);
		this.itemHandler = itemHandler;
		this.slot = slot;
	}
	
	@Override
	public void setChanged() {
		if (itemHandler instanceof final UItemStackHandler uItemHandler) {
			uItemHandler.onContentsChanged(slot);
		}
	}
	
}

@@ -84,32 +84,75 @@
 emStackHandler;%0A
+import net.minecraft.world.item.ItemStack;%0A
 import net.minec
@@ -669,10 +669,193 @@
 %09%7D%0A%09%7D%0A%09%0A
+%09@Override%0A%09public void initialize(ItemStack stack) %7B%0A%09%09set(stack); // TODO is this right to prevent java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0%0A%09%7D%0A%09%0A
 %7D%0A

Fix ArrayIndexOutOfBoundsException