Customizable server command hover players

This commit is contained in:
LinsaFTW 2023-01-15 17:19:58 -03:00
parent b305ac5e15
commit a8046caf48
4 changed files with 29 additions and 13 deletions

View File

@ -1,4 +1,4 @@
From dae4aa8593ae097fcc2961539dd2fc7787e8d63e Mon Sep 17 00:00:00 2001 From 6eae2c1a46011d8e4aabaf919279a9d941c403f1 Mon Sep 17 00:00:00 2001
From: linsaftw <25271111+linsaftw@users.noreply.github.com> From: linsaftw <25271111+linsaftw@users.noreply.github.com>
Date: Sat, 1 May 2021 13:40:39 -0300 Date: Sat, 1 May 2021 13:40:39 -0300
Subject: [PATCH] FlameCord message configuration Subject: [PATCH] FlameCord message configuration
@ -34,10 +34,10 @@ index ac37eaa3e..c78ab3a7c 100644
private FlameCord(final Logger logger, final Collection<String> whitelistedAddresses) { private FlameCord(final Logger logger, final Collection<String> whitelistedAddresses) {
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
new file mode 100644 new file mode 100644
index 000000000..4f306660e index 000000000..70d5d61fe
--- /dev/null --- /dev/null
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -0,0 +1,114 @@ @@ -0,0 +1,115 @@
+package dev._2lstudios.flamecord.configuration; +package dev._2lstudios.flamecord.configuration;
+ +
+import java.io.File; +import java.io.File;
@ -109,6 +109,7 @@ index 000000000..4f306660e
+ "&cAn error occurred while parsing your message. (Hover for details)", configuration); + "&cAn error occurred while parsing your message. (Hover for details)", configuration);
+ setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}", + setIfUnexistant("error_occurred_console", "&cAn error occurred while parsing your message: {0}",
+ configuration); + configuration);
+ setIfUnexistant("server_command_hover_players", "{0} players", configuration);
+ setIfUnexistant("click_to_connect", "Click to connect to the server", configuration); + setIfUnexistant("click_to_connect", "Click to connect to the server", configuration);
+ setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration); + setIfUnexistant("username_needed", "&cPlease follow this command by a user name.", configuration);
+ setIfUnexistant("user_not_online", "&cThat user is not online.", configuration); + setIfUnexistant("user_not_online", "&cThat user is not online.", configuration);
@ -153,6 +154,21 @@ index 000000000..4f306660e
+ } + }
+} +}
\ No newline at end of file \ No newline at end of file
diff --git a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
index 698b420f4..e4ad7e389 100644
--- a/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
+++ b/module/cmd-server/src/main/java/net/md_5/bungee/module/cmd/server/CommandServer.java
@@ -50,7 +50,9 @@ public class CommandServer extends Command implements TabExecutor
int count = server.getPlayers().size();
serverTextComponent.setHoverEvent( new HoverEvent(
HoverEvent.Action.SHOW_TEXT,
- new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() )
+ // FlameCord - FlameCord messages configuration
+ // Make player count customizable
+ new ComponentBuilder( ProxyServer.getInstance().getTranslation( "server_command_hover_players", count ) + "\n" ).appendLegacy( ProxyServer.getInstance().getTranslation( "click_to_connect" ) ).create() )
);
serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) );
serverList.append( serverTextComponent );
diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java diff --git a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java b/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
index 91d60bfb3..cc76325b2 100644 index 91d60bfb3..cc76325b2 100644
--- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java --- a/proxy/src/main/java/dev/_2lstudios/flamecord/commands/FlameCordCommand.java
@ -201,7 +217,7 @@ index 91d60bfb3..cc76325b2 100644
} }
} }
diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java diff --git a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
index 88ac66bab..501aacfa0 100644 index 7cbac8937..8edaa3026 100644
--- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java --- a/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
+++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java +++ b/proxy/src/main/java/net/md_5/bungee/BungeeCord.java
@@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer @@ -626,8 +626,8 @@ public class BungeeCord extends ProxyServer

