aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-08-27 01:38:49 +0200
committernea <romangraef@gmail.com>2022-08-27 01:38:49 +0200
commit973c13e84f8e091a6a920779103d96559dcd32a8 (patch)
tree95741faaa85509216a3a5130a3d8cd48b1b415fd /src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt
parent4c7bd601c4df4d03536e97e18e4b88d858330ad9 (diff)
downloadfirmament-973c13e84f8e091a6a920779103d96559dcd32a8.tar.gz
firmament-973c13e84f8e091a6a920779103d96559dcd32a8.tar.bz2
firmament-973c13e84f8e091a6a920779103d96559dcd32a8.zip
Switch to yarn mappings
Diffstat (limited to 'src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt')
-rw-r--r--src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt b/src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt
index 07a9b4c..7827708 100644
--- a/src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt
+++ b/src/main/kotlin/moe/nea/notenoughupdates/util/ConfigHolder.kt
@@ -5,9 +5,10 @@ import kotlinx.serialization.SerializationException
import moe.nea.notenoughupdates.NotEnoughUpdates
import moe.nea.notenoughupdates.events.NEUScreenEvents
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents
-import net.minecraft.client.Minecraft
-import net.minecraft.commands.CommandSource
-import net.minecraft.network.chat.Component
+import net.minecraft.client.MinecraftClient
+import net.minecraft.command.CommandSource
+import net.minecraft.server.command.CommandOutput
+import net.minecraft.text.Text
import java.io.IOException
import java.nio.file.Path
import java.util.concurrent.CopyOnWriteArrayList
@@ -102,10 +103,10 @@ abstract class ConfigHolder<T>(
}
}
- private fun warnForResetConfigs(player: CommandSource) {
+ private fun warnForResetConfigs(player: CommandOutput) {
if (badLoads.isNotEmpty()) {
- player.sendSystemMessage(
- Component.literal(
+ player.sendMessage(
+ Text.literal(
"The following configs have been reset: ${badLoads.joinToString(", ")}. " +
"This can be intentional, but probably isn't."
)
@@ -117,7 +118,7 @@ abstract class ConfigHolder<T>(
fun registerEvents() {
NEUScreenEvents.SCREEN_OPEN.register(NEUScreenEvents.OnScreenOpen { old, new ->
performSaves()
- val p = Minecraft.getInstance().player
+ val p = MinecraftClient.getInstance().player
if (p != null) {
warnForResetConfigs(p)
}
@@ -128,6 +129,5 @@ abstract class ConfigHolder<T>(
})
}
-
}
-} \ No newline at end of file
+}