mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 01:45:44 -05:00
append new text instead of concatenating (#330)
This commit is contained in:
parent
baddda61aa
commit
411cdaa104
2 changed files with 13 additions and 5 deletions
|
@ -35,9 +35,13 @@ public final class CommandDestroyEntities implements CommandExecutor {
|
|||
worldCount++;
|
||||
}
|
||||
|
||||
sender.sendMessage(Component.text(
|
||||
"Successfully destroyed " + entityCount + " entities in "
|
||||
+ worldCount + " worlds"));
|
||||
sender.sendMessage(
|
||||
Component.text("Successfully destroyed ")
|
||||
.append(Component.text(entityCount))
|
||||
.append(Component.text(" entities in "))
|
||||
.append(Component.text(worldCount))
|
||||
.append(Component.text(" worlds"))
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,8 +54,12 @@ public final class CommandPing implements CommandExecutor {
|
|||
break;
|
||||
}
|
||||
|
||||
sender.sendMessage(Component.text((args.length == 0 ?
|
||||
"Your" : target.getName() + "'s") + " ping is ")
|
||||
Component namePrefix = args.length == 0
|
||||
? Component.text("Your")
|
||||
: Component.text(target.getName()).append(Component.text("'s"));
|
||||
|
||||
sender.sendMessage(namePrefix
|
||||
.append(Component.text(" ping is "))
|
||||
.append(Component.text(ping, highlighting))
|
||||
.append(Component.text("ms.", highlighting)));
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue