Fixed bat ponies unable to sleep at night when there is a thunderstorm. Fixes #436

This commit is contained in:
Sollace 2024-09-16 17:17:21 +01:00
parent b53a51173c
commit 2046ca3029
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -807,7 +807,7 @@ public class Pony extends Living<PlayerEntity> implements Copyable<Pony>, Update
public ActionResult canSleepNow() { public ActionResult canSleepNow() {
if (asWorld().getGameRules().getBoolean(UGameRules.DO_NOCTURNAL_BAT_PONIES) && getSpecies().isNocturnal()) { if (asWorld().getGameRules().getBoolean(UGameRules.DO_NOCTURNAL_BAT_PONIES) && getSpecies().isNocturnal()) {
return asWorld().isDay() ? ActionResult.SUCCESS : ActionResult.FAIL; return asWorld().isDay() || asWorld().getAmbientDarkness() >= 4 ? ActionResult.SUCCESS : ActionResult.FAIL;
} }
return ActionResult.PASS; return ActionResult.PASS;