Add sound for level-up even when not using Spout.

This commit is contained in:
GJ 2013-09-16 09:52:09 -04:00
parent 816b08b14a
commit e8bc2475c3
2 changed files with 6 additions and 2 deletions

View File

@ -38,13 +38,15 @@ public final class Misc {
public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0; public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0;
// Sound Pitches & Volumes from CB // Sound Pitches & Volumes from CB
public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values public static final float ANVIL_USE_PITCH = 0.3F; // Not in CB directly, I went off the place sound values
public static final float ANVIL_USE_VOLUME = 1.0F; // Not in CB directly, I went off the place sound values public static final float ANVIL_USE_VOLUME = 1.0F; // Not in CB directly, I went off the place sound values
public static final float FIZZ_VOLUME = 0.5F; public static final float FIZZ_VOLUME = 0.5F;
public static final float POP_VOLUME = 0.2F; public static final float POP_VOLUME = 0.2F;
public static final float BAT_VOLUME = 1.0F; public static final float BAT_VOLUME = 1.0F;
public static final float BAT_PITCH = 0.6F; public static final float BAT_PITCH = 0.6F;
public static final float GHAST_VOLUME = 1.0F; public static final float GHAST_VOLUME = 1.0F;
public static final float LEVELUP_PITCH = 0.5F; // Reduced to differentiate between vanilla level-up
public static final float LEVELUP_VOLUME = 0.75F; // Use max volume always
private Misc() {}; private Misc() {};

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.enchantments.Enchantment; import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -166,6 +167,7 @@ public class SkillUtils {
SpoutUtils.processLevelup(mcMMOPlayer, skillType, levelsGained); SpoutUtils.processLevelup(mcMMOPlayer, skillType, levelsGained);
} }
else { else {
player.playSound(player.getLocation(), Sound.LEVEL_UP, Misc.LEVELUP_VOLUME, Misc.LEVELUP_PITCH);
player.sendMessage(LocaleLoader.getString(capitalized + ".Skillup", levelsGained, profile.getSkillLevel(skillType))); player.sendMessage(LocaleLoader.getString(capitalized + ".Skillup", levelsGained, profile.getSkillLevel(skillType)));
} }
} }