Skip to content

Commit

Permalink
added namespace to beh entity animations in the description (LotsOfPi…
Browse files Browse the repository at this point in the history
…xelsStudios#128)

* added namespace to beh entity animations in the description

* add anim to test
  • Loading branch information
12rcu authored Aug 28, 2024
1 parent db934ce commit 371d53d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ open class BehaviourEntity(val entityData: Entity.Data) : OverwriteComponents(en
*/
open fun animation(name: String, settings: BehAnimation.() -> Unit) {
unsafeRawAnimations.animation("animation.${entityData.addon.config.namespace}.${entityData.name}.$name", settings)
addSharedAnimation("animation.${entityData.name}.$name", name)
addSharedAnimation("animation.${entityData.addon.config.namespace}.${entityData.name}.$name", name)
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class AnimControllerTest {
components {
physics { }
}
//animation("test") {
// timeline { }
// animLength = 2f
//}
animation("test") {
timeline { }
animLength = 2f
}
animController("my_anim_controller", Query.isBaby) {
initialState = "default"
variables {
Expand All @@ -50,6 +50,27 @@ class AnimControllerTest {
}
}
}
withJsonFile(config.paths.behEntity.resolve("my_anim_test.json")) {
assert(
containsKeyChainValue(
value = "query.is_baby",
"minecraft:entity",
"description",
"scripts",
"animate",
"my_anim_controller"
)
)
assert(
containsKeyChainValue(
value = "controller.animation.${config.namespace}.my_anim_test.my_anim_controller",
"minecraft:entity",
"description",
"animations",
"my_anim_controller"
)
)
}
withJsonFile(config.paths.behAnimController.resolve("my_anim_test.json")) {
assert(
containsKeyChain(
Expand Down

0 comments on commit 371d53d

Please sign in to comment.