From 4de3f3daa2a9f0e48841f1ba55f1662b1a4ff8e7 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 24 Oct 2023 01:12:36 +0100 Subject: [PATCH] Fix constant logging when playing on a multiplayer server that doesn't register for receiving pony data packets # Conflicts: # src/main/java/com/minelittlepony/api/events/Channel.java # src/main/java/com/minelittlepony/client/render/EquineRenderManager.java --- .../com/minelittlepony/api/events/Channel.java | 14 +++++++------- .../client/render/EquineRenderManager.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/minelittlepony/api/events/Channel.java b/src/main/java/com/minelittlepony/api/events/Channel.java index 1e3d29a2..ce1ac4b8 100644 --- a/src/main/java/com/minelittlepony/api/events/Channel.java +++ b/src/main/java/com/minelittlepony/api/events/Channel.java @@ -54,18 +54,18 @@ public class Channel { }); } + public static boolean isRegistered() { + return registered; + } + public static boolean broadcastPonyData(PonyData packet) { + if (!isRegistered()) { + return false; + } if (FabricLoader.getInstance().getEnvironmentType() != EnvType.CLIENT) { throw new RuntimeException("Client packet send called by the server"); } - if (!registered) { - LOGGER.info("Skipping network packet as the server has not consented"); - return false; - } else { - LOGGER.info("Sending pony data to server for player"); - } - ClientPlayNetworking.send(CLIENT_PONY_DATA, MsgPonyData.write(packet, PacketByteBufs.create())); return true; } diff --git a/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java b/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java index da0a8579..dae39170 100644 --- a/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java +++ b/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java @@ -197,7 +197,7 @@ public class EquineRenderManager