Skip to content

Commit

Permalink
Animation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
MysticKoko committed Nov 3, 2024
1 parent 6e34f78 commit ab47416
Show file tree
Hide file tree
Showing 84 changed files with 695 additions and 1,801 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ package dev.hybridlabs.aquatic.client.model.entity.cephalopod

import dev.hybridlabs.aquatic.HybridAquatic
import dev.hybridlabs.aquatic.entity.cephalopod.HybridAquaticCephalopodEntity
import net.minecraft.client.MinecraftClient
import net.minecraft.client.render.entity.model.EntityModelPartNames
import net.minecraft.util.Identifier
import net.minecraft.util.math.MathHelper
import software.bernie.geckolib.core.animation.AnimationState
import software.bernie.geckolib.model.GeoModel

abstract class HybridAquaticCephalopodEntityModel<T: HybridAquaticCephalopodEntity> (private val id: String) : GeoModel<T>() {
Expand All @@ -26,4 +30,16 @@ abstract class HybridAquaticCephalopodEntityModel<T: HybridAquaticCephalopodEnti
return Identifier(HybridAquatic.MOD_ID, "animations/${id}_${variant.variantName}.animation.json")
return Identifier(HybridAquatic.MOD_ID, "animations/$id.animation.json")
}

override fun setCustomAnimations(
animatable: T,
instanceId: Long,
animationState: AnimationState<T>
) {
super.setCustomAnimations(animatable, instanceId, animationState)
val deltaTime: Float = MinecraftClient.getInstance().tickDelta

val body = animationProcessor.getBone(EntityModelPartNames.BODY)
body.rotX = MathHelper.lerp(deltaTime, animatable.prevPitch, animatable.pitch) * -MathHelper.RADIANS_PER_DEGREE
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.world.World

class CuttlefishEntity(entityType: EntityType<out CuttlefishEntity>, world: World) :
HybridAquaticCephalopodEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.CUTTLEFISH_PREY, HybridAquaticEntityTags.CUTTLEFISH_PREDATOR, true) {
HybridAquaticCephalopodEntity(
entityType,
world,
emptyMap(),
HybridAquaticEntityTags.CUTTLEFISH_PREY,
HybridAquaticEntityTags.CUTTLEFISH_PREDATOR
) {

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.world.World

class FireflySquidEntity(entityType: EntityType<out FireflySquidEntity>, world: World) :
HybridAquaticCephalopodEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.FIREFLY_SQUID_PREY, HybridAquaticEntityTags.FIREFLY_SQUID_PREDATOR, true) {
HybridAquaticCephalopodEntity(
entityType,
world,
emptyMap(),
HybridAquaticEntityTags.FIREFLY_SQUID_PREY,
HybridAquaticEntityTags.FIREFLY_SQUID_PREDATOR
) {

companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import net.minecraft.entity.mob.WaterCreatureEntity
import net.minecraft.world.World

class GlowingSuckerOctopusEntity(entityType: EntityType<out GlowingSuckerOctopusEntity>, world: World) :
HybridAquaticCephalopodEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.OCTOPUS_PREY, HybridAquaticEntityTags.OCTOPUS_PREDATOR, false) {
HybridAquaticCephalopodEntity(entityType, world, emptyMap(), HybridAquaticEntityTags.OCTOPUS_PREY, HybridAquaticEntityTags.OCTOPUS_PREDATOR) {
companion object {
fun createMobAttributes(): DefaultAttributeContainer.Builder {
return WaterCreatureEntity.createMobAttributes()
Expand Down
Loading

0 comments on commit ab47416

Please sign in to comment.