mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Correct packet reading/writing
This commit is contained in:
parent
30f3fdd99a
commit
abace56778
@ -36,7 +36,7 @@ public class ExplosionPacket implements ServerPacket {
|
||||
y = reader.readFloat();
|
||||
z = reader.readFloat();
|
||||
radius = reader.readFloat();
|
||||
int recordCount = reader.readInt() * 3;
|
||||
int recordCount = reader.readVarInt() * 3;
|
||||
records = reader.readBytes(recordCount);
|
||||
playerMotionX = reader.readFloat();
|
||||
playerMotionY = reader.readFloat();
|
||||
|
@ -73,11 +73,15 @@ public class MapDataPacket implements ComponentHoldingServerPacket {
|
||||
locked = reader.readBoolean();
|
||||
trackingPosition = reader.readBoolean();
|
||||
|
||||
int iconCount = reader.readVarInt();
|
||||
icons = new Icon[iconCount];
|
||||
for (int i = 0; i < iconCount; i++) {
|
||||
icons[i] = new Icon();
|
||||
icons[i].read(reader);
|
||||
if (trackingPosition) {
|
||||
int iconCount = reader.readVarInt();
|
||||
icons = new Icon[iconCount];
|
||||
for (int i = 0; i < iconCount; i++) {
|
||||
icons[i] = new Icon();
|
||||
icons[i].read(reader);
|
||||
}
|
||||
} else {
|
||||
icons = new Icon[0];
|
||||
}
|
||||
|
||||
columns = reader.readByte();
|
||||
|
Loading…
Reference in New Issue
Block a user