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