From 8ae70da8e870c3522489c2845f1d5980d3698e46 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 23 Feb 2021 19:36:10 +0200 Subject: [PATCH] Don't invert whilst sleeping --- .../com/minelittlepony/unicopia/entity/EntityPhysics.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java index 66a17cb5..8c14516d 100644 --- a/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java +++ b/src/main/java/com/minelittlepony/unicopia/entity/EntityPhysics.java @@ -144,7 +144,12 @@ public class EntityPhysics> implements Physics public float getGravityModifier() { Entity master = pony.getMaster(); + if (master instanceof LivingEntity) { + if (((LivingEntity)master).isSleeping()) { + return 1; + } + if (((LivingEntity)master).getAttributes() == null) { // may be null due to order of execution in the constructor. // Will have the default (1) here in any case, so it's safe to ignore the attribute at this point.