aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPauline <git@ethanlibs.co>2025-03-03 17:02:34 +0100
committerLinnea Grรคf <nea@nea.moe>2025-03-08 16:01:00 +0100
commite2f3ed48d24697b78c42992788310f725ed5cec7 (patch)
treef33d4b0840296b37479ec2b670a42dc52f909817 /src
parentaf2a6d7a5509691abfd1b0a314e8d9c2d423aa21 (diff)
downloadFirmament-e2f3ed48d24697b78c42992788310f725ed5cec7.tar.gz
Firmament-e2f3ed48d24697b78c42992788310f725ed5cec7.tar.bz2
Firmament-e2f3ed48d24697b78c42992788310f725ed5cec7.zip
๐Ÿ› fix: d
Signed-off-by: Pauline <git@ethanlibs.co>
Diffstat (limited to 'src')
-rw-r--r--src/compat/jade/java/moe/nea/firmament/compat/jade/DrillToolHandler.kt15
-rw-r--r--src/compat/jade/java/moe/nea/firmament/compat/jade/utils.kt12
2 files changed, 23 insertions, 4 deletions
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<ItemStack>
) : ToolHandler {
- constructor(uid: Identifier, tools: MutableList<Item>) : 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<ItemStack> {
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
+}