Merge pull request #75 from emmanuelvlad/expose-locked-players

feat/data-edit-commands
William 2 years ago committed by GitHub
commit 42177f2582
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

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

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

@ -236,4 +236,8 @@ public abstract class EventListener {
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();
}

@ -166,4 +166,9 @@ public class DummyPlayer extends OnlineUser {
return false;
}
@Override
public boolean isLocked() {
return false;
}
}

Loading…
Cancel
Save