Utils ported

This commit is contained in:
Sebastian Hartte
2020-06-28 03:41:44 +02:00
parent 7c28a71e10
commit fee5b7fdfc
204 changed files with 1371 additions and 1737 deletions
@@ -18,21 +18,14 @@
package appeng.util.inv;
import alexiil.mc.lib.attributes.item.compat.FixedInventoryVanillaWrapper;
import alexiil.mc.lib.attributes.item.impl.DelegatingFixedItemInv;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraftforge.items.ItemStackHandler;
public class WrapperCursorItemHandler extends ItemStackHandler {
private final PlayerInventory inv;
public class WrapperCursorItemHandler extends DelegatingFixedItemInv {
public WrapperCursorItemHandler(PlayerInventory PlayerInventory) {
super(1);
this.inv = PlayerInventory;
this.setStackInSlot(0, PlayerInventory.getItemStack());
public WrapperCursorItemHandler(PlayerInventory inventory) {
super(new FixedInventoryVanillaWrapper(inventory).getSubInv(0, 1));
}
@Override
protected void onContentsChanged(int slot) {
this.inv.setItemStack(this.getStackInSlot(slot));
}
}