From 00e1521d4656b1efdc5e5577f1d80081f772cb70 Mon Sep 17 00:00:00 2001 From: gmcferrin Date: Wed, 9 Jan 2013 21:47:03 -0500 Subject: [PATCH] Functions >> copy-paste code. --- src/main/java/com/gmail/nossr50/util/Skills.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index 25dca50d1..10f3d5e6d 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -192,11 +192,7 @@ public class Skills { profile.setAbilityInformed(ability, false); player.sendMessage(ability.getAbilityOff()); - for (Player nearbyPlayer : player.getWorld().getPlayers()) { - if (nearbyPlayer != player && Misc.isNear(player.getLocation(), nearbyPlayer.getLocation(), MAX_DISTANCE_AWAY)) { - nearbyPlayer.sendMessage(ability.getAbilityPlayerOff(player)); - } - } + Misc.sendSkillMessage(player, ability.getAbilityPlayerOff(player)); } } } @@ -459,11 +455,7 @@ public class Skills { if (!profile.getAbilityMode(ability) && cooldownOver(profile.getSkillDATS(ability), ability.getCooldown(), player)) { player.sendMessage(ability.getAbilityOn()); - for (Player y : player.getWorld().getPlayers()) { - if (y != player && Misc.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) { - y.sendMessage(ability.getAbilityPlayer(player)); - } - } + Misc.sendSkillMessage(player, ability.getAbilityPlayer(player)); profile.setSkillDATS(ability, System.currentTimeMillis() + (ticks * TIME_CONVERSION_FACTOR)); profile.setAbilityMode(ability, true);