mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
New debug log to prevent startup issues
This commit is contained in:
parent
1252558e6c
commit
bd1b40f1da
@ -1,5 +1,6 @@
|
||||
package net.Indyuce.mmocore.manager;
|
||||
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.ConfigFile;
|
||||
import net.Indyuce.mmocore.api.SoundEvent;
|
||||
import net.Indyuce.mmocore.api.SoundObject;
|
||||
@ -9,6 +10,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
|
||||
public class SoundManager implements MMOCoreManager {
|
||||
private final Map<SoundEvent, SoundObject> sounds = new HashMap<>();
|
||||
@ -25,6 +27,10 @@ public class SoundManager implements MMOCoreManager {
|
||||
|
||||
FileConfiguration config = new ConfigFile("sounds").getConfig();
|
||||
for (SoundEvent sound : SoundEvent.values())
|
||||
try {
|
||||
sounds.put(sound, new SoundObject(config.getString(sound.name().replace("_", "-").toLowerCase())));
|
||||
} catch (RuntimeException exception) {
|
||||
MMOCore.plugin.getLogger().log(Level.WARNING, "Could not load sound for '" + sound.name() + "': " + exception.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user