From 5fcbe3c63a248a8f478d8ee668c7d37fe7754a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=AA=E8=81=AA?= <178666380@qq.com> Date: Thu, 20 Jul 2017 13:38:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E5=9B=A0?= =?UTF-8?q?=E4=B8=BA=E5=A4=A7=E5=B0=8F=E5=86=99=E5=90=8D=E5=AD=97=E9=80=A0?= =?UTF-8?q?=E6=88=90=E7=9A=84=E9=97=AE=E9=A2=98,=E4=BE=8B=E5=A6=82Ban?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/management/UserList.java.patch | 22 +++++++++++++++++-- .../server/management/UserListBans.java.patch | 11 ++++++++++ .../server/management/UserListOps.java.patch | 8 ++++--- .../management/UserListWhitelist.java.patch | 11 ++++++++++ 4 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 patches/net/minecraft/server/management/UserListBans.java.patch create mode 100644 patches/net/minecraft/server/management/UserListWhitelist.java.patch diff --git a/patches/net/minecraft/server/management/UserList.java.patch b/patches/net/minecraft/server/management/UserList.java.patch index a7029df..79470dc 100644 --- a/patches/net/minecraft/server/management/UserList.java.patch +++ b/patches/net/minecraft/server/management/UserList.java.patch @@ -1,6 +1,24 @@ --- ../src-base/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_) { @@ -10,7 +28,7 @@ return p_152681_1_.toString(); } -@@ -184,6 +187,12 @@ +@@ -184,6 +189,12 @@ return this.field_152696_d.size() < 1; } diff --git a/patches/net/minecraft/server/management/UserListBans.java.patch b/patches/net/minecraft/server/management/UserListBans.java.patch new file mode 100644 index 0000000..28daba7 --- /dev/null +++ b/patches/net/minecraft/server/management/UserListBans.java.patch @@ -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_) diff --git a/patches/net/minecraft/server/management/UserListOps.java.patch b/patches/net/minecraft/server/management/UserListOps.java.patch index 8cda80d..e71051b 100644 --- a/patches/net/minecraft/server/management/UserListOps.java.patch +++ b/patches/net/minecraft/server/management/UserListOps.java.patch @@ -1,10 +1,12 @@ --- ../src-base/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_) { -+ 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_) diff --git a/patches/net/minecraft/server/management/UserListWhitelist.java.patch b/patches/net/minecraft/server/management/UserListWhitelist.java.patch new file mode 100644 index 0000000..04dc0c9 --- /dev/null +++ b/patches/net/minecraft/server/management/UserListWhitelist.java.patch @@ -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_)