From ddc2674b1532a7d645a71f7f7e7c5b5dce011bb7 Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Sun, 21 Jan 2024 20:09:29 +0100 Subject: [PATCH] Fix dialogue registry sync --- changelog.md | 5 +++++ gradle.properties | 2 +- .../org/ladysnake/blabber/impl/common/BlabberRegistrar.java | 5 ++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 4951857a..3e242544 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +------------------------------------------------------ +Version 1.4.1-mc1.20.1 +------------------------------------------------------ +- Fixed dialogues not being synced with clients + ------------------------------------------------------ Version 1.4.0-mc1.20.1 ------------------------------------------------------ diff --git a/gradle.properties b/gradle.properties index 500ab757..8457ad12 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx2G java_version=17 # Mod Properties - mod_version = 1.4.0-mc1.20.1 + mod_version = 1.4.1-mc1.20.1 maven_group = org.ladysnake archives_base_name = blabber diff --git a/src/main/java/org/ladysnake/blabber/impl/common/BlabberRegistrar.java b/src/main/java/org/ladysnake/blabber/impl/common/BlabberRegistrar.java index bbadb97a..d197f23d 100644 --- a/src/main/java/org/ladysnake/blabber/impl/common/BlabberRegistrar.java +++ b/src/main/java/org/ladysnake/blabber/impl/common/BlabberRegistrar.java @@ -27,7 +27,6 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents; import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; -import net.fabricmc.fabric.impl.networking.server.ServerNetworkingImpl; import net.minecraft.command.CommandSource; import net.minecraft.command.suggestion.SuggestionProviders; import net.minecraft.entity.Entity; @@ -83,11 +82,11 @@ public static void init() { }); ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> { - if (ServerNetworkingImpl.getAddon(handler).getSendableChannels().contains(DialogueListPacket.TYPE)) { + if (ServerPlayNetworking.canSend(handler, DialogueListPacket.TYPE)) { Set dialogueIds = DialogueRegistry.getIds(); sender.sendPacket(new DialogueListPacket(dialogueIds)); } else { - Blabber.LOGGER.warn("{} does not have Blabber installed, this will cause issues if they trigger a dialogue", handler.getPlayer().getName()); + Blabber.LOGGER.warn("{} does not have Blabber installed, this will cause issues if they trigger a dialogue", handler.getPlayer().getEntityName()); } }); }