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-11-18 04:45:18 +01:00
index 2aca8cc2be963b2b015e52cdec6b3843011f1ccb..346da105776a0ae0cb06ed69f1f8f9160695bb85 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
2020-06-25 16:09:55 +02:00
@@ -19,6 +19,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;
2020-06-26 08:29:44 +02:00
import org.bukkit.configuration.ConfigurationSection;
2018-11-18 20:54:38 +01:00
import org.bukkit.configuration.InvalidConfigurationException;
2020-06-26 08:29:44 +02:00
@@ -279,6 +280,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));
+ }
+
2020-11-09 01:09:37 +01:00
private static void savePlayerData() {
2020-11-09 02:05:27 +01:00
Object val = config.get("settings.save-player-data");
if (val instanceof Boolean) {
2018-11-18 20:54:38 +01:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-09-14 11:57:06 +02:00
index 251433b5a0560cdfca298aca45c53191b74bc403..975b2b35324d5eb00a85b4771f68dd0b320c58e3 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-09-14 11:57:06 +02:00
@@ -2271,6 +2271,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);