mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Move sendMessage(Component) to GeyserCommandSource
This commit is contained in:
parent
f1642d81dc
commit
936fed1ded
3 changed files with 6 additions and 9 deletions
|
@ -4,8 +4,6 @@ plugins {
|
|||
|
||||
dependencies {
|
||||
api(projects.api)
|
||||
|
||||
implementation("net.kyori", "adventure-text-serializer-legacy", Versions.adventureVersion)
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
|
|
@ -25,9 +25,6 @@
|
|||
|
||||
package org.geysermc.geyser.api.command;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
|
||||
/**
|
||||
* Represents an instance capable of sending commands.
|
||||
*/
|
||||
|
@ -58,10 +55,6 @@ public interface CommandSource {
|
|||
}
|
||||
}
|
||||
|
||||
default void sendMessage(Component message) {
|
||||
sendMessage(LegacyComponentSerializer.legacySection().serialize(message));
|
||||
}
|
||||
|
||||
/**
|
||||
* If this source is the console.
|
||||
*
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue