Bump Bukkit dependency to 1.7.9-R0.3-SNAPSHOT.

This commit is contained in:
sk89q 2015-01-07 16:28:26 -08:00
parent fd460337f4
commit e747e3a3fa
5 changed files with 18 additions and 16 deletions

View File

@ -93,7 +93,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.7.9-R0.2</version>
<version>1.7.9-R0.3-SNAPSHOT</version>
<scope>compile</scope>
<type>jar</type>
</dependency>

View File

@ -19,6 +19,7 @@
package com.sk89q.worldguard.bukkit;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
@ -509,7 +510,7 @@ public Player checkPlayer(CommandSender sender)
* @return A {@link List} of players who match {@code filter}
*/
public List<Player> matchPlayerNames(String filter) {
Player[] players = getServer().getOnlinePlayers();
Collection<? extends Player> players = getServer().getOnlinePlayers();
filter = filter.toLowerCase();
@ -562,7 +563,7 @@ public List<Player> matchPlayerNames(String filter) {
* @return {@code players} as an {@link Iterable}
* @throws CommandException If {@code players} is empty
*/
protected Iterable<Player> checkPlayerMatch(List<Player> players)
protected Iterable<? extends Player> checkPlayerMatch(List<? extends Player> players)
throws CommandException {
// Check to see if there were any matches
if (players.size() == 0) {
@ -587,15 +588,15 @@ protected Iterable<Player> checkPlayerMatch(List<Player> players)
* @return iterator for players
* @throws CommandException if no matches are found
*/
public Iterable<Player> matchPlayers(CommandSender source, String filter)
public Iterable<? extends Player> matchPlayers(CommandSender source, String filter)
throws CommandException {
if (getServer().getOnlinePlayers().length == 0) {
if (getServer().getOnlinePlayers().isEmpty()) {
throw new CommandException("No players matched query.");
}
if (filter.equals("*")) {
return checkPlayerMatch(Arrays.asList(getServer().getOnlinePlayers()));
return checkPlayerMatch(Lists.newArrayList(getServer().getOnlinePlayers()));
}
// Handle special hash tag groups
@ -655,7 +656,7 @@ public Iterable<Player> matchPlayers(CommandSender source, String filter)
public Player matchSinglePlayer(CommandSender sender, String filter)
throws CommandException {
// This will throw an exception if there are no matches
Iterator<Player> players = matchPlayers(sender, filter).iterator();
Iterator<? extends Player> players = matchPlayers(sender, filter).iterator();
Player match = players.next();
@ -993,11 +994,11 @@ public PlayerMoveListener getPlayerMoveListener() {
* @return The message with macros replaced
*/
public String replaceMacros(CommandSender sender, String message) {
Player[] online = getServer().getOnlinePlayers();
Collection<? extends Player> online = getServer().getOnlinePlayers();
message = message.replace("%name%", toName(sender));
message = message.replace("%id%", toUniqueName(sender));
message = message.replace("%online%", String.valueOf(online.length));
message = message.replace("%online%", String.valueOf(online.size()));
if (sender instanceof Player) {
Player player = (Player) sender;

View File

@ -45,7 +45,7 @@ public GeneralCommands(WorldGuardPlugin plugin) {
public void god(CommandContext args, CommandSender sender) throws CommandException {
ConfigurationManager config = plugin.getGlobalStateManager();
Iterable<Player> targets = null;
Iterable<? extends Player> targets = null;
boolean included = false;
// Detect arguments based on the number of arguments provided
@ -91,7 +91,7 @@ public void god(CommandContext args, CommandSender sender) throws CommandExcepti
public void ungod(CommandContext args, CommandSender sender) throws CommandException {
ConfigurationManager config = plugin.getGlobalStateManager();
Iterable<Player> targets = null;
Iterable<? extends Player> targets = null;
boolean included = false;
// Detect arguments based on the number of arguments provided
@ -133,7 +133,7 @@ public void ungod(CommandContext args, CommandSender sender) throws CommandExcep
@Command(aliases = {"heal"}, usage = "[player]", desc = "Heal a player", flags = "s", max = 1)
public void heal(CommandContext args,CommandSender sender) throws CommandException {
Iterable<Player> targets = null;
Iterable<? extends Player> targets = null;
boolean included = false;
// Detect arguments based on the number of arguments provided
@ -176,7 +176,7 @@ public void heal(CommandContext args,CommandSender sender) throws CommandExcepti
@Command(aliases = {"slay"}, usage = "[player]", desc = "Slay a player", flags = "s", max = 1)
public void slay(CommandContext args, CommandSender sender) throws CommandException {
Iterable<Player> targets = null;
Iterable<? extends Player> targets = null;
boolean included = false;
// Detect arguments based on the number of arguments provided

View File

@ -29,6 +29,7 @@
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@ -61,7 +62,7 @@ public FlagStateManager(WorldGuardPlugin plugin) {
*/
@Override
public void run() {
Player[] players = plugin.getServer().getOnlinePlayers();
Collection<? extends Player> players = plugin.getServer().getOnlinePlayers();
ConfigurationManager config = plugin.getGlobalStateManager();
for (Player player : players) {

View File

@ -34,7 +34,7 @@ public ServerReport() {
append("Server Name", server.getServerName());
append("Bukkit Version", server.getBukkitVersion());
append("Implementation", server.getVersion());
append("Player Count", "%d/%d", server.getOnlinePlayers().length, server.getMaxPlayers());
append("Player Count", "%d/%d", server.getOnlinePlayers().size(), server.getMaxPlayers());
DataReport spawning = new DataReport("Spawning");
spawning.append("Ambient Spawn Limit", server.getAmbientSpawnLimit());