类 Inventory
java.lang.Object
net.minecraft.world.entity.player.Inventory
-
字段概要
字段修饰符和类型字段说明final NonNullList
<ItemStack> private final List
<NonNullList<ItemStack>> static final int
final NonNullList
<ItemStack> static final int
final NonNullList
<ItemStack> final Player
static final int
int
static final int
static final int
private int
从接口继承的字段 net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
boolean
void
addAndPickItem
(ItemStack p_378587_) private int
addResource
(int p_36048_, ItemStack p_36049_) private int
addResource
(ItemStack p_36067_) void
int
clearOrCountMatchingItems
(Predicate<ItemStack> p_36023_, int p_36024_, Container p_36025_) boolean
boolean
boolean
createInventoryUpdatePacket
(int p_362278_) void
dropAll()
void
fillStackedContents
(StackedItemContents p_364670_) int
findSlotMatchingCraftingIngredient
(Holder<Item> p_363996_, ItemStack p_376934_) int
findSlotMatchingItem
(ItemStack p_36031_) getArmor
(int p_36053_) int
float
getDestroySpeed
(BlockState p_36021_) int
getItem
(int p_35991_) getName()
static int
int
getSlotWithRemainingSpace
(ItemStack p_36051_) int
int
private boolean
hasRemainingSpaceForItem
(ItemStack p_36015_, ItemStack p_36016_) boolean
isEmpty()
static boolean
isHotbarSlot
(int p_36046_) static boolean
isUsableForCrafting
(ItemStack p_362871_) void
void
pickSlot
(int p_36039_) void
placeItemBackInInventory
(ItemStack p_150080_) void
placeItemBackInInventory
(ItemStack p_150077_, boolean p_150078_) removeFromSelected
(boolean p_182404_) removeItem
(int p_35993_, int p_35994_) void
removeItem
(ItemStack p_36058_) removeItemNoUpdate
(int p_36029_) void
replaceWith
(Inventory p_36007_) void
void
void
setSelectedHotbarSlot
(int p_363017_) boolean
stillValid
(Player p_36009_) void
tick()
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
从接口继承的方法 net.minecraft.world.Nameable
getCustomName, getDisplayName, hasCustomName
-
字段详细资料
-
POP_TIME_DURATION
public static final int POP_TIME_DURATION- 另请参阅:
-
INVENTORY_SIZE
public static final int INVENTORY_SIZE- 另请参阅:
-
SELECTION_SIZE
public static final int SELECTION_SIZE- 另请参阅:
-
SLOT_OFFHAND
public static final int SLOT_OFFHAND- 另请参阅:
-
NOT_FOUND_INDEX
public static final int NOT_FOUND_INDEX- 另请参阅:
-
items
-
armor
-
offhand
-
compartments
-
selected
public int selected -
player
-
timesChanged
private int timesChanged
-
-
构造器详细资料
-
Inventory
-
-
方法详细资料
-
getSelected
-
getSelectionSize
public static int getSelectionSize() -
hasRemainingSpaceForItem
-
getFreeSlot
public int getFreeSlot() -
addAndPickItem
-
pickSlot
public void pickSlot(int p_36039_) -
isHotbarSlot
public static boolean isHotbarSlot(int p_36046_) -
findSlotMatchingItem
-
isUsableForCrafting
-
findSlotMatchingCraftingIngredient
-
getSuitableHotbarSlot
public int getSuitableHotbarSlot() -
setSelectedHotbarSlot
public void setSelectedHotbarSlot(int p_363017_) -
clearOrCountMatchingItems
-
addResource
-
addResource
-
getSlotWithRemainingSpace
-
tick
public void tick() -
add
-
add
-
placeItemBackInInventory
-
placeItemBackInInventory
-
createInventoryUpdatePacket
-
removeItem
- 指定者:
removeItem
在接口中Container
-
removeItem
-
removeItemNoUpdate
- 指定者:
removeItemNoUpdate
在接口中Container
-
setItem
-
getDestroySpeed
-
save
-
load
-
getContainerSize
public int getContainerSize()- 指定者:
getContainerSize
在接口中Container
-
isEmpty
public boolean isEmpty() -
getItem
-
getName
-
getArmor
-
dropAll
public void dropAll() -
setChanged
public void setChanged()- 指定者:
setChanged
在接口中Container
-
getTimesChanged
public int getTimesChanged() -
stillValid
- 指定者:
stillValid
在接口中Container
-
contains
-
contains
-
contains
-
replaceWith
-
clearContent
public void clearContent()- 指定者:
clearContent
在接口中Clearable
-
fillStackedContents
-
removeFromSelected
-