Package info.u_team.u_team_core.menu
Klasse UAbstractContainerMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
info.u_team.u_team_core.menu.UAbstractContainerMenu
- Bekannte direkte Unterklassen:
FluidContainerMenu
public abstract class UAbstractContainerMenu
extends net.minecraft.world.inventory.AbstractContainerMenu
Enhanced version of
AbstractContainerMenu with the benefit that the player that opened the container is known
and a method is called when the container is opened on the logical server. Furthermore adds some convenience methods
to add multiple slots.-
Feldübersicht
Von Klasse geerbte Felder 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 -
Konstruktorübersicht
KonstruktorenModifiziererKonstruktorBeschreibungprotectedUAbstractContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId) Creates a container menu. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected voidaddPlayerInventory(net.minecraft.world.entity.player.Inventory playerInventory, int x, int y) This methods adds a player inventory to the container.protected voidaddSlots(ItemSlotCreator slotCreator, int rows, int columns, int x, int y) This methods can add anyItemSlotCreatorto this menu.protected voidaddSlots(ItemSlotCreator slotCreator, int startIndex, int rows, int columns, int x, int y) This methods can add anyItemSlotCreatorto this menu.protected List<net.minecraft.world.item.ItemStack> Returns the last slot list that is used to check if a stack has changed since last check.final net.minecraft.server.level.ServerPlayerReturns the player that opened the container and should be used for synchronizing purposes.voidinitMenu(net.minecraft.server.level.ServerPlayer player) Will be called immediately after thesetSynchronizerPlayer(ServerPlayer).final voidsetSynchronizerPlayer(net.minecraft.server.level.ServerPlayer player) Do not call your self.Von Klasse geerbte Methoden 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, moveItemStackTo, quickMoveStack, removed, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, setCarried, setData, setItem, setRemoteCarried, setRemoteSlot, setRemoteSlotNoCopy, setSynchronizer, slotsChanged, stillValid, stillValid, suppressRemoteUpdates, transferState
-
Konstruktordetails
-
UAbstractContainerMenu
protected UAbstractContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId) Creates a container menu. Must be implemented by a sub class to be used.- Parameter:
menuType- Menu typecontainerId- Container id
-
-
Methodendetails
-
setSynchronizerPlayer
public final void setSynchronizerPlayer(net.minecraft.server.level.ServerPlayer player) Do not call your self. Will be called from an asm hook insideServerPlayer.initMenu(AbstractContainerMenu). This method sets player that has the container opened. Will be called beforeAbstractContainerMenu.setSynchronizer(net.minecraft.world.inventory.ContainerSynchronizer)so that method can be used for synchronizing already.- Parameter:
player- Server player that opened the container
-
getSynchronizerPlayer
public final net.minecraft.server.level.ServerPlayer getSynchronizerPlayer()Returns the player that opened the container and should be used for synchronizing purposes.- Gibt zurück:
- Server player that opened the container
-
initMenu
public void initMenu(net.minecraft.server.level.ServerPlayer player) Will be called immediately after thesetSynchronizerPlayer(ServerPlayer).- Parameter:
player- Server player that opened the container
-
getLastSlots
Returns the last slot list that is used to check if a stack has changed since last check. The list should not be modified manually.- Gibt zurück:
- List with item stacks
-
addPlayerInventory
protected void addPlayerInventory(net.minecraft.world.entity.player.Inventory playerInventory, int x, int y) This methods adds a player inventory to the container.- Parameter:
playerInventory- Player inventoryx- Start xy- Start y
-