Skip to content

Commit

Permalink
Fix dead players interacting with specific packets (#1312)
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 authored May 3, 2024
1 parent 9e52762 commit 4366da2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/tc/oc/pgm/api/player/MatchPlayerState.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,9 @@ public interface MatchPlayerState extends Audience, Named {
default boolean isPlayer(MatchPlayer player) {
return getPlayer().map(player::equals).orElse(false);
}

/** @return if the player can interact */
default boolean canInteract() {
return getPlayer().map(MatchPlayer::canInteract).orElse(false);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ boolean cancelUnlessInteracting(Cancellable event, Entity entity) {
}

boolean cancelUnlessInteracting(Cancellable event, MatchPlayerState player) {
return cancel(
event, !player.getParty().isParticipating(), player.getMatch().getWorld(), null, null);
return cancel(event, !player.canInteract(), player.getMatch().getWorld(), null, null);
}

ClickType convertClick(ClickType clickType, Player player) {
Expand Down

0 comments on commit 4366da2

Please sign in to comment.