Misc formatting fixes

This commit is contained in:
md_5 2019-02-26 13:11:05 +11:00
parent 9133a6f511
commit e2bc7ed797
3 changed files with 12 additions and 10 deletions

View File

@ -47,7 +47,8 @@ public class ChatEvent extends TargetedEvent implements Cancellable
* Checks whether this message is run on this proxy server. * Checks whether this message is run on this proxy server.
* *
* @return if this command runs on the proxy * @return if this command runs on the proxy
* @see PluginManager#isExecutableCommand(java.lang.String, net.md_5.bungee.api.CommandSender) * @see PluginManager#isExecutableCommand(java.lang.String,
* net.md_5.bungee.api.CommandSender)
*/ */
public boolean isProxyCommand() public boolean isProxyCommand()
{ {

View File

@ -40,11 +40,12 @@ public class CommandAlertRaw extends Command
} }
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 )
color( ChatColor.RED ).underlined( true ). .underlined( true )
event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( error.getMessage() ).color( ChatColor.RED ).create() ) ). .event( new HoverEvent( HoverEvent.Action.SHOW_TEXT, 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() );

View File

@ -49,10 +49,10 @@ public class CommandServer extends Command implements TabExecutor
{ {
TextComponent serverTextComponent = new TextComponent( first ? server.getName() : ", " + server.getName() ); TextComponent serverTextComponent = new TextComponent( first ? server.getName() : ", " + server.getName() );
int count = server.getPlayers().size(); int count = server.getPlayers().size();
serverTextComponent.setHoverEvent( new HoverEvent( HoverEvent.Action.SHOW_TEXT, serverTextComponent.setHoverEvent( new HoverEvent(
new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ) HoverEvent.Action.SHOW_TEXT,
.append( "Click to connect to the server" ).italic( true ) new ComponentBuilder( count + ( count == 1 ? " player" : " players" ) + "\n" ).append( "Click to connect to the server" ).italic( true ).create() )
.create() ) ); );
serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) ); serverTextComponent.setClickEvent( new ClickEvent( ClickEvent.Action.RUN_COMMAND, "/server " + server.getName() ) );
serverList.append( serverTextComponent ); serverList.append( serverTextComponent );
first = false; first = false;