2020-05-06 09:48:49 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-11-18 19:54:38 +00: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
2021-02-26 17:54:48 +00:00
index 13edb435b3fa65b4980bd7472aa5a5196f4d5b2b..469f78775b03cf363d88e35c69c0dc185c22547c 100644
2018-11-18 19:54:38 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2020-06-25 14:09:55 +00:00
@@ -19,6 +19,7 @@ import java.util.regex.Pattern;
2018-11-18 19:54:38 +00: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;
2020-06-26 06:29:44 +00:00
import org.bukkit.configuration.ConfigurationSection;
2018-11-18 19:54:38 +00:00
import org.bukkit.configuration.InvalidConfigurationException;
2021-02-26 17:54:48 +00:00
@@ -287,6 +288,11 @@ public class PaperConfig {
2018-11-18 19:54:38 +00: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));
+ }
+
2020-11-09 00:09:37 +00:00
private static void savePlayerData() {
2020-11-09 01:05:27 +00:00
Object val = config.get("settings.save-player-data");
if (val instanceof Boolean) {
2018-11-18 19:54:38 +00:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2021-05-18 04:54:25 +00:00
index 63f24b977d11fc2658f8ec23c65029f3baf551f5..d44ff2830b6c74f301108f31432627426ca41b9a 100644
2018-11-18 19:54:38 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2021-05-18 04:54:25 +00:00
@@ -2337,6 +2337,11 @@ public final class CraftServer implements Server {
2018-11-18 19:54:38 +00:00
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
2019-05-05 11:12:32 +00:00
+ @Override
2018-11-18 19:54:38 +00:00
+ public String getPermissionMessage() {
+ return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
+ }
+
2019-05-05 11:12:32 +00:00
@Override
2018-11-18 19:54:38 +00:00
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);