Modifier and Type | Field and Description |
---|---|
DefaultedList<ItemStack> |
armor |
private int |
changeCount |
private List<DefaultedList<ItemStack>> |
combinedInventory |
private ItemStack |
cursorStack |
DefaultedList<ItemStack> |
main |
DefaultedList<ItemStack> |
offHand |
PlayerEntity |
player |
int |
selectedSlot |
Constructor and Description |
---|
PlayerInventory(PlayerEntity player) |
Modifier and Type | Method and Description |
---|---|
void |
addPickBlock(ItemStack stack) |
private int |
addStack(int slot,
ItemStack stack) |
private int |
addStack(ItemStack stack) |
private boolean |
areItemsEqual(ItemStack stack1,
ItemStack stack2) |
boolean |
canPlayerUse(PlayerEntity player) |
private boolean |
canStackAddMore(ItemStack existingStack,
ItemStack stack) |
void |
clear() |
void |
clone(PlayerInventory other) |
boolean |
contains(ItemStack stack) |
boolean |
contains(Tag<Item> tag) |
void |
damageArmor(DamageSource damageSource,
float float2) |
void |
deserialize(ListTag tag) |
void |
dropAll() |
ItemStack |
getArmorStack(int slot) |
float |
getBlockBreakingSpeed(BlockState block) |
int |
getChangeCount() |
ItemStack |
getCursorStack() |
int |
getEmptySlot() |
static int |
getHotbarSize() |
ItemStack |
getMainHandStack() |
Text |
getName() |
int |
getOccupiedSlotWithRoomForStack(ItemStack stack) |
int |
getSlotWithStack(ItemStack stack) |
ItemStack |
getStack(int slot)
Fetches the stack currently stored at the given slot.
|
int |
getSwappableHotbarSlot() |
boolean |
insertStack(int slot,
ItemStack stack) |
boolean |
insertStack(ItemStack stack) |
boolean |
isEmpty() |
static boolean |
isValidHotbarIndex(int slot) |
void |
markDirty() |
int |
method_7371(ItemStack itemStack) |
void |
offerOrDrop(World world,
ItemStack stack) |
void |
populateRecipeFinder(RecipeFinder finder) |
int |
remove(Predicate<ItemStack> shouldRemove,
int maxCount,
Inventory craftingInventory) |
void |
removeOne(ItemStack stack) |
ItemStack |
removeStack(int slot)
Removes the stack currently stored at the indicated slot.
|
ItemStack |
removeStack(int slot,
int amount)
Removes a specific number of items from the given slot.
|
void |
scrollInHotbar(double scrollAmount) |
ListTag |
serialize(ListTag tag) |
void |
setCursorStack(ItemStack stack) |
void |
setStack(int slot,
ItemStack stack) |
int |
size() |
void |
swapSlotWithHotbar(int hotbarSlot) |
void |
updateItems() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
containsAny, count, getMaxCountPerStack, isValid, onClose, onOpen
getCustomName, getDisplayName, hasCustomName
public final DefaultedList<ItemStack> main
public final DefaultedList<ItemStack> armor
public final DefaultedList<ItemStack> offHand
private final List<DefaultedList<ItemStack>> combinedInventory
public int selectedSlot
public final PlayerEntity player
private ItemStack cursorStack
private int changeCount
public PlayerInventory(PlayerEntity player)
public ItemStack getMainHandStack()
public static int getHotbarSize()
public int getEmptySlot()
@Environment(value=CLIENT) public void addPickBlock(ItemStack stack)
public void swapSlotWithHotbar(int hotbarSlot)
public static boolean isValidHotbarIndex(int slot)
@Environment(value=CLIENT) public int getSlotWithStack(ItemStack stack)
public int method_7371(ItemStack itemStack)
public int getSwappableHotbarSlot()
@Environment(value=CLIENT) public void scrollInHotbar(double scrollAmount)
public int remove(Predicate<ItemStack> shouldRemove, int maxCount, Inventory craftingInventory)
private int addStack(ItemStack stack)
private int addStack(int slot, ItemStack stack)
public int getOccupiedSlotWithRoomForStack(ItemStack stack)
public void updateItems()
public boolean insertStack(ItemStack stack)
public boolean insertStack(int slot, ItemStack stack)
public ItemStack removeStack(int slot, int amount)
removeStack
in interface Inventory
public void removeOne(ItemStack stack)
public ItemStack removeStack(int slot)
removeStack
in interface Inventory
public void setStack(int slot, ItemStack stack)
public float getBlockBreakingSpeed(BlockState block)
public void deserialize(ListTag tag)
public ItemStack getStack(int slot)
ItemStack.EMPTY
.@Environment(value=CLIENT) public ItemStack getArmorStack(int slot)
public void damageArmor(DamageSource damageSource, float float2)
public void dropAll()
@Environment(value=CLIENT) public int getChangeCount()
public void setCursorStack(ItemStack stack)
public ItemStack getCursorStack()
public boolean canPlayerUse(PlayerEntity player)
canPlayerUse
in interface Inventory
public boolean contains(ItemStack stack)
public void clone(PlayerInventory other)
public void populateRecipeFinder(RecipeFinder finder)