61 lines
3.2 KiB
Diff
61 lines
3.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
Date: Sat, 16 May 2020 10:12:15 +0200
|
|
Subject: [PATCH] Add option for console having all permissions
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
index ef9e4515260ec92a6a0d6ab77d6492574d70a3f9..3b4b7dca3d109f72aa12f8ac79fb46bf94d25641 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -438,4 +438,9 @@ public class PaperConfig {
|
|
|
|
}
|
|
|
|
+ public static boolean consoleHasAllPermissions = false;
|
|
+ private static void consoleHasAllPermissions() {
|
|
+ consoleHasAllPermissions = getBoolean("settings.console-has-all-permissions", consoleHasAllPermissions);
|
|
+ }
|
|
+
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
index b41452c3ed833f0e6c3b03a56fe5773e7b68a8e6..9383e2fd8469d3203e0fe91dfbb05eb8192bc082 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
@@ -86,5 +86,15 @@ public class CraftConsoleCommandSender extends ServerCommandSender implements Co
|
|
public void sendMessage(final net.kyori.adventure.identity.Identity identity, final net.kyori.adventure.text.Component message, final net.kyori.adventure.audience.MessageType type) {
|
|
this.sendRawMessage(io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.serialize(message));
|
|
}
|
|
+
|
|
+ @Override
|
|
+ public boolean hasPermission(String name) {
|
|
+ return com.destroystokyo.paper.PaperConfig.consoleHasAllPermissions || super.hasPermission(name);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean hasPermission(org.bukkit.permissions.Permission perm) {
|
|
+ return com.destroystokyo.paper.PaperConfig.consoleHasAllPermissions || super.hasPermission(perm);
|
|
+ }
|
|
// Paper end
|
|
}
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
|
index 02a8c522a25f1c3c8eb0245560757772e627d31e..a3194c8a425d1d808c76ebef9997478f4d399fe0 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
|
@@ -39,4 +39,16 @@ public class CraftRemoteConsoleCommandSender extends ServerCommandSender impleme
|
|
public void setOp(boolean value) {
|
|
throw new UnsupportedOperationException("Cannot change operator status of remote controller.");
|
|
}
|
|
+
|
|
+ // Paper start
|
|
+ @Override
|
|
+ public boolean hasPermission(String name) {
|
|
+ return com.destroystokyo.paper.PaperConfig.consoleHasAllPermissions || super.hasPermission(name);
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public boolean hasPermission(org.bukkit.permissions.Permission perm) {
|
|
+ return com.destroystokyo.paper.PaperConfig.consoleHasAllPermissions || super.hasPermission(perm);
|
|
+ }
|
|
+ // Paper end
|
|
}
|