类 Inventory
java.lang.Object
net.minecraft.world.entity.player.Inventory
-
字段概要
字段修饰符和类型字段说明static final int[]
final NonNullList<ItemStack>
private final List<NonNullList<ItemStack>>
static final int[]
static final int
final NonNullList<ItemStack>
static final int
final NonNullList<ItemStack>
final Player
static final int
int
private static final int
static final int
private int
从接口继承的字段 net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
boolean
private int
addResource
(int pSlot, ItemStack pStack) private int
addResource
(ItemStack pStack) void
int
clearOrCountMatchingItems
(Predicate<ItemStack> pStackPredicate, int pMaxCount, Container pInventory) boolean
boolean
void
dropAll()
void
fillStackedContents
(StackedContents pStackedContent) int
findSlotMatchingItem
(ItemStack pStack) int
findSlotMatchingUnusedItem
(ItemStack pStack) getArmor
(int pSlot) int
float
getDestroySpeed
(BlockState pState) int
getItem
(int pIndex) getName()
static int
int
getSlotWithRemainingSpace
(ItemStack pStack) int
int
private boolean
hasRemainingSpaceForItem
(ItemStack pDestination, ItemStack pOrigin) void
hurtArmor
(DamageSource pSource, float pDamage, int[] pArmorPieces) boolean
isEmpty()
static boolean
isHotbarSlot
(int pIndex) void
void
pickSlot
(int pIndex) void
placeItemBackInInventory
(ItemStack pStack) void
placeItemBackInInventory
(ItemStack pStack, boolean pSendPacket) removeFromSelected
(boolean pRemoveStack) removeItem
(int pIndex, int pCount) void
removeItem
(ItemStack pStack) removeItemNoUpdate
(int pIndex) void
replaceWith
(Inventory pPlayerInventory) void
void
void
setPickedItem
(ItemStack pStack) boolean
stillValid
(Player pPlayer) void
swapPaint
(double pDirection) void
tick()
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, 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
private static final int SELECTION_SIZE- 另请参阅:
-
SLOT_OFFHAND
public static final int SLOT_OFFHAND- 另请参阅:
-
NOT_FOUND_INDEX
public static final int NOT_FOUND_INDEX- 另请参阅:
-
ALL_ARMOR_SLOTS
public static final int[] ALL_ARMOR_SLOTS -
HELMET_SLOT_ONLY
public static final int[] HELMET_SLOT_ONLY -
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() -
setPickedItem
-
pickSlot
public void pickSlot(int pIndex) -
isHotbarSlot
public static boolean isHotbarSlot(int pIndex) -
findSlotMatchingItem
-
findSlotMatchingUnusedItem
-
getSuitableHotbarSlot
public int getSuitableHotbarSlot() -
swapPaint
public void swapPaint(double pDirection) -
clearOrCountMatchingItems
-
addResource
-
addResource
-
getSlotWithRemainingSpace
-
tick
public void tick() -
add
-
add
-
placeItemBackInInventory
-
placeItemBackInInventory
-
removeItem
- 指定者:
removeItem
在接口中Container
-
removeItem
-
removeItemNoUpdate
- 指定者:
removeItemNoUpdate
在接口中Container
-
setItem
-
getDestroySpeed
-
save
-
load
-
getContainerSize
public int getContainerSize()- 指定者:
getContainerSize
在接口中Container
-
isEmpty
public boolean isEmpty() -
getItem
-
getName
-
getArmor
-
hurtArmor
-
dropAll
public void dropAll() -
setChanged
public void setChanged()- 指定者:
setChanged
在接口中Container
-
getTimesChanged
public int getTimesChanged() -
stillValid
- 指定者:
stillValid
在接口中Container
-
contains
-
contains
-
replaceWith
-
clearContent
public void clearContent()- 指定者:
clearContent
在接口中Clearable
-
fillStackedContents
-
removeFromSelected
-