mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-09-05 20:55:35 +02:00
major optimizations to getting xp values for specific blocks
This commit is contained in:
@@ -9,14 +9,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SoundManager {
|
||||
public static Sound CRIPPLE_SOUND;
|
||||
static {
|
||||
try {
|
||||
CRIPPLE_SOUND = Sound.valueOf("ITEM_MACE_SMASH_GROUND");
|
||||
} catch (IllegalArgumentException e) {
|
||||
CRIPPLE_SOUND = Sound.BLOCK_ANVIL_PLACE;
|
||||
}
|
||||
}
|
||||
private static Sound CRIPPLE_SOUND;
|
||||
|
||||
/**
|
||||
* Sends a sound to the player
|
||||
@@ -107,10 +100,24 @@ public class SoundManager {
|
||||
case DEFLECT_ARROWS, BLEED -> Sound.ENTITY_ENDER_EYE_DEATH;
|
||||
case GLASS -> Sound.BLOCK_GLASS_BREAK;
|
||||
case ITEM_CONSUMED -> Sound.ITEM_BOTTLE_EMPTY;
|
||||
case CRIPPLE -> CRIPPLE_SOUND;
|
||||
case CRIPPLE -> getCrippleSound();
|
||||
};
|
||||
}
|
||||
|
||||
private static Sound getCrippleSound() {
|
||||
if (CRIPPLE_SOUND != null) {
|
||||
return CRIPPLE_SOUND;
|
||||
}
|
||||
|
||||
try {
|
||||
CRIPPLE_SOUND = Sound.valueOf("ITEM_MACE_SMASH_GROUND");
|
||||
return CRIPPLE_SOUND;
|
||||
} catch (IllegalArgumentException e) {
|
||||
CRIPPLE_SOUND = Sound.BLOCK_ANVIL_PLACE;
|
||||
return CRIPPLE_SOUND;
|
||||
}
|
||||
}
|
||||
|
||||
public static float getFizzPitch() {
|
||||
return 2.6F + (Misc.getRandom().nextFloat() - Misc.getRandom().nextFloat()) * 0.8F;
|
||||
}
|
||||
|
Reference in New Issue
Block a user