testserver/Spigot-Server-Patches/0345-Make-the-default-permi...

50 lines
2.3 KiB
Diff
Raw Normal View History

2019-05-27 00:16:47 +00:00
From 2fb7d628c80d5a2687651ee3ad8333eb8afd3471 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/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
index e5e41c6621..8942a06bfe 100644
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
@@ -21,6 +21,7 @@ import java.util.regex.Pattern;
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;
@@ -281,6 +282,11 @@ public class PaperConfig {
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
2019-05-27 00:16:47 +00:00
index c97bf8a05c..88b416f600 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
2019-05-06 03:53:47 +00:00
@@ -2123,6 +2123,11 @@ public final class CraftServer implements Server {
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
}
2019-05-05 11:12:32 +00:00
+ @Override
+ public String getPermissionMessage() {
+ return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
+ }
+
2019-05-05 11:12:32 +00:00
@Override
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
return createProfile(uuid, null);
--
2019-05-05 11:32:20 +00:00
2.21.0