mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
74 lines
3.9 KiB
Diff
74 lines
3.9 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -0,0 +0,0 @@ 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/net/minecraft/world/entity/player/EntityHuman.java b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/player/EntityHuman.java
|
|
@@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving {
|
|
}
|
|
}
|
|
|
|
- protected void releaseShoulderEntities() {
|
|
+ public void releaseShoulderEntities() { // Paper - protected -> public
|
|
if (this.e + 20L < this.world.getTime()) {
|
|
// CraftBukkit start
|
|
if (this.spawnEntityFromShoulder(this.getShoulderEntityLeft())) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftConsoleCommandSender.java
|
|
@@ -0,0 +0,0 @@ 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(org.bukkit.craftbukkit.util.CraftChatMessage.fromComponent(io.papermc.paper.adventure.PaperAdventure.asVanilla(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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/command/CraftRemoteConsoleCommandSender.java
|
|
@@ -0,0 +0,0 @@ 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
|
|
}
|