diff options
author | md_5 <git@md-5.net> | 2014-07-12 16:03:36 +1000 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2014-07-19 20:07:50 +0100 |
commit | 035182fcda8acf77d3727ce21993e9bb57c90077 (patch) | |
tree | ec572bba04047317cadbf153848c2c08c42d2bca /Essentials/src/com/earth2me/essentials/commands/Commandnuke.java | |
parent | 310e41396b8122bb4889a6c757597b5ac2db5b78 (diff) | |
download | Essentials-035182fcda8acf77d3727ce21993e9bb57c90077.tar Essentials-035182fcda8acf77d3727ce21993e9bb57c90077.tar.gz Essentials-035182fcda8acf77d3727ce21993e9bb57c90077.tar.lz Essentials-035182fcda8acf77d3727ce21993e9bb57c90077.tar.xz Essentials-035182fcda8acf77d3727ce21993e9bb57c90077.zip |
Optimize player / user iteration.
* Add a method for backwards compatability with unmapped code.
* Convert all getOnlinePlayers() calls to use this method, part of the IEssentials interface
* Add a new method getOnlineUsers() Ljava/lang/Iterable;
* Convert appropriate calls to use this method
* Update Bukkit to #1945
* Update CraftBukkit to #3103
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandnuke.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandnuke.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java index 7e6e347c3..e82c46c8d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnuke.java @@ -3,8 +3,7 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; import static com.earth2me.essentials.I18n.tl; import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; +import java.util.Collection; import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.World; @@ -22,7 +21,7 @@ public class Commandnuke extends EssentialsCommand @Override protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException { - List<Player> targets; + Collection<Player> targets; if (args.length > 0) { targets = new ArrayList<Player>(); @@ -35,7 +34,7 @@ public class Commandnuke extends EssentialsCommand } else { - targets = Arrays.asList(server.getOnlinePlayers()); + targets = ess.getOnlinePlayers(); } ess.getTNTListener().enable(); for (Player player : targets) |