diff --git a/BlueMapCommon/webapp/src/js/map/TextureAnimation.js b/BlueMapCommon/webapp/src/js/map/TextureAnimation.js index 540f5abe..5f742465 100644 --- a/BlueMapCommon/webapp/src/js/map/TextureAnimation.js +++ b/BlueMapCommon/webapp/src/js/map/TextureAnimation.js @@ -44,8 +44,10 @@ export class TextureAnimation { this.frameImages = height / width; this.uniforms.animationFrameHeight.value = 1 / this.frameImages; this.frames = this.frameImages; - if (this.data.frames) { + if (this.data.frames && this.data.frames.length > 0) { this.frames = this.data.frames.length; + } else { + this.data.frames = null; } } diff --git a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/AnimationMeta.java b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/AnimationMeta.java index 0042e8fd..3aec544e 100644 --- a/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/AnimationMeta.java +++ b/BlueMapCore/src/main/java/de/bluecolored/bluemap/core/resources/resourcepack/texture/AnimationMeta.java @@ -101,7 +101,7 @@ public AnimationMeta read(JsonReader in, Gson gson) throws IOException { } private void readFramesList(JsonReader in, AnimationMeta animationMeta) throws IOException { - animationMeta.frames = new ArrayList<>(); + List frames = new ArrayList<>(); in.beginArray(); while (in.hasNext()) { @@ -122,9 +122,12 @@ private void readFramesList(JsonReader in, AnimationMeta animationMeta) throws I in.endObject(); } - animationMeta.frames.add(new FrameMeta(index, time)); + frames.add(new FrameMeta(index, time)); } in.endArray(); + + if (!frames.isEmpty()) + animationMeta.frames = frames; } @Override