Fix getting white list, ban list, and op list. Fixes BUKKIT-5538

The getEntries methods on these return player names instead of UUIDs.
As we need the UUIDs for our API we add a getValues method to get at
the data we need. To further ensure we get the most data possible we
also add a way to get at the stored GameProfile to ensure we always
have both the UUID and the name from the list.

By: Travis Watkins <amaranth@ubuntu.com>
This commit is contained in:
CraftBukkit/Spigot
2014-04-17 03:31:49 -05:00
parent 35ef785bd7
commit a546a14bb1
5 changed files with 55 additions and 28 deletions

View File

@@ -2,7 +2,9 @@ package org.bukkit.craftbukkit;
import net.minecraft.server.IpBanEntry;
import net.minecraft.server.IpBanList;
import net.minecraft.server.MinecraftServer;
import java.io.IOException;
import java.util.Date;
public final class CraftIpBanEntry implements org.bukkit.BanEntry {
@@ -75,6 +77,10 @@ public final class CraftIpBanEntry implements org.bukkit.BanEntry {
public void save() {
IpBanEntry entry = new IpBanEntry(target, this.created, this.source, this.expiration, this.reason);
this.list.add(entry);
this.list.save();
try {
this.list.save();
} catch (IOException ex) {
MinecraftServer.getLogger().error("Failed to save banned-ips.json, " + ex.getMessage());
}
}
}