9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-23 16:49:19 +00:00

refactor: Use native adventure implementation on Paper

This commit is contained in:
William
2023-12-19 22:03:24 +00:00
parent 22eedc8522
commit fb069296e1
7 changed files with 44 additions and 15 deletions

View File

@@ -22,6 +22,8 @@ package net.william278.husksync;
import com.fatboyindustrial.gsonjavatime.Converters;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.platform.AudienceProvider;
import net.william278.annotaml.Annotaml;
import net.william278.desertwell.util.ThrowingConsumer;
import net.william278.desertwell.util.UpdateChecker;
@@ -250,12 +252,35 @@ public interface HuskSync extends Task.Supplier, EventDispatcher {
}
/**
* Get the console user
* Get the {@link AudienceProvider} instance
*
* @return the {@link ConsoleUser}
* @return the {@link AudienceProvider} instance
* @since 1.0
*/
@NotNull
ConsoleUser getConsole();
AudienceProvider getAudiences();
/**
* Get the {@link Audience} instance for the given {@link OnlineUser}
*
* @param user the {@link OnlineUser} to get the {@link Audience} for
* @return the {@link Audience} instance
*/
@NotNull
default Audience getAudience(@NotNull UUID user) {
return getAudiences().player(user);
}
/**
* Get the {@link ConsoleUser} instance
*
* @return the {@link ConsoleUser} instance
* @since 1.0
*/
@NotNull
default ConsoleUser getConsole() {
return new ConsoleUser(getAudiences());
}
/**
* Returns the plugin version