From 973c13e84f8e091a6a920779103d96559dcd32a8 Mon Sep 17 00:00:00 2001 From: nea Date: Sat, 27 Aug 2022 01:38:49 +0200 Subject: Switch to yarn mappings --- .../kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt') diff --git a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt b/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt index 2c0b4ec..ac595ca 100644 --- a/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt +++ b/src/main/kotlin/moe/nea/notenoughupdates/repo/RepoManager.kt @@ -11,9 +11,9 @@ import moe.nea.notenoughupdates.NotEnoughUpdates.logger import moe.nea.notenoughupdates.hud.ProgressBar import moe.nea.notenoughupdates.util.ConfigHolder import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents -import net.minecraft.client.Minecraft -import net.minecraft.network.chat.Component -import net.minecraft.network.protocol.game.ClientboundUpdateRecipesPacket +import net.minecraft.client.MinecraftClient +import net.minecraft.network.packet.s2c.play.SynchronizeRecipesS2CPacket +import net.minecraft.text.Text object RepoManager : ConfigHolder(serializer(), "repo", ::Config) { @Serializable @@ -43,8 +43,8 @@ object RepoManager : ConfigHolder(serializer(), "repo", ::Co } private fun trySendClientboundUpdateRecipesPacket(): Boolean { - return Minecraft.getInstance().level != null && Minecraft.getInstance().connection?.handleUpdateRecipes( - ClientboundUpdateRecipesPacket(mutableListOf()) + return MinecraftClient.getInstance().world != null && MinecraftClient.getInstance().networkHandler?.onSynchronizeRecipes( + SynchronizeRecipesS2CPacket(mutableListOf()) ) != null } @@ -71,8 +71,8 @@ object RepoManager : ConfigHolder(serializer(), "repo", ::Co CottonHud.add(progressBar) neuRepo.reload() } catch (exc: NEURepositoryException) { - Minecraft.getInstance().player?.sendSystemMessage( - Component.literal("Failed to reload repository. This will result in some mod features not working.") + MinecraftClient.getInstance().player?.sendMessage( + Text.literal("Failed to reload repository. This will result in some mod features not working.") ) CottonHud.remove(progressBar) exc.printStackTrace() -- cgit