Package codechicken.lib.inventory
Class InventorySimple
java.lang.Object
codechicken.lib.inventory.InventorySimple
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container
Simple IInventory implementation with an array of items, name and maximum stack size
-
Field Summary
FieldsModifier and TypeFieldDescriptionnet.minecraft.world.item.ItemStack[]intFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_BUFFER -
Constructor Summary
ConstructorsConstructorDescriptionInventorySimple(int size) InventorySimple(int size, int limit) InventorySimple(int size, int limit, String name) InventorySimple(int size, String name) InventorySimple(net.minecraft.world.item.ItemStack[] items) InventorySimple(net.minecraft.world.item.ItemStack[] items, int limit) InventorySimple(net.minecraft.world.item.ItemStack[] items, int limit, String name) InventorySimple(net.minecraft.world.item.ItemStack[] items, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidintnet.minecraft.world.item.ItemStackgetItem(int slot) intbooleanisEmpty()net.minecraft.world.item.ItemStackremoveItem(int slot, int amount) net.minecraft.world.item.ItemStackremoveItemNoUpdate(int slot) voidvoidsetItem(int slot, net.minecraft.world.item.ItemStack stack) booleanstillValid(net.minecraft.world.entity.player.Player player) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canPlaceItem, canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, startOpen, stopOpen
-
Field Details
-
items
public net.minecraft.world.item.ItemStack[] items -
limit
public int limit -
name
-
-
Constructor Details
-
InventorySimple
-
InventorySimple
-
InventorySimple
public InventorySimple(net.minecraft.world.item.ItemStack[] items, int limit) -
InventorySimple
public InventorySimple(net.minecraft.world.item.ItemStack[] items) -
InventorySimple
-
InventorySimple
public InventorySimple(int size, int limit) -
InventorySimple
-
InventorySimple
public InventorySimple(int size)
-
-
Method Details
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int slot) - Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int slot, int amount) - Specified by:
removeItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int slot) - Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
setItem
public void setItem(int slot, net.minecraft.world.item.ItemStack stack) - Specified by:
setItemin interfacenet.minecraft.world.Container
-
getMaxStackSize
public int getMaxStackSize()- Specified by:
getMaxStackSizein interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin interfacenet.minecraft.world.Container
-
setChanged
public void setChanged()- Specified by:
setChangedin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-