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()