Class UBlockEntityContainerMenu<T extends net.minecraft.world.level.block.entity.BlockEntity>

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu

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

    Fields
    Modifier and Type
    Field
    Description
    protected final T
     
    protected final net.minecraft.world.entity.player.Inventory
     

    Fields 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

    Constructors
    Constructor
    Description
    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.
    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 Type
    Method
    Description
    Gets the block entity
    protected abstract void
    init(NetworkEnvironment environment)
    Is called after the server and client constructor.

    Methods inherited from class info.u_team.u_team_core.menu.FluidContainerMenu

    broadcastFullState, getDelegator

    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, 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • playerInventory

      protected final net.minecraft.world.entity.player.Inventory playerInventory
    • blockEntity

      protected final T extends net.minecraft.world.level.block.entity.BlockEntity 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 method init(NetworkEnvironment) is called.
      Parameters:
      menuType - Menu type
      containerId - Container id
      playerInventory - Player inventory
      blockEntity - 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 type
      containerId - Container id
      playerInventory - Player inventory
      blockEntity - Block entity
      callInit - If the constructor should call init(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 supplied FriendlyByteBuf and tries to get the block entity at the client side. The block pos must be the first entry in the buffer! The method init(NetworkEnvironment) is called.
      Parameters:
      menuType - Menu type
      containerId - Container id
      playerInventory - Player inventory
      buffer - Initial menu data (specified with MenuUtil.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 supplied FriendlyByteBuf 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 type
      containerId - Container id
      playerInventory - Player inventory
      buffer - Initial menu data (specified with MenuUtil.openMenu(net.minecraft.server.level.ServerPlayer, net.minecraft.world.MenuProvider, java.util.function.Consumer, boolean))
      callInit - If the constructor should call init(NetworkEnvironment)
  • Method Details

    • init

      protected abstract void init(NetworkEnvironment environment)
      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

      public T getBlockEntity()
      Gets the block entity
      Returns:
      Block entity associated with this menu