aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/Firmament.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/Firmament.kt')
-rw-r--r--src/main/kotlin/Firmament.kt21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/main/kotlin/Firmament.kt b/src/main/kotlin/Firmament.kt
index 0191036..b00546a 100644
--- a/src/main/kotlin/Firmament.kt
+++ b/src/main/kotlin/Firmament.kt
@@ -51,6 +51,7 @@ import moe.nea.firmament.repo.RepoManager
import moe.nea.firmament.util.MC
import moe.nea.firmament.util.SBData
import moe.nea.firmament.util.data.IDataHolder
+import moe.nea.firmament.util.mc.InitLevel
import moe.nea.firmament.util.tr
object Firmament {
@@ -66,6 +67,8 @@ object Firmament {
}
val version: Version by lazy { metadata.version }
+ private val DEFAULT_JSON_INDENT = " "
+
@OptIn(ExperimentalSerializationApi::class)
val json = Json {
prettyPrint = DEBUG
@@ -73,10 +76,23 @@ object Firmament {
allowTrailingComma = true
ignoreUnknownKeys = true
encodeDefaults = true
+ prettyPrintIndent = if (prettyPrint) "\t" else DEFAULT_JSON_INDENT
+ }
+
+ /**
+ * FUCK two space indentation
+ */
+ val twoSpaceJson = Json(from = json) {
+ prettyPrint = true
+ prettyPrintIndent = " "
}
val gson = Gson()
val tightJson = Json(from = json) {
prettyPrint = false
+ // Reset pretty print indent back to default to prevent getting yelled at by json
+ prettyPrintIndent = DEFAULT_JSON_INDENT
+ encodeDefaults = false
+ explicitNulls = false
}
@@ -119,6 +135,7 @@ object Firmament {
@JvmStatic
fun onClientInitialize() {
+ InitLevel.bump(InitLevel.MC_INIT)
FeatureManager.subscribeEvents()
ClientTickEvents.END_CLIENT_TICK.register(ClientTickEvents.EndTick { instance ->
TickEvent.publish(TickEvent(MC.currentTick++))
@@ -148,9 +165,9 @@ object Firmament {
})
ClientInitEvent.publish(ClientInitEvent())
ResourceManagerHelper.registerBuiltinResourcePack(
- identifier("transparent_storage"),
+ identifier("transparent_overlay"),
modContainer,
- tr("firmament.resourcepack.transparentstorage", "Transparent Firmament Storage Overlay"),
+ tr("firmament.resourcepack.transparentoverlay", "Transparent Firmament Overlay"),
ResourcePackActivationType.NORMAL
)
}