CustomCrafting icon indicating copy to clipboard operation
CustomCrafting copied to clipboard

Exception while edit custom item

Open Ste3et opened this issue 4 months ago • 1 comments

What happened?

A saved item can't be editet again on a 1.21.4/8 server

https://www.youtube.com/watch?v=SWvbAEEOqVQ

How can the bug be reproduced?

Just save a custom item and stop/start your server

Expected Behaviour?

That i can reedit the item after saving

Plugin version

CustomCrafting 4.19.0.2; WolfyUtils 4.19.0.0; NBT-API 2.15.2

Server software

PaperSpigot 1.21.8

Relevant log output

[19:20:13 WARN]: [WolfyUtilities] Unable to load custom data from '{"id":"customcrafting:common_player_data","darkMode":false,"totalCrafts":0,"advancedCrafts":0,"normalCrafts":0,"lightBackground":"none:glass_white","darkBackground":"none:glass_gray"}'! Removing it now to prevent further issues!
[19:20:13 WARN]: [CustomCrafting] Task #6183197 for CustomCrafting v4.19.0.2 generated an exception
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.getPersistentDataContainer()" because "itemMeta" is null
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.lambda$create$3(CustomItem.java:615) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at java.base/java.util.Optional.map(Optional.java:260) ~[?:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.create(CustomItem.java:611) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.custom_items.CustomItem.create(CustomItem.java:597) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at customcrafting-spigot-4.19.0.2.jar/me.wolfyscript.customcrafting.gui.item_creator.MenuItemCreator.onUpdateAsync(MenuItemCreator.java:261) ~[customcrafting-spigot-4.19.0.2.jar:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.openInventory(GuiWindow.java:278) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.lambda$callUpdate$1(GuiWindow.java:268) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.callUpdate(GuiWindow.java:270) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at wolfyutils-spigot-4.19.0.0.jar/me.wolfyscript.utilities.api.inventory.gui.GuiWindow.lambda$update$0(GuiWindow.java:261) ~[wolfyutils-spigot-4.19.0.0.jar:?]
        at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1662) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1530) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1252) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.8.jar:1.21.8-21-ed31825]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Submit issue

  • [x] read the Wiki and especially the FaQ, and made sure there is no fix to your issue,
  • [x] searched for and ensured there isn't already an open issue regarding this,
  • [x] are running the latest version of your server software (Spigot, Paper, etc.), and plugins (WolfyUtilities, CustomCrafting).

Ste3et avatar Sep 13 '25 12:09 Ste3et

https://github.com/WolfyScript/WolfyUtils-Spigot/blob/3bc850dcc06aef2c83c92b7bd3ae03b96f8cbdcc/core/src/main/java/me/wolfyscript/utilities/api/inventory/custom_items/CustomItem.java#L614 the itemmetadata is null here idk why but it trigger the exception

Ste3et avatar Sep 13 '25 12:09 Ste3et