Skip to content

Commit 4cbe7d4

Browse files
committed
Use adventure textOfChildren method
1 parent fd20b5e commit 4cbe7d4

File tree

4 files changed

+5
-54
lines changed

4 files changed

+5
-54
lines changed

common/src/main/java/xyz/jpenilla/minimotd/common/CommandHandler.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import net.kyori.adventure.text.minimessage.MiniMessage;
3030
import org.checkerframework.checker.nullness.qual.NonNull;
3131
import org.checkerframework.framework.qual.DefaultQualifier;
32-
import xyz.jpenilla.minimotd.common.util.Components;
3332

3433
import static net.kyori.adventure.text.Component.space;
3534
import static net.kyori.adventure.text.Component.text;
@@ -77,15 +76,15 @@ public void reload(final Audience audience) {
7776
this.miniMOTD.reload();
7877
} catch (final Exception ex) {
7978
this.miniMOTD.logger().warn("Failed to reload MiniMOTD. Ensure there are no errors in your config files.", ex);
80-
audience.sendMessage(Components.ofChildren(
79+
audience.sendMessage(Component.textOfChildren(
8180
Constants.COMMAND_PREFIX,
8281
space(),
8382
text("Failed to reload MiniMOTD. Ensure there are no errors in your config files. See console for more details.", RED)
8483
));
8584
return;
8685
}
8786

88-
audience.sendMessage(Components.ofChildren(
87+
audience.sendMessage(Component.textOfChildren(
8988
Constants.COMMAND_PREFIX,
9089
space(),
9190
text("Done reloading configuration.", GREEN)

common/src/main/java/xyz/jpenilla/minimotd/common/MiniMOTD.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.slf4j.Logger;
3636
import xyz.jpenilla.minimotd.common.config.ConfigManager;
3737
import xyz.jpenilla.minimotd.common.config.MOTDConfig;
38-
import xyz.jpenilla.minimotd.common.util.Components;
3938

4039
import static net.kyori.adventure.text.Component.newline;
4140

@@ -91,7 +90,7 @@ public PingResponse<I> createMOTD(final MOTDConfig config, final int onlinePlaye
9190
}
9291
final int index = config.motds().size() == 1 ? 0 : ThreadLocalRandom.current().nextInt(config.motds().size());
9392
final MOTDConfig.MOTD motdConfig = config.motds().get(index);
94-
final Component motd = Components.ofChildren(
93+
final Component motd = Component.textOfChildren(
9594
parse(motdConfig.line1(), count),
9695
newline(),
9796
parse(motdConfig.line2(), count)

common/src/main/java/xyz/jpenilla/minimotd/common/util/Components.java

-47
This file was deleted.

common/src/test/java/xyz/jpenilla/minimotd/common/util/ComponentColorDownsamplerTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ class ComponentColorDownsamplerTest {
4141

4242
@Test
4343
void testColorDownsampling() {
44-
final Component fullColor = Components.ofChildren(
44+
final Component fullColor = Component.textOfChildren(
4545
text("Green ", GREEN),
4646
text("Orange Yellow ", ORANGE_YELLOW),
4747
text("Pink ", PINK),
4848
text("Blue ", BLUE),
4949
text("Lime Green", LIME_GREEN)
5050
);
51-
final Component expectedDownsample = Components.ofChildren(
51+
final Component expectedDownsample = Component.textOfChildren(
5252
text("Green ", nearestTo(GREEN)),
5353
text("Orange Yellow ", nearestTo(ORANGE_YELLOW)),
5454
text("Pink ", nearestTo(PINK)),

0 commit comments

Comments
 (0)