Move sendMessage(Component) to GeyserCommandSource

This commit is contained in:
Kas-tle 2022-08-24 15:38:54 +00:00 committed by GitHub
parent f1642d81dc
commit 936fed1ded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 9 deletions

View file

@ -27,6 +27,8 @@ package org.geysermc.geyser.command;
import org.geysermc.geyser.api.command.CommandSource;
import org.geysermc.geyser.text.GeyserLocale;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
/**
* Implemented on top of any class that can send a command.
@ -40,4 +42,8 @@ public interface GeyserCommandSource extends CommandSource {
default String locale() {
return GeyserLocale.getDefaultLocale();
}
default void sendMessage(Component message) {
sendMessage(LegacyComponentSerializer.legacySection().serialize(message));
}
}