mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-25 18:17:38 +01:00
Formatting fixes
This commit is contained in:
parent
28c8bf47ff
commit
e7f1a88e6e
@ -1,5 +1,6 @@
|
|||||||
package net.md_5.bungee.command;
|
package net.md_5.bungee.command;
|
||||||
|
|
||||||
|
import com.google.common.base.Joiner;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.CommandSender;
|
import net.md_5.bungee.api.CommandSender;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
@ -9,8 +10,6 @@ import net.md_5.bungee.api.connection.ProxiedPlayer;
|
|||||||
import net.md_5.bungee.api.plugin.Command;
|
import net.md_5.bungee.api.plugin.Command;
|
||||||
import net.md_5.bungee.chat.ComponentSerializer;
|
import net.md_5.bungee.chat.ComponentSerializer;
|
||||||
|
|
||||||
import com.google.common.base.Joiner;
|
|
||||||
|
|
||||||
public class CommandAlertRaw extends Command
|
public class CommandAlertRaw extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -27,30 +26,30 @@ public class CommandAlertRaw extends Command
|
|||||||
sender.sendMessage( ChatColor.RED + "You must supply a message." );
|
sender.sendMessage( ChatColor.RED + "You must supply a message." );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
String message = Joiner.on(' ').join( args );
|
String message = Joiner.on( ' ' ).join( args );
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
ProxyServer.getInstance().broadcast( ComponentSerializer.parse( message ) );
|
ProxyServer.getInstance().broadcast( ComponentSerializer.parse( message ) );
|
||||||
} catch ( Exception e )
|
} catch ( Exception e )
|
||||||
{
|
{
|
||||||
Throwable error = e;
|
Throwable error = e;
|
||||||
while ( error.getCause() != null )
|
while ( error.getCause() != null )
|
||||||
{
|
{
|
||||||
error = error.getCause();
|
error = error.getCause();
|
||||||
}
|
}
|
||||||
if ( sender instanceof ProxiedPlayer )
|
if ( sender instanceof ProxiedPlayer )
|
||||||
{
|
{
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
new ComponentBuilder( "An error occurred while parsing your message. (Hover for details)" ).
|
new ComponentBuilder( "An error occurred while parsing your message. (Hover for details)" ).
|
||||||
color( ChatColor.RED ).underlined( true ).
|
color( ChatColor.RED ).underlined( true ).
|
||||||
event( new HoverEvent( HoverEvent.Action.SHOW_TEXT,
|
event( new HoverEvent( HoverEvent.Action.SHOW_TEXT,
|
||||||
new ComponentBuilder( error.getMessage() ).color( ChatColor.RED ).create() ) ).
|
new ComponentBuilder( error.getMessage() ).color( ChatColor.RED ).create() ) ).
|
||||||
create() );
|
create() );
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
sender.sendMessage(new ComponentBuilder( "An error occurred while parsing your message: " ).color( ChatColor.RED ).append( error.getMessage() ).create() );
|
sender.sendMessage( new ComponentBuilder( "An error occurred while parsing your message: " ).color( ChatColor.RED ).append( error.getMessage() ).create() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user