feat: Add custom hardness tooltips

This commit is contained in:
Linnea Gräf
2025-03-06 21:04:18 +01:00
parent ebd2f270c3
commit 9099abe955
5 changed files with 70 additions and 28 deletions

View File

@@ -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 {