Add ClientBlockNBTRequestPacket

This commit is contained in:
Jonas Herzig 2018-07-19 13:24:39 +02:00
parent e632e480cd
commit 76699d9fcd
2 changed files with 45 additions and 1 deletions

View file

@ -32,6 +32,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreat
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEnchantItemPacket;
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.ClientSpectatePacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerBoatPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientSteerVehiclePacket;
@ -434,7 +435,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerIncoming(0x55, ServerDeclareTagsPacket.class);
this.registerOutgoing(0x00, ClientTeleportConfirmPacket.class);
// FIXME: 01
this.registerOutgoing(0x01, ClientBlockNBTRequestPacket.class);
this.registerOutgoing(0x02, ClientTabCompletePacket.class);
this.registerOutgoing(0x03, ClientChatPacket.class);
this.registerOutgoing(0x04, ClientRequestPacket.class);

View file

@ -0,0 +1,43 @@
package com.github.steveice10.mc.protocol.packet.ingame.client.world;
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
import com.github.steveice10.mc.protocol.packet.MinecraftPacket;
import com.github.steveice10.mc.protocol.util.NetUtil;
import com.github.steveice10.packetlib.io.NetInput;
import com.github.steveice10.packetlib.io.NetOutput;
import java.io.IOException;
public class ClientBlockNBTRequestPacket extends MinecraftPacket {
private int transactionId;
private Position position;
@SuppressWarnings("unused")
private ClientBlockNBTRequestPacket() {
}
public ClientBlockNBTRequestPacket(int transactionId, Position position) {
this.transactionId = transactionId;
this.position = position;
}
public int getTransactionId() {
return this.transactionId;
}
public Position getPosition() {
return this.position;
}
@Override
public void read(NetInput in) throws IOException {
this.transactionId = in.readVarInt();
this.position = NetUtil.readPosition(in);
}
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.transactionId);
NetUtil.writePosition(out, this.position);
}
}