From 070bf1e3271d7ded9106e909e723eab78e9379d9 Mon Sep 17 00:00:00 2001 From: Ivan Kh <47220198+Ivan-Khar@users.noreply.github.com> Date: Mon, 4 Dec 2023 08:34:39 +0300 Subject: [PATCH] fix some anims --- .../aquatic/entity/fish/GouramiEntity.kt | 16 ++-------------- .../entity/fish/HybridAquaticFishEntity.kt | 4 ++-- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/GouramiEntity.kt b/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/GouramiEntity.kt index 11223eb18..8341fbcf9 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/GouramiEntity.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/GouramiEntity.kt @@ -21,20 +21,8 @@ class GouramiEntity(entityType: EntityType, world: World) : } } - override fun predicate(event: AnimationState): PlayState { - if (isSubmergedInWater) { - event.controller.setAnimation(RawAnimation.begin().then("swim", Animation.LoopType.LOOP)) - return PlayState.CONTINUE - } - if (!isSubmergedInWater) { - event.controller.setAnimation(RawAnimation.begin().then("flop", Animation.LoopType.LOOP)) - return PlayState.CONTINUE - } - if (isWet && isFallFlying) { - event.controller.setAnimation(RawAnimation.begin().then("swim", Animation.LoopType.LOOP)) - return PlayState.CONTINUE - } - return PlayState.STOP + override fun shouldFlopOnLand(): Boolean { + return true } override fun getMaxSize(): Int { diff --git a/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/HybridAquaticFishEntity.kt b/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/HybridAquaticFishEntity.kt index de026f767..d6620bfca 100644 --- a/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/HybridAquaticFishEntity.kt +++ b/src/main/kotlin/dev/hybridlabs/aquatic/entity/fish/HybridAquaticFishEntity.kt @@ -149,11 +149,11 @@ open class HybridAquaticFishEntity( if (isSubmergedInWater) { event.controller.setAnimation(SWIM_ANIMATION) return PlayState.CONTINUE - } - if (!isSubmergedInWater && shouldFlopOnLand()) { + } else if (shouldFlopOnLand()) { event.controller.setAnimation(FLOP_ANIMATION) return PlayState.CONTINUE } + if (isWet && isFallFlying) { event.controller.setAnimation(SWIM_ANIMATION) return PlayState.CONTINUE