Skip to content

Commit

Permalink
Added flop behaviour to jellyfish, need animations
Browse files Browse the repository at this point in the history
Added flop animation to atolla jellyfish
Added flop animation to mauve stinger
Added flop animation to moon jellyfish
  • Loading branch information
MysticKoko committed Feb 16, 2024
1 parent 19a2581 commit 2344a51
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.hybridlabs.aquatic.entity.jellyfish

import dev.hybridlabs.aquatic.entity.fish.HybridAquaticFishEntity
import net.minecraft.entity.*
import net.minecraft.entity.ai.TargetPredicate
import net.minecraft.entity.ai.control.YawAdjustingLookControl
Expand Down Expand Up @@ -131,6 +130,10 @@ open class HybridAquaticJellyfishEntity(type: EntityType<out HybridAquaticJellyf
event.controller.setAnimation(BOB_ANIMATION)
return PlayState.CONTINUE
}
if (!isSubmergedInWater && isOnGround) {
event.controller.setAnimation(FLOP_ANIMATION)
return PlayState.CONTINUE
}
return PlayState.STOP
}
protected open fun getMinSize() : Int {
Expand Down Expand Up @@ -226,6 +229,7 @@ open class HybridAquaticJellyfishEntity(type: EntityType<out HybridAquaticJellyf
val JELLYFISH_SIZE: TrackedData<Int> = DataTracker.registerData(HybridAquaticJellyfishEntity::class.java, TrackedDataHandlerRegistry.INTEGER)

val BOB_ANIMATION: RawAnimation = RawAnimation.begin().then("bob", Animation.LoopType.LOOP)
val FLOP_ANIMATION: RawAnimation = RawAnimation.begin().then("flop", Animation.LoopType.LOOP)

val CLOSE_PLAYER_PREDICATE: TargetPredicate = TargetPredicate.createNonAttackable().setBaseMaxDistance(10.0).ignoreVisibility()

Expand All @@ -252,6 +256,5 @@ open class HybridAquaticJellyfishEntity(type: EntityType<out HybridAquaticJellyf
const val SPAWNED_ON_Y_KEY = "Spawned_on_Y"
const val VARIANT_KEY = "Variant"
const val JELLYFISH_SIZE_KEY = "JellyfishSize"

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,51 @@
"position": [0, "Math.sin(query.anim_time * 90)*1", 0]
}
}
},
"flop": {
"loop": true,
"bones": {
"mauve_stinger": {
"position": [0, -5.4, 0]
},
"atolla_jellyfish": {
"position": [0, -7.9, 0]
},
"head": {
"scale": [1.2, 0.5, 1.2]
},
"core_tentacles": {
"position": [0, 0.5, 0],
"scale": [1, 0.2, 1]
},
"tentacle_a1": {
"rotation": [-90, 0, 0]
},
"tentacle_b1": {
"rotation": [-90, 0, 0]
},
"tentacle_c1": {
"rotation": [-90, 0, 0]
},
"tentacle_d1": {
"rotation": [90, 0, 0]
},
"tentacle_e1": {
"rotation": [90, 0, 0]
},
"tentacle_f1": {
"rotation": [90, 0, 0]
},
"tentacle_f2": {
"rotation": [0, 0, 0]
},
"tentacle_g1": {
"rotation": [-90, 0, 0]
},
"tentacle_h1": {
"rotation": [-90, 0, 0]
}
}
}
},
"geckolib_format_version": 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,51 @@
}
}
}
},
"flop": {
"loop": true,
"bones": {
"mauve_stinger": {
"position": [0, -5.4, 0]
},
"head": {
"scale": [1.2, 0.7, 1.2]
},
"inner_tentacles": {
"position": [0, 0.5, 0]
},
"tentacle_a1": {
"rotation": [-90, 0, 0]
},
"tentacle_b1": {
"rotation": [-90, 0, 0]
},
"tentacle_c1": {
"rotation": [-90, 0, 0]
},
"tentacle_d1": {
"rotation": [90, 0, 0]
},
"tentacle_e1": {
"rotation": [90, 0, 0]
},
"tentacle_f1": {
"rotation": [90, 0, 0]
},
"tentacle_f2": {
"rotation": [0, 0, 0]
},
"tentacle_g1": {
"rotation": [-90, 0, 0]
},
"tentacle_h1": {
"rotation": [-90, 0, 0]
},
"core_tentacles": {
"position": [0, 2.5, 0],
"scale": [1, 0.2, 1]
}
}
}
},
"geckolib_format_version": 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,37 @@
"position": [0, "Math.sin(query.anim_time * 90)*0.5", 0]
}
}
},
"flop": {
"loop": true,
"bones": {
"moon_jelly": {
"position": [0, -1.75, 0]
},
"head": {
"position": [0, -0.5, 0],
"scale": [1.2, 0.8, 1.2]
},
"core_tentacles": {
"position": [0, 1, 0]
},
"tentacle_1": {
"rotation": [-54.7356, 30, 54.7356],
"position": [-0.5, 0.25, -0.5]
},
"tentacle_2": {
"rotation": [-54.7356, -30, -54.73561],
"position": [0.5, 0.25, -0.5]
},
"tentacle_3": {
"rotation": [54.73561, 30, -54.73561],
"position": [0.5, 0.25, 0.5]
},
"tentacle_4": {
"rotation": [54.7356, -30, 54.7356],
"position": [-0.5, 0.25, 0.5]
}
}
}
},
"geckolib_format_version": 2
Expand Down

0 comments on commit 2344a51

Please sign in to comment.