Skip to content

Commit

Permalink
fix: Block duplication fixed due to bug in piston event handling
Browse files Browse the repository at this point in the history
  • Loading branch information
oddlama committed Oct 5, 2021
1 parent 2a32f52 commit 15b47a4
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void on_entity_change_block(final EntityChangeBlockEvent event) {
public void on_block_piston_extend_event(final BlockPistonExtendEvent event) {
// Prevent pistons from moving portal blocks
for (final var block : event.getBlocks()) {
if (get_module().is_portal_block(event.getBlock())) {
if (get_module().is_portal_block(block)) {
event.setCancelled(true);
return;
}
Expand All @@ -67,7 +67,7 @@ public void on_block_piston_extend_event(final BlockPistonExtendEvent event) {
public void on_block_piston_retract(final BlockPistonRetractEvent event) {
// Prevent pistons from moving portal blocks
for (final var block : event.getBlocks()) {
if (get_module().is_portal_block(event.getBlock())) {
if (get_module().is_portal_block(block)) {
event.setCancelled(true);
return;
}
Expand Down

0 comments on commit 15b47a4

Please sign in to comment.