From e2f3ed48d24697b78c42992788310f725ed5cec7 Mon Sep 17 00:00:00 2001 From: Pauline Date: Mon, 3 Mar 2025 17:02:34 +0100 Subject: 🐛 fix: d MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Pauline --- .../moe/nea/firmament/compat/jade/DrillToolHandler.kt | 15 +++++++++++---- .../jade/java/moe/nea/firmament/compat/jade/utils.kt | 12 ++++++++++++ 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolHandler.kt b/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolHandler.kt index 8bed40a..d9e9436 100644 --- a/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolHandler.kt +++ b/src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolHandler.kt @@ -1,22 +1,29 @@ package moe.nea.firmament.compat.jade import com.google.common.collect.Lists +import snownee.jade.addon.harvest.SimpleToolHandler import snownee.jade.addon.harvest.ToolHandler import net.minecraft.block.BlockState +import net.minecraft.client.MinecraftClient import net.minecraft.item.Item import net.minecraft.item.ItemStack import net.minecraft.util.Identifier import net.minecraft.util.math.BlockPos import net.minecraft.world.World +import moe.nea.firmament.util.SBData -class SimpleToolHandler( +class DrillToolHandler( private val uid: Identifier, private val tools: MutableList ) : ToolHandler { - constructor(uid: Identifier, tools: MutableList) : this(uid, Lists.transform(tools, Item::getDefaultStack)) - override fun test(state: BlockState, world: World, pos: BlockPos): ItemStack { - TODO("We need to override the existing tool handler tests because they use state.getHardness(world, pos) instead of using Breaking Power") + if (isOnMiningIsland()) { + } + + // TODO: figure out how this work + return SimpleToolHandler.create(uid, tools.map { + return@map it.item + }).test(state, world, pos) } override fun getTools(): List { diff --git a/src/compat/jade/java/moe/nea/firmament/compat/jade/utils.kt b/src/compat/jade/java/moe/nea/firmament/compat/jade/utils.kt index 2fdd031..520190b 100644 --- a/src/compat/jade/java/moe/nea/firmament/compat/jade/utils.kt +++ b/src/compat/jade/java/moe/nea/firmament/compat/jade/utils.kt @@ -6,6 +6,8 @@ import snownee.jade.api.ui.IElementHelper import net.minecraft.item.ItemStack import net.minecraft.item.Items import net.minecraft.util.Identifier +import moe.nea.firmament.util.SBData +import moe.nea.firmament.util.SkyBlockIsland import moe.nea.firmament.util.SkyblockId import moe.nea.firmament.util.setSkyBlockId @@ -18,3 +20,13 @@ val drillIcon: IElement = IElementHelper.get().item(drillItem, 0.5f).message(nul fun IWailaClientRegistration.registerGemstone(type: String) { } + +fun isOnMiningIsland(): Boolean { + if (!SBData.isOnSkyblock) return false + // how does a when loop work + if (SBData.skyblockLocation == SkyBlockIsland.forMode("dwarven_mines")) return true + if (SBData.skyblockLocation == SkyBlockIsland.MINESHAFT) return true + if (SBData.skyblockLocation == SkyBlockIsland.forMode("crystal_hollows")) return true + if (SBData.skyblockLocation == SkyBlockIsland.forMode("crimson_isle")) return true + return false +} -- cgit