mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
52 lines
1.5 KiB
Diff
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
|
|
}
|
|
}
|