mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
Add ClientRenameItemPacket
This commit is contained in:
parent
c3a1b2b6f9
commit
704ce885cc
2 changed files with 35 additions and 1 deletions
|
@ -33,6 +33,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientEditB
|
|||
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.ClientRenameItemPacket;
|
||||
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;
|
||||
|
@ -465,7 +466,7 @@ public class MinecraftProtocol extends PacketProtocol {
|
|||
this.registerOutgoing(0x19, ClientPlayerStatePacket.class);
|
||||
this.registerOutgoing(0x1A, ClientSteerVehiclePacket.class);
|
||||
this.registerOutgoing(0x1B, ClientCraftingBookDataPacket.class);
|
||||
// FIXME: 1C
|
||||
this.registerOutgoing(0x1C, ClientRenameItemPacket.class);
|
||||
this.registerOutgoing(0x1D, ClientResourcePackStatusPacket.class);
|
||||
this.registerOutgoing(0x1E, ClientAdvancementTabPacket.class);
|
||||
// FIXME: 1F
|
||||
|
|
|
@ -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 ClientRenameItemPacket extends MinecraftPacket {
|
||||
private String name;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private ClientRenameItemPacket() {
|
||||
}
|
||||
|
||||
public ClientRenameItemPacket(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(NetInput in) throws IOException {
|
||||
this.name = in.readString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(NetOutput out) throws IOException {
|
||||
out.writeString(this.name);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue