Implemented Trapinch and Vibrava animations

This commit is contained in:
Jerzykv committed 2026-12-01 19:36:28 +01:00
1 parent 0d14365932
commit 3b252fed00
9 files changed
+2557 -224

No files matched your search

@@ -1,70 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.animation.QuadrupedWalkAnimation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class TrapinchModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame {
override val rootPart = root.registerChildWithAllChildren("trapinch")
override val head = getPart("head")
override val foreLeftLeg = getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 1.44F
override var portraitTranslation = Vec3(-0.4, -0.6, 0.0)
override var profileScale = 0.9F
override var profileTranslation = Vec3(0.12, 0.33, 0.0)
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("trapinch", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("trapinch", "blink") }
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.UI_POSES + PoseType.STATIONARY_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("trapinch", "ground_idle")
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES,
quirks = arrayOf(blink),
animations = arrayOf(
QuadrupedWalkAnimation(this, periodMultiplier = 1.1F),
singleBoneLook(),
bedrock("trapinch", "ground_idle")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("trapinch", "faint") else null
}
@@ -1,104 +0,0 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.client.render.models.blockbench.pokemon.gen3
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.PokemonPosableModel
import com.cobblemon.mod.common.client.render.models.blockbench.createTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.frame.BiWingedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.frame.QuadrupedFrame
import com.cobblemon.mod.common.client.render.models.blockbench.pokemon.CryProvider
import com.cobblemon.mod.common.client.render.models.blockbench.pose.CobblemonPose
import com.cobblemon.mod.common.client.render.models.blockbench.pose.ModelPartTransformation
import com.cobblemon.mod.common.client.render.models.blockbench.wavefunction.triangleFunction
import com.cobblemon.mod.common.entity.PoseType
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class VibravaModel (root: ModelPart) : PokemonPosableModel(root), QuadrupedFrame, HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("vibrava")
override val head = getPart("head")
override val foreLeftLeg= getPart("leg_front_left")
override val foreRightLeg = getPart("leg_front_right")
override val hindLeftLeg = getPart("leg_back_left")
override val hindRightLeg = getPart("leg_back_right")
override var portraitScale = 1.36F
override var portraitTranslation = Vec3(-0.37, -0.55, 0.0)
override var profileScale = 0.54F
override var profileTranslation = Vec3(-0.01, 0.71, 0.0)
lateinit var standing: CobblemonPose
lateinit var walk: CobblemonPose
override val cryAnimation = CryProvider { bedrockStateful("vibrava", "cry") }
val wing_front_left = getPart("wing_front_left")
val wing_front_right = getPart("wing_front_right")
override fun registerPoses() {
val blink = quirk { bedrockStateful("vibrava", "blink") }
val wingFrame1 = object : BiWingedFrame {
override val rootPart = this@VibravaModel.rootPart
override val leftWing = getPart("wing_front_left")
override val rightWing = getPart("wing_front_right")
}
val wingFrame2 = object : BiWingedFrame {
override val rootPart = this@VibravaModel.rootPart
override val leftWing = getPart("wing_back_left")
override val rightWing = getPart("wing_back_right")
}
standing = registerPose(
poseName = "standing",
poseTypes = PoseType.STATIONARY_POSES + PoseType.UI_POSES - PoseType.HOVER,
transformTicks = 30,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(pitchMultiplier = 0.6F, yawMultiplier = 0.3F),
bedrock("vibrava", "ground_idle")
),
transformedParts = arrayOf(
wing_front_left.createTransformation().addRotationDegrees(ModelPartTransformation.Y_AXIS, -75),
wing_front_right.createTransformation().addRotationDegrees(ModelPartTransformation.Y_AXIS, 75)
)
)
walk = registerPose(
poseName = "walk",
poseTypes = PoseType.MOVING_POSES + PoseType.HOVER,
transformTicks = 10,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(pitchMultiplier = 0.6F, yawMultiplier = 0.3F),
bedrock("vibrava", "ground_idle"),
wingFrame1.wingFlap(
flapFunction = triangleFunction(period = 0.08F, amplitude = 0.6F),
timeVariable = { state, _, _ -> state.animationSeconds },
axis = ModelPartTransformation.Z_AXIS
),
wingFrame2.wingFlap(
flapFunction = triangleFunction(period = 0.1F, amplitude = 0.4F),
timeVariable = { state, _, _ -> 0.01F + state.animationSeconds },
axis = ModelPartTransformation.Z_AXIS
)
),
transformedParts = arrayOf(
rootPart.createTransformation().addPosition(ModelPartTransformation.Y_AXIS, -4),
wing_front_left.createTransformation().addRotationDegrees(ModelPartTransformation.Z_AXIS, -30),
wing_front_right.createTransformation().addRotationDegrees(ModelPartTransformation.Z_AXIS, 30)
)
)
}
}
@@ -507,8 +507,6 @@ object VaryingModelRepository {
inbuilt("jangmo-o", ::JangmoOModel)
inbuilt("hakamo-o", ::HakamoOModel)
inbuilt("kommo-o", ::KommoOModel)
inbuilt("trapinch", ::TrapinchModel)
inbuilt("vibrava", ::VibravaModel)
inbuilt("larvitar", ::LarvitarModel)
inbuilt("pupitar", ::PupitarModel)
inbuilt("impidimp", ::ImpidimpModel)
@@ -0,0 +1,61 @@
{
"portraitScale": 1.5,
"portraitTranslation": [-0.52, -0.54, 0],
"profileScale": 0.9,
"profileTranslation": [0.12, 0.33, 0],
"rootBone": "trapinch",
"animations": {
"cry": "q.bedrock_stateful('trapinch', 'cry')"
},
"poses": {
"battle-standing": {
"poseTypes": ["STAND"],
"isBattle": true,
"animations": [
"q.look('head')",
"q.bedrock('trapinch', 'battle_idle')"
],
"quirks": [
"q.bedrock_quirk('trapinch', 'blink')"
]
},
"battle-sleep": {
"poseTypes": ["SLEEP"],
"isBattle": true,
"animations": ["q.bedrock('trapinch', 'battle_sleep')"],
"namedAnimations": {
"cry": "q.bedrock_stateful('dummy', 'cry')"
},
"quirks": []
},
"standing": {
"poseTypes": ["STAND", "NONE", "PORTRAIT", "PROFILE"],
"isBattle": false,
"animations": [
"q.look('head')",
"q.bedrock('trapinch', 'ground_idle')"
],
"quirks": [
"q.bedrock_quirk('trapinch', 'blink')"
]
},
"walking": {
"poseTypes": ["WALK"],
"animations": [
"q.bedrock('trapinch', 'ground_walk')"
],
"quirks": [
"q.bedrock_quirk('trapinch', 'blink')"
]
},
"sleep": {
"poseTypes": ["SLEEP"],
"isBattle": false,
"animations": ["q.bedrock('trapinch', 'sleep')"],
"namedAnimations": {
"cry": "q.bedrock_stateful('dummy', 'cry')"
},
"quirks": []
}
}
}
@@ -0,0 +1,60 @@
{
"portraitScale": 1.36,
"portraitTranslation": [-0.37, -0.55, 0.0],
"profileScale": 0.54,
"profileTranslation": [0.01, 0.71, 0],
"rootBone": "vibrava",
"animations": {
"cry": "q.bedrock_stateful('vibrava', 'cry')"
},
"poses": {
"standing": {
"poseTypes": ["STAND", "NONE", "PORTRAIT", "PROFILE"],
"animations": [
"q.look('head')",
"q.bedrock('vibrava', 'ground_idle')"
],
"quirks": [
"q.bedrock_quirk('vibrava', q.array('look_left_quirk', 'look_right_quirk'), 30, 90, 1)"
]
},
"walking": {
"poseTypes": ["WALK"],
"animations": [
"q.bedrock('vibrava', 'air_fly')"
],
"transformedParts": [
{
"part": "body",
"position": [0, -10, 0],
"rotation": [0, 0, 0],
"isVisible": true
}
]
},
"hover": {
"poseTypes": ["HOVER"],
"isBattle": false,
"animations": [
"q.look('head')",
"q.bedrock('vibrava', 'air_idle')"
],
"quirks": [
"q.bedrock_quirk('vibrava', q.array('look_left_quirk', 'look_right_quirk'), 30, 90, 1)"
]
},
"fly": {
"poseTypes": ["FLY"],
"animations": [
"q.bedrock('vibrava', 'air_fly')"
]
},
"sleep": {
"poseTypes": ["SLEEP"],
"animations": ["q.bedrock('vibrava', 'sleep')"],
"namedAnimations": {
"cry": "q.bedrock_stateful('dummy', 'cry')"
}
}
}
}
@@ -52,7 +52,7 @@
"behaviour": {
"moving": {
"walk": {
"walkSpeed": 0.3
"walkSpeed": 0.1
},
"swim": {
"avoidsWater": true
@@ -57,6 +57,9 @@
"rouseChance": 0.0042
},
"moving": {
"walk": {
"walkSpeed": 0.3
},
"fly": {
"canFly": true
},