Add support for 1.16.4

This commit is contained in:
DoctorMacc 2020-10-15 20:34:39 -04:00 committed by Steveice10
parent 9182eca85b
commit 37af0d3a39
3 changed files with 7 additions and 8 deletions

View file

@ -5,7 +5,7 @@
<groupId>com.github.steveice10</groupId> <groupId>com.github.steveice10</groupId>
<artifactId>mcprotocollib</artifactId> <artifactId>mcprotocollib</artifactId>
<version>1.16.3-1</version> <version>1.16.4-pre1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>MCProtocolLib</name> <name>MCProtocolLib</name>

View file

@ -12,12 +12,13 @@ public final class MinecraftConstants {
/** /**
* Current supported game version. * Current supported game version.
*/ */
public static final String GAME_VERSION = "1.16.3"; public static final String GAME_VERSION = "1.16.4-pre1";
/** /**
* Current supported protocol version. * Current supported protocol version.
*/ */
public static final int PROTOCOL_VERSION = 753; //public static final int PROTOCOL_VERSION = 754;
public static final int PROTOCOL_VERSION = (1 << 30) | 1;
// General Key Constants // General Key Constants

View file

@ -1,8 +1,6 @@
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;
@ -22,20 +20,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; private int slot;
@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()); this.slot = 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)); out.writeVarInt(slot);
} }
@Override @Override