diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java b/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java index 5958c967..a584e300 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandAlert.java @@ -31,7 +31,7 @@ public class CommandAlert extends Command for (String s : args) { - s = s.replace("&h", ""); + s = s.substring(1, s.length()); builder.append(ChatColor.translateAlternateColorCodes('&', s)); builder.append(" "); } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandMotd.java b/proxy/src/main/java/net/md_5/bungee/command/CommandMotd.java index 22a5ee1c..a253f185 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandMotd.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandMotd.java @@ -3,7 +3,6 @@ package net.md_5.bungee.command; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.Command; /** @@ -27,6 +26,6 @@ public class CommandMotd extends Command newMOTD.append(s); newMOTD.append(" "); } - ((BungeeCord) ProxyServer.getInstance()).config.motd = ChatColor.translateAlternateColorCodes('&', newMOTD.substring(0, newMOTD.length() - 1)); + BungeeCord.getInstance().config.motd = ChatColor.translateAlternateColorCodes('&', newMOTD.substring(0, newMOTD.length() - 1)); } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java index 268a8d46..99a47ecc 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandReload.java @@ -3,7 +3,6 @@ package net.md_5.bungee.command; import net.md_5.bungee.BungeeCord; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; -import net.md_5.bungee.api.ProxyServer; import net.md_5.bungee.api.plugin.Command; public class CommandReload extends Command @@ -17,7 +16,7 @@ public class CommandReload extends Command @Override public void execute(CommandSender sender, String[] args) { - ((BungeeCord) ProxyServer.getInstance()).config.load(); + BungeeCord.getInstance().config.load(); sender.sendMessage(ChatColor.GREEN + "Reloaded config, please restart if you have any issues"); } } diff --git a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java b/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java index 746b585a..92f01c99 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java +++ b/proxy/src/main/java/net/md_5/bungee/command/CommandServer.java @@ -1,8 +1,6 @@ package net.md_5.bungee.command; import java.util.Collection; -import net.md_5.bungee.BungeeCord; -import net.md_5.bungee.UserConnection; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; import net.md_5.bungee.api.ProxyServer; diff --git a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java index 77a1a956..3c637882 100644 --- a/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java +++ b/proxy/src/main/java/net/md_5/bungee/command/ConsoleCommandSender.java @@ -2,6 +2,7 @@ package net.md_5.bungee.command; import java.util.Collection; import java.util.Collections; +import lombok.Getter; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; @@ -11,7 +12,12 @@ import net.md_5.bungee.api.CommandSender; public class ConsoleCommandSender implements CommandSender { - public static final ConsoleCommandSender instance = new ConsoleCommandSender(); + @Getter + private static final ConsoleCommandSender instance = new ConsoleCommandSender(); + + private ConsoleCommandSender() + { + } @Override public void sendMessage(String message) diff --git a/proxy/src/main/java/net/md_5/bungee/packet/PacketInputStream.java b/proxy/src/main/java/net/md_5/bungee/packet/PacketInputStream.java index 66753a83..30a39ac1 100644 --- a/proxy/src/main/java/net/md_5/bungee/packet/PacketInputStream.java +++ b/proxy/src/main/java/net/md_5/bungee/packet/PacketInputStream.java @@ -2,11 +2,8 @@ package net.md_5.bungee.packet; import java.io.ByteArrayOutputStream; import java.io.DataInputStream; -import java.io.EOFException; import java.io.IOException; import java.io.InputStream; -import net.md_5.bungee.Util; -import net.md_5.mendax.PacketDefinitions; import net.md_5.mendax.datainput.DataInputPacketReader; /**