From 0c8239b85e0cf3f6e6d646c34829cda5facfcbe2 Mon Sep 17 00:00:00 2001 From: Gitoido Okaski Date: Wed, 21 Oct 2026 02:23:29 +0300 Subject: [PATCH] refactor: Doduo poser --- .../blockbench/pokemon/gen1/DoduoModel.kt | 85 ------------------- .../repository/VaryingModelRepository.kt | 1 - .../pokemon/posers/0084_doduo/doduo.json | 82 ++++++++++++++++++ 3 files changed, 82 insertions(+), 86 deletions(-) delete mode 100644 common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DoduoModel.kt create mode 100644 common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0084_doduo/doduo.json diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DoduoModel.kt b/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DoduoModel.kt deleted file mode 100644 index f4751f2e44..0000000000 --- a/common/src/main/kotlin/com/cobblemon/mod/common/client/render/models/blockbench/pokemon/gen1/DoduoModel.kt +++ /dev/null @@ -1,85 +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.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.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 DoduoModel (root: ModelPart) : PokemonPosableModel(root) { - override val rootPart = root.registerChildWithAllChildren("doduo") - - override var portraitScale = 2.0F - override var portraitTranslation = Vec3(-0.1, 0.35, 0.0) - - override var profileScale = 0.85F - override var profileTranslation = Vec3(0.0, 0.5, 0.0) - - lateinit var standing: CobblemonPose - lateinit var walking: CobblemonPose - lateinit var sleep: CobblemonPose - lateinit var battleidle: CobblemonPose - - override val cryAnimation = CryProvider { bedrockStateful("doduo", "cry") } - - override fun registerPoses() { - val blink = quirk { bedrockStateful("doduo", "blink1") } - val blink2 = quirk { bedrockStateful("doduo", "blink2") } - val bite = quirk(secondsBetweenOccurrences = 5F to 20F) { bedrockStateful("doduo", "bite_quirk1") } - val bite2 = quirk(secondsBetweenOccurrences = 5F to 20F) { bedrockStateful("doduo", "bite_quirk2") } - - sleep = registerPose( - poseType = PoseType.SLEEP, - animations = arrayOf(bedrock("doduo", "sleep")) - ) - - standing = registerPose( - poseName = "standing", - poseTypes = STATIONARY_POSES + UI_POSES, - transformTicks = 10, - condition = { !it.isBattling }, - quirks = arrayOf(blink, blink2), - animations = arrayOf( - bedrock("doduo", "ground_idle") - ) - ) - - walking = registerPose( - poseName = "walking", - poseTypes = MOVING_POSES, - transformTicks = 10, - quirks = arrayOf(blink, blink2), - animations = arrayOf( - bedrock("doduo", "ground_walk") - ) - ) - - battleidle = registerPose( - poseName = "battle_idle", - poseTypes = PoseType.STATIONARY_POSES, - transformTicks = 10, - quirks = arrayOf(blink, blink2, bite, bite2), - condition = { it.isBattling }, - animations = arrayOf( - bedrock("doduo", "battle_idle") - ) - ) - } -// override fun getFaintAnimation( -// pokemonEntity: PokemonEntity, -// state: PosableState -// ) = if (state.isPosedIn(standing, walking, battleidle, sleep)) bedrockStateful("doduo", "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 746dd8db1f..fa576965ec 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 @@ -223,7 +223,6 @@ object VaryingModelRepository { inbuilt("electrode", ::ElectrodeModel) inbuilt("cubone", ::CuboneModel) inbuilt("dodrio", ::DodrioModel) - inbuilt("doduo", ::DoduoModel) inbuilt("electabuzz", ::ElectabuzzModel) inbuilt("exeggcute", ::ExeggcuteModel) inbuilt("exeggutor", ::ExeggutorModel) diff --git a/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0084_doduo/doduo.json b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0084_doduo/doduo.json new file mode 100644 index 0000000000..53181bdec1 --- /dev/null +++ b/common/src/main/resources/assets/cobblemon/bedrock/pokemon/posers/0084_doduo/doduo.json @@ -0,0 +1,82 @@ +{ + "rootBone": "doduo", + "portraitScale": 2.0, + "portraitTranslation": [ + -0.1, + 0.35, + 0 + ], + "profileScale": 0.85, + "profileTranslation": [ + 0, + 0.5, + 0 + ], + "animations": { + "cry": "q.bedrock_stateful('doduo', 'cry')" + }, + "poses": { + "sleep": { + "poseTypes": [ + "SLEEP" + ], + "animations": [ + "q.bedrock('doduo', 'sleep')" + ] + }, + "standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER", + "PROFILE", + "PORTRAIT" + ], + "isBattle": false, + "animations": [ + "q.look('head')", + "q.bedrock('doduo', 'ground_idle')" + ], + "transformTicks": 10, + "quirks": [ + "q.bedrock_quirk('doduo', 'blink1')", + "q.bedrock_quirk('doduo', 'blink2')" + ] + }, + "walk": { + "poseTypes": [ + "WALK", + "SWIM", + "FLY" + ], + "animations": [ + "q.look('head')", + "q.bedrock('doduo', 'ground_walk')" + ], + "transformTicks": 10, + "quirks": [ + "q.bedrock_quirk('doduo', 'blink1')", + "q.bedrock_quirk('doduo', 'blink2')" + ] + }, + "battle-standing": { + "poseTypes": [ + "STAND", + "FLOAT", + "HOVER" + ], + "isBattle": true, + "animations": [ + "q.look('head')", + "q.bedrock('doduo', 'battle_idle')" + ], + "transformTicks": 10, + "quirks": [ + "q.bedrock_quirk('doduo', 'blink1')", + "q.bedrock_quirk('doduo', 'blink2')", + "q.bedrock_quirk('doduo', 'bite_quirk1', 5, 20, 1)", + "q.bedrock_quirk('doduo', 'bite_quirk2', 5, 20, 1)" + ] + } + } +} \ No newline at end of file