mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-31 01:44:22 +07:00
Add RandomSound support to ContentParser (#9518)
This commit is contained in:
parent
e521cc5237
commit
9093c92b07
@ -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) -> {
|
||||
|
Loading…
Reference in New Issue
Block a user