Package net.minecraft.world.inventory
Class AbstractContainerMenu
java.lang.Object
net.minecraft.world.inventory.AbstractContainerMenu
- Direct Known Subclasses:
BeaconMenu
,BrewingStandMenu
,CartographyTableMenu
,ChestMenu
,ContainerTypeTest.TestContainer
,CrafterMenu
,CreativeModeInventoryScreen.ItemPickerMenu
,DispenserMenu
,EnchantmentMenu
,GrindstoneMenu
,HopperMenu
,HorseInventoryMenu
,ItemCombinerMenu
,LecternMenu
,LoomMenu
,MerchantMenu
,RecipeBookMenu
,ShulkerBoxMenu
,StonecutterMenu
-
Field Summary
Modifier and TypeFieldDescriptionprivate ItemStack
static final int
final int
private final List<ContainerListener>
private final NonNullList<ItemStack>
private static final org.slf4j.Logger
private final MenuType<?>
static final int
static final int
static final int
static final int
static final int
static final int
private int
private int
private ItemStack
private final it.unimi.dsi.fastutil.ints.IntList
private final NonNullList<ItemStack>
static final int
final NonNullList<Slot>
private int
private boolean
private ContainerSynchronizer
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractContainerMenu
(MenuType<?> p_38851_, int p_38852_) -
Method Summary
Modifier and TypeMethodDescriptionprotected DataSlot
addDataSlot
(DataSlot p_38896_) protected void
addDataSlots
(ContainerData p_38885_) protected Slot
void
addSlotListener
(ContainerListener p_38894_) void
void
boolean
static boolean
canItemQuickReplace
(Slot p_38900_, ItemStack p_38901_, boolean p_38902_) boolean
canTakeItemForPickAll
(ItemStack p_38908_, Slot p_38909_) protected static void
checkContainerDataCount
(ContainerData p_38887_, int p_38888_) protected static void
checkContainerSize
(Container p_38870_, int p_38871_) protected void
clearContainer
(Player p_150412_, Container p_150413_) void
boolean
clickMenuButton
(Player p_38875_, int p_38876_) private SlotAccess
private void
getItems()
static int
getQuickcraftHeader
(int p_38948_) static int
getQuickcraftMask
(int p_38931_, int p_38932_) static int
getQuickCraftPlaceCount
(Set<Slot> p_279393_, int p_279288_, ItemStack p_279172_) static int
getQuickcraftType
(int p_38929_) static int
getRedstoneSignalFromBlockEntity
(BlockEntity p_38919_) static int
getRedstoneSignalFromContainer
(Container p_38939_) getSlot
(int p_38854_) int
MenuType<?>
getType()
int
void
initializeContents
(int p_182411_, List<ItemStack> p_182412_, ItemStack p_182413_) static boolean
isValidQuickcraftType
(int p_38863_, Player p_38864_) boolean
isValidSlotIndex
(int p_207776_) protected boolean
moveItemStackTo
(ItemStack p_38904_, int p_38905_, int p_38906_, boolean p_38907_) abstract ItemStack
quickMoveStack
(Player p_38941_, int p_38942_) void
void
removeSlotListener
(ContainerListener p_38944_) protected void
void
void
void
setCarried
(ItemStack p_150439_) void
setData
(int p_38855_, int p_38856_) void
void
setRemoteCarried
(ItemStack p_150423_) void
setRemoteSlot
(int p_150405_, ItemStack p_150406_) void
setRemoteSlotNoCopy
(int p_182415_, ItemStack p_182416_) void
setSynchronizer
(ContainerSynchronizer p_150417_) void
slotsChanged
(Container p_38868_) abstract boolean
stillValid
(Player p_38874_) protected static boolean
stillValid
(ContainerLevelAccess p_38890_, Player p_38891_, Block p_38892_) void
private void
private void
synchronizeDataSlotToRemote
(int p_150441_, int p_150442_) private void
synchronizeSlotToRemote
(int p_150436_, ItemStack p_150437_, Supplier<ItemStack> p_150438_) void
transferState
(AbstractContainerMenu p_150415_) private void
triggerSlotListeners
(int p_150408_, ItemStack p_150409_, Supplier<ItemStack> p_150410_) private boolean
tryItemClickBehaviourOverride
(Player p_249615_, ClickAction p_250300_, Slot p_249384_, ItemStack p_251073_, ItemStack p_252026_) private void
updateDataSlotListeners
(int p_182421_, int p_182422_)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SLOT_CLICKED_OUTSIDE
public static final int SLOT_CLICKED_OUTSIDE- See Also:
-
QUICKCRAFT_TYPE_CHARITABLE
public static final int QUICKCRAFT_TYPE_CHARITABLE- See Also:
-
QUICKCRAFT_TYPE_GREEDY
public static final int QUICKCRAFT_TYPE_GREEDY- See Also:
-
QUICKCRAFT_TYPE_CLONE
public static final int QUICKCRAFT_TYPE_CLONE- See Also:
-
QUICKCRAFT_HEADER_START
public static final int QUICKCRAFT_HEADER_START- See Also:
-
QUICKCRAFT_HEADER_CONTINUE
public static final int QUICKCRAFT_HEADER_CONTINUE- See Also:
-
QUICKCRAFT_HEADER_END
public static final int QUICKCRAFT_HEADER_END- See Also:
-
CARRIED_SLOT_SIZE
public static final int CARRIED_SLOT_SIZE- See Also:
-
lastSlots
-
slots
-
dataSlots
-
carried
-
remoteSlots
-
remoteDataSlots
private final it.unimi.dsi.fastutil.ints.IntList remoteDataSlots -
remoteCarried
-
stateId
private int stateId -
containerId
public final int containerId -
quickcraftType
private int quickcraftType -
quickcraftStatus
private int quickcraftStatus -
quickcraftSlots
-
containerListeners
-
synchronizer
-
suppressRemoteUpdates
private boolean suppressRemoteUpdates
-
-
Constructor Details
-
AbstractContainerMenu
-
-
Method Details
-
stillValid
-
getType
-
checkContainerSize
-
checkContainerDataCount
-
isValidSlotIndex
public boolean isValidSlotIndex(int p_207776_) -
addSlot
-
addDataSlot
-
addDataSlots
-
addSlotListener
-
setSynchronizer
-
sendAllDataToRemote
public void sendAllDataToRemote() -
removeSlotListener
-
getItems
-
broadcastChanges
public void broadcastChanges() -
broadcastFullState
public void broadcastFullState() -
updateDataSlotListeners
private void updateDataSlotListeners(int p_182421_, int p_182422_) -
triggerSlotListeners
-
synchronizeSlotToRemote
-
synchronizeDataSlotToRemote
private void synchronizeDataSlotToRemote(int p_150441_, int p_150442_) -
synchronizeCarriedToRemote
private void synchronizeCarriedToRemote() -
setRemoteSlot
-
setRemoteSlotNoCopy
-
setRemoteCarried
-
clickMenuButton
-
getSlot
-
quickMoveStack
-
clicked
-
doClick
-
tryItemClickBehaviourOverride
private boolean tryItemClickBehaviourOverride(Player p_249615_, ClickAction p_250300_, Slot p_249384_, ItemStack p_251073_, ItemStack p_252026_) -
createCarriedSlotAccess
-
canTakeItemForPickAll
-
removed
-
clearContainer
-
slotsChanged
-
setItem
-
initializeContents
-
setData
public void setData(int p_38855_, int p_38856_) -
stillValid
-
moveItemStackTo
-
getQuickcraftType
public static int getQuickcraftType(int p_38929_) -
getQuickcraftHeader
public static int getQuickcraftHeader(int p_38948_) -
getQuickcraftMask
public static int getQuickcraftMask(int p_38931_, int p_38932_) -
isValidQuickcraftType
-
resetQuickCraft
protected void resetQuickCraft() -
canItemQuickReplace
-
getQuickCraftPlaceCount
-
canDragTo
-
getRedstoneSignalFromBlockEntity
-
getRedstoneSignalFromContainer
-
setCarried
-
getCarried
-
suppressRemoteUpdates
public void suppressRemoteUpdates() -
resumeRemoteUpdates
public void resumeRemoteUpdates() -
transferState
-
findSlot
-
getStateId
public int getStateId() -
incrementStateId
public int incrementStateId()
-