Update to Minecraft 1.13.2

This commit is contained in:
Paul 2018-10-23 19:00:19 +02:00
parent 10ec617e5a
commit 8b759faf44
No known key found for this signature in database
GPG key ID: 15496769790ACD39
3 changed files with 10 additions and 11 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.13.1-1-SNAPSHOT</version> <version>1.13.2-1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>MCProtocolLib</name> <name>MCProtocolLib</name>

View file

@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol;
public class MinecraftConstants { public class MinecraftConstants {
// General Constants // General Constants
public static final String GAME_VERSION = "1.13.1"; public static final String GAME_VERSION = "1.13.2";
public static final int PROTOCOL_VERSION = 401; public static final int PROTOCOL_VERSION = 404;
// General Key Constants // General Key Constants
public static final String PROFILE_KEY = "profile"; public static final String PROFILE_KEY = "profile";

View file

@ -69,19 +69,18 @@ public class NetUtil {
} }
public static ItemStack readItem(NetInput in) throws IOException { public static ItemStack readItem(NetInput in) throws IOException {
short item = in.readShort(); boolean present = in.readBoolean();
if(item < 0) { if (!present) {
return null; 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 { public static void writeItem(NetOutput out, ItemStack item) throws IOException {
if(item == null) { out.writeBoolean(item != null);
out.writeShort(-1); if (item != null) {
} else { out.writeVarInt(item.getId());
out.writeShort(item.getId());
out.writeByte(item.getAmount()); out.writeByte(item.getAmount());
writeNBT(out, item.getNBT()); writeNBT(out, item.getNBT());
} }