From 9064272771e8745808a1dd83166f4caefa1a3f47 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 --- .../api/pony/network/fabric/Channel.java | 15 ++++++++------- .../client/render/EquineRenderManager.java | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java b/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java index d787d8be..2c719950 100644 --- a/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java +++ b/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java @@ -55,18 +55,19 @@ public class Channel { }); } + public static boolean isRegistered() { + return registered; + } + public static boolean broadcastPonyData(IPonyData packet, boolean noSkin) { + 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"); - } - + LOGGER.info("Sending pony data to server for player"); ClientPlayNetworking.send(CLIENT_PONY_DATA, new MsgPonyData(packet, noSkin).toBuffer(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 c72f06d6..5c8e6309 100644 --- a/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java +++ b/src/main/java/com/minelittlepony/client/render/EquineRenderManager.java @@ -140,7 +140,7 @@ public class EquineRenderManager