mirror of
https://github.com/GeyserExtensionists/GeyserModelEnginePackGenerator.git
synced 2025-12-19 15:09:18 +00:00
replace illegal chars
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user