mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 05:28:59 +00:00
Use better Piston Retract Barrel check
This commit is contained in:
@@ -70,10 +70,11 @@ public class BlockListener implements Listener {
|
|||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
public void onPistonRetract(BlockPistonRetractEvent event) {
|
public void onPistonRetract(BlockPistonRetractEvent event) {
|
||||||
if (event.isSticky()) {
|
if (event.isSticky()) {
|
||||||
Block block = event.getRetractLocation().getBlock();
|
for (Block block : event.getBlocks()) {
|
||||||
|
if (Barrel.get(block) != null) {
|
||||||
if (Barrel.get(block) != null) {
|
event.setCancelled(true);
|
||||||
event.setCancelled(true);
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user