mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-20 11:45:51 +00:00
Hercules' Pickaxe now supports 1.17 deepslate ores and copper
This commit is contained in:
parent
e0291d7092
commit
ae6cfdcf0f
@ -3,6 +3,8 @@ package io.github.thebusybiscuit.slimefun4.implementation.items.tools;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.ParametersAreNonnullByDefault;
|
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.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@ -25,16 +27,36 @@ public class HerculesPickaxe extends SimpleSlimefunItem<ToolUseHandler> {
|
|||||||
@Override
|
@Override
|
||||||
public @Nonnull ToolUseHandler getItemHandler() {
|
public @Nonnull ToolUseHandler getItemHandler() {
|
||||||
return (e, tool, fortune, drops) -> {
|
return (e, tool, fortune, drops) -> {
|
||||||
if (SlimefunTag.ORES.isTagged(e.getBlock().getType())) {
|
Material mat = e.getBlock().getType();
|
||||||
if (e.getBlock().getType() == Material.IRON_ORE) {
|
|
||||||
drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2));
|
if (SlimefunTag.ORES.isTagged(mat)) {
|
||||||
} else if (e.getBlock().getType() == Material.GOLD_ORE) {
|
if (Slimefun.getMinecraftVersion().isAtLeast(MinecraftVersion.MINECRAFT_1_17)) {
|
||||||
drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2));
|
switch(mat) {
|
||||||
} else {
|
case DEEPSLATE_IRON_ORE:
|
||||||
for (ItemStack drop : e.getBlock().getDrops(tool)) {
|
drops.add(new CustomItemStack(SlimefunItems.IRON_DUST, 2));
|
||||||
drops.add(new CustomItemStack(drop, drop.getAmount() * 2));
|
break;
|
||||||
|
case DEEPSLATE_GOLD_ORE:
|
||||||
|
drops.add(new CustomItemStack(SlimefunItems.GOLD_DUST, 2));
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user