Class ContainerBuildingInventory
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
com.minecolonies.api.inventory.container.ContainerBuildingInventory
public class ContainerBuildingInventory
extends net.minecraft.world.inventory.AbstractContainerMenu
Container for Mie
-
Field Summary
Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsConstructorDescriptionContainerBuildingInventory(int windowId, net.minecraft.world.entity.player.Inventory inv, int colonyId, net.minecraft.core.BlockPos pos) Constructor to create an instance of this container. -
Method Summary
Modifier and TypeMethodDescriptionstatic ContainerBuildingInventoryfromFriendlyByteBuf(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.FriendlyByteBuf packetBuffer) Deserialize packet buffer to container instance.intgetSize()Get the size of the inventory.protected booleanmoveItemStackTo(net.minecraft.world.item.ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) net.minecraft.world.item.ItemStackquickMoveStack(net.minecraft.world.entity.player.Player playerIn, int index) Handle when the stack in slotindexis shift-clicked.voidremoved(net.minecraft.world.entity.player.Player playerIn) Called when the container is closed.booleanstillValid(@NotNull net.minecraft.world.entity.player.Player playerIn) Determines whether supplied player can use this containerMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, broadcastChanges, broadcastFullState, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Constructor Details
-
ContainerBuildingInventory
public ContainerBuildingInventory(int windowId, net.minecraft.world.entity.player.Inventory inv, int colonyId, net.minecraft.core.BlockPos pos) Constructor to create an instance of this container.- Parameters:
windowId- the id of the window.inv- the player inventory.colonyId- colony idpos- te world pos
-
-
Method Details
-
fromFriendlyByteBuf
public static ContainerBuildingInventory fromFriendlyByteBuf(int windowId, net.minecraft.world.entity.player.Inventory inv, net.minecraft.network.FriendlyByteBuf packetBuffer) Deserialize packet buffer to container instance.- Parameters:
windowId- the id of the window.inv- the player inventory.packetBuffer- network buffer- Returns:
- new instance
-
quickMoveStack
public net.minecraft.world.item.ItemStack quickMoveStack(net.minecraft.world.entity.player.Player playerIn, int index) Handle when the stack in slotindexis shift-clicked. Normally this moves the stack between the player inventory and the other inventory(s).- Specified by:
quickMoveStackin classnet.minecraft.world.inventory.AbstractContainerMenu- Parameters:
playerIn- Player that interacted with thisContainer.index- Index of theSlot. This index is relative to the list of slots in thisAbstractContainerMenu,AbstractContainerMenu.slots.
-
moveItemStackTo
protected boolean moveItemStackTo(net.minecraft.world.item.ItemStack stack, int startIndex, int endIndex, boolean reverseDirection) - Overrides:
moveItemStackToin classnet.minecraft.world.inventory.AbstractContainerMenu
-
removed
public void removed(net.minecraft.world.entity.player.Player playerIn) Called when the container is closed.- Overrides:
removedin classnet.minecraft.world.inventory.AbstractContainerMenu
-
stillValid
public boolean stillValid(@NotNull @NotNull net.minecraft.world.entity.player.Player playerIn) Determines whether supplied player can use this container- Specified by:
stillValidin classnet.minecraft.world.inventory.AbstractContainerMenu
-
getSize
public int getSize()Get the size of the inventory.- Returns:
- the size.
-