mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
Add ClientEditBookPacket
This commit is contained in:
parent
bfc511cb49
commit
cace45970a
2 changed files with 45 additions and 1 deletions
|
@ -29,6 +29,7 @@ import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientClose
|
|||
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientConfirmTransactionPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientCraftingBookDataPacket;
|
||||
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.ClientPrepareCraftingGridPacket;
|
||||
import com.github.steveice10.mc.protocol.packet.ingame.client.window.ClientWindowActionPacket;
|
||||
|
@ -445,7 +446,7 @@ public class MinecraftProtocol extends PacketProtocol {
|
|||
this.registerOutgoing(0x08, ClientWindowActionPacket.class);
|
||||
this.registerOutgoing(0x09, ClientCloseWindowPacket.class);
|
||||
this.registerOutgoing(0x0A, ClientPluginMessagePacket.class);
|
||||
// FIXME: 0B
|
||||
this.registerOutgoing(0x0B, ClientEditBookPacket.class);
|
||||
// FIXME: 0C
|
||||
this.registerOutgoing(0x0D, ClientPlayerInteractEntityPacket.class);
|
||||
this.registerOutgoing(0x0E, ClientKeepAlivePacket.class);
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
|
||||
|
||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||
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 ClientEditBookPacket extends MinecraftPacket {
|
||||
private ItemStack book;
|
||||
private boolean isSigning;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
private ClientEditBookPacket() {
|
||||
}
|
||||
|
||||
public ClientEditBookPacket(ItemStack book, boolean isSigning) {
|
||||
this.book = book;
|
||||
this.isSigning = isSigning;
|
||||
}
|
||||
|
||||
public ItemStack getBook() {
|
||||
return this.book;
|
||||
}
|
||||
|
||||
public boolean getIsSigning() {
|
||||
return this.isSigning;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(NetInput in) throws IOException {
|
||||
this.book = NetUtil.readItem(in);
|
||||
this.isSigning = in.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(NetOutput out) throws IOException {
|
||||
NetUtil.writeItem(out, this.book);
|
||||
out.writeBoolean(this.isSigning);
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue