Skip to content

Commit

Permalink
fix(GetGoldSpade): no longer placeable
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 committed Aug 14, 2024
1 parent aa7cb60 commit 48e6284
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType
import io.github.thebusybiscuit.slimefun4.core.handlers.ToolUseHandler
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem
import io.github.thebusybiscuit.slimefun4.implementation.items.blocks.UnplaceableBlock
import net.guizhanss.guizhanlib.utils.RandomUtil
import org.bukkit.Material
import org.bukkit.enchantments.Enchantment
Expand All @@ -19,8 +19,12 @@ class GetGoldSpade(
itemStack: SlimefunItemStack,
recipeType: RecipeType,
recipe: Array<out ItemStack?>
) : SimpleSlimefunItem<ToolUseHandler>(itemGroup, itemStack, recipeType, recipe) {
override fun getItemHandler() =
) : UnplaceableBlock(itemGroup, itemStack, recipeType, recipe) {
init {
addItemHandler(getToolUseHandler())
}

private fun getToolUseHandler() =
ToolUseHandler { e: BlockBreakEvent, item: ItemStack, _: Int, drops: MutableList<ItemStack> ->
if (e.block.type != Material.SAND) return@ToolUseHandler

Expand Down

0 comments on commit 48e6284

Please sign in to comment.