13
0
geforkt von Mirrors/Paper
Paper/src/main/java/org/bukkit/craftbukkit/CraftSound.java

27 Zeilen
714 B
Java

package org.bukkit.craftbukkit;
2016-02-29 22:32:46 +01:00
import com.google.common.base.Preconditions;
import net.minecraft.server.MinecraftKey;
import net.minecraft.server.SoundEffect;
import org.apache.commons.lang.Validate;
import org.bukkit.Sound;
public class CraftSound {
2016-02-29 22:32:46 +01:00
public static String getSound(final Sound sound) {
Validate.notNull(sound, "Sound cannot be null");
2016-02-29 22:32:46 +01:00
return sound.name().replace('_', '.').toLowerCase();
}
2016-02-29 22:32:46 +01:00
public static SoundEffect getSoundEffect(String s) {
SoundEffect effect = SoundEffect.a.get(new MinecraftKey(s));
Preconditions.checkArgument(effect != null, "Sound effect %s does not exist", s);
return effect;
}
private CraftSound() {}
}