From 9099abe955d88f7e0f1a1a8feba519a8a098858d Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 6 Mar 2025 21:04:18 +0100 Subject: feat: Add custom hardness tooltips --- src/main/kotlin/repo/MiningRepoData.kt | 5 +++++ src/main/kotlin/util/SkyBlockIsland.kt | 1 + 2 files changed, 6 insertions(+) (limited to 'src/main') diff --git a/src/main/kotlin/repo/MiningRepoData.kt b/src/main/kotlin/repo/MiningRepoData.kt index bbaeea3..46eaeb0 100644 --- a/src/main/kotlin/repo/MiningRepoData.kt +++ b/src/main/kotlin/repo/MiningRepoData.kt @@ -13,6 +13,7 @@ import net.minecraft.item.ItemStack import net.minecraft.nbt.NbtCompound import moe.nea.firmament.repo.ReforgeStore.kJson import moe.nea.firmament.util.MC +import moe.nea.firmament.util.SBData import moe.nea.firmament.util.SkyBlockIsland import moe.nea.firmament.util.SkyblockId @@ -51,6 +52,10 @@ class MiningRepoData : IReloadable { @Transient val block = convertToModernBlock() + val isCurrentlyActive: Boolean + get() = isActiveIn(SBData.skyblockLocation ?: SkyBlockIsland.NIL) + fun isActiveIn(location: SkyBlockIsland) = onlyIn == null || location in onlyIn + private fun convertToModernBlock(): Block? { // TODO: this should be in a shared util, really val newCompound = ItemCache.convert189ToModern(NbtCompound().apply { diff --git a/src/main/kotlin/util/SkyBlockIsland.kt b/src/main/kotlin/util/SkyBlockIsland.kt index 1f00915..e7f955a 100644 --- a/src/main/kotlin/util/SkyBlockIsland.kt +++ b/src/main/kotlin/util/SkyBlockIsland.kt @@ -40,6 +40,7 @@ private constructor( val MINESHAFT = forMode("mineshaft") val GARDEN = forMode("garden") val DUNGEON = forMode("dungeon") + val NIL = forMode("_") } val hasCustomMining -- cgit