2020-05-06 11:48:49 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-11-18 20:54:38 +01:00
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/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2020-05-06 11:48:49 +02:00
index 6d069c73d0058f58e908f351a849ec3a753f2d22..dbd14399707cdd43f98af40191be8ff3e76edf43 100644
2018-11-18 20:54:38 +01:00
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2019-12-12 17:20:43 +01:00
@@ -20,6 +20,7 @@ import java.util.regex.Pattern;
2018-11-18 20:54:38 +01:00
import com.google.common.collect.Lists;
import net.minecraft.server.MinecraftServer;
import org.bukkit.Bukkit;
+import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.InvalidConfigurationException;
2019-12-12 17:20:43 +01:00
@@ -280,6 +281,11 @@ public class PaperConfig {
2018-11-18 20:54:38 +01:00
connectionThrottleKickMessage = getString("messages.kick.connection-throttle", connectionThrottleKickMessage);
}
+ public static String noPermissionMessage = "&cI'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.";
+ private static void noPermissionMessage() {
+ noPermissionMessage = ChatColor.translateAlternateColorCodes('&', getString("messages.no-permission", noPermissionMessage));
+ }
+
public static boolean savePlayerData = true;
private static void savePlayerData() {
savePlayerData = getBoolean("settings.save-player-data", savePlayerData);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-05-06 11:48:49 +02:00
index 7b53ebb6d7cf241c6b89ec04acd0bcc25e1c105a..811e676e4f9f1f8beb8eb9e20cef3ef03633a856 100644
2018-11-18 20:54:38 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-04-27 09:34:45 +02:00
@@ -2180,6 +2180,11 @@ public final class CraftServer implements Server {
2018-11-18 20:54:38 +01:00
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
2019-05-05 13:12:32 +02:00
+ @Override
2018-11-18 20:54:38 +01:00
+ public String getPermissionMessage() {
+ return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
+ }
+
2019-05-05 13:12:32 +02:00
@Override
2018-11-18 20:54:38 +01:00
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);