Add ClientMoveItemToHotbarPacket

This commit is contained in:
Jonas Herzig 2018-07-19 13:39:13 +02:00
parent 074bd8d84f
commit d5de1262e9
2 changed files with 35 additions and 1 deletions

View file

@ -31,6 +31,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCraft
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCreativeInventoryActionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEditBookPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEnchantItemPacket;
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.ClientWindowActionPacket;
import com.github.steveice10.mc.protocol.packet.ingame.client.world.ClientBlockNBTRequestPacket;
@ -457,7 +458,7 @@ public class MinecraftProtocol extends PacketProtocol {
this.registerOutgoing(0x12, ClientPlayerRotationPacket.class);
this.registerOutgoing(0x13, ClientVehicleMovePacket.class);
this.registerOutgoing(0x14, ClientSteerBoatPacket.class);
// FIXME: 15
this.registerOutgoing(0x15, ClientMoveItemToHotbarPacket.class);
this.registerOutgoing(0x16, ClientPrepareCraftingGridPacket.class);
this.registerOutgoing(0x17, ClientPlayerAbilitiesPacket.class);
this.registerOutgoing(0x18, ClientPlayerActionPacket.class);

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 ClientMoveItemToHotbarPacket extends MinecraftPacket {
private int slot;
@SuppressWarnings("unused")
private ClientMoveItemToHotbarPacket() {
}
public ClientMoveItemToHotbarPacket(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);
}
}