Add ClientSelectTradePacket

This commit is contained in:
Jonas Herzig 2018-07-19 13:58:10 +02:00
parent 704ce885cc
commit 16fa0aab9d
2 changed files with 35 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.ClientMoveItemToHotbarPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientPrepareCraftingGridPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientRenameItemPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientSelectTradePacket;
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;
@ -469,7 +470,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x1C, ClientRenameItemPacket.class);
this.registerOutgoing(0x1D, ClientResourcePackStatusPacket.class);
this.registerOutgoing(0x1E, ClientAdvancementTabPacket.class);
// FIXME: 1F
this.registerOutgoing(0x1F, ClientSelectTradePacket.class);
// FIXME: 20
this.registerOutgoing(0x21, ClientPlayerChangeHeldItemPacket.class);
// FIXME: 22

View file

@ -0,0 +1,33 @@
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
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 ClientSelectTradePacket extends MinecraftPacket {
private int slot;
@SuppressWarnings("unused")
private ClientSelectTradePacket() {
}
public ClientSelectTradePacket(int slot) {
this.slot = slot;
}
public int getSlot() {
return this.slot;
}
@Override
public void read(NetInput in) throws IOException {
this.slot = in.readVarInt();
}
@Override
public void write(NetOutput out) throws IOException {
out.writeVarInt(this.slot);
}
}