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>
<artifactId>mcprotocollib</artifactId>
<version>1.13.1-1-SNAPSHOT</version>
<version>1.13.2-1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MCProtocolLib</name>

View file

@ -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";

View file

@ -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());
}