Browse Source

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

GJ 11 years ago
parent
commit
e8bc2475c3

+ 4 - 2
src/main/java/com/gmail/nossr50/util/Misc.java

@@ -38,13 +38,15 @@ public final class Misc {
     public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0;
 
     // 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_VOLUME = 1.0F; // 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 FIZZ_VOLUME      = 0.5F;
     public static final float POP_VOLUME       = 0.2F;
     public static final float BAT_VOLUME       = 1.0F;
     public static final float BAT_PITCH        = 0.6F;
     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() {};
 

+ 2 - 0
src/main/java/com/gmail/nossr50/util/skills/SkillUtils.java

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