aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/kotlin/repo/MiningRepoData.kt5
-rw-r--r--src/main/kotlin/util/SkyBlockIsland.kt1
2 files changed, 6 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 {
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