Cleanup & refactoring, part 1.

This commit is contained in:
GJ
2012-04-20 18:09:50 -04:00
parent 153ecf4d13
commit f94a617d94
32 changed files with 224 additions and 188 deletions

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.spout;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
@ -9,6 +8,8 @@ import org.getspout.spoutapi.player.SpoutPlayer;
import org.getspout.spoutapi.sound.SoundEffect;
import org.getspout.spoutapi.sound.SoundManager;
import com.gmail.nossr50.mcMMO;
public class SpoutSounds {
/**
@ -30,12 +31,12 @@ public class SpoutSounds {
*
* @param player The player who repaired an item
*/
public static void playRepairNoise(Player player) {
public static void playRepairNoise(Player player, mcMMO plugin) {
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
//If this is pulling from online, why have it in the jar?
SM.playCustomSoundEffect(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, "repair.wav", false);
SM.playCustomSoundEffect(plugin, sPlayer, "repair.wav", false);
}
/**
@ -43,11 +44,11 @@ public class SpoutSounds {
*
* @param player The player who leveled up
*/
protected static void playLevelUpNoise(Player player) {
protected static void playLevelUpNoise(Player player, mcMMO plugin) {
SoundManager SM = SpoutManager.getSoundManager();
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
//If this is pulling from online, why have it in the jar?
SM.playCustomSoundEffect(Bukkit.getServer().getPluginManager().getPlugin("mcMMO"), sPlayer, "level.wav", false);
SM.playCustomSoundEffect(plugin, sPlayer, "level.wav", false);
}
}

View File

@ -32,8 +32,7 @@ import com.gmail.nossr50.listeners.mcSpoutListener;
import com.gmail.nossr50.listeners.mcSpoutScreenListener;
public class SpoutStuff {
static mcMMO plugin = (mcMMO) Bukkit.getServer().getPluginManager().getPlugin("mcMMO");
static mcMMO plugin = mcMMO.p;
private final static mcSpoutListener spoutListener = new mcSpoutListener(plugin);
private final static mcSpoutInputListener spoutInputListener = new mcSpoutInputListener(plugin);
@ -548,7 +547,7 @@ public class SpoutStuff {
//TODO: Use Locale
sPlayer.sendNotification(ChatColor.GREEN + "Level Up!", ChatColor.YELLOW + m.getCapitalized(skillType.toString()) + ChatColor.DARK_AQUA + " (" + ChatColor.GREEN + PP.getSkillLevel(skillType) + ChatColor.DARK_AQUA + ")", mat);
SpoutSounds.playLevelUpNoise(sPlayer);
SpoutSounds.playLevelUpNoise(sPlayer, plugin);
}
/**