Class InventoryUpdate
java.lang.Object
me.devnatan.inventoryframework.runtime.thirdparty.InventoryUpdate
A utility class for update the inventory of a player. This is useful to change the title of an
inventory.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum class for the necessaries containers. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MethodHandlestatic final Class<?> static final Object[]static final MethodHandlestatic final MethodHandlestatic final MethodHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectcreateTitleComponent(Object text) static ObjectgetActiveContainer(Object entityPlayer) static MethodHandlegetConstructor(Class<?> refc, Class<?>... types) static ObjectgetContainerOrName(InventoryUpdate.Containers container, org.bukkit.event.inventory.InventoryType type) static MethodHandlestatic MethodHandlegetFieldHandle(Class<?> refc, Class<?> inscofc, String name) static MethodHandlegetMethod(Class<?> refc, String name, MethodType type) static MethodHandlegetMethod(Class<?> refc, String name, MethodType type, boolean isStatic) static MethodHandlegetMethod(Class<?> refc, String name, MethodType type, boolean isStatic, String... extraNames) static MethodHandlestatic MethodHandlesetFieldHandle(Class<?> refc, Class<?> inscofc, String name) static voidupdateInventory(org.bukkit.entity.Player player, Object newTitle) Update the player inventory, so you can change the title.static booleanContainers were added in 1.14, a String were used in previous versions.
-
Field Details
-
CONTAINER
-
getBukkitView
-
packetPlayOutOpenWindow
-
activeContainer
-
windowId
-
DUMMY_COLOR_MODIFIERS
-
-
Constructor Details
-
InventoryUpdate
public InventoryUpdate()
-
-
Method Details
-
updateInventory
Update the player inventory, so you can change the title.- Parameters:
player- whose inventory will be updated.newTitle- the new title for the inventory.
-
getContainerOrName
public static Object getContainerOrName(InventoryUpdate.Containers container, org.bukkit.event.inventory.InventoryType type) -
createTitleComponent
- Throws:
Throwable
-
getActiveContainer
- Throws:
Throwable
-
getField
public static MethodHandle getField(Class<?> refc, Class<?> instc, String name, String... extraNames) -
setField
public static MethodHandle setField(Class<?> refc, Class<?> instc, String name, String... extraNames) -
getFieldHandle
-
setFieldHandle
-
getConstructor
-
getMethod
-
getMethod
-
getMethod
public static MethodHandle getMethod(Class<?> refc, String name, MethodType type, boolean isStatic, String... extraNames) -
useContainers
public static boolean useContainers()Containers were added in 1.14, a String were used in previous versions.- Returns:
- whether to use containers.
-