mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-01-24 21:31:22 +01:00
Use better Piston Retract Barrel check
This commit is contained in:
parent
7c3d231b34
commit
0e02355cca
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user