Start cleaning up the mess we've made of our listeners.

This commit is contained in:
GJ
2013-01-24 11:45:40 -05:00
parent 29d796b6af
commit ab677e941d
4 changed files with 183 additions and 98 deletions

View File

@ -17,6 +17,7 @@ import org.bukkit.plugin.PluginManager;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
import com.gmail.nossr50.events.fake.FakeBlockDamageEvent;
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
@ -89,6 +90,14 @@ public class Misc {
return false;
}
public static boolean isNPC(Player player, PlayerProfile profile) {
if (player == null || profile == null || player.hasMetadata("NPC")) {
return true;
}
return false;
}
public static void sendSkillMessage(Player player, String message) {
for (Player otherPlayer : player.getWorld().getPlayers()) {
if (otherPlayer != player && Misc.isNear(player.getLocation(), otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) {