mirror of
https://gitlab.com/cable-mc/cobblemon.git
synced 2026-11-11 18:58:53 -05:00
refactor: Sandslash poser
This commit is contained in:
1 parent
616d23d149
commit
ee86c54ebd
3 files changed
+38
-73
No files matched your search
-72
@@ -1,72 +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.MOVING_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.STATIONARY_POSES
|
||||
import com.cobblemon.mod.common.entity.PoseType.Companion.UI_POSES
|
||||
import net.minecraft.client.model.geom.ModelPart
|
||||
import net.minecraft.world.phys.Vec3
|
||||
|
||||
class SandslashModel(root: ModelPart) : PokemonPosableModel(root), HeadedFrame {
|
||||
override val rootPart = root.registerChildWithAllChildren("sandslash")
|
||||
override val head = getPart("head")
|
||||
|
||||
override var portraitScale = 2.0F
|
||||
override var portraitTranslation = Vec3(-0.15, 0.0, 0.0)
|
||||
|
||||
override var profileScale = 0.8F
|
||||
override var profileTranslation = Vec3(0.0, 0.55, 0.0)
|
||||
|
||||
lateinit var sleep: Pose
|
||||
lateinit var standing: Pose
|
||||
lateinit var walk: Pose
|
||||
|
||||
override val cryAnimation = CryProvider { bedrockStateful("sandslash", "cry") }
|
||||
|
||||
override fun registerPoses() {
|
||||
val blink = quirk { bedrockStateful("sandslash", "blink")}
|
||||
standing = registerPose(
|
||||
poseName = "standing",
|
||||
poseTypes = STATIONARY_POSES + UI_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("sandslash", "ground_idle")
|
||||
)
|
||||
)
|
||||
|
||||
sleep = registerPose(
|
||||
poseType = PoseType.SLEEP,
|
||||
animations = arrayOf(bedrock("sandslash", "sleep"))
|
||||
)
|
||||
|
||||
walk = registerPose(
|
||||
poseName = "walk",
|
||||
poseTypes = MOVING_POSES,
|
||||
transformTicks = 10,
|
||||
quirks = arrayOf(blink),
|
||||
animations = arrayOf(
|
||||
singleBoneLook(),
|
||||
bedrock("sandslash", "ground_walk")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// override fun getFaintAnimation(
|
||||
// pokemonEntity: PokemonEntity,
|
||||
// state: PosableState<PokemonEntity>
|
||||
// ) = if (state.isPosedIn(standing, walk)) bedrockStateful("sandslash", "faint") else null
|
||||
}
|
||||
-1
@@ -255,7 +255,6 @@ object VaryingModelRepository {
|
||||
inbuilt("ponyta", ::PonytaModel)
|
||||
inbuilt("psyduck", ::PsyduckModel)
|
||||
inbuilt("rapidash", ::RapidashModel)
|
||||
inbuilt("sandslash", ::SandslashModel)
|
||||
inbuilt("tangela", ::TangelaModel)
|
||||
inbuilt("venomoth", ::VenomothModel)
|
||||
inbuilt("venonat", ::VenonatModel)
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"portraitScale": 2,
|
||||
"portraitTranslation": [-0.15, 0, 0],
|
||||
"profileScale": 0.8,
|
||||
"profileTranslation": [0, 0.55, 0],
|
||||
"rootBone": "sandslash",
|
||||
"poses": {
|
||||
"standing": {
|
||||
"poseTypes": ["STAND", "FLOAT", "HOVER", "PROFILE", "PORTRAIT"],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('sandslash', 'ground_idle')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('sandslash', 'blink')"
|
||||
],
|
||||
"transformTicks": 10
|
||||
},
|
||||
"walk": {
|
||||
"poseName": "walk",
|
||||
"poseTypes": ["WALK", "SWIM", "FLY"],
|
||||
"animations": [
|
||||
"q.look('head')",
|
||||
"q.bedrock('sandslash', 'ground_walk')"
|
||||
],
|
||||
"quirks": [
|
||||
"q.bedrock_quirk('sandslash', 'blink')"
|
||||
],
|
||||
"transformTicks": 10
|
||||
},
|
||||
"sleep": {
|
||||
"poseTypes": ["SLEEP"],
|
||||
"animations": [
|
||||
"q.bedrock('sandslash', 'sleep')"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user