3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

exclude operatores

Dieser Commit ist enthalten in:
Tamion 2024-11-10 22:40:23 +01:00
Ursprung eebada35eb
Commit c241489552
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 01E616386DBAE296

Datei anzeigen

@ -12,7 +12,7 @@ Mojira Issue: https://bugs.mojang.com/browse/MC-235045
Feature patch Feature patch
diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java diff --git a/src/main/java/net/minecraft/commands/CommandSourceStack.java b/src/main/java/net/minecraft/commands/CommandSourceStack.java
index 3549ffea451b932602efb113844ba21a7bc72371..31ba3e942e39a6f1fe848f937bf97ffa2b4102da 100644 index 3549ffea451b932602efb113844ba21a7bc72371..373482cfdb449a0bd6aa078eb40b87522bf9ca4c 100644
--- a/src/main/java/net/minecraft/commands/CommandSourceStack.java --- a/src/main/java/net/minecraft/commands/CommandSourceStack.java
+++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java +++ b/src/main/java/net/minecraft/commands/CommandSourceStack.java
@@ -370,7 +370,7 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS @@ -370,7 +370,7 @@ public class CommandSourceStack implements ExecutionCommandSource<CommandSourceS
@ -20,7 +20,7 @@ index 3549ffea451b932602efb113844ba21a7bc72371..31ba3e942e39a6f1fe848f937bf97ffa
@Override @Override
public Collection<String> getOnlinePlayerNames() { public Collection<String> getOnlinePlayerNames() {
- return Lists.newArrayList(this.server.getPlayerNames()); - return Lists.newArrayList(this.server.getPlayerNames());
+ return this.entity instanceof ServerPlayer sourcePlayer ? this.getServer().getPlayerList().getPlayers().stream().filter(serverPlayer -> sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players + return this.entity instanceof ServerPlayer sourcePlayer && !this.server.getPlayerList().isOp(sourcePlayer.getGameProfile()) ? this.getServer().getPlayerList().getPlayers().stream().filter(serverPlayer -> sourcePlayer.getBukkitEntity().canSee(serverPlayer.getBukkitEntity())).map(serverPlayer -> serverPlayer.getGameProfile().getName()).toList() : Lists.newArrayList(this.server.getPlayerNames()); // Paper - Make CommandSourceStack respect hidden players
} }
@Override @Override