mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-04 21:01:02 -05:00
add hand to edit book
This commit is contained in:
parent
634635ef31
commit
9cbdafb659
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,8 @@
|
||||||
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
|
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
|
||||||
|
|
||||||
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -20,17 +22,20 @@ import java.io.IOException;
|
||||||
public class ClientEditBookPacket implements Packet {
|
public class ClientEditBookPacket implements Packet {
|
||||||
private @NonNull ItemStack book;
|
private @NonNull ItemStack book;
|
||||||
private boolean signing;
|
private boolean signing;
|
||||||
|
private @NonNull Hand hand;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.book = ItemStack.read(in);
|
this.book = ItemStack.read(in);
|
||||||
this.signing = in.readBoolean();
|
this.signing = in.readBoolean();
|
||||||
|
this.hand = MagicValues.key(Hand.class, in.readVarInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(NetOutput out) throws IOException {
|
public void write(NetOutput out) throws IOException {
|
||||||
ItemStack.write(out, this.book);
|
ItemStack.write(out, this.book);
|
||||||
out.writeBoolean(this.signing);
|
out.writeBoolean(this.signing);
|
||||||
|
out.writeVarInt(MagicValues.value(Integer.class, hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue