diff --git a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java index 7c4bf81f25..a88d419c2a 100644 --- a/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java +++ b/fabric-lifecycle-events-v1/src/client/java/net/fabricmc/fabric/mixin/event/lifecycle/client/ClientPlayNetworkHandlerMixin.java @@ -26,7 +26,6 @@ import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; -import net.minecraft.network.packet.s2c.common.SynchronizeTagsS2CPacket; import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket; import net.minecraft.world.chunk.WorldChunk; @@ -96,16 +95,12 @@ private void onClearWorld(CallbackInfo ci) { } } + /** + * Also invoked during GameJoin, but before Networking API fires the Ready event. + */ @SuppressWarnings("ConstantConditions") - @Inject( - method = "onSynchronizeTags", - at = @At( - value = "INVOKE", - target = "Lnet/minecraft/client/network/ClientCommonNetworkHandler;onSynchronizeTags(Lnet/minecraft/network/packet/s2c/common/SynchronizeTagsS2CPacket;)V", - shift = At.Shift.AFTER, by = 1 - ) - ) - private void hookOnSynchronizeTags(SynchronizeTagsS2CPacket packet, CallbackInfo ci) { + @Inject(method = "refreshTagBasedData", at = @At("RETURN")) + private void hookOnSynchronizeTags(CallbackInfo ci) { ClientPlayNetworkHandler self = (ClientPlayNetworkHandler) (Object) this; CommonLifecycleEvents.TAGS_LOADED.invoker().onTagsLoaded(self.getRegistryManager(), true); }