mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-28 19:22:50 +01:00
35 lines
2 KiB
Diff
35 lines
2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
Date: Sun, 18 Nov 2018 19:49:56 +0000
|
|
Subject: [PATCH] Make the default permission message configurable
|
|
|
|
|
|
diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
index e75134a6aa92c86aa86430c7603e111280077d16..c5b005e7a803c848dca31dc76d1ec83ffca42950 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java
|
|
@@ -56,7 +56,7 @@ public class PaperCommand extends Command {
|
|
|
|
private static boolean testPermission(CommandSender commandSender, String permission) {
|
|
if (commandSender.hasPermission(BASE_PERM + permission) || commandSender.hasPermission("bukkit.command.paper")) return true;
|
|
- commandSender.sendMessage(text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", RED));
|
|
+ commandSender.sendMessage(Bukkit.getPermissionMessage()); // Sorry, kashike
|
|
return false;
|
|
}
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 9a9b6ceab49e78a6b5523825e571186f6f610212..fe5a676abb5c47045f6ca1a6dde78d9859b43abe 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2586,6 +2586,11 @@ public final class CraftServer implements Server {
|
|
return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions;
|
|
}
|
|
|
|
+ @Override
|
|
+ public String getPermissionMessage() {
|
|
+ return io.papermc.paper.configuration.GlobalConfiguration.get().messages.noPermission;
|
|
+ }
|
|
+
|
|
@Override
|
|
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
|
|
return createProfile(uuid, null);
|