Class PlayerInventoryUtils
java.lang.Object
net.minestom.server.utils.inventory.PlayerInventoryUtils
public final class PlayerInventoryUtils
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description static int
BOOTS_SLOT
static int
CHESTPLATE_SLOT
static int
CRAFT_RESULT
static int
CRAFT_SLOT_1
static int
CRAFT_SLOT_2
static int
CRAFT_SLOT_3
static int
CRAFT_SLOT_4
static int
HELMET_SLOT
static int
LEGGINGS_SLOT
static int
OFFHAND_SLOT
static int
OFFSET
-
Method Summary
Modifier and Type Method Description static int
convertSlot(int slot, int offset)
Converts a packet slot to an internal one.static int
convertToPacketSlot(int slot)
Used to convert internal slot to one used in packets
-
Field Details
-
OFFSET
public static final int OFFSET- See Also:
- Constant Field Values
-
CRAFT_RESULT
public static final int CRAFT_RESULT- See Also:
- Constant Field Values
-
CRAFT_SLOT_1
public static final int CRAFT_SLOT_1- See Also:
- Constant Field Values
-
CRAFT_SLOT_2
public static final int CRAFT_SLOT_2- See Also:
- Constant Field Values
-
CRAFT_SLOT_3
public static final int CRAFT_SLOT_3- See Also:
- Constant Field Values
-
CRAFT_SLOT_4
public static final int CRAFT_SLOT_4- See Also:
- Constant Field Values
-
HELMET_SLOT
public static final int HELMET_SLOT- See Also:
- Constant Field Values
-
CHESTPLATE_SLOT
public static final int CHESTPLATE_SLOT- See Also:
- Constant Field Values
-
LEGGINGS_SLOT
public static final int LEGGINGS_SLOT- See Also:
- Constant Field Values
-
BOOTS_SLOT
public static final int BOOTS_SLOT- See Also:
- Constant Field Values
-
OFFHAND_SLOT
public static final int OFFHAND_SLOT- See Also:
- Constant Field Values
-
-
Method Details
-
convertSlot
public static int convertSlot(int slot, int offset)Converts a packet slot to an internal one.- Parameters:
slot
- the packet slotoffset
- the slot count separating the up part of the inventory to the bottom part (armor/craft in PlayerInventory, inventory slots in others) the offset for the player inventory isOFFSET
- Returns:
- a packet which can be use internally with Minestom
-
convertToPacketSlot
public static int convertToPacketSlot(int slot)Used to convert internal slot to one used in packets- Parameters:
slot
- the internal slot- Returns:
- a slot id which can be used for packets
-