mirror of
https://github.com/xSquishyLiam/mc-GeyserModelEnginePackGenerator-extension.git
synced 2025-12-20 07:19:19 +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);
|
json.add("animations", newAnimations);
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class AnimationController {
|
|||||||
|
|
||||||
Collections.sort(sorted);
|
Collections.sort(sorted);
|
||||||
for (String id : sorted) {
|
for (String id : sorted) {
|
||||||
|
id = id.replace(" ", "_");
|
||||||
int n = (int) Math.pow(2, (i % 24));
|
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();
|
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);
|
animationControllers.add("controller.animation." + animation.modelId + "." + id, controller);
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ public class Entity {
|
|||||||
|
|
||||||
if (animation != null) {
|
if (animation != null) {
|
||||||
for (String animation : animation.animationIds) {
|
for (String animation : animation.animationIds) {
|
||||||
|
animation = animation.replace(" ", "_");
|
||||||
String controller = "controller.animation." + modelId + "." + animation;
|
String controller = "controller.animation." + modelId + "." + animation;
|
||||||
animate.add(animation + "_control");
|
animate.add(animation + "_control");
|
||||||
jsonAnimations.addProperty(animation, "animation." + modelId + "." + animation);
|
jsonAnimations.addProperty(animation, "animation." + modelId + "." + animation);
|
||||||
|
|||||||
Reference in New Issue
Block a user