Skip to content

Commit

Permalink
Fix dialogue registry sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jan 21, 2024
1 parent 121f7ae commit ddc2674
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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
------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Identifier> 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());
}
});
}
Expand Down

0 comments on commit ddc2674

Please sign in to comment.