From a948aaf762419095424bcc356e50c44b527bcbe7 Mon Sep 17 00:00:00 2001 From: Estecka Date: Mon, 30 Oct 2023 19:43:00 +0100 Subject: [PATCH] Fix potential null packets --- .../mixin/ServerPlayNetworkHandlerMixin_HealthTag.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/samo_lego/healthcare/mixin/ServerPlayNetworkHandlerMixin_HealthTag.java b/src/main/java/org/samo_lego/healthcare/mixin/ServerPlayNetworkHandlerMixin_HealthTag.java index cd6016d..4085289 100644 --- a/src/main/java/org/samo_lego/healthcare/mixin/ServerPlayNetworkHandlerMixin_HealthTag.java +++ b/src/main/java/org/samo_lego/healthcare/mixin/ServerPlayNetworkHandlerMixin_HealthTag.java @@ -81,9 +81,12 @@ else if (sendPacket instanceof ClientboundBundlePacket bundledPackets){ boolean doMutate = false; for (var p : bundledPackets.subPackets()){ - if (p instanceof ClientboundSetEntityDataPacket dataPacket && (p=TryMutatePacket(dataPacket)) != null) + if (p instanceof ClientboundSetEntityDataPacket dataPacket && (dataPacket=TryMutatePacket(dataPacket)) != null){ doMutate = true; - packets.add(p); + packets.add(dataPacket); + } + else + packets.add(p); } if (doMutate)