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.FluidSlotHandlerFunction
Nested classes/interfaces inherited from class info.u_team.u_team_core.menu.UAbstractContainerMenu
UAbstractContainerMenu.SlotContainerFunction, UAbstractContainerMenu.SlotHandlerFunction
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final T
protected final net.minecraft.world.entity.player.Inventory
Fields inherited from class info.u_team.u_team_core.menu.FluidContainerMenu
fluidSlots
Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu
CARRIED_SLOT_SIZE, containerId, containerListeners, lastSlots, QUICKCRAFT_HEADER_CONTINUE, QUICKCRAFT_HEADER_END, QUICKCRAFT_HEADER_START, QUICKCRAFT_TYPE_CHARITABLE, QUICKCRAFT_TYPE_CLONE, QUICKCRAFT_TYPE_GREEDY, SLOT_CLICKED_OUTSIDE, slots, stateId, suppressRemoteUpdates
-
Constructor Summary
ConstructorsConstructorDescriptionUBlockEntityContainerMenu
(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf byteBuf) 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 byteBuf, 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 void
init
(net.minecraftforge.fml.LogicalSide side) 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, stillValid
Methods inherited from class info.u_team.u_team_core.menu.FluidContainerMenu
addFluidSlot, addFluidSlots, addFluidSlots, addFluidSlots, addFluidSlots, broadcastFullState, fluidSlotClick, getFluidSlot, getLastFluidSlots, initializeFluidContents, setFluid, setRemoteFluidSlot, setRemoteFluidSlotNoCopy
Methods inherited from class info.u_team.u_team_core.menu.UAbstractContainerMenu
addPlayerInventory, addSlots, addSlots, addSlots, addSlots, addSlots, addSlots, addSlots, addSlots, getLastSlots, getSynchronizerPlayer, initMenu, setSynchronizerPlayer
Methods 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, getQuickCraftSlotCount, 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(LogicalSide)
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(LogicalSide)
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf byteBuf) This is the client constructor. This methods reads the block entity pos from the suppliedFriendlyByteBuf
and tries to get the block entity at the client side. The block pos must be the first entry in the buffer! The methodinit(LogicalSide)
is called.- Parameters:
menuType
- Menu typecontainerId
- Container idplayerInventory
- Player inventorybyteBuf
- Initial menu data (specified withNetworkHooks.openScreen(net.minecraft.server.level.ServerPlayer, net.minecraft.world.MenuProvider, java.util.function.Consumer)
)
-
UBlockEntityContainerMenu
public UBlockEntityContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.FriendlyByteBuf byteBuf, boolean callInit) This is the client constructor. This methods reads the block entity pos from the suppliedFriendlyByteBuf
and 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 inventorybyteBuf
- Initial menu data (specified withNetworkHooks.openScreen(net.minecraft.server.level.ServerPlayer, net.minecraft.world.MenuProvider, java.util.function.Consumer)
)callInit
- If the constructor should callinit(LogicalSide)
-
-
Method Details
-
init
protected abstract void init(net.minecraftforge.fml.LogicalSide side) 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:
side
- Logical side this method is called on
-
getBlockEntity
Gets the block entity- Returns:
- Block entity associated with this menu
-