mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-23 14:17:48 +07:00
Add RandomSound support to ContentParser (#9518)
This commit is contained in:
@ -271,8 +271,9 @@ public class ContentParser{
|
|||||||
return new Vec3(data.getFloat("x", 0f), data.getFloat("y", 0f), data.getFloat("z", 0f));
|
return new Vec3(data.getFloat("x", 0f), data.getFloat("y", 0f), data.getFloat("z", 0f));
|
||||||
});
|
});
|
||||||
put(Sound.class, (type, data) -> {
|
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());
|
return field != null ? field : Vars.tree.loadSound(data.asString());
|
||||||
});
|
});
|
||||||
put(Music.class, (type, data) -> {
|
put(Music.class, (type, data) -> {
|
||||||
|
Reference in New Issue
Block a user