mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 03:35:51 +00:00
One more change
This commit is contained in:
parent
012a0a7df9
commit
7cc795f30e
@ -91,7 +91,7 @@ public class BlockListener implements Listener {
|
||||
int fortune = getBonusDropsWithFortune(item, e.getBlock());
|
||||
List<ItemStack> drops = new ArrayList<>();
|
||||
|
||||
if (isTool(item.getType())) {
|
||||
if (item.getType() != Material.AIR) {
|
||||
SlimefunItem tool = SlimefunItem.getByItem(item);
|
||||
|
||||
if (tool != null) {
|
||||
@ -136,11 +136,6 @@ public class BlockListener implements Listener {
|
||||
dropItems(e, drops);
|
||||
}
|
||||
|
||||
private boolean isTool(Material type) {
|
||||
// Small performance optimization in case someone has backwards compatibility enabled.
|
||||
return type == Material.SHEARS || type.name().endsWith("_AXE") || type.name().endsWith("_PICKAXE") || type.name().endsWith("_SHOVEL");
|
||||
}
|
||||
|
||||
private void dropItems(BlockBreakEvent e, List<ItemStack> drops) {
|
||||
if (!drops.isEmpty()) {
|
||||
e.getBlock().setType(Material.AIR);
|
||||
|
Loading…
Reference in New Issue
Block a user