9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-19 15:09:15 +00:00

修复声音错误验证sound event

This commit is contained in:
XiaoMoMi
2025-12-05 23:27:11 +08:00
parent d5bbbc4903
commit 2f8351d75e

View File

@@ -1419,6 +1419,10 @@ public abstract class AbstractPackManager implements PackManager {
oggToSoundEvents.put(Key.of(primitive.getAsString()), soundKey); oggToSoundEvents.put(Key.of(primitive.getAsString()), soundKey);
} }
} else if (sound instanceof JsonObject soundObj && soundObj.has("name")) { } else if (sound instanceof JsonObject soundObj && soundObj.has("name")) {
if (soundObj.has("type")) {
String type = soundObj.get("type").getAsString();
if (!type.equals("file")) continue;
}
String name = soundObj.get("name").getAsString(); String name = soundObj.get("name").getAsString();
oggToSoundEvents.put(Key.of(name), soundKey); oggToSoundEvents.put(Key.of(name), soundKey);
} }