View File

@ -1,4 +1,4 @@
From a680ab172db4764d038ffbfadc9d1c454440ded9 Mon Sep 17 00:00:00 2001 From fec0949f3ebda6711d1dddfdfb8774917e9849e3 Mon Sep 17 00:00:00 2001
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
Date: Fri, 4 Mar 2022 13:35:53 -0300 Date: Fri, 4 Mar 2022 13:35:53 -0300
Subject: [PATCH] Antibot System Subject: [PATCH] Antibot System
@ -1281,10 +1281,10 @@ index 9912fc25c..9b0c542aa 100644
this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration); this.loggerInitialhandler = setIfUnexistant("logger.initialhandler", this.loggerInitialhandler, configuration);
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
index 4f306660e..d0d8fc391 100644 index 70d5d61fe..731833f31 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -82,12 +82,27 @@ public class MessagesConfiguration extends FlameConfig { @@ -83,12 +83,27 @@ public class MessagesConfiguration extends FlameConfig {
setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration); setIfUnexistant("command_ip", "&9IP of {0} is {1}", configuration);
setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration); setIfUnexistant("illegal_chat_characters", "&cIllegal characters in chat ({0})", configuration);

View File

@ -1,14 +1,14 @@
From ab055556001fcc9e5278a383ff187e05499937ba Mon Sep 17 00:00:00 2001 From 10210edef9cec9b3892205d79d9701ba5d9980df Mon Sep 17 00:00:00 2001
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
Date: Wed, 11 Jan 2023 10:14:12 -0300 Date: Wed, 11 Jan 2023 10:14:12 -0300
Subject: [PATCH] Bungee Plugins Command Subject: [PATCH] Bungee Plugins Command
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
index 2ecbf29d5..3d4fede4f 100644 index 84b907e28..ca3dd2397 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -95,6 +95,11 @@ public class MessagesConfiguration extends FlameConfig { @@ -96,6 +96,11 @@ public class MessagesConfiguration extends FlameConfig {
setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration); setIfUnexistant("antibot_stats", "&c&lFlameCord Antibot Stats\n &7■ Total Pings: &a{0}\n &7■ Total Connections: &b{1}\n\n &7■ Current Pings: &a{2}\n &7■ Current Connections: &b{3}", configuration);
// FlameCord end - Antibot System // FlameCord end - Antibot System

View File

@ -1,14 +1,14 @@
From 97e6fb1e2fcdb45f9bd000c29a87e3cd5fea9cc6 Mon Sep 17 00:00:00 2001 From cf2b0add184a3df3dfdc9bf47c9b278117a4cd4c Mon Sep 17 00:00:00 2001
From: LinsaFTW <25271111+linsaftw@users.noreply.github.com> From: LinsaFTW <25271111+linsaftw@users.noreply.github.com>
Date: Sun, 15 Jan 2023 10:12:45 -0300 Date: Sun, 15 Jan 2023 10:12:45 -0300
Subject: [PATCH] Bungee IP Command Subject: [PATCH] Bungee IP Command
diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java diff --git a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
index 3d4fede4f..2b9e7f5b9 100644 index ca3dd2397..d3d279d27 100644
--- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java --- a/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
+++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java +++ b/flamecord/src/main/java/dev/_2lstudios/flamecord/configuration/MessagesConfiguration.java
@@ -100,6 +100,12 @@ public class MessagesConfiguration extends FlameConfig { @@ -101,6 +101,12 @@ public class MessagesConfiguration extends FlameConfig {
setIfUnexistant("flamecord_bplugins_separator", ", ", configuration); setIfUnexistant("flamecord_bplugins_separator", ", ", configuration);
setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration); setIfUnexistant("flamecord_bplugins_header", "&aPlugins ({0}): ", configuration);