public class PlayerInventory extends java.lang.Object implements IInventory, INameable
Modifier and Type | Field and Description |
---|---|
NonNullList<ItemStack> |
armor |
private ItemStack |
carried |
private java.util.List<NonNullList<ItemStack>> |
compartments |
NonNullList<ItemStack> |
items |
NonNullList<ItemStack> |
offhand |
PlayerEntity |
player |
int |
selected |
private int |
timesChanged |
Constructor and Description |
---|
PlayerInventory(PlayerEntity p_i1750_1_) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int p_191971_1_,
ItemStack p_191971_2_) |
boolean |
add(ItemStack p_70441_1_) |
private int |
addResource(int p_191973_1_,
ItemStack p_191973_2_) |
private int |
addResource(ItemStack p_70452_1_) |
void |
clearContent() |
int |
clearOrCountMatchingItems(java.util.function.Predicate<ItemStack> p_234564_1_,
int p_234564_2_,
IInventory p_234564_3_) |
boolean |
contains(ITag<Item> p_199712_1_) |
boolean |
contains(ItemStack p_70431_1_) |
void |
dropAll() |
void |
fillStackedContents(RecipeItemHelper p_201571_1_) |
int |
findSlotMatchingItem(ItemStack p_184429_1_) |
int |
findSlotMatchingUnusedItem(ItemStack p_194014_1_) |
ItemStack |
getArmor(int p_70440_1_) |
ItemStack |
getCarried() |
int |
getContainerSize() |
float |
getDestroySpeed(BlockState p_184438_1_) |
int |
getFreeSlot() |
ItemStack |
getItem(int p_70301_1_) |
ITextComponent |
getName() |
ItemStack |
getSelected() |
static int |
getSelectionSize() |
int |
getSlotWithRemainingSpace(ItemStack p_70432_1_) |
int |
getSuitableHotbarSlot() |
int |
getTimesChanged() |
private boolean |
hasRemainingSpaceForItem(ItemStack p_184436_1_,
ItemStack p_184436_2_) |
void |
hurtArmor(DamageSource p_234563_1_,
float p_234563_2_) |
boolean |
isEmpty() |
static boolean |
isHotbarSlot(int p_184435_0_) |
private boolean |
isSameItem(ItemStack p_184431_1_,
ItemStack p_184431_2_) |
void |
load(ListNBT p_70443_1_) |
void |
pickSlot(int p_184430_1_) |
void |
placeItemBackInInventory(World p_191975_1_,
ItemStack p_191975_2_) |
ItemStack |
removeItem(int p_70298_1_,
int p_70298_2_) |
void |
removeItem(ItemStack p_184437_1_) |
ItemStack |
removeItemNoUpdate(int p_70304_1_) |
void |
replaceWith(PlayerInventory p_70455_1_) |
ListNBT |
save(ListNBT p_70442_1_) |
void |
setCarried(ItemStack p_70437_1_) |
void |
setChanged() |
void |
setItem(int p_70299_1_,
ItemStack p_70299_2_) |
void |
setPickedItem(ItemStack p_184434_1_) |
boolean |
stillValid(PlayerEntity p_70300_1_) |
void |
swapPaint(double p_195409_1_) |
void |
tick() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
canPlaceItem, countItem, getMaxStackSize, hasAnyOf, startOpen, stopOpen
tryClear
getCustomName, getDisplayName, hasCustomName
public final NonNullList<ItemStack> items
public final NonNullList<ItemStack> armor
public final NonNullList<ItemStack> offhand
private final java.util.List<NonNullList<ItemStack>> compartments
public int selected
public final PlayerEntity player
private ItemStack carried
private int timesChanged
public PlayerInventory(PlayerEntity p_i1750_1_)
public ItemStack getSelected()
public static int getSelectionSize()
private boolean hasRemainingSpaceForItem(ItemStack p_184436_1_, ItemStack p_184436_2_)
public int getFreeSlot()
public void setPickedItem(ItemStack p_184434_1_)
public void pickSlot(int p_184430_1_)
public static boolean isHotbarSlot(int p_184435_0_)
public int findSlotMatchingItem(ItemStack p_184429_1_)
public int findSlotMatchingUnusedItem(ItemStack p_194014_1_)
public int getSuitableHotbarSlot()
public void swapPaint(double p_195409_1_)
public int clearOrCountMatchingItems(java.util.function.Predicate<ItemStack> p_234564_1_, int p_234564_2_, IInventory p_234564_3_)
private int addResource(ItemStack p_70452_1_)
private int addResource(int p_191973_1_, ItemStack p_191973_2_)
public int getSlotWithRemainingSpace(ItemStack p_70432_1_)
public void tick()
public boolean add(ItemStack p_70441_1_)
public boolean add(int p_191971_1_, ItemStack p_191971_2_)
public void placeItemBackInInventory(World p_191975_1_, ItemStack p_191975_2_)
public ItemStack removeItem(int p_70298_1_, int p_70298_2_)
removeItem
in interface IInventory
public void removeItem(ItemStack p_184437_1_)
public ItemStack removeItemNoUpdate(int p_70304_1_)
removeItemNoUpdate
in interface IInventory
public void setItem(int p_70299_1_, ItemStack p_70299_2_)
setItem
in interface IInventory
public float getDestroySpeed(BlockState p_184438_1_)
public void load(ListNBT p_70443_1_)
public int getContainerSize()
getContainerSize
in interface IInventory
public boolean isEmpty()
isEmpty
in interface IInventory
public ItemStack getItem(int p_70301_1_)
getItem
in interface IInventory
public ITextComponent getName()
public ItemStack getArmor(int p_70440_1_)
public void hurtArmor(DamageSource p_234563_1_, float p_234563_2_)
public void dropAll()
public void setChanged()
setChanged
in interface IInventory
public int getTimesChanged()
public void setCarried(ItemStack p_70437_1_)
public ItemStack getCarried()
public boolean stillValid(PlayerEntity p_70300_1_)
stillValid
in interface IInventory
public boolean contains(ItemStack p_70431_1_)
public void replaceWith(PlayerInventory p_70455_1_)
public void clearContent()
clearContent
in interface IClearable
public void fillStackedContents(RecipeItemHelper p_201571_1_)