1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00
Poslovitch 2017-09-10 11:05:54 +02:00
parent 55731ef532
commit eb17f19258

View File

@ -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;
}
}
}
}