3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

Handle cases where Mojang uses an empty string for permission checks

Dieser Commit ist enthalten in:
Thinkofname 2016-04-01 22:58:20 +01:00
Ursprung f92e01ba5c
Commit 420afc57ef

Datei anzeigen

@ -436,24 +436,23 @@
this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId)); this.playerConnection.sendPacket(new PacketPlayOutCloseWindow(this.activeContainer.windowId));
this.s(); this.s();
} }
@@ -741,8 +917,17 @@ @@ -741,7 +917,16 @@
public void triggerHealthUpdate() { public void triggerHealthUpdate() {
this.lastHealthSent = -1.0E8F; this.lastHealthSent = -1.0E8F;
+ this.lastSentExp = -1; // CraftBukkit - Added to reset + this.lastSentExp = -1; // CraftBukkit - Added to reset
} + }
+
+ // CraftBukkit start - Support multi-line messages + // CraftBukkit start - Support multi-line messages
+ public void sendMessage(IChatBaseComponent[] ichatbasecomponent) { + public void sendMessage(IChatBaseComponent[] ichatbasecomponent) {
+ for (IChatBaseComponent component : ichatbasecomponent) { + for (IChatBaseComponent component : ichatbasecomponent) {
+ this.sendMessage(component); + this.sendMessage(component);
+ } + }
+ } }
+ // CraftBukkit end + // CraftBukkit end
+
public void b(IChatBaseComponent ichatbasecomponent) { public void b(IChatBaseComponent ichatbasecomponent) {
this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent)); this.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent));
}
@@ -802,6 +987,8 @@ @@ -802,6 +987,8 @@
} }
@ -479,7 +478,7 @@
if ("seed".equals(s) && !this.server.aa()) { if ("seed".equals(s) && !this.server.aa()) {
return true; return true;
} else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) { } else if (!"tell".equals(s) && !"help".equals(s) && !"me".equals(s) && !"trigger".equals(s)) {
@@ -840,6 +1029,12 @@ @@ -840,6 +1029,15 @@
} else { } else {
return true; return true;
} }
@ -487,12 +486,15 @@
+ if ("@".equals(s)) { + if ("@".equals(s)) {
+ return getBukkitEntity().hasPermission("minecraft.command.selector"); + return getBukkitEntity().hasPermission("minecraft.command.selector");
+ } + }
+ if ("".equals(s)) {
+ return getBukkitEntity().isOp();
+ }
+ return true; + return true;
+ // CraftBukkit end + // CraftBukkit end
} }
public String A() { public String A() {
@@ -938,7 +1133,7 @@ @@ -938,7 +1136,7 @@
} }
public IChatBaseComponent getPlayerListName() { public IChatBaseComponent getPlayerListName() {
@ -501,7 +503,7 @@
} }
public void a(EnumHand enumhand) { public void a(EnumHand enumhand) {
@@ -955,11 +1150,139 @@ @@ -955,11 +1153,139 @@
} }
public void M() { public void M() {