mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-15 07:01:36 +08:00
Customize server is full message
This commit is contained in:
parent
c6e50618a8
commit
777dddbc24
@ -1,11 +1,11 @@
|
||||
From 866aee41f87d8a15b7181248f1f36076e818c67a Mon Sep 17 00:00:00 2001
|
||||
From 1c42664186e3191cc60a48a07769707934d3a112 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Fri, 21 Jun 2013 19:21:58 +1000
|
||||
Subject: [PATCH] Configurable Messages
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
index fe846af..edeefba 100644
|
||||
index fe846af..ab38736 100644
|
||||
--- a/src/main/java/net/minecraft/server/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/PlayerList.java
|
||||
@@ -307,7 +307,7 @@ public abstract class PlayerList {
|
||||
@ -17,6 +17,15 @@ index fe846af..edeefba 100644
|
||||
} else {
|
||||
String s2 = socketaddress.toString();
|
||||
|
||||
@@ -323,7 +323,7 @@ public abstract class PlayerList {
|
||||
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_BANNED, s3);
|
||||
} else if (this.players.size() >= this.maxPlayers) {
|
||||
- event.disallow(PlayerLoginEvent.Result.KICK_FULL, "The server is full!");
|
||||
+ event.disallow(PlayerLoginEvent.Result.KICK_FULL, org.spigotmc.SpigotConfig.serverFullMessage); // Spigot
|
||||
} else {
|
||||
event.disallow(PlayerLoginEvent.Result.ALLOWED, s2);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 42600a6..9d71ae3 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@ -31,7 +40,7 @@ index 42600a6..9d71ae3 100644
|
||||
return false;
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 3cccb72..102c5fa 100644
|
||||
index d217794..0d53a5b 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -15,6 +15,7 @@ import java.util.Map;
|
||||
@ -42,13 +51,14 @@ index 3cccb72..102c5fa 100644
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.craftbukkit.command.TicksPerSecondCommand;
|
||||
@@ -225,4 +226,16 @@ public class SpigotConfig
|
||||
@@ -225,4 +226,18 @@ public class SpigotConfig
|
||||
{
|
||||
tabComplete = getBoolean( "commands.tab-complete", true );
|
||||
}
|
||||
+
|
||||
+ public static String whitelistMessage;
|
||||
+ public static String unknownCommandMessage;
|
||||
+ public static String serverFullMessage;
|
||||
+ private static String transform(String s)
|
||||
+ {
|
||||
+ return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\n", "\n" );
|
||||
@ -57,6 +67,7 @@ index 3cccb72..102c5fa 100644
|
||||
+ {
|
||||
+ whitelistMessage = transform( getString( "messages.whitelist", "You are not whitelisted on this server!" ) );
|
||||
+ unknownCommandMessage = transform( getString( "messages.unknown-command", "Unknown command. Type \"help\" for help." ) );
|
||||
+ serverFullMessage = transform( getString( "messages.server-full", "The server is full!" ) );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
|
@ -1,4 +1,4 @@
|
||||
From a6d06947f8a021fe637a3a32b1c1e5a8213ffc93 Mon Sep 17 00:00:00 2001
|
||||
From 12842ce0abe79fc49a1c054dbd3cd04a4959d0c1 Mon Sep 17 00:00:00 2001
|
||||
From: md_5 <md_5@live.com.au>
|
||||
Date: Sat, 22 Jun 2013 16:40:11 +1000
|
||||
Subject: [PATCH] Add Log Filtering
|
||||
@ -32,7 +32,7 @@ index 0000000..fd26480
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
index 67854aa..7c80298 100644
|
||||
index 0d53a5b..cc3b9d8 100644
|
||||
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
@@ -13,6 +13,8 @@ import java.util.HashMap;
|
||||
@ -44,9 +44,9 @@ index 67854aa..7c80298 100644
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
@@ -238,4 +240,27 @@ public class SpigotConfig
|
||||
whitelistMessage = transform( getString( "messages.whitelist", "You are not whitelisted on this server!" ) );
|
||||
@@ -240,4 +242,27 @@ public class SpigotConfig
|
||||
unknownCommandMessage = transform( getString( "messages.unknown-command", "Unknown command. Type \"help\" for help." ) );
|
||||
serverFullMessage = transform( getString( "messages.server-full", "The server is full!" ) );
|
||||
}
|
||||
+
|
||||
+ public static List<Pattern> logFilters;
|
||||
|
Loading…
Reference in New Issue
Block a user