aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0958-Improve-command-function-perm-level-checks.patch
diff options
context:
space:
mode:
authorTamion <[email protected]>2023-11-04 21:20:13 +0100
committerGitHub <[email protected]>2023-11-04 13:20:13 -0700
commitbffb08c2f99a5527b7357d005cb10ba21cf048d9 (patch)
treec25ad5490b0ede8ce30bc0f23b5e0255eecc0dbc /patches/server/0958-Improve-command-function-perm-level-checks.patch
parent6592fed511ee2ea17de9e05463579bd1923cf8aa (diff)
downloadPaper-bffb08c2f99a5527b7357d005cb10ba21cf048d9.tar.gz
Paper-bffb08c2f99a5527b7357d005cb10ba21cf048d9.zip
Deprecate Player#boostElytra (#9899)
The Paper method was chosen for deprecation because it was more restrictive in that it has an isGliding check.
Diffstat (limited to 'patches/server/0958-Improve-command-function-perm-level-checks.patch')
-rw-r--r--patches/server/0958-Improve-command-function-perm-level-checks.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/patches/server/0958-Improve-command-function-perm-level-checks.patch b/patches/server/0958-Improve-command-function-perm-level-checks.patch
new file mode 100644
index 0000000000..5d912059ff
--- /dev/null
+++ b/patches/server/0958-Improve-command-function-perm-level-checks.patch
@@ -0,0 +1,27 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Tue, 27 Jun 2023 16:32:39 -0700
+Subject: [PATCH] Improve command function perm level checks
+
+
+diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
+index 0112035219b21550ca14fa1755c43a5547ca4136..56ae02aab93b9a698e9d2f07a0448aa4767169d9 100644
+--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
++++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
+@@ -212,8 +212,14 @@ public class CommandSourceStack implements SharedSuggestionProvider, com.destroy
+
+ // CraftBukkit start
+ public boolean hasPermission(int i, String bukkitPermission) {
+- // World is null when loading functions
+- return ((this.getLevel() == null || !this.getLevel().getCraftServer().ignoreVanillaPermissions) && this.permissionLevel >= i) || this.getBukkitSender().hasPermission(bukkitPermission);
++ // Paper start
++ boolean hasPermissionLevel = this.permissionLevel >= i;
++ if (this.source == CommandSource.NULL) {
++ return hasPermissionLevel;
++ } else {
++ return (!this.getLevel().getCraftServer().ignoreVanillaPermissions && hasPermissionLevel) || this.getBukkitSender().hasPermission(bukkitPermission);
++ }
++ // Paper end
+ }
+ // CraftBukkit end
+