use int property for animation controller

This commit is contained in:
zimzaza4
2024-07-19 16:27:33 +08:00
parent c5a739074b
commit 9e51150dd9
2 changed files with 17 additions and 14 deletions

View File

@@ -54,10 +54,7 @@ public class ExtensionMain implements Extension {
GeyserUtils.addProperty(id, entity + ":" + bone, Boolean.class);
});
GeyserUtils.addProperty(id, "modelengine:anim_idle", Boolean.class);
GeyserUtils.addProperty(id, "modelengine:anim_spawn", Boolean.class);
GeyserUtils.addProperty(id, "modelengine:anim_walk", Boolean.class);
GeyserUtils.addProperty(id, "modelengine:anim_stop", Boolean.class);
GeyserUtils.addProperty(id, "modelengine:anim", Integer.class);
GeyserUtils.registerProperties(id);
}

View File

@@ -15,7 +15,13 @@ public class AnimationController {
],
"transitions": [
{
"idle": "query.property('modelengine:anim_idle')"
"idle": "query.property('modelengine:anim') == 2"
},
{
"walk": "query.property('modelengine:anim') == 3"
},
{
"stop": "query.property('modelengine:anim') == 0"
}
]
},
@@ -25,13 +31,13 @@ public class AnimationController {
],
"transitions": [
{
"spawn": "query.property('modelengine:anim_spawn')"
"spawn": "query.property('modelengine:anim') == 1"
},
{
"walk": "query.property('modelengine:anim_walk')"
"walk": "query.property('modelengine:anim') == 3"
},
{
"stop": "query.property('modelengine:anim_stop')"
"stop": "query.property('modelengine:anim') == 0"
}
]
},
@@ -41,26 +47,26 @@ public class AnimationController {
],
"transitions": [
{
"spawn": "query.property('modelengine:anim_spawn')"
"spawn": "query.property('modelengine:anim') == 1"
},
{
"stop": "query.property('modelengine:anim_stop')"
"stop": "query.property('modelengine:anim') == 0"
},
{
"idle": "query.property('modelengine:anim_idle')"
"idle": "query.property('modelengine:anim') == 2"
}
]
},
"stop": {
"transitions": [
{
"idle": "query.property('modelengine:anim_idle')"
"idle": "query.property('modelengine:anim') == 2"
},
{
"spawn": "query.property('modelengine:anim_spawn')"
"spawn": "query.property('modelengine:anim') == 1"
},
{
"walk": "query.property('modelengine:anim_walk')"
"walk": "query.property('modelengine:anim') == 3"
}
]
}