mirror of
https://github.com/WiIIiam278/HuskSync.git
synced 2025-12-23 16:49:19 +00:00
User data pinning, version validation checks, fixes
This commit is contained in:
@@ -10,6 +10,7 @@ import net.william278.husksync.migrator.Migrator;
|
||||
import net.william278.husksync.player.OnlineUser;
|
||||
import net.william278.husksync.redis.RedisManager;
|
||||
import net.william278.husksync.util.Logger;
|
||||
import net.william278.husksync.util.Version;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,32 +19,122 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
|
||||
/**
|
||||
* Abstract implementation of the HuskSync plugin.
|
||||
*/
|
||||
public interface HuskSync {
|
||||
|
||||
@NotNull Set<OnlineUser> getOnlineUsers();
|
||||
/**
|
||||
* Returns a set of online players.
|
||||
*
|
||||
* @return a set of online players as {@link OnlineUser}
|
||||
*/
|
||||
@NotNull
|
||||
Set<OnlineUser> getOnlineUsers();
|
||||
|
||||
@NotNull Optional<OnlineUser> getOnlineUser(@NotNull UUID uuid);
|
||||
/**
|
||||
* Returns an online user by UUID if they exist
|
||||
*
|
||||
* @param uuid the UUID of the user to get
|
||||
* @return an online user as {@link OnlineUser}
|
||||
*/
|
||||
@NotNull
|
||||
Optional<OnlineUser> getOnlineUser(@NotNull UUID uuid);
|
||||
|
||||
@NotNull Database getDatabase();
|
||||
/**
|
||||
* Returns the database implementation
|
||||
*
|
||||
* @return the {@link Database} implementation
|
||||
*/
|
||||
@NotNull
|
||||
Database getDatabase();
|
||||
|
||||
@NotNull RedisManager getRedisManager();
|
||||
/**
|
||||
* Returns the redis manager implementation
|
||||
*
|
||||
* @return the {@link RedisManager} implementation
|
||||
*/
|
||||
|
||||
@NotNull DataAdapter getDataAdapter();
|
||||
@NotNull
|
||||
RedisManager getRedisManager();
|
||||
|
||||
@NotNull DataEditor getDataEditor();
|
||||
/**
|
||||
* Returns the data adapter implementation
|
||||
*
|
||||
* @return the {@link DataAdapter} implementation
|
||||
*/
|
||||
@NotNull
|
||||
DataAdapter getDataAdapter();
|
||||
|
||||
@NotNull EventCannon getEventCannon();
|
||||
/**
|
||||
* Returns the data editor implementation
|
||||
*
|
||||
* @return the {@link DataEditor} implementation
|
||||
*/
|
||||
@NotNull
|
||||
DataEditor getDataEditor();
|
||||
|
||||
@NotNull List<Migrator> getAvailableMigrators();
|
||||
/**
|
||||
* Returns the event firing cannon
|
||||
*
|
||||
* @return the {@link EventCannon} implementation
|
||||
*/
|
||||
@NotNull
|
||||
EventCannon getEventCannon();
|
||||
|
||||
@NotNull Settings getSettings();
|
||||
/**
|
||||
* Returns a list of available data {@link Migrator}s
|
||||
*
|
||||
* @return a list of {@link Migrator}s
|
||||
*/
|
||||
@NotNull
|
||||
List<Migrator> getAvailableMigrators();
|
||||
|
||||
@NotNull Locales getLocales();
|
||||
/**
|
||||
* Returns the plugin {@link Settings}
|
||||
*
|
||||
* @return the {@link Settings}
|
||||
*/
|
||||
@NotNull
|
||||
Settings getSettings();
|
||||
|
||||
@NotNull Logger getLoggingAdapter();
|
||||
/**
|
||||
* Returns the plugin {@link Locales}
|
||||
*
|
||||
* @return the {@link Locales}
|
||||
*/
|
||||
@NotNull
|
||||
Locales getLocales();
|
||||
|
||||
@NotNull String getVersion();
|
||||
/**
|
||||
* Returns the plugin {@link Logger}
|
||||
*
|
||||
* @return the {@link Logger}
|
||||
*/
|
||||
@NotNull
|
||||
Logger getLoggingAdapter();
|
||||
|
||||
/**
|
||||
* Returns the plugin version
|
||||
*
|
||||
* @return the plugin {@link Version}
|
||||
*/
|
||||
@NotNull
|
||||
Version getPluginVersion();
|
||||
|
||||
/**
|
||||
* Returns the Minecraft version implementation
|
||||
*
|
||||
* @return the Minecraft {@link Version}
|
||||
*/
|
||||
@NotNull
|
||||
Version getMinecraftVersion();
|
||||
|
||||
/**
|
||||
* Reloads the {@link Settings} and {@link Locales} from their respective config files
|
||||
*
|
||||
* @return a {@link CompletableFuture} that will be completed when the plugin reload is complete and if it was successful
|
||||
*/
|
||||
CompletableFuture<Boolean> reload();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user