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

    Konstruktoren
    Modifizierer
    Konstruktor
    Beschreibung
    protected
    UAbstractContainerMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId)
    Creates a container menu.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    protected void
    addPlayerInventory(net.minecraft.world.entity.player.Inventory playerInventory, int x, int y)
    This methods adds a player inventory to the container.
    protected void
    addSlots(ItemSlotCreator slotCreator, int rows, int columns, int x, int y)
    This methods can add any ItemSlotCreator to this menu.
    protected void
    addSlots(ItemSlotCreator slotCreator, int startIndex, int rows, int columns, int x, int y)
    This methods can add any ItemSlotCreator to 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.ServerPlayer
    Returns the player that opened the container and should be used for synchronizing purposes.
    void
    initMenu(net.minecraft.server.level.ServerPlayer player)
    Will be called immediately after the setSynchronizerPlayer(ServerPlayer).
    final void
    setSynchronizerPlayer(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

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 type
      containerId - 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 inside ServerPlayer.initMenu(AbstractContainerMenu). This method sets player that has the container opened. Will be called before AbstractContainerMenu.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 the setSynchronizerPlayer(ServerPlayer).
      Parameter:
      player - Server player that opened the container
    • getLastSlots

      protected List<net.minecraft.world.item.ItemStack> 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 inventory
      x - Start x
      y - Start y
    • addSlots

      protected void addSlots(ItemSlotCreator slotCreator, int rows, int columns, int x, int y)
      This methods can add any ItemSlotCreator to this menu.
      Parameter:
      slotCreator - Slot creator
      rows - Slot rows
      columns - Slot columns
      x - Start x
      y - Start y
    • addSlots

      protected void addSlots(ItemSlotCreator slotCreator, int startIndex, int rows, int columns, int x, int y)
      This methods can add any ItemSlotCreator to this menu.
      Parameter:
      slotCreator - Slot creator
      startIndex - Start index of inventory
      rows - Slot rows
      columns - Slot columns
      x - Start x
      y - Start y