3
0

修复部分因为大小写名字造成的问题,例如Ban

This commit is contained in:
聪聪 2017-07-20 13:38:35 +08:00
parent d06c424b1f
commit 5fcbe3c63a
4 changed files with 47 additions and 5 deletions

View File

@ -1,6 +1,24 @@
--- ../src-base/minecraft/net/minecraft/server/management/UserList.java --- ../src-base/minecraft/net/minecraft/server/management/UserList.java
+++ ../src-work/minecraft/net/minecraft/server/management/UserList.java +++ ../src-work/minecraft/net/minecraft/server/management/UserList.java
@@ -119,6 +119,9 @@ @@ -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 @@
protected String func_152681_a(Object p_152681_1_) protected String func_152681_a(Object p_152681_1_)
{ {
@ -10,7 +28,7 @@
return p_152681_1_.toString(); return p_152681_1_.toString();
} }
@@ -184,6 +187,12 @@ @@ -184,6 +189,12 @@
return this.field_152696_d.size() < 1; return this.field_152696_d.size() < 1;
} }

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/server/management/UserListBans.java
+++ ../src-work/minecraft/net/minecraft/server/management/UserListBans.java
@@ -40,7 +40,7 @@
protected String func_152701_b(GameProfile p_152701_1_)
{
- return p_152701_1_.getId().toString();
+ return p_152701_1_.getName().toLowerCase();
}
public GameProfile func_152703_a(String p_152703_1_)

View File

@ -1,10 +1,12 @@
--- ../src-base/minecraft/net/minecraft/server/management/UserListOps.java --- ../src-base/minecraft/net/minecraft/server/management/UserListOps.java
+++ ../src-work/minecraft/net/minecraft/server/management/UserListOps.java +++ ../src-work/minecraft/net/minecraft/server/management/UserListOps.java
@@ -35,6 +35,7 @@ @@ -35,7 +35,8 @@
protected String func_152699_b(GameProfile p_152699_1_) protected String func_152699_b(GameProfile p_152699_1_)
{ {
+ if (p_152699_1_ == null || p_152699_1_.getId() == null) return "invalid"; // Cauldron - handle GameProfiles with no ID - return p_152699_1_.getId().toString();
return p_152699_1_.getId().toString(); + if (p_152699_1_ == null) return "invalid"; // Cauldron - handle GameProfiles with no ID
+ return p_152699_1_.getName().toLowerCase();
} }
public GameProfile func_152700_a(String p_152700_1_)

View File

@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/server/management/UserListWhitelist.java
+++ ../src-work/minecraft/net/minecraft/server/management/UserListWhitelist.java
@@ -43,7 +43,7 @@
protected String func_152704_b(GameProfile p_152704_1_)
{
- return p_152704_1_.getId().toString();
+ return p_152704_1_.getName().toLowerCase();
}
public GameProfile func_152706_a(String p_152706_1_)