diff --git a/CHANGELOG.md b/CHANGELOG.md index 72cc5f53a1..3465b1a5ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). - The Umbral Infiltrator no longer jitters when thrown by a void player - Manually-spawned Lotus Flowers can no longer be hurt or killed by any damage source - Lotus Flowers no longer push entities inside of them away +- Ogres and Basilisks no longer slide around when idling ### Contributors for this release diff --git a/src/main/java/com/mraof/minestuck/entity/underling/BasiliskEntity.java b/src/main/java/com/mraof/minestuck/entity/underling/BasiliskEntity.java index 47263484b3..93307ffb35 100644 --- a/src/main/java/com/mraof/minestuck/entity/underling/BasiliskEntity.java +++ b/src/main/java/com/mraof/minestuck/entity/underling/BasiliskEntity.java @@ -235,7 +235,7 @@ private static PlayState idleAnimation(AnimationState state) private static PlayState walkAnimation(AnimationState state) { - if(!state.isMoving()) + if(!state.getAnimatable().isMovingHorizontally()) { return PlayState.STOP; } diff --git a/src/main/java/com/mraof/minestuck/entity/underling/GiclopsEntity.java b/src/main/java/com/mraof/minestuck/entity/underling/GiclopsEntity.java index c889a36d1a..80a2d122a8 100644 --- a/src/main/java/com/mraof/minestuck/entity/underling/GiclopsEntity.java +++ b/src/main/java/com/mraof/minestuck/entity/underling/GiclopsEntity.java @@ -187,7 +187,7 @@ private static PlayState idleAnimation(AnimationState state) private static PlayState walkAnimation(AnimationState state) { - if(state.isMoving()) + if(state.getAnimatable().isMovingHorizontally()) { state.getController().setAnimation(WALK_ANIMATION); return PlayState.CONTINUE; diff --git a/src/main/java/com/mraof/minestuck/entity/underling/OgreEntity.java b/src/main/java/com/mraof/minestuck/entity/underling/OgreEntity.java index 2a72f0c7f6..5ab0df839a 100644 --- a/src/main/java/com/mraof/minestuck/entity/underling/OgreEntity.java +++ b/src/main/java/com/mraof/minestuck/entity/underling/OgreEntity.java @@ -130,7 +130,7 @@ public void registerControllers(AnimatableManager.ControllerRegistrar controller private static PlayState walkAnimation(AnimationState state) { - if(state.isMoving()) + if(state.getAnimatable().isMovingHorizontally()) { state.getController().setAnimation(WALK_ANIMATION); return PlayState.CONTINUE; @@ -140,7 +140,7 @@ private static PlayState walkAnimation(AnimationState state) private static PlayState walkArmsAnimation(AnimationState state) { - if(state.isMoving() && !state.getAnimatable().isActive()) + if(state.getAnimatable().isMovingHorizontally() && !state.getAnimatable().isActive()) { state.getController().setAnimation(WALKARMS_ANIMATION); return PlayState.CONTINUE; diff --git a/src/main/java/com/mraof/minestuck/entity/underling/UnderlingEntity.java b/src/main/java/com/mraof/minestuck/entity/underling/UnderlingEntity.java index c79ff0158e..1ad75e3615 100644 --- a/src/main/java/com/mraof/minestuck/entity/underling/UnderlingEntity.java +++ b/src/main/java/com/mraof/minestuck/entity/underling/UnderlingEntity.java @@ -401,6 +401,11 @@ protected static void firstKillBonus(Entity killer, EcheladderBonusType type) } } + public boolean isMovingHorizontally() + { + return getDeltaMovement().horizontalDistanceSqr() > 0; + } + protected static class UnderlingData implements SpawnGroupData { public final GristType type;