3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-26 16:12:42 +01:00

Custom reload message #459

Dieser Commit ist enthalten in:
Myles 2016-07-09 14:41:07 +01:00
Ursprung 1d0c0c527c
Commit 07d89b24af
4 geänderte Dateien mit 19 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -180,4 +180,9 @@ public class ViaConfig implements ViaVersionConfig {
public String getBlockedDisconnectMsg() {
return plugin.getConfig().getString("block-disconnect-msg", "You are using an unsupported Minecraft version!");
}
@Override
public String getReloadDisconnectMsg() {
return plugin.getConfig().getString("reload-disconnect-msg", "Server reload, please rejoin!");
}
}

Datei anzeigen

@ -7,6 +7,7 @@ import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;
import lombok.Getter;
import lombok.NonNull;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginDescriptionFile;
@ -79,7 +80,7 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
if (Bukkit.getPluginManager().getPlugin("ProtocolLib") != null) {
getLogger().severe("ViaVersion is already loaded, we're going to kick all the players... because otherwise we'll crash because of ProtocolLib.");
for (Player player : Bukkit.getOnlinePlayers()) {
player.kickPlayer("Server reload, please rejoin!");
player.kickPlayer(ChatColor.translateAlternateColorCodes('&', getConf().getReloadDisconnectMsg()));
}
} else {

Datei anzeigen

@ -209,4 +209,12 @@ public interface ViaVersionConfig {
* @return Disconnect message
*/
String getBlockedDisconnectMsg();
/**
* Get the message sent to players being kicked on reload.
* Players are kicked to stop the server crashing
*
* @return Disconnect message
*/
String getReloadDisconnectMsg();
}

Datei anzeigen

@ -17,6 +17,10 @@ send-supported-versions: false
block-protocols: []
# Change the blocked disconnect message
block-disconnect-msg: "You are using an unsupported Minecraft version!"
# If you use ProtocolLib, we can't reload without kicking the players.
# (We don't suggest using reload either, use a plugin manager)
# You can customise the message we kick people with if you use ProtocolLib here.
reload-disconnect-msg: "Server reload, please rejoin!"
#
#----------------------------------------------------------#
# GLOBAL PACKET LIMITER #