aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/repo/MiningRepoData.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/repo/MiningRepoData.kt')
-rw-r--r--src/main/kotlin/repo/MiningRepoData.kt5
1 files changed, 5 insertions, 0 deletions
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 {