public class InventoryUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
LAST_RECIPE_NET_ID
Stores the last used recipe network ID.
|
static com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack |
REFRESH_ITEM |
| Constructor and Description |
|---|
InventoryUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canStack(GeyserItemStack item1,
GeyserItemStack item2) |
static boolean |
canStack(com.nukkitx.protocol.bedrock.data.inventory.ItemData item1,
com.nukkitx.protocol.bedrock.data.inventory.ItemData item2) |
static boolean |
canStack(com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack item1,
com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack item2) |
static void |
closeInventory(GeyserSession session,
int windowId,
boolean confirm) |
static IntFunction<com.nukkitx.protocol.bedrock.data.inventory.ItemData> |
createUnusableSpaceBlock(String description)
Returns a barrier block with custom name and lore to explain why
part of the inventory is unusable.
|
static void |
displayInventory(GeyserSession session,
Inventory inventory) |
static void |
findOrCreateItem(GeyserSession session,
com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack itemStack)
|
static void |
findOrCreateItem(GeyserSession session,
String itemName)
Attempt to find the specified item name in the session's inventory.
|
static Inventory |
getInventory(GeyserSession session,
int windowId) |
static void |
openInventory(GeyserSession session,
Inventory inventory) |
static void |
updateCursor(GeyserSession session) |
public static int LAST_RECIPE_NET_ID
public static final com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack REFRESH_ITEM
public static void openInventory(GeyserSession session, Inventory inventory)
public static void displayInventory(GeyserSession session, Inventory inventory)
public static void closeInventory(GeyserSession session, int windowId, boolean confirm)
public static Inventory getInventory(GeyserSession session, int windowId)
public static void updateCursor(GeyserSession session)
public static boolean canStack(GeyserItemStack item1, GeyserItemStack item2)
public static boolean canStack(com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack item1,
com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack item2)
public static boolean canStack(com.nukkitx.protocol.bedrock.data.inventory.ItemData item1,
com.nukkitx.protocol.bedrock.data.inventory.ItemData item2)
public static IntFunction<com.nukkitx.protocol.bedrock.data.inventory.ItemData> createUnusableSpaceBlock(String description)
description - the descriptionpublic static void findOrCreateItem(GeyserSession session, com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack itemStack)
findOrCreateItem(GeyserSession, String). This is for finding a specified ItemStack.session - the Bedrock client's sessionitemStack - the item to try to find a match for. NBT will also be accounted for.public static void findOrCreateItem(GeyserSession session, String itemName)
session - the Bedrock client's sessionitemName - the Java identifier of the item to search/selectCopyright © 2021 GeyserMC. All rights reserved.