DuckyCrayfish / hourglass

Hourglass is a Minecraft Forge mod that gives you control over the passage of time. It allows you to customize the length of the day-night cycle and alters the Minecraft sleep mechanic by accelerating the speed of time.
GNU Lesser General Public License v3.0
14 stars 4 forks source link

Enhanced Celestials compatibility problem #6

Closed GauntAndreX8 closed 3 years ago

GauntAndreX8 commented 3 years ago

There is a bug with Enchanced Celestial like when I go sleep during bloodmoon I’m in a bed for a sec but later automatically made me leave the bed saying it’s bloodmoon and it causes to forward time a bit more so I suggest like They should only speed up time after the player actually sleeps

CorgiTaco commented 3 years ago

Relevant code on my side: https://github.com/CorgiTaco/Enhanced-Celestials/blob/Forge-1.16.X/src/main/java/corgitaco/enhancedcelestials/mixin/MixinLivingEntity.java#L35-L43

DuckyCrayfish commented 3 years ago

I was about to go digging, thanks for saving me the trouble @CorgiTaco

GauntAndreX8 commented 3 years ago

Wait so is the problem fixed or you guys still doing your thing

GauntAndreX8 commented 3 years ago

When I mean thing I mean still working on it

DuckyCrayfish commented 3 years ago

@CorgiTaco I have a suggestion. If you're comfortable having Forge events in your mod (it seems you prefer sponge methods), using the SleepingTimeCheckEvent event will not only prevent time from starting to progress in Hourglass, but it will also prevent the "blinking in an out of bed" effect that currently happens when you try to get in bed during a blood moon. It will instead prevent the player from getting into bed in the first place while presenting them with your red Game Info message, similar to how vanilla handles a player trying to sleep during the day.

Unfortunately this event does not get called on other LivingEntities like villagers, so this event will have to be implemented alongside either your current method of sleep prevention, or alongside an additional SleepingLocationCheckEvent, which is called for villagers.

DuckyCrayfish commented 3 years ago

While troubleshooting this issue I noticed that Lunar Event chat notifications will sometimes get sent twice. I'll work on fixing this as well.

CorgiTaco commented 3 years ago

Wouldn't the simplest solution here be firing the the boolean I mixin before anything? To me that makes the most sense and it also works on fabric, the reason I've exclusively used mixins here is due to my mod needing to work on both forge + fabric w/ little to no changes.

CorgiTaco commented 3 years ago

And on top of that, fabric does not have the mentioned forge events on their side of the fence, so I'm basically forced to use mixin.

DuckyCrayfish commented 3 years ago

Ahh, I understand. I did not realize your mod supports Fabric as well.

I agree that your suggestion is the easiest route. Another possibility is delaying time changes until the second tick in bed (more compatible with other Forge exclusive mods that utilize the SleepingLocationCheck).

I only asked in case the blink effect was something you were interested in preventing.

DuckyCrayfish commented 3 years ago

Issue fix released in v1.16.5-1.1.1.1