From 9093c92b075c8b5de1bcc6835acab9926dec39d1 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Sun, 4 Feb 2024 15:58:40 -0800 Subject: [PATCH] Add RandomSound support to ContentParser (#9518) --- core/src/mindustry/mod/ContentParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 269cc56ce5..093f9fd98f 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -271,8 +271,9 @@ public class ContentParser{ return new Vec3(data.getFloat("x", 0f), data.getFloat("y", 0f), data.getFloat("z", 0f)); }); put(Sound.class, (type, data) -> { - var field = fieldOpt(Sounds.class, data); + if(data.isArray()) return new RandomSound(parser.readValue(Sound[].class, data)); + var field = fieldOpt(Sounds.class, data); return field != null ? field : Vars.tree.loadSound(data.asString()); }); put(Music.class, (type, data) -> {