mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +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) {
|
+ public boolean unlistPlayer(@NotNull Player other) {
|
||||||
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
||||||
+ if (this.getHandle().connection == null) return false;
|
+ if (this.getHandle().connection == null) return false;
|
||||||
+ if (this.equals(other)) return false;
|
|
||||||
+ if (!this.canSee(other)) return false;
|
+ if (!this.canSee(other)) return false;
|
||||||
+
|
+
|
||||||
+ if (unlistedEntities.add(other.getUniqueId())) {
|
+ if (unlistedEntities.add(other.getUniqueId())) {
|
||||||
|
@ -160,7 +159,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ public boolean listPlayer(@NotNull Player other) {
|
+ public boolean listPlayer(@NotNull Player other) {
|
||||||
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
+ Preconditions.checkNotNull(other, "hidden entity cannot be null");
|
||||||
+ if (this.getHandle().connection == null) return false;
|
+ 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.canSee(other)) throw new IllegalStateException("Player cannot see other player");
|
||||||
+
|
+
|
||||||
+ if (this.unlistedEntities.remove(other.getUniqueId())) {
|
+ if (this.unlistedEntities.remove(other.getUniqueId())) {
|
||||||
|
|
Loading…
Reference in a new issue