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
Raw Normal View History

2020-06-15 23:14:36 +00:00
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) {
2020-06-16 16:21:17 +00:00
this(Twine.BACKPACK_SCREEN_TYPE, i, playerInventory, new BackpackInventory(9 * (large ? 6 : 3), playerInventory.player, hand));
2020-06-15 23:14:36 +00:00
}
public BackpackScreenHandler(ScreenHandlerType<?> type, int syncId, PlayerInventory playerInventory, Inventory inventory) {
super(type, syncId, playerInventory, inventory, inventory.size() / 9);
}
}