mirror of
https://github.com/songoda/EpicHoppers.git
synced 2025-01-27 01:51:29 +01:00
Restricted block break from working on lava or water.
This commit is contained in:
parent
08713df07f
commit
707259c8d1
@ -31,6 +31,7 @@ public class ModuleBlockBreak implements Module {
|
|||||||
@Override
|
@Override
|
||||||
public void run(Hopper hopper) {
|
public void run(Hopper hopper) {
|
||||||
Block block = hopper.getLocation().getBlock();
|
Block block = hopper.getLocation().getBlock();
|
||||||
|
|
||||||
if (!blockTick.containsKey(block)) {
|
if (!blockTick.containsKey(block)) {
|
||||||
blockTick.put(block, 1);
|
blockTick.put(block, 1);
|
||||||
return;
|
return;
|
||||||
@ -40,6 +41,8 @@ public class ModuleBlockBreak implements Module {
|
|||||||
blockTick.put(block, put);
|
blockTick.put(block, put);
|
||||||
if (tick < amount) return;
|
if (tick < amount) return;
|
||||||
Block above = block.getRelative(0, 1, 0);
|
Block above = block.getRelative(0, 1, 0);
|
||||||
|
if (above.getType() == Material.WATER || above.getType() == Material.LAVA) return;
|
||||||
|
|
||||||
if (above.getType() != Material.AIR && above.getType() != Material.HOPPER && !EpicHoppersPlugin.getInstance().getConfig().getStringList("Main.BlockBreak Blacklisted Blocks").contains(above.getType().name())) {
|
if (above.getType() != Material.AIR && above.getType() != Material.HOPPER && !EpicHoppersPlugin.getInstance().getConfig().getStringList("Main.BlockBreak Blacklisted Blocks").contains(above.getType().name())) {
|
||||||
above.getWorld().playSound(above.getLocation(), Sound.BLOCK_STONE_BREAK, 1F, 1F);
|
above.getWorld().playSound(above.getLocation(), Sound.BLOCK_STONE_BREAK, 1F, 1F);
|
||||||
Location locationAbove = above.getLocation();
|
Location locationAbove = above.getLocation();
|
||||||
|
Loading…
Reference in New Issue
Block a user