Replace string concatenation with appending text components (#325)

* Replace string concatenation with appending text

* Fix inconsistent indentation

oops

* indentation

i forgor 💀
This commit is contained in:
Chip 2022-11-01 13:02:25 +00:00 committed by GitHub
parent 03a2fec6f4
commit a1007853dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 12 deletions

View file

@ -64,8 +64,11 @@ public final class CommandUsername implements CommandExecutor {
player.setPlayerProfile(profile);
millis = System.currentTimeMillis();
player.sendMessage(Component
.text("Successfully set your username to \"" + name + "\""));
player.sendMessage(
Component.text("Successfully set your username to \"")
.append(Component.text(name))
.append(Component.text("\""))
);
return true;
}
}