From ae94a3308d189583b4e8efbffa4ad802d0ca4df9 Mon Sep 17 00:00:00 2001 From: Jeff Wardian Date: Thu, 14 Jun 2012 22:43:46 -0500 Subject: [PATCH] Preserve whitelist ordering. Addresses BUKKIT-1805 --- .../java/net/minecraft/server/ServerConfigurationManager.java | 4 +++- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index b765faf713..e009956853 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -13,6 +13,8 @@ import java.util.Set; import java.util.logging.Logger; // CraftBukkit start +import java.util.LinkedHashSet; + import org.bukkit.Location; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftWorld; @@ -37,7 +39,7 @@ public class ServerConfigurationManager { public Set banByName = new HashSet(); // CraftBukkit - private -> public public Set banByIP = new HashSet(); // CraftBukkit - private -> public public Set operators = new HashSet(); // CraftBukkit - private -> public - private Set whitelist = new HashSet(); + private Set whitelist = new LinkedHashSet(); // CraftBukkit - HashSet() -> LinkedHashSet(); private File j; private File k; private File l; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 708daf7355..cd85bdb107 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -9,6 +9,7 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -1025,7 +1026,7 @@ public final class CraftServer implements Server { } public Set getWhitelistedPlayers() { - Set result = new HashSet(); + Set result = new LinkedHashSet(); for (Object name : server.getWhitelisted()) { result.add(getOfflinePlayer((String) name));