mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
Fix EntityPropertiesPacket property count
This commit is contained in:
parent
b8d1966ce4
commit
698469aa60
@ -19,12 +19,13 @@ public class EntityPropertiesPacket implements ServerPacket {
|
|||||||
public int entityId;
|
public int entityId;
|
||||||
public Property[] properties = new Property[0];
|
public Property[] properties = new Property[0];
|
||||||
|
|
||||||
public EntityPropertiesPacket() {}
|
public EntityPropertiesPacket() {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(@NotNull BinaryWriter writer) {
|
public void write(@NotNull BinaryWriter writer) {
|
||||||
writer.writeVarInt(entityId);
|
writer.writeVarInt(entityId);
|
||||||
writer.writeInt(properties.length);
|
writer.writeVarInt(properties.length);
|
||||||
for (Property property : properties) {
|
for (Property property : properties) {
|
||||||
property.write(writer);
|
property.write(writer);
|
||||||
}
|
}
|
||||||
@ -33,7 +34,7 @@ public class EntityPropertiesPacket implements ServerPacket {
|
|||||||
@Override
|
@Override
|
||||||
public void read(@NotNull BinaryReader reader) {
|
public void read(@NotNull BinaryReader reader) {
|
||||||
entityId = reader.readVarInt();
|
entityId = reader.readVarInt();
|
||||||
int propertyCount = reader.readInt();
|
int propertyCount = reader.readVarInt();
|
||||||
properties = new Property[propertyCount];
|
properties = new Property[propertyCount];
|
||||||
for (int i = 0; i < propertyCount; i++) {
|
for (int i = 0; i < propertyCount; i++) {
|
||||||
properties[i] = new Property();
|
properties[i] = new Property();
|
||||||
|
Loading…
Reference in New Issue
Block a user