better use of the explosion packet limit

This commit is contained in:
DrPerkyLegit committed 2026-10-30 15:37:09 -04:00
1 parent 7d9e12501c
commit 02e1ab5956
1 file changed
+4 -3
+4 -3
View File
@@ -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<int>(Mth::asbMax(count, 16384));
int xp = static_cast<int>(x);
int yp = static_cast<int>(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<int>(toBlow.size()));
dos->writeInt(static_cast<int>(Mth::asbMax(toBlow.size(), 16384)));
int xp = static_cast<int>(x);
int yp = static_cast<int>(y);
@@ -110,7 +111,7 @@ void ExplodePacket::handle(PacketListener *listener)
int ExplodePacket::getEstimatedSize()
{
return 8*3+4+4+static_cast<int>(toBlow.size())*3+12;
return 8*3+4+4+static_cast<int>(Mth::asbMax(toBlow.size(), 16384))*3+12;
}
float ExplodePacket::getKnockbackX()