2015-03-22 17:38:04 +00:00
|
|
|
--- ../src-base/minecraft/net/minecraft/server/management/UserList.java
|
|
|
|
+++ ../src-work/minecraft/net/minecraft/server/management/UserList.java
|
2017-07-20 05:38:35 +00:00
|
|
|
@@ -14,6 +14,8 @@
|
|
|
|
import com.google.gson.JsonSerializer;
|
|
|
|
import cpw.mods.fml.relauncher.Side;
|
|
|
|
import cpw.mods.fml.relauncher.SideOnly;
|
|
|
|
+import net.minecraft.server.MinecraftServer;
|
|
|
|
+
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
import java.io.File;
|
|
|
|
@@ -56,7 +58,7 @@
|
|
|
|
|
|
|
|
public UserList(File p_i1144_1_)
|
|
|
|
{
|
|
|
|
- this.field_152695_c = p_i1144_1_;
|
|
|
|
+ this.field_152695_c = (!p_i1144_1_.isAbsolute()&&!Boolean.getBoolean("NoChangeDir_UserList"))?new File(MinecraftServer.serverConfigDir,p_i1144_1_.getPath()):p_i1144_1_;
|
|
|
|
GsonBuilder gsonbuilder = (new GsonBuilder()).setPrettyPrinting();
|
|
|
|
gsonbuilder.registerTypeHierarchyAdapter(UserListEntry.class, new UserList.Serializer(null));
|
|
|
|
this.field_152694_b = gsonbuilder.create();
|
|
|
|
@@ -119,6 +121,9 @@
|
2017-06-25 11:08:37 +00:00
|
|
|
|
|
|
|
protected String func_152681_a(Object p_152681_1_)
|
|
|
|
{
|
|
|
|
+ if(p_152681_1_ instanceof com.mojang.authlib.GameProfile){
|
|
|
|
+ return ((com.mojang.authlib.GameProfile)p_152681_1_).getName().toLowerCase();
|
|
|
|
+ }
|
|
|
|
return p_152681_1_.toString();
|
|
|
|
}
|
|
|
|
|
2017-07-20 05:38:35 +00:00
|
|
|
@@ -184,6 +189,12 @@
|
2015-03-22 17:38:04 +00:00
|
|
|
return this.field_152696_d.size() < 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ public Collection<UserListEntry> getValues() {
|
|
|
|
+ return this.field_152696_d.values();
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
|
|
|
@SideOnly(Side.SERVER)
|
|
|
|
public void func_152679_g() throws IOException
|
|
|
|
{
|