Package com.loohp.limbo.player
Class PlayerInventory
java.lang.Object
com.loohp.limbo.inventory.AbstractInventory
com.loohp.limbo.player.PlayerInventory
- All Implemented Interfaces:
EntityEquipment
,Inventory
,Iterable<ItemStack>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.loohp.limbo.inventory.AbstractInventory
AbstractInventory.Unsafe
-
Field Summary
Fields inherited from class com.loohp.limbo.inventory.AbstractInventory
inventory, inventoryHolder, inventoryType, inverseSlotConvertor, listener, maxStackSize, slotConvertor, viewers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a copy of all worn armorgetBoots()
Gets a copy of the boots currently being worn by the entityGets a copy of the chest plate currently being worn by the entityGets a copy of the helmet currently being worn by the entityGets the block or entity belonging to the open inventorygetItem
(EquipmentSlot slot) Gets the ItemStack at the given equipment slot in the inventory.Gets a copy of the item the entity is currently holding in their main hand.Gets a copy of the item the entity is currently holding in their off hand.Gets a copy of the leggings currently being worn by the entityvoid
setArmorContents
(ItemStack[] items) Sets the entities armor to the provided array of ItemStacksvoid
Sets the boots worn by the entityvoid
setChestplate
(ItemStack chestplate) Sets the chest plate worn by the entityvoid
Sets the helmet worn by the entityvoid
setItem
(EquipmentSlot slot, ItemStack item) Stores the ItemStack at the given equipment slot in the inventory.void
setItemInMainHand
(ItemStack item) Sets the item the entity is holding in their main hand.void
setItemInOffHand
(ItemStack item) Sets the item the entity is holding in their off hand.void
setLeggings
(ItemStack leggings) Sets the leggings worn by the entityMethods inherited from class com.loohp.limbo.inventory.AbstractInventory
addItem, all, all, clear, clear, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, firstPartial, getContents, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getUnsafe, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, setContents, setItem, setMaxStackSize, setStorageContents, updateInventory, updateInventory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.loohp.limbo.entity.EntityEquipment
clear
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PlayerInventory
-
-
Method Details
-
getHolder
Description copied from interface:Inventory
Gets the block or entity belonging to the open inventory- Specified by:
getHolder
in interfaceEntityEquipment
- Specified by:
getHolder
in interfaceInventory
- Overrides:
getHolder
in classAbstractInventory
- Returns:
- The holder of the inventory; null if it has no holder.
-
setItem
Description copied from interface:EntityEquipment
Stores the ItemStack at the given equipment slot in the inventory.- Specified by:
setItem
in interfaceEntityEquipment
- Parameters:
slot
- the slot to put the ItemStackitem
- the ItemStack to set
-
getItem
Description copied from interface:EntityEquipment
Gets the ItemStack at the given equipment slot in the inventory.- Specified by:
getItem
in interfaceEntityEquipment
- Parameters:
slot
- the slot to get the ItemStack- Returns:
- the ItemStack in the given slot
-
getItemInMainHand
Description copied from interface:EntityEquipment
Gets a copy of the item the entity is currently holding in their main hand.- Specified by:
getItemInMainHand
in interfaceEntityEquipment
- Returns:
- the currently held item
-
setItemInMainHand
Description copied from interface:EntityEquipment
Sets the item the entity is holding in their main hand.- Specified by:
setItemInMainHand
in interfaceEntityEquipment
- Parameters:
item
- The item to put into the entities hand
-
getItemInOffHand
Description copied from interface:EntityEquipment
Gets a copy of the item the entity is currently holding in their off hand.- Specified by:
getItemInOffHand
in interfaceEntityEquipment
- Returns:
- the currently held item
-
setItemInOffHand
Description copied from interface:EntityEquipment
Sets the item the entity is holding in their off hand.- Specified by:
setItemInOffHand
in interfaceEntityEquipment
- Parameters:
item
- The item to put into the entities hand
-
getHelmet
Description copied from interface:EntityEquipment
Gets a copy of the helmet currently being worn by the entity- Specified by:
getHelmet
in interfaceEntityEquipment
- Returns:
- The helmet being worn
-
setHelmet
Description copied from interface:EntityEquipment
Sets the helmet worn by the entity- Specified by:
setHelmet
in interfaceEntityEquipment
- Parameters:
helmet
- The helmet to put on the entity
-
getChestplate
Description copied from interface:EntityEquipment
Gets a copy of the chest plate currently being worn by the entity- Specified by:
getChestplate
in interfaceEntityEquipment
- Returns:
- The chest plate being worn
-
setChestplate
Description copied from interface:EntityEquipment
Sets the chest plate worn by the entity- Specified by:
setChestplate
in interfaceEntityEquipment
- Parameters:
chestplate
- The chest plate to put on the entity
-
getLeggings
Description copied from interface:EntityEquipment
Gets a copy of the leggings currently being worn by the entity- Specified by:
getLeggings
in interfaceEntityEquipment
- Returns:
- The leggings being worn
-
setLeggings
Description copied from interface:EntityEquipment
Sets the leggings worn by the entity- Specified by:
setLeggings
in interfaceEntityEquipment
- Parameters:
leggings
- The leggings to put on the entity
-
getBoots
Description copied from interface:EntityEquipment
Gets a copy of the boots currently being worn by the entity- Specified by:
getBoots
in interfaceEntityEquipment
- Returns:
- The boots being worn
-
setBoots
Description copied from interface:EntityEquipment
Sets the boots worn by the entity- Specified by:
setBoots
in interfaceEntityEquipment
- Parameters:
boots
- The boots to put on the entity
-
getArmorContents
Description copied from interface:EntityEquipment
Gets a copy of all worn armor- Specified by:
getArmorContents
in interfaceEntityEquipment
- Returns:
- The array of worn armor. Individual items may be null.
-
setArmorContents
Description copied from interface:EntityEquipment
Sets the entities armor to the provided array of ItemStacks- Specified by:
setArmorContents
in interfaceEntityEquipment
- Parameters:
items
- The items to set the armor as. Individual items may be null.
-