From e5d77492551a94a6f20c8d178584666144ef619e Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 3 Dec 2014 02:13:39 +0100 Subject: [PATCH] Use inhouse getOnlinePlayers method. --- .../java/com/massivecraft/factions/engine/EngineSeeChunk.java | 4 ++-- src/main/java/com/massivecraft/factions/entity/Faction.java | 3 +-- .../integration/herochat/ChannelFactionsAbstract.java | 3 ++- .../com/massivecraft/factions/task/TaskPlayerPowerUpdate.java | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java b/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java index 50976504..2068a5d8 100644 --- a/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java +++ b/src/main/java/com/massivecraft/factions/engine/EngineSeeChunk.java @@ -4,7 +4,6 @@ import java.security.InvalidParameterException; import java.util.ArrayList; import java.util.List; -import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.World; import org.bukkit.entity.Player; @@ -20,6 +19,7 @@ import com.massivecraft.massivecore.EngineAbstract; import com.massivecraft.massivecore.event.EventMassiveCorePlayerLeave; import com.massivecraft.massivecore.particleeffect.ParticleEffect; import com.massivecraft.massivecore.ps.PS; +import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.PeriodUtil; public class EngineSeeChunk extends EngineAbstract @@ -99,7 +99,7 @@ public class EngineSeeChunk extends EngineAbstract final int amount = MConf.get().seeChunkParticleAmount; // For each player - for (Player player : Bukkit.getOnlinePlayers()) + for (Player player : MUtil.getOnlinePlayers()) { // Hide for dead players since the death screen looks better without. if (player.isDead()) continue; diff --git a/src/main/java/com/massivecraft/factions/entity/Faction.java b/src/main/java/com/massivecraft/factions/entity/Faction.java index 54a724a2..cf3a66d0 100644 --- a/src/main/java/com/massivecraft/factions/entity/Faction.java +++ b/src/main/java/com/massivecraft/factions/entity/Faction.java @@ -3,7 +3,6 @@ package com.massivecraft.factions.entity; import java.util.*; import java.util.Map.Entry; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -1076,7 +1075,7 @@ public class Faction extends Entity implements EconomyParticipator public List getOnlinePlayers() { List ret = new ArrayList(); - for (Player player : Bukkit.getOnlinePlayers()) + for (Player player : MUtil.getOnlinePlayers()) { MPlayer mplayer = MPlayer.get(player); if (mplayer.getFaction() != this) continue; diff --git a/src/main/java/com/massivecraft/factions/integration/herochat/ChannelFactionsAbstract.java b/src/main/java/com/massivecraft/factions/integration/herochat/ChannelFactionsAbstract.java index 50f08dd4..d42d4f4a 100644 --- a/src/main/java/com/massivecraft/factions/integration/herochat/ChannelFactionsAbstract.java +++ b/src/main/java/com/massivecraft/factions/integration/herochat/ChannelFactionsAbstract.java @@ -25,6 +25,7 @@ import com.dthielke.herochat.MessageNotFoundException; import com.massivecraft.factions.Rel; import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.entity.Faction; +import com.massivecraft.massivecore.util.MUtil; public abstract class ChannelFactionsAbstract implements Channel { @@ -234,7 +235,7 @@ public abstract class ChannelFactionsAbstract implements Channel Faction faction = fpsender.getFaction(); String universe = fpsender.getUniverse(); - for (Player player : Bukkit.getOnlinePlayers()) + for (Player player : MUtil.getOnlinePlayers()) { MPlayer frecipient = MPlayer.get(player); if (!frecipient.getUniverse().equals(universe)) continue; diff --git a/src/main/java/com/massivecraft/factions/task/TaskPlayerPowerUpdate.java b/src/main/java/com/massivecraft/factions/task/TaskPlayerPowerUpdate.java index 103ac9b0..4e65ed81 100644 --- a/src/main/java/com/massivecraft/factions/task/TaskPlayerPowerUpdate.java +++ b/src/main/java/com/massivecraft/factions/task/TaskPlayerPowerUpdate.java @@ -1,6 +1,5 @@ package com.massivecraft.factions.task; -import org.bukkit.Bukkit; import org.bukkit.entity.Player; import com.massivecraft.factions.entity.MConf; @@ -8,6 +7,7 @@ import com.massivecraft.factions.entity.MPlayer; import com.massivecraft.factions.event.EventFactionsPowerChange; import com.massivecraft.factions.event.EventFactionsPowerChange.PowerChangeReason; import com.massivecraft.massivecore.ModuloRepeatTask; +import com.massivecraft.massivecore.util.MUtil; import com.massivecraft.massivecore.util.TimeUnit; public class TaskPlayerPowerUpdate extends ModuloRepeatTask @@ -40,7 +40,7 @@ public class TaskPlayerPowerUpdate extends ModuloRepeatTask { long millis = this.getDelayMillis(); - for (Player player : Bukkit.getOnlinePlayers()) + for (Player player : MUtil.getOnlinePlayers()) { if (player.isDead()) continue;