This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
Twine/src/main/java/com/thebrokenrail/twine/util/BackpackScreenHandler.java

24 lines
1.1 KiB
Java

package com.thebrokenrail.twine.util;
import com.thebrokenrail.twine.Twine;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.screen.GenericContainerScreenHandler;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Hand;
public class BackpackScreenHandler extends GenericContainerScreenHandler {
public BackpackScreenHandler(int i, PlayerInventory playerInventory, PacketByteBuf buf) {
this(i, playerInventory, buf.readBoolean(), buf.readEnumConstant(Hand.class));
}
public BackpackScreenHandler(int i, PlayerInventory playerInventory, boolean large, Hand hand) {
this(Twine.BACKPACK_SCREEN_TYPE, i, playerInventory, new BackpackInventory(9 * (large ? 6 : 3), playerInventory.player, hand));
}
public BackpackScreenHandler(ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, Inventory inventory) {
super(type, syncId, playerInventory, inventory, inventory.size() / 9);
}
}