2020-05-06 17:48:49 +08:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2018-11-19 03:54:38 +08: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-08 18:00:43 +08:00
index ae27b5d3fbc8e9476469a1201066b46b47efeb5c..92386af0dc3e308b93fd4fa04ffe32ac9f76e272 100644
2018-11-19 03:54:38 +08:00
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
2020-06-25 22:09:55 +08:00
@@ -19,6 +19,7 @@ import java.util.regex.Pattern;
2018-11-19 03:54:38 +08: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 14:29:44 +08:00
import org.bukkit.configuration.ConfigurationSection;
2018-11-19 03:54:38 +08:00
import org.bukkit.configuration.InvalidConfigurationException;
2020-06-26 14:29:44 +08:00
@@ -279,6 +280,11 @@ public class PaperConfig {
2018-11-19 03:54:38 +08: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-08 18:00:43 +08:00
public static boolean useAlternativeLuckFormula = false;
private static void useAlternativeLuckFormula() {
useAlternativeLuckFormula = getBoolean("settings.use-alternative-luck-formula", false);
2018-11-19 03:54:38 +08:00
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-09-14 17:57:06 +08:00
index 251433b5a0560cdfca298aca45c53191b74bc403..975b2b35324d5eb00a85b4771f68dd0b320c58e3 100644
2018-11-19 03:54:38 +08:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2020-09-14 17:57:06 +08:00
@@ -2271,6 +2271,11 @@ public final class CraftServer implements Server {
2018-11-19 03:54:38 +08:00
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
2019-05-05 19:12:32 +08:00
+ @Override
2018-11-19 03:54:38 +08:00
+ public String getPermissionMessage() {
+ return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
+ }
+
2019-05-05 19:12:32 +08:00
@Override
2018-11-19 03:54:38 +08:00
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);