Package info.u_team.u_team_core.menu
Class UBlockEntityContainerMenu<T extends net.minecraft.world.level.block.entity.BlockEntity>
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
info.u_team.u_team_core.menu.UAbstractContainerMenu
info.u_team.u_team_core.menu.FluidContainerMenu
info.u_team.u_team_core.menu.UContainerMenu
info.u_team.u_team_core.menu.UBlockEntityContainerMenu<T>
public abstract class UBlockEntityContainerMenu<T extends net.minecraft.world.level.block.entity.BlockEntity>
extends UContainerMenu
-
Nested Class Summary
Nested classes/interfaces inherited from class info.u_team.u_team_core.menu.FluidContainerMenu
FluidContainerMenu.FluidContainerDelegator -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Tprotected final net.minecraft.world.entity.player.InventoryFields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, lastSlots, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots -
Constructor Summary
ConstructorsConstructorDescriptionUBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer) This is the client constructor.UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer, boolean callInit) This is the client constructor.UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, T blockEntity) This is the server constructor.UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, T blockEntity, boolean callInit) This is the server constructor. -
Method Summary
Modifier and TypeMethodDescriptionGets the block entityprotected abstract voidinit(NetworkEnvironment environment) Is called after the server and client constructor.Methods inherited from class info.u_team.u_team_core.menu.UContainerMenu
addDataHolderToClient, addDataHolderToServer, broadcastChanges, broadcastChangesToServer, sendAllDataToRemote, setDataHolder, stillValidMethods inherited from class info.u_team.u_team_core.menu.FluidContainerMenu
broadcastFullState, getDelegatorMethods inherited from class info.u_team.u_team_core.menu.UAbstractContainerMenu
addPlayerInventory, addSlots, addSlots, getLastSlots, getSynchronizerPlayer, initMenu, setSynchronizerPlayerMethods inherited from class net.minecraft.world.inventory.AbstractContainerMenu
addDataSlot, addDataSlots, addSlot, addSlotListener, canDragTo, canItemQuickReplace, canTakeItemForPickAll, checkContainerDataCount, checkContainerSize, clearContainer, clicked, clickMenuButton, findSlot, getCarried, getItems, getQuickcraftHeader, getQuickcraftMask, getQuickCraftPlaceCount, getQuickcraftType, getRedstoneSignalFromBlockEntity, getRedstoneSignalFromContainer, getSlot, getStateId, getType, incrementStateId, initializeContents, isValidQuickcraftType, isValidSlotIndex, moveItemStackTo, quickMoveStack, removed, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, suppressRemoteUpdates, transferState
-
Field Details
-
playerInventory
protected final net.minecraft.world.entity.player.Inventory playerInventory -
blockEntity
-
-
Constructor Details
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, T blockEntity) This is the server constructor. The methodinit(NetworkEnvironment)is called.- Parameters:
menuType- Menu typecontainerId- Container idplayerInventory- Player inventoryblockEntity- Block entity
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, T blockEntity, boolean callInit) This is the server constructor.- Parameters:
menuType- Menu typecontainerId- Container idplayerInventory- Player inventoryblockEntity- Block entitycallInit- If the constructor should callinit(NetworkEnvironment)
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer) This is the client constructor. This methods reads the block entity pos from the suppliedFriendlyByteBufand tries to get the block entity at the client side. The block pos must be the first entry in the buffer! The methodinit(NetworkEnvironment)is called.- Parameters:
menuType- Menu typecontainerId- Container idplayerInventory- Player inventorybuffer- Initial menu data (specified withMenuUtil.openMenu(net.minecraft.server.level.ServerPlayer, net.minecraft.world.MenuProvider, java.util.function.Consumer, boolean))
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf buffer, boolean callInit) This is the client constructor. This methods reads the block entity pos from the suppliedFriendlyByteBufand tries to get the block entity at the client side. The block pos must be the first entry in the buffer!- Parameters:
menuType- Menu typecontainerId- Container idplayerInventory- Player inventorybuffer- Initial menu data (specified withMenuUtil.openMenu(net.minecraft.server.level.ServerPlayer, net.minecraft.world.MenuProvider, java.util.function.Consumer, boolean))callInit- If the constructor should callinit(NetworkEnvironment)
-
-
Method Details
-
init
Is called after the server and client constructor. If you want to use your own fields in the init method, set the last constructor boolean to false and then call this method in all constructors of the implementing class.- Parameters:
environment- Logical side this method is called on
-
getBlockEntity
Gets the block entity- Returns:
- Block entity associated with this menu
-