diff --git a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java index 797766f4..517a8347 100644 --- a/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java +++ b/src/main/java/org/spacehq/mc/protocol/packet/ingame/server/entity/ServerEntitySetPassengersPacket.java @@ -8,32 +8,40 @@ import java.io.IOException; public class ServerEntitySetPassengersPacket implements Packet { - private int entityIds[]; + private int entityId; + private int passengerIds[]; @SuppressWarnings("unused") private ServerEntitySetPassengersPacket() { } - public ServerEntitySetPassengersPacket(int... entityIds) { - this.entityIds = entityIds; + public ServerEntitySetPassengersPacket(int entityId, int... passengerIds) { + this.entityId = entityId; + this.passengerIds = passengerIds; } - public int[] getEntityIds() { - return this.entityIds; + public int getEntityId() { + return this.entityId; + } + + public int[] getPassengerIds() { + return this.passengerIds; } @Override public void read(NetInput in) throws IOException { - this.entityIds = new int[in.readVarInt()]; - for(int index = 0; index < this.entityIds.length; index++) { - this.entityIds[index] = in.readVarInt(); + this.entityId = in.readVarInt(); + this.passengerIds = new int[in.readVarInt()]; + for(int index = 0; index < this.passengerIds.length; index++) { + this.passengerIds[index] = in.readVarInt(); } } @Override public void write(NetOutput out) throws IOException { - out.writeVarInt(this.entityIds.length); - for(int entityId : this.entityIds) { + out.writeVarInt(this.entityId); + out.writeVarInt(this.passengerIds.length); + for(int entityId : this.passengerIds) { out.writeVarInt(entityId); } }