mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Set default instead of null check
This commit is contained in:
1 parent
33f907e237
commit
f7077316b1
1 file changed
+3
-7
@@ -86,13 +86,9 @@ public class ChannelListCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void makeList(Iterator<ChatChannel> iterator, TextComponent.Builder list) {
|
private void makeList(Iterator<ChatChannel> iterator, TextComponent.Builder list) {
|
||||||
String listSeparator = carbonChat.getLanguage().getString("channel-list-separator");
|
String listSeparator = carbonChat.getLanguage().getString("channel-list-separator", ", ");
|
||||||
Component listSeparatorComponent;
|
Component listSeparatorComponent = listSeparatorComponent = TextComponent.of(listSeparator);
|
||||||
if (listSeparator != null) {
|
|
||||||
listSeparatorComponent = TextComponent.of(listSeparator);
|
|
||||||
} else {
|
|
||||||
listSeparatorComponent = TextComponent.of(", ");
|
|
||||||
}
|
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
ChatChannel channel = iterator.next();
|
ChatChannel channel = iterator.next();
|
||||||
list.append(TextComponent.of(channel.getName()));
|
list.append(TextComponent.of(channel.getName()));
|
||||||
|
|||||||
Reference in new issue
Block a user