Initial work on user rewrite

Only JSONUserManager and Paper platform work currently
This commit is contained in:
Jason Penilla committed 2023-03-19 11:24:11 -07:00
1 parent 8e3a6935a3
commit e803fa4203
22 files changed
+456 -305

No files matched your search

@@ -21,6 +21,7 @@ package net.draycia.carbon.api.users;
import net.kyori.adventure.text.Component;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
import org.jetbrains.annotations.ApiStatus;
/**
* The result of a player data operation.
@@ -29,6 +30,8 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* @param reason the reason of the result, typically empty unless {@link #player} is null
* @since 2.0.0
*/
@Deprecated(forRemoval = true)
@ApiStatus.Internal
public record ComponentPlayerResult<C extends CarbonPlayer>(@MonotonicNonNull C player, Component reason) {
}
@@ -23,6 +23,7 @@ import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.framework.qual.DefaultQualifier;
import org.jetbrains.annotations.ApiStatus;
/**
* Manager used to load/obtain and save {@link CarbonPlayer CarbonPlayers}.
@@ -39,8 +40,11 @@ public interface UserManager<C extends CarbonPlayer> {
* @return the result
* @since 2.0.0
*/
@Deprecated(forRemoval = true)
CompletableFuture<ComponentPlayerResult<C>> carbonPlayer(final UUID uuid);
CompletableFuture<C> user(final UUID uuid);
/**
* Saves the {@link CarbonPlayer} and returns the result.
*
@@ -48,6 +52,8 @@ public interface UserManager<C extends CarbonPlayer> {
* @return the result
* @since 2.0.0
*/
@ApiStatus.Internal
@Deprecated(forRemoval = true)
CompletableFuture<ComponentPlayerResult<C>> savePlayer(final C player);
/**
@@ -57,6 +63,8 @@ public interface UserManager<C extends CarbonPlayer> {
* @return the result
* @since 2.0.0
*/
@ApiStatus.Internal
@Deprecated(forRemoval = true)
CompletableFuture<ComponentPlayerResult<C>> saveAndInvalidatePlayer(final C player);
}