diff --git a/src/main/java/re/imc/geysermodelenginepackgenerator/generator/Animation.java b/src/main/java/re/imc/geysermodelenginepackgenerator/generator/Animation.java index d022e2f..77b4f40 100644 --- a/src/main/java/re/imc/geysermodelenginepackgenerator/generator/Animation.java +++ b/src/main/java/re/imc/geysermodelenginepackgenerator/generator/Animation.java @@ -59,6 +59,9 @@ public class Animation { if (animation.has("loop")) { if (animation.get("loop").getAsJsonPrimitive().isString()) { if (animation.get("loop").getAsString().equals("hold_on_last_frame")) { + if (!animation.has("bones")) { + continue; + } for (Map.Entry bone : animation.get("bones").getAsJsonObject().entrySet()) { for (Map.Entry anim : bone.getValue().getAsJsonObject().entrySet()) { @@ -67,15 +70,17 @@ public class Animation { if (!anim.getValue().isJsonObject()) { continue; } - for (Map.Entry timeline : anim.getValue().getAsJsonObject().entrySet()) { - float time = Float.parseFloat(timeline.getKey()); - if (time > max) { - max = time; - if (timeline.getValue().isJsonObject()) { - end = timeline.getValue().getAsJsonObject(); + try { + for (Map.Entry timeline : anim.getValue().getAsJsonObject().entrySet()) { + float time = Float.parseFloat(timeline.getKey()); + if (time > max) { + max = time; + if (timeline.getValue().isJsonObject()) { + end = timeline.getValue().getAsJsonObject(); + } } } - } + } catch (Throwable t) {} if (end != null && end.get("lerp_mode").getAsString().equals("catmullrom")) { end.addProperty("lerp_mode", "linear"); }