[Bug]: Dusk is incompatible with mod that allow sleeping at day
Cheaterpaul opened this issue ยท 1 comments
Describe the bug you're experiencing
Correct sleep event
Your sleep time check should be done in the appropriated event.
dusk/src/main/java/com/dusk/event/EventHandler.java
Lines 74 to 92 in 3aaafa0
The PlayerSleepInBedEvent
is not supposed to check the sleep time. For that there is the dedicated SleepingTimeCheckEvent
. This way your sleep time is compatible with other mods.
Besides the time check (event.getEntity().level().getDayTime() % 24000) < Dusk.config.getCommonConfig().minSleepTime.get()
the rest is fine in the PlayerSleepInBedEvent
event
Problem with sleeping time
I do not know if this is intended or overlooked, but some mods allow player to sleep at day, which is completely ignored by this mod. I do not know how this should be solved correctly, maybe you have an idea.
Reproducability
^^
Mod up to date
- Before submitting this issue I updated to the newest version and reproduced it
Minecraft version
1.20.1
Modloader version
Forge
Logs
source code