From 420afc57ef55c910cd7db4285ab6cdc83fc2ce39 Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Fri, 1 Apr 2016 22:58:20 +0100 Subject: [PATCH] Handle cases where Mojang uses an empty string for permission checks --- nms-patches/EntityPlayer.patch | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index 4ef2f37620..ca39da4d2a 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -436,24 +436,23 @@ this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.s(); } -@@ -741,8 +917,17 @@ +@@ -741,7 +917,16 @@ public void triggerHealthUpdate() { this.lastHealthSent = -1.0E8F; + this.lastSentExp = -1; // CraftBukkit - Added to reset - } - ++ } ++ + // CraftBukkit start - Support multi-line messages + public void sendMessage(IChatBaseComponent[] ichatbasecomponent) { + for (IChatBaseComponent component : ichatbasecomponent) { + this.sendMessage(component); + } -+ } + } + // CraftBukkit end -+ + public void b(IChatBaseComponent ichatbasecomponent) { this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent)); - } @@ -802,6 +987,8 @@ } @@ -479,7 +478,7 @@ if ("seed".equals(s) && !this.server.aa()) { return true; } else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) { -@@ -840,6 +1029,12 @@ +@@ -840,6 +1029,15 @@ } else { return true; } @@ -487,12 +486,15 @@ + if ("@".equals(s)) { + return getBukkitEntity().hasPermission("minecraft.command.selector"); + } ++ if ("".equals(s)) { ++ return getBukkitEntity().isOp(); ++ } + return true; + // CraftBukkit end } public String A() { -@@ -938,7 +1133,7 @@ +@@ -938,7 +1136,7 @@ } public IChatBaseComponent getPlayerListName() { @@ -501,7 +503,7 @@ } public void a(EnumHand enumhand) { -@@ -955,11 +1150,139 @@ +@@ -955,11 +1153,139 @@ } public void M() {