Skip to content

Commit

Permalink
Fix dead players interacting with specific packets
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 committed May 3, 2024
1 parent 4714177 commit 830c38f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
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 @@ -116,7 +116,7 @@ boolean cancelUnlessInteracting(Cancellable event, Entity entity) {

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

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

0 comments on commit 830c38f

Please sign in to comment.