Clean commands a bit.

This commit is contained in:
md_5 2013-01-18 11:39:15 +11:00
parent 8e3f750c7c
commit 4ba6993039
6 changed files with 10 additions and 11 deletions

View File

@ -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(" ");
}

View File

@ -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));
}
}

View File

@ -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");
}
}

View File

@ -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;

View File

@ -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)

View File

@ -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;
/**