Skip to content

Commit

Permalink
Fix blockglitch incident querying
Browse files Browse the repository at this point in the history
Signed-off-by: Pablo Herrera <[email protected]>
  • Loading branch information
Pablete1234 committed Jan 13, 2025
1 parent 8dbc43a commit e3da7b9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public List<Incident> getIncidents() {
}

public Incident getIncident(int id) {
if (pastIncidents.isEmpty()) return null;
int idx = id - pastIncidents.getFirst().id;
if (idx < 0 || idx >= pastIncidents.size()) return null;
return pastIncidents.get(idx);
for (Incident i : pastIncidents) {
if (i.id == id) return i;
}
return null;
}

@EventHandler(priority = EventPriority.MONITOR)
Expand All @@ -92,7 +92,7 @@ public void onBlockTransform(ParticipantBlockTransformEvent event) {
Player pl = bpe.getPlayer();

boolean isBlockglitch = event.isCancelled()
&& playerState.getLocation().getY() > event.getBlock().getY()
&& (playerState.getLocation().getY() - 0.75) > event.getBlock().getY()
&& pl != null
&& !pl.isOnGround()
&& !pl.isFlying();
Expand Down

0 comments on commit e3da7b9

Please sign in to comment.