3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-12-27 08:30:12 +01:00

Move sendMessage(Component) to GeyserCommandSource

Dieser Commit ist enthalten in:
Kas-tle 2022-08-24 15:38:54 +00:00 committet von GitHub
Ursprung f1642d81dc
Commit 936fed1ded
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
3 geänderte Dateien mit 6 neuen und 9 gelöschten Zeilen

Datei anzeigen

@ -4,8 +4,6 @@ plugins {
dependencies { dependencies {
api(projects.api) api(projects.api)
implementation("net.kyori", "adventure-text-serializer-legacy", Versions.adventureVersion)
} }
publishing { publishing {

Datei anzeigen

@ -25,9 +25,6 @@
package org.geysermc.geyser.api.command; 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. * 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. * If this source is the console.
* *

Datei anzeigen

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