Skip to content

Commit

Permalink
Use better Piston Retract Barrel check
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Oct 31, 2020
1 parent 7c3d231 commit 0e02355
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/com/dre/brewery/listeners/BlockListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ public void onBlockBurn(BlockBurnEvent event) {
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
public void onPistonRetract(BlockPistonRetractEvent event) {
if (event.isSticky()) {
Block block = event.getRetractLocation().getBlock();

if (Barrel.get(block) != null) {
event.setCancelled(true);
for (Block block : event.getBlocks()) {
if (Barrel.get(block) != null) {
event.setCancelled(true);
return;
}
}
}
}
Expand Down

0 comments on commit 0e02355

Please sign in to comment.