1
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:
TheBusyBiscuit 2020-08-04 09:52:53 +02:00
parent 012a0a7df9
commit 7cc795f30e

View File

@ -91,7 +91,7 @@ public class BlockListener implements Listener {
int fortune = getBonusDropsWithFortune(item, e.getBlock()); int fortune = getBonusDropsWithFortune(item, e.getBlock());
List<ItemStack> drops = new ArrayList<>(); List<ItemStack> drops = new ArrayList<>();
if (isTool(item.getType())) { if (item.getType() != Material.AIR) {
SlimefunItem tool = SlimefunItem.getByItem(item); SlimefunItem tool = SlimefunItem.getByItem(item);
if (tool != null) { if (tool != null) {
@ -136,11 +136,6 @@ public class BlockListener implements Listener {
dropItems(e, drops); 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) { private void dropItems(BlockBreakEvent e, List<ItemStack> drops) {
if (!drops.isEmpty()) { if (!drops.isEmpty()) {
e.getBlock().setType(Material.AIR); e.getBlock().setType(Material.AIR);