Potentially fix map packet

This commit is contained in:
TheMode 2021-06-14 22:01:12 +02:00
parent 27f30fa394
commit 051fbcb34b

View File

@ -38,13 +38,15 @@ public class MapDataPacket implements ComponentHoldingServerPacket {
writer.writeBoolean(locked); writer.writeBoolean(locked);
writer.writeBoolean(trackingPosition); writer.writeBoolean(trackingPosition);
if (icons != null && icons.length > 0) { if (trackingPosition) {
writer.writeVarInt(icons.length); if (icons != null && icons.length > 0) {
for (Icon icon : icons) { writer.writeVarInt(icons.length);
icon.write(writer); for (Icon icon : icons) {
icon.write(writer);
}
} else {
writer.writeVarInt(0);
} }
} else {
writer.writeVarInt(0);
} }
writer.writeByte((byte) columns); writer.writeByte((byte) columns);