Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RoseStacker v1.5.32-SNAPSHOT generated an exception while executing task 78 #142

Open
smscentras opened this issue Jan 21, 2025 · 9 comments

Comments

@smscentras
Copy link

[05:42:22] [Craft Scheduler Thread - 2825 - RoseStacker/WARN]: [RoseStacker] Plugin RoseStacker v1.5.32-SNAPSHOT generated an exception while executing task 78 java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.hasItemName()" because "itemMeta" is null at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackedItem.updateDisplay(StackedItem.java:104) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?] at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackingThread.tryStackItem(StackingThread.java:1088) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?] at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackingThread.stackItems(StackingThread.java:220) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?] at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.lib.rosegarden.scheduler.RoseScheduler.lambda$wrap$0(RoseScheduler.java:158) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?] at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:86) ~[purpur-1.21.1.jar:1.21.1-2329-803bf62] at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.21.1.jar:1.21.1-2329-803bf62] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.21.1.jar:?] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

@smscentras
Copy link
Author

Puppur 1.21.1

@Esophose
Copy link
Member

Esophose commented Jan 21, 2025

This is going to be impossible for me to reproduce on my own. There is no possible way for itemMeta to be null since there's a null check right before it's used.
https://github.com/Rosewood-Development/RoseStacker/blob/master/Plugin/src/main/java/dev/rosewood/rosestacker/stack/StackedItem.java#L102
I simply can't fix this, as it shouldn't be possible. If anyone else sees something I'm missing please chime in.

@Esophose
Copy link
Member

Esophose commented Jan 21, 2025

If you want to avoid the error you can disable stacked item nametags by setting display-tags to false under the global-item-settings section of the config.yml, otherwise I don't really have any other suggestions.

@smscentras
Copy link
Author

smscentras commented Jan 21, 2025

This is going to be impossible for me to reproduce on my own. There is no possible way for itemMeta to be null since there's a null check right before it's used. https://github.com/Rosewood-Development/RoseStacker/blob/master/Plugin/src/main/java/dev/rosewood/rosestacker/stack/StackedItem.java#L102 I simply can't fix this, as it shouldn't be possible. If anyone else sees something I'm missing please chime in.

if (itemMeta == null) { return; }
something like that maybe?
Sometimes there can be not NULL, but empty!

if (itemMeta == "") { return; }

if (itemMeta != null && itemMeta != "") {

@Esophose
Copy link
Member

there is already a null check

@smscentras
Copy link
Author

there is already a null check

but null is not ""
ok, you know better...

@smscentras
Copy link
Author

Disabled "display-tags", restarted server, but:

[Craft Scheduler Thread - 143 - RoseStacker/WARN]: [RoseStacker] Plugin RoseStacker v1.5.32-SNAPSHOT generated an exception while executing task 78 java.lang.NullPointerException: null

@smscentras
Copy link
Author

Maybe you need to add same line if (itemMeta != null)
on updateDisplay
on tryStackItem
on stackItems

I'm just guessing..

[Craft Scheduler Thread - 14 - RoseStacker/WARN]: [RoseStacker] Plugin RoseStacker v1.5.32-SNAPSHOT generated an exception while executing task 78
java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.meta.ItemMeta.hasItemName()" because "itemMeta" is null
at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackedItem.updateDisplay(StackedItem.java:104) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?]
at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackingThread.tryStackItem(StackingThread.java:1088) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?]
at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.stack.StackingThread.stackItems(StackingThread.java:220) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?]
at RoseStacker-1.5.32-SNAPSHOT.jar/dev.rosewood.rosestacker.lib.rosegarden.scheduler.RoseScheduler.lambda$wrap$0(RoseScheduler.java:158) ~[RoseStacker-1.5.32-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:86) ~[purpur-1.21.1.jar:1.21.1-2329-803bf62]
at org.bukkit.craftbukkit.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.21.1.jar:1.21.1-2329-803bf62]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.21.1.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants