Files
2019-02-24 22:29:41 +08:00

52 lines
1.5 KiB
Diff

--- ../src-base/minecraft/net/minecraft/server/management/UserListBansEntry.java
+++ ../src-work/minecraft/net/minecraft/server/management/UserListBansEntry.java
@@ -14,7 +14,7 @@
public UserListBansEntry(GameProfile profile, Date startDate, String banner, Date endDate, String banReason)
{
- super(profile, endDate, banner, endDate, banReason);
+ super(profile, startDate, banner, endDate, banReason);
}
public UserListBansEntry(JsonObject json)
@@ -34,10 +34,13 @@
private static GameProfile toGameProfile(JsonObject json)
{
- if (json.has("uuid") && json.has("name"))
+ // Spigot start
+ // this whole method has to be reworked to account for the fact Bukkit only accepts UUID bans and gives no way for usernames to be stored!
+ UUID uuid = null;
+ String name = null;
+ if (json.has("uuid"))
{
String s = json.get("uuid").getAsString();
- UUID uuid;
try
{
@@ -45,14 +48,20 @@
}
catch (Throwable var4)
{
- return null;
}
-
- return new GameProfile(uuid, json.get("name").getAsString());
}
+ if (json.has("name"))
+ {
+ name = json.get("name").getAsString();
+ }
+ if (uuid != null || name != null)
+ {
+ return new GameProfile(uuid, name);
+ }
else
{
return null;
}
+ // Spigot End
}
}