Class BaseCrateMenu

java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
com.hbm_m.inventory.menu.BaseCrateMenu
Direct Known Subclasses:
DeshCrateMenu, IronCrateMenu, SteelCrateMenu, TemplateCrateMenu, TungstenCrateMenu

public abstract class BaseCrateMenu extends net.minecraft.world.inventory.AbstractContainerMenu
Базовое меню для всех ящиков HBM. Содержит общую логику: CrateSlot с валидацией, ProtectedSlot для хотбара, quickMoveStack и стандартное расположение слотов.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final BaseCrateBlockEntity
     
    protected final CrateType
     
    protected final net.minecraft.world.level.Level
     

    Fields inherited from class net.minecraft.world.inventory.AbstractContainerMenu

    CARRIED_SLOT_SIZE, containerId, 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
    Modifier
    Constructor
    Description
    protected
    BaseCrateMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory inv, BaseCrateBlockEntity blockEntity, CrateType crateType)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract net.minecraft.world.level.block.Block
    Блок, к которому привязано меню (для stillValid).
     
    net.minecraft.world.item.ItemStack
    quickMoveStack(net.minecraft.world.entity.player.Player player, int index)
     
    boolean
    stillValid(net.minecraft.world.entity.player.Player player)
     

    Methods inherited from class 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, removed, removeSlotListener, resetQuickCraft, resumeRemoteUpdates, sendAllDataToRemote, 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

    • blockEntity

      protected final BaseCrateBlockEntity blockEntity
    • level

      protected final net.minecraft.world.level.Level level
    • crateType

      protected final CrateType crateType
  • Constructor Details

    • BaseCrateMenu

      protected BaseCrateMenu(net.minecraft.world.inventory.MenuType<?> menuType, int containerId, net.minecraft.world.entity.player.Inventory inv, BaseCrateBlockEntity blockEntity, CrateType crateType)
  • Method Details

    • getBlock

      protected abstract net.minecraft.world.level.block.Block getBlock()
      Блок, к которому привязано меню (для stillValid).
    • quickMoveStack

      @NotNull public net.minecraft.world.item.ItemStack quickMoveStack(@NotNull net.minecraft.world.entity.player.Player player, int index)
      Specified by:
      quickMoveStack in class net.minecraft.world.inventory.AbstractContainerMenu
    • stillValid

      public boolean stillValid(@NotNull net.minecraft.world.entity.player.Player player)
      Specified by:
      stillValid in class net.minecraft.world.inventory.AbstractContainerMenu
    • getBlockEntity

      public BaseCrateBlockEntity getBlockEntity()