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

Could not pass event SleepSkipEvent to sleep-most v5.2.0 #183

Open
64BitUniverse opened this issue Dec 24, 2023 · 2 comments
Open

Could not pass event SleepSkipEvent to sleep-most v5.2.0 #183

64BitUniverse opened this issue Dec 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@64BitUniverse
Copy link

Describe the bug
This isn't impacting gameplay, but when going through logs it causes an issue. Whenever someone sleeps, the console puts out:

java.lang.NullPointerException: Cannot invoke "me.mrgeneralq.sleepmost.interfaces.IBossBarService.setVisible(org.bukkit.World, boolean)" because "this.bossBarService" is null
	at me.mrgeneralq.sleepmost.eventlisteners.SleepSkipEventListener.onSleepSkip(SleepSkipEventListener.java:105) ~[sleep-most-5.2.0.jar:?]
	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor9.execute(Unknown Source) ~[?:?]
	at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:git-Paper-318]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.2.jar:git-Paper-318]
	at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.2.jar:git-Paper-318]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
	at me.mrgeneralq.sleepmost.services.SleepService.executeSleepReset(SleepService.java:291) ~[sleep-most-5.2.0.jar:?]
	at me.mrgeneralq.sleepmost.runnables.NightcycleAnimationTask.run(NightcycleAnimationTask.java:57) ~[sleep-most-5.2.0.jar:?]
	at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.2.jar:git-Paper-318]
	at org.bukkit.craftbukkit.v1_20_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[paper-1.20.2.jar:git-Paper-318]
	at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1470) ~[paper-1.20.2.jar:git-Paper-318]
	at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:446) ~[paper-1.20.2.jar:git-Paper-318]
	at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1379) ~[paper-1.20.2.jar:git-Paper-318]
	at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1156) ~[paper-1.20.2.jar:git-Paper-318]
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-318]
	at java.lang.Thread.run(Thread.java:1589) ~[?:?]

To Reproduce
Steps to reproduce the behavior:

  1. Set time to night (or wait)
  2. Go to sleep like normal
  3. See error in console

Expected behavior
No console errors

Server:

  • OS: Linux Mint 21.2 'Victoria'
  • Server: Paper
  • JDK: OpenJDK 19.0.2
  • Minecraft Version: 1.20.2

Additional context
/sm info returns:

allow-kick false
allow-sleep-cmd true
calculation-method percentage
clock-animation true
dynamic-animation-speed false
exempt-below-y -1
exempt-creative false
exempt-flying false
exempt-spectator false
feed false
gsit-hook false
gsit-sleep true
heal false
insomnia-chance 0.0
insomnia-milk false
mob-no-target true
nightcycle-animation true
non-sleeping-clock-animation false
non-sleeping-sound false
non-sleeping-title false
percentage-required 0.5
phantom-reset-audience all
players-requiered 1
precent-phantom false
prevent-sleep false
skip-delay 0
skip-night-sound ui.toast.challenge_complete
skip-storm true
skip-storm-sound entity.wither.spawn
storm-sleep true
use-afk false
use-bossbar false
use-exempt false
use-sound-night-skipped false
use-sound-storm-skipped false
use-title-night-skipped false
use-title-storm-skipped false
@64BitUniverse 64BitUniverse added the bug Something isn't working label Dec 24, 2023
@mrgeneralq
Copy link
Owner

Hello @64BitUniverse
Thank you for reporting this issue. I see that you are not using the latest version of spigot. This is ofcourse not a problem as the plugin is supposed to support from 1.8 range.

The issue originates from the support check I built in the code. When bossbars (in the API) are not supported, I don't register the boss bar service. This is causing an issue as there are places in the code where I simply don't use it.

I will need to adjust my code a little bit so I don't have scenario's where the bossbar service is NULL.

Thank you for reporting this issue!

Kind regards

Quinten

@mrgeneralq mrgeneralq added the good first issue Good for newcomers label Dec 24, 2023
@mrgeneralq mrgeneralq self-assigned this Jan 30, 2024
@mrgeneralq
Copy link
Owner

Hello @64BitUniverse

This problem will now be solved in the next release. A more long term approach will be taken to improve the architecture.
Thank you for reporting and have a nice day!

PS: this ticket will be closed as soon as the plugin is released.

Kind regards

Quinten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants