refactor: Golduck poser

This commit is contained in:
Gitoido Okaski committed 2026-10-29 19:50:46 +03:00
1 parent 40687d8ba0
commit cd68f75d60
3 files changed
+80 -91

No files matched your search

@@ -1,90 +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.gen1
import com.cobblemon.mod.common.client.render.models.blockbench.frame.HeadedFrame
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.Pose
import com.cobblemon.mod.common.entity.PoseType
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
import net.minecraft.client.model.geom.ModelPart
import net.minecraft.world.phys.Vec3
class GolduckModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
override val rootPart = root.registerChildWithAllChildren("golduck")
override val head = getPart("head")
override var portraitScale = 2.1F
override var portraitTranslation = Vec3(-0.1, 0.55, 0.0)
override var profileScale = 0.8F
override var profileTranslation = Vec3(0.0, 0.54, 0.0)
lateinit var sleep: Pose
lateinit var standing: Pose
lateinit var walk: Pose
lateinit var float: Pose
lateinit var swim: Pose
override val cryAnimation = CryProvider { bedrockStateful("golduck", "cry") }
override fun registerPoses() {
val blink = quirk { bedrockStateful("golduck", "blink")}
standing = registerPose(
poseName = "standing",
poseTypes = UI_POSES + PoseType.STAND,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("golduck", "ground_idle")
)
)
sleep = registerPose(
poseType = PoseType.SLEEP,
animations = arrayOf(bedrock("golduck", "sleep"))
)
walk = registerPose(
poseName = "walk",
poseType = PoseType.WALK,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("golduck", "ground_walk")
)
)
float = registerPose(
poseName = "float",
poseType = PoseType.FLOAT,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("golduck", "water_idle")
)
)
swim = registerPose(
poseName = "swim",
poseType = PoseType.SWIM,
quirks = arrayOf(blink),
animations = arrayOf(
singleBoneLook(),
bedrock("golduck", "water_swim")
)
)
}
// override fun getFaintAnimation(
// pokemonEntity: PokemonEntity,
// state: PosableState<PokemonEntity>
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("golduck", "faint") else null
}
@@ -236,7 +236,6 @@ object VaryingModelRepository {
inbuilt("farfetchd_galarian", ::FarfetchdGalarianModel)
inbuilt("gengar", ::GengarModel)
inbuilt("geodude", ::GeodudeModel)
inbuilt("golduck", ::GolduckModel)
inbuilt("golem", ::GolemModel)
inbuilt("hitmonchan", ::HitmonchanModel)
inbuilt("hitmonlee", ::HitmonleeModel)
@@ -0,0 +1,80 @@
{
"rootBone": "golduck",
"portraitScale": 2.1,
"portraitTranslation": [
-0.1,
0.55,
0
],
"profileScale": 0.8,
"profileTranslation": [
0,
0.54,
0
],
"animations": {
"cry": "q.bedrock_stateful('golduck', 'cry')"
},
"poses": {
"standing": {
"poseTypes": [
"PROFILE",
"PORTRAIT",
"STAND"
],
"animations": [
"q.look('head')",
"q.bedrock('golduck', 'ground_idle')"
],
"quirks": [
"q.bedrock_quirk('golduck', 'blink')"
]
},
"sleep": {
"poseTypes": [
"SLEEP"
],
"animations": [
"q.bedrock('golduck', 'sleep')"
]
},
"walk": {
"poseTypes": [
"WALK"
],
"animations": [
"q.look('head')",
"q.bedrock('golduck', 'ground_walk')"
],
"quirks": [
"q.bedrock_quirk('golduck', 'blink')"
]
},
"float": {
"poseTypes": [
"FLOAT"
],
"isTouchingWater": true,
"animations": [
"q.look('head')",
"q.bedrock('golduck', 'water_idle')"
],
"quirks": [
"q.bedrock_quirk('golduck', 'blink')"
]
},
"swim": {
"poseTypes": [
"SWIM"
],
"isTouchingWater": true,
"animations": [
"q.look('head')",
"q.bedrock('golduck', 'water_swim')"
],
"quirks": [
"q.bedrock_quirk('golduck', 'blink')"
]
}
}
}