Skip to content

Commit

Permalink
Use server instead of players as entity selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ustc-zzzz committed Sep 19, 2023
1 parent 0c9ecc5 commit 690f32a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/org/teacon/signin/SignMeUp.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@ public static boolean trigger(ServerPlayer player, Vec3i pos, ResourceLocation t
if (server != null) {
final Vec3 pos3d = Vec3.atLowerCornerOf(pos);
final CommandSourceStack source = isCommand
? player.createCommandSourceStack().withPosition(pos3d).withPermission(2)
: player.createCommandSourceStack().withPosition(pos3d).withSuppressedOutput().withMaximumPermission(2);
? player.getServer().createCommandSourceStack()
.withEntity(player).withPosition(pos3d).withPermission(2)
: player.getServer().createCommandSourceStack()
.withEntity(player).withPosition(pos3d).withSuppressedOutput().withMaximumPermission(2);
for (String command : trigger.executes) {
server.getCommands().performPrefixedCommand(source, command);
}
Expand Down

0 comments on commit 690f32a

Please sign in to comment.