Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 20:40:07 +01:00
47 Zeilen
2.4 KiB
Diff
47 Zeilen
2.4 KiB
Diff
From 0000000000000000000000000000000000000000 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 e8bade581ed391b25c592dbafb3fb3ccf72be616..053ba1023b6d1393c0ade589ae53feb22218f413 100644
|
|
--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
+++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
|
@@ -19,6 +19,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;
|
|
@@ -282,6 +283,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));
|
|
+ }
|
|
+
|
|
private static void savePlayerData() {
|
|
Object val = config.get("settings.save-player-data");
|
|
if (val instanceof Boolean) {
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
index 0463e546fba266df3984022e3e1122750fc9bb06..c9ce183a8acfda1c639e6d808e90936f5a8d35a8 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
@@ -2335,6 +2335,11 @@ public final class CraftServer implements Server {
|
|
return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions;
|
|
}
|
|
|
|
+ @Override
|
|
+ public String getPermissionMessage() {
|
|
+ return com.destroystokyo.paper.PaperConfig.noPermissionMessage;
|
|
+ }
|
|
+
|
|
@Override
|
|
public com.destroystokyo.paper.profile.PlayerProfile createProfile(@Nonnull UUID uuid) {
|
|
return createProfile(uuid, null);
|