replace illegal chars

This commit is contained in:
zimzaza4
2025-06-10 09:04:06 +08:00
parent ffea824de9
commit ce0306a187
3 changed files with 3 additions and 2 deletions

View File

@@ -87,7 +87,7 @@ public class Animation {
}
}
newAnimations.add("animation." + modelId + "." + element.getKey(), element.getValue());
newAnimations.add("animation." + modelId + "." + element.getKey().replace(" ", "_"), element.getValue());
}
json.add("animations", newAnimations);

View File

@@ -51,7 +51,7 @@ public class AnimationController {
Collections.sort(sorted);
for (String id : sorted) {
id = id.replace(" ", "_");
int n = (int) Math.pow(2, (i % 24));
JsonObject controller = new JsonParser().parse(CONTROLLER_TEMPLATE.replace("%anim%", id).replace("%query%", "math.mod(math.floor(query.property('modelengine:anim" + i / 24 + "') / " + n + "), 2)")).getAsJsonObject();
animationControllers.add("controller.animation." + animation.modelId + "." + id, controller);

View File

@@ -112,6 +112,7 @@ public class Entity {
if (animation != null) {
for (String animation : animation.animationIds) {
animation = animation.replace(" ", "_");
String controller = "controller.animation." + modelId + "." + animation;
animate.add(animation + "_control");
jsonAnimations.addProperty(animation, "animation." + modelId + "." + animation);