From 4cd3e0502840c67378ab0a089d31fde6aed2cecc Mon Sep 17 00:00:00 2001 From: Gitoido Okaski Date: Wed, 21 Oct 2026 02:04:30 +0300 Subject: [PATCH] refactor: Rapidash (+ galar) poser --- .../pokemon/gen1/RapidashGalarianModel.kt | 83 ----------------- .../blockbench/pokemon/gen1/RapidashModel.kt | 93 ------------------- .../repository/VaryingModelRepository.kt | 2 - .../posers/0078_rapidash/rapidash.json | 67 +++++++++++++ .../0078_rapidash/rapidash_galarian.json | 66 +++++++++++++ 5 files changed, 133 insertions(+), 178 deletions(-) delete mode 100644 common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashGalarianModel.kt delete mode 100644 common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashModel.kt create mode 100644 common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash.json create mode 100644 common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash_galarian.json diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashGalarianModel.kt b/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashGalarianModel.kt deleted file mode 100644 index 41d17ea10f..0000000000 --- a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashGalarianModel.kt +++ /dev/null @@ -1,83 +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.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 com.cobblemon.mod.common.util.isBattling -import net.minecraft.client.model.geom.ModelPart -import net.minecraft.world.phys.Vec3 - -class RapidashGalarianModel (root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame { - override val rootPart = root.registerChildWithAllChildren("rapidash_galar") - override val head = getPart("neck") - - 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.86F - override var portraitTranslation = Vec3(-0.5, 1.3, 0.0) - - override var profileScale = 0.67F - override var profileTranslation = Vec3(0.0, 0.72, 0.0) - - lateinit var standing: CobblemonPose - lateinit var walk: CobblemonPose - lateinit var battle_idle: CobblemonPose - - override val cryAnimation = CryProvider { bedrockStateful("rapidash_galar", "cry") } - - override fun registerPoses() { - val blink = quirk { bedrockStateful("rapidash_galar", "blink") } - standing = registerPose( - poseName = "standing", - poseTypes = PoseType.UI_POSES + PoseType.STATIONARY_POSES, - quirks = arrayOf(blink), - condition = { !it.isBattling }, - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash_galar", "ground_idle"), - bedrock("rapidash_galar", "hair") - ) - ) - - walk = registerPose( - poseName = "walk", - poseTypes = PoseType.MOVING_POSES, - quirks = arrayOf(blink), - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash_galar", "ground_walk"), - bedrock("rapidash_galar", "hair") - ) - ) - - battle_idle = registerPose( - poseName = "battle_idle", - poseTypes = PoseType.STATIONARY_POSES, - condition = { it.isBattling }, - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash_galar", "battle_idle"), - bedrock("rapidash_galar", "hair") - ) - ) - } - -// override fun getFaintAnimation( -// pokemonEntity: PokemonEntity, -// state: PosableState -// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("rapidash_galar", "faint") else null -} \ No newline at end of file diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashModel.kt b/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashModel.kt deleted file mode 100644 index 8ad74d2821..0000000000 --- a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/RapidashModel.kt +++ /dev/null @@ -1,93 +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.PosableState -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.Pose -import com.cobblemon.mod.common.entity.PoseType -import com.cobblemon.mod.common.entity.PoseType.Companion.MOVING_POSES -import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES -import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES -import com.cobblemon.mod.common.util.isBattling -import net.minecraft.client.model.geom.ModelPart -import net.minecraft.world.phys.Vec3 - -class RapidashModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame, QuadrupedFrame { - override val rootPart = root.registerChildWithAllChildren("rapidash") - 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 = 2.5F - override var portraitTranslation = Vec3(-0.7, 1.11, 0.0) - - override var profileScale = 0.75F - override var profileTranslation = Vec3(0.0, 0.65, 0.0) - - lateinit var standing: Pose - lateinit var walk: Pose - lateinit var sleep: Pose - lateinit var battling: Pose - - override val cryAnimation = CryProvider { bedrockStateful("rapidash", "cry") } - - override fun registerPoses() { - val blink = quirk { bedrockStateful("rapidash", "blink") } - sleep = registerPose( - poseType = PoseType.SLEEP, - animations = arrayOf(bedrock("rapidash", "sleep")) - ) - - standing = registerPose( - poseName = "standing", - poseTypes = STATIONARY_POSES + UI_POSES, - transformTicks = 10, - condition = { !it.isBattling }, - quirks = arrayOf(blink), - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash", "ground_idle") - ) - ) - - walk = registerPose( - poseName = "walk", - poseTypes = MOVING_POSES, - transformTicks = 10, - quirks = arrayOf(blink), - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash", "ground_walk") - ) - ) - - battling = registerPose( - poseName = "battlestanding", - poseTypes = STATIONARY_POSES, - transformTicks = 10, - quirks = arrayOf(blink), - condition = { it.isBattling }, - animations = arrayOf( - singleBoneLook(), - bedrock("rapidash", "ground_idle") - ) - ) - } - - override fun getFaintAnimation(state: PosableState) = if (state.isPosedIn(standing, walk, sleep)) bedrockStateful("rapidash", "faint") else - if (state.isPosedIn(battling)) bedrockStateful("rapidash", "battle_faint") - else null -} \ No newline at end of file diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt b/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt index e8f10ac0b6..4b9cdf345c 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/repository/VaryingModelRepository.kt @@ -239,7 +239,6 @@ object VaryingModelRepository { inbuilt("lickitung", ::LickitungModel) inbuilt("marowak", ::MarowakModel) inbuilt("pinsir", ::PinsirModel) - inbuilt("rapidash", ::RapidashModel) inbuilt("tangela", ::TangelaModel) inbuilt("elekid", ::ElekidModel) inbuilt("hitmontop", ::HitmontopModel) @@ -372,7 +371,6 @@ object VaryingModelRepository { inbuilt("bunnelby", ::BunnelbyModel) inbuilt("arrokuda", ::ArrokudaModel) inbuilt("barraskewda", ::BarraskewdaModel) - inbuilt("rapidash_galarian", ::RapidashGalarianModel) inbuilt("volbeat", ::VolbeatModel) inbuilt("illumise", ::IllumiseModel) inbuilt("yamper", ::YamperModel) diff --git a/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash.json b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash.json new file mode 100644 index 0000000000..4365c2cb06 --- /dev/null +++ b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash.json @@ -0,0 +1,67 @@ +{ + "rootBone": "rapidash", + "portraitScale": 2.5, + "portraitTranslation": [ + -0.7, + 1.11, + 0 + ], + "profileScale": 0.75, + "profileTranslation": [ + 0, + 0.65, + 0 + ], + "animations": { + "cry": "q.bedrock_stateful('rapidash', 'cry')", + "faint": "q.bedrock_stateful('rapidash', 'faint')" + }, + "poses": { + "standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER", + "PROFILE", + "PORTRAIT" + ], + "isBattle": false, + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash', 'ground_idle')" + ], + "quirks": [ + "q.bedrock_quirk('rapidash', 'blink')" + ] + }, + "walk": { + "poseTypes": [ + "WALK", + "SWIM", + "FLY" + ], + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash', 'ground_walk')" + ], + "quirks": [ + "q.bedrock_quirk('rapidash', 'blink')" + ] + }, + "battle-standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER" + ], + "isBattle": true, + "namedAnimations": { + "faint": "q.bedrock_stateful('rapidash', 'battle_faint')" + }, + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash', 'battle_idle')" + ] + } + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash_galarian.json b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash_galarian.json new file mode 100644 index 0000000000..32e4d6dce4 --- /dev/null +++ b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0078_rapidash/rapidash_galarian.json @@ -0,0 +1,66 @@ +{ + "rootBone": "rapidash_galar", + "portraitScale": 1.86, + "portraitTranslation": [ + -0.5, + 1.3, + 0 + ], + "profileScale": 0.67, + "profileTranslation": [ + 0, + 0.72, + 0 + ], + "animations": { + "cry": "q.bedrock_stateful('rapidash', 'cry')" + }, + "poses": { + "standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER", + "PROFILE", + "PORTRAIT" + ], + "isBattle": false, + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash_galar', 'ground_idle')", + "q.bedrock('rapidash_galar', 'hair')" + ], + "quirks": [ + "q.bedrock_quirk('rapidash_galar', 'blink')" + ] + }, + "walk": { + "poseTypes": [ + "WALK", + "SWIM", + "FLY" + ], + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash_galar', 'ground_walk')", + "q.bedrock('rapidash_galar', 'hair')" + ], + "quirks": [ + "q.bedrock_quirk('rapidash_galar', 'blink')" + ] + }, + "battle-standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER" + ], + "isBattle": true, + "animations": [ + "q.look('neck')", + "q.bedrock('rapidash_galar', 'battle_idle')", + "q.bedrock('rapidash_galar', 'hair')" + ] + } + } +} \ No newline at end of file