mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Allow player-list API to self un/list (#10358)
This commit is contained in:
parent
bccba9bc30
commit
b56970d394
1 changed files with 0 additions and 2 deletions
|
@ -145,7 +145,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public boolean unlistPlayer(@NotNull Player other) {
|
||||
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
||||
+ if (this.getHandle().connection == null) return false;
|
||||
+ if (this.equals(other)) return false;
|
||||
+ if (!this.canSee(other)) return false;
|
||||
+
|
||||
+ if (unlistedEntities.add(other.getUniqueId())) {
|
||||
|
@ -160,7 +159,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ public boolean listPlayer(@NotNull Player other) {
|
||||
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
||||
+ if (this.getHandle().connection == null) return false;
|
||||
+ if (this.equals(other)) return false;
|
||||
+ if (!this.canSee(other)) throw new IllegalStateException("Player cannot see other player");
|
||||
+
|
||||
+ if (this.unlistedEntities.remove(other.getUniqueId())) {
|
||||
|
|
Loading…
Reference in a new issue