Skip to content

Commit

Permalink
Fix Trample in Cause Filter (#1086)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick <[email protected]>
  • Loading branch information
CoWinkKeyDinkInc authored Oct 21, 2022
1 parent 57e4269 commit b144fea
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public Class<? extends MatchQuery> queryType() {
@Override
public boolean matches(MatchQuery query) {
Event event = query.getEvent();
if (event instanceof GeneralizedEvent) {
// Prevent PlayerTrampleBlockEvent from casting, which will turn into PlayerCoarseMoveEvent
// which doesn't work for trample
if (event instanceof GeneralizedEvent && !(event instanceof PlayerTrampleBlockEvent)) {
event = ((GeneralizedEvent) event).getCause();
}

Expand Down

0 comments on commit b144fea

Please sign in to comment.