Interface PlayerInventory
- All Superinterfaces:
Container
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe chestplate slot.static final intThe boots slot.static final intThe helmet slot.static final intThe number of hotbar slots.static final intThe first hotbar slot.static final intThe leggings slot.static final intThe first slot of the main inventory, right after the hotbar.static final intThe off hand slot.static final intThe number of slots of a player inventory, reserved ones included.static final intThe number of slots of the hotbar and the main inventory together, from 0. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic @Nullable EquipmentSlotequipmentSlotAt(int slot) The other way round fromslotOf(EquipmentSlot).static intslotOf(EquipmentSlot slot) Where a piece of equipment sits in this inventory.Methods inherited from interface Container
clear, contents, firstEmpty, get, isEmpty, set, setContents, size
-
Field Details
-
SIZE
static final int SIZEThe number of slots of a player inventory, reserved ones included.- Since:
- 0.1.0
- See Also:
-
HOTBAR_START
static final int HOTBAR_STARTThe first hotbar slot.- Since:
- 0.1.0
- See Also:
-
HOTBAR_SIZE
static final int HOTBAR_SIZEThe number of hotbar slots.- Since:
- 0.1.0
- See Also:
-
MAIN_START
static final int MAIN_STARTThe first slot of the main inventory, right after the hotbar.- Since:
- 0.1.0
- See Also:
-
STORAGE_SIZE
static final int STORAGE_SIZEThe number of slots of the hotbar and the main inventory together, from 0.- Since:
- 0.1.0
- See Also:
-
FEET
static final int FEETThe boots slot.- Since:
- 0.1.0
- See Also:
-
LEGS
static final int LEGSThe leggings slot.- Since:
- 0.1.0
- See Also:
-
CHEST
static final int CHESTThe chestplate slot.- Since:
- 0.1.0
- See Also:
-
HEAD
static final int HEADThe helmet slot.- Since:
- 0.1.0
- See Also:
-
OFF_HAND
static final int OFF_HANDThe off hand slot.- Since:
- 0.1.0
- See Also:
-
-
Method Details
-
slotOf
Where a piece of equipment sits in this inventory.- Parameters:
slot- the equipment slot- Returns:
- the inventory slot,
-1for the main hand (it follows the selected hotbar slot) and for the slots a player does not have - Since:
- 0.1.0
-
equipmentSlotAt
The other way round fromslotOf(EquipmentSlot).- Parameters:
slot- an inventory slot- Returns:
- the equipment slot it holds,
nullfor the hotbar, the main inventory and the reserved slots - Since:
- 0.1.0
-