mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-12 08:41:00 -05:00
Fix ServerEntitySetPassengersPacket.
This commit is contained in:
parent
e447052eca
commit
7dd6887fed
1 changed files with 18 additions and 10 deletions
|
@ -8,32 +8,40 @@ import java.io.IOException;
|
||||||
|
|
||||||
public class ServerEntitySetPassengersPacket implements Packet {
|
public class ServerEntitySetPassengersPacket implements Packet {
|
||||||
|
|
||||||
private int entityIds[];
|
private int entityId;
|
||||||
|
private int passengerIds[];
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private ServerEntitySetPassengersPacket() {
|
private ServerEntitySetPassengersPacket() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerEntitySetPassengersPacket(int... entityIds) {
|
public ServerEntitySetPassengersPacket(int entityId, int... passengerIds) {
|
||||||
this.entityIds = entityIds;
|
this.entityId = entityId;
|
||||||
|
this.passengerIds = passengerIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getEntityIds() {
|
public int getEntityId() {
|
||||||
return this.entityIds;
|
return this.entityId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getPassengerIds() {
|
||||||
|
return this.passengerIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.entityIds = new int[in.readVarInt()];
|
this.entityId = in.readVarInt();
|
||||||
for(int index = 0; index < this.entityIds.length; index++) {
|
this.passengerIds = new int[in.readVarInt()];
|
||||||
this.entityIds[index] = in.readVarInt();
|
for(int index = 0; index < this.passengerIds.length; index++) {
|
||||||
|
this.passengerIds[index] = in.readVarInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(NetOutput out) throws IOException {
|
public void write(NetOutput out) throws IOException {
|
||||||
out.writeVarInt(this.entityIds.length);
|
out.writeVarInt(this.entityId);
|
||||||
for(int entityId : this.entityIds) {
|
out.writeVarInt(this.passengerIds.length);
|
||||||
|
for(int entityId : this.passengerIds) {
|
||||||
out.writeVarInt(entityId);
|
out.writeVarInt(entityId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue