expose locked players + add a method on OnlineUser

feat/data-edit-commands
evlad 2 years ago
parent 101e0c11d7
commit 71706bf9ae

@ -307,6 +307,11 @@ public class BukkitHuskSync extends JavaPlugin implements HuskSync {
return audiences; return audiences;
} }
@Override
public Set<UUID> getLockedPlayers() {
return this.eventListener.getLockedPlayers();
}
@Override @Override
public CompletableFuture<Boolean> reload() { public CompletableFuture<Boolean> reload() {
return CompletableFuture.supplyAsync(() -> { return CompletableFuture.supplyAsync(() -> {

@ -675,4 +675,9 @@ public class BukkitPlayer extends OnlineUser {
return maxHealth; return maxHealth;
} }
@Override
public boolean isLocked() {
return BukkitHuskSync.getInstance().getLockedPlayers().contains(player.getUniqueId());
}
} }

@ -165,4 +165,6 @@ public interface HuskSync {
*/ */
CompletableFuture<Boolean> reload(); CompletableFuture<Boolean> reload();
Set<UUID> getLockedPlayers();
} }

@ -236,4 +236,8 @@ public abstract class EventListener {
plugin.getRedisManager().close(); plugin.getRedisManager().close();
} }
public final Set<UUID> getLockedPlayers() {
return this.lockedPlayers;
}
} }

@ -371,4 +371,10 @@ public abstract class OnlineUser extends User {
}); });
} }
/**
* Get if the player is locked
*
* @return the player's locked status
*/
public abstract boolean isLocked();
} }

Loading…
Cancel
Save