MySQLDatabase

public final class MySQLDatabase implements DatabaseManager

Constructors

Link copied to clipboard
public void MySQLDatabase(Plugin plugin, String host, String port, String database, String username, String password)

Functions

Link copied to clipboard
public void close()
Closes the database connection.
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Optional<String>> getActiveSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() Material material)
Gets the active skin for a specific item type.
Link copied to clipboard
Retrieves all grants that have expired (expires_at is not null and <= now).
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Collection<SkinGrant>> getGrants(@NotNull() @NotNull() UUID playerUuid)
Gets all skin grants for a player.
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Void> grantSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId, @NotNull() @NotNull() String source)
Grants a skin to a player.
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Void> grantSkinWithExpiry(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId, @NotNull() @NotNull() String source, @Nullable() @Nullable() LocalDateTime expiresAt)
Grants a skin with an optional expiration date.
Link copied to clipboard
public void init()
Initializes the database connection and creates tables.
Link copied to clipboard
public void logAction(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String action, @NotNull() @NotNull() String target, @Nullable() @Nullable() String metadata)
Logs an action to the database.
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Void> migrateSkinId(String oldSkinId, @NotNull() @NotNull() String newSkinId)
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Void> revokeSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() String skinId)
Revokes a skin from a player.
Link copied to clipboard
@NotNull()
public @NotNull() CompletableFuture<Void> setActiveSkin(@NotNull() @NotNull() UUID playerUuid, @NotNull() @NotNull() Material material, @Nullable() @Nullable() String skinId)
Sets the active skin for a specific item type.