From 02e1ab5956690e220ea61a9e1c1127d248dd6863 Mon Sep 17 00:00:00 2001 From: DrPerkyLegit <116128211+DrPerkyLegit@users.noreply.github.com> Date: Fri, 30 Oct 2026 15:37:09 -0400 Subject: [PATCH] better use of the explosion packet limit --- Minecraft.World/ExplodePacket.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Minecraft.World/ExplodePacket.cpp b/Minecraft.World/ExplodePacket.cpp index 88bf00c6..2def5c58 100644 --- a/Minecraft.World/ExplodePacket.cpp +++ b/Minecraft.World/ExplodePacket.cpp @@ -52,7 +52,7 @@ void ExplodePacket::read(DataInputStream *dis) //throws IOException r = dis->readFloat(); int count = dis->readInt(); - if (count < 0 || count > 32768) count = 0; + count = static_cast(Mth::asbMax(count, 16384)); int xp = static_cast(x); int yp = static_cast(y); @@ -81,7 +81,8 @@ void ExplodePacket::write(DataOutputStream *dos) //throws IOException dos->writeDouble(y); dos->writeDouble(z); dos->writeFloat(r); - dos->writeInt(static_cast(toBlow.size())); + + dos->writeInt(static_cast(Mth::asbMax(toBlow.size(), 16384))); int xp = static_cast(x); int yp = static_cast(y); @@ -110,7 +111,7 @@ void ExplodePacket::handle(PacketListener *listener) int ExplodePacket::getEstimatedSize() { - return 8*3+4+4+static_cast(toBlow.size())*3+12; + return 8*3+4+4+static_cast(Mth::asbMax(toBlow.size(), 16384))*3+12; } float ExplodePacket::getKnockbackX()