diff --git a/pom.xml b/pom.xml index 5e40d4a7..cb1a6483 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.github.steveice10 mcprotocollib - 1.13.1-1-SNAPSHOT + 1.13.2-1-SNAPSHOT jar MCProtocolLib diff --git a/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java b/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java index 69276591..da1fe68b 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java +++ b/src/main/java/com/github/steveice10/mc/protocol/MinecraftConstants.java @@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol; public class MinecraftConstants { // General Constants - public static final String GAME_VERSION = "1.13.1"; - public static final int PROTOCOL_VERSION = 401; + public static final String GAME_VERSION = "1.13.2"; + public static final int PROTOCOL_VERSION = 404; // General Key Constants public static final String PROFILE_KEY = "profile"; diff --git a/src/main/java/com/github/steveice10/mc/protocol/util/NetUtil.java b/src/main/java/com/github/steveice10/mc/protocol/util/NetUtil.java index 28b0d61c..a20f9761 100644 --- a/src/main/java/com/github/steveice10/mc/protocol/util/NetUtil.java +++ b/src/main/java/com/github/steveice10/mc/protocol/util/NetUtil.java @@ -69,19 +69,18 @@ public class NetUtil { } public static ItemStack readItem(NetInput in) throws IOException { - short item = in.readShort(); - if(item < 0) { + boolean present = in.readBoolean(); + if (!present) { return null; - } else { - return new ItemStack(item, in.readByte(), readNBT(in)); } + int item = in.readVarInt(); + return new ItemStack(item, in.readByte(), readNBT(in)); } public static void writeItem(NetOutput out, ItemStack item) throws IOException { - if(item == null) { - out.writeShort(-1); - } else { - out.writeShort(item.getId()); + out.writeBoolean(item != null); + if (item != null) { + out.writeVarInt(item.getId()); out.writeByte(item.getAmount()); writeNBT(out, item.getNBT()); }