mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Added sneaking check to ExplosiveTool
This commit is contained in:
parent
0262830ef5
commit
fcee14cb0c
@ -58,13 +58,16 @@ public class ExplosiveTool extends SimpleSlimefunItem<ToolUseHandler> implements
|
|||||||
public ToolUseHandler getItemHandler() {
|
public ToolUseHandler getItemHandler() {
|
||||||
return (e, tool, fortune, drops) -> {
|
return (e, tool, fortune, drops) -> {
|
||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
Block b = e.getBlock();
|
|
||||||
|
|
||||||
b.getWorld().createExplosion(b.getLocation(), 0);
|
if (!p.isSneaking()) {
|
||||||
b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F);
|
Block b = e.getBlock();
|
||||||
|
|
||||||
List<Block> blocks = findBlocks(b);
|
b.getWorld().createExplosion(b.getLocation(), 0);
|
||||||
breakBlocks(e, p, tool, b, blocks, drops);
|
b.getWorld().playSound(b.getLocation(), Sound.ENTITY_GENERIC_EXPLODE, 0.2F, 1F);
|
||||||
|
|
||||||
|
List<Block> blocks = findBlocks(b);
|
||||||
|
breakBlocks(e, p, tool, b, blocks, drops);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user