1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Hercules' Pickaxe now supports 1.17 deepslate ores and copper

This commit is contained in:
ybw0014 2021-09-14 02:16:55 +08:00 committed by Kyle Einstein
parent e0291d7092
commit ae6cfdcf0f

View File

@ -3,6 +3,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools;
import javax.annotation.Nonnull;
import javax.annotation.ParametersAreNonnullByDefault;
import io.github.thebusybiscuit.slimefun4.api.MinecraftVersion;
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -25,12 +27,32 @@ public class HerculesPickaxe extends SimpleSlimefunItem<ToolUseHandler> {
@Override
public @Nonnull ToolUseHandler getItemHandler() {
return (e, tool, fortune, drops) -> {
if (SlimefunTag.ORES.isTagged(e.getBlock().getType())) {
if (e.getBlock().getType() == Material.IRON_ORE) {
Material mat = e.getBlock().getType();
if (SlimefunTag.ORES.isTagged(mat)) {
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
switch(mat) {
case DEEPSLATE_IRON_ORE:
drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2));
} else if (e.getBlock().getType() == Material.GOLD_ORE) {
break;
case DEEPSLATE_GOLD_ORE:
drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2));
} else {
break;
case COPPER_ORE:
case DEEPSLATE_COPPER_ORE:
drops.add(new CustomItemStack(SlimefunItems.COPPER_DUST, 2));
break;
}
}
switch(mat) {
case IRON_ORE:
drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2));
break;
case GOLD_ORE:
drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2));
break;
default:
for (ItemStack drop : e.getBlock().getDrops(tool)) {
drops.add(new CustomItemStack(drop, drop.getAmount() * 2));
}