mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
This commit is contained in:
parent
55731ef532
commit
eb17f19258
@ -33,7 +33,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPistonExtend(BlockPistonExtendEvent e) {
|
||||
for (Block b: e.getBlocks()) {
|
||||
for (Block b : e.getBlocks()) {
|
||||
if (BlockStorage.hasBlockInfo(b)) {
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
@ -41,12 +41,15 @@ public class BlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@EventHandler
|
||||
public void onPistonRetract(BlockPistonRetractEvent e) {
|
||||
if (e.isSticky() && BlockStorage.hasBlockInfo(e.getRetractLocation().getBlock())) {
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
if (e.isSticky()) {
|
||||
for (Block b : e.getBlocks()) {
|
||||
if (BlockStorage.hasBlockInfo(b)) {
|
||||
e.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user