Add ClientEntityNBTRequestPacket

This commit is contained in:
Jonas Herzig 2018-07-19 13:36:06 +02:00
parent cace45970a
commit 074bd8d84f
2 changed files with 43 additions and 1 deletions

View file

@ -34,6 +34,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEncha
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientPrepareCraftingGridPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientWindowActionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientBlockNBTRequestPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientEntityNBTRequestPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSpectatePacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerBoatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerVehiclePacket;
@ -447,7 +448,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x09, ClientCloseWindowPacket.class);
this.registerOutgoing(0x0A, ClientPluginMessagePacket.class);
this.registerOutgoing(0x0B, ClientEditBookPacket.class);
// FIXME: 0C
this.registerOutgoing(0x0C, ClientEntityNBTRequestPacket.class);
this.registerOutgoing(0x0D, ClientPlayerInteractEntityPacket.class);
this.registerOutgoing(0x0E, ClientKeepAlivePacket.class);
this.registerOutgoing(0x0F, ClientPlayerMovementPacket.class);

View file

@ -0,0 +1,41 @@
package com.github.steveice10.mc.protocol.packet.ingame.client.world;
import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import java.io.IOException;
public class ClientEntityNBTRequestPacket extends MinecraftPacket {
private int transactionId;
private int entityId;
@SuppressWarnings("unused")
private ClientEntityNBTRequestPacket() {
}
public ClientEntityNBTRequestPacket(int transactionId, int entityId) {
this.transactionId = transactionId;
this.entityId = entityId;
}
public int getTransactionId() {
return this.transactionId;
}
public int getEntityId() {
return this.entityId;
}
@Override
public void read(NetInput in) throws IOException {
this.transactionId = in.readVarInt();
this.entityId = in.readVarInt();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.transactionId);
out.writeVarInt(this.entityId);
}
}