mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 06:32:17 -07:00
Minecraft 1.9.4
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
--- a/net/minecraft/server/PacketDataSerializer.java
|
||||
+++ b/net/minecraft/server/PacketDataSerializer.java
|
||||
@@ -20,9 +20,12 @@
|
||||
import java.nio.charset.Charset;
|
||||
@@ -21,6 +21,8 @@
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack; // CraftBukkit
|
||||
+
|
||||
public class PacketDataSerializer extends ByteBuf {
|
||||
|
||||
private final ByteBuf a;
|
||||
+ int version = 107; // CraftBukkkit
|
||||
|
||||
public PacketDataSerializer(ByteBuf bytebuf) {
|
||||
this.a = bytebuf;
|
||||
@@ -119,7 +122,7 @@
|
||||
@@ -120,7 +122,7 @@
|
||||
}
|
||||
|
||||
public <T extends Enum<T>> T a(Class<T> oclass) {
|
||||
@@ -22,7 +18,7 @@
|
||||
}
|
||||
|
||||
public PacketDataSerializer a(Enum<?> oenum) {
|
||||
@@ -196,7 +199,7 @@
|
||||
@@ -197,7 +199,7 @@
|
||||
} else {
|
||||
try {
|
||||
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
|
||||
@@ -31,16 +27,16 @@
|
||||
throw new EncoderException(ioexception);
|
||||
}
|
||||
}
|
||||
@@ -222,7 +225,7 @@
|
||||
@@ -224,7 +226,7 @@
|
||||
}
|
||||
|
||||
public PacketDataSerializer a(ItemStack itemstack) {
|
||||
public PacketDataSerializer a(@Nullable ItemStack itemstack) {
|
||||
- if (itemstack == null) {
|
||||
+ if (itemstack == null || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
|
||||
this.writeShort(-1);
|
||||
} else {
|
||||
this.writeShort(Item.getId(itemstack.getItem()));
|
||||
@@ -250,6 +253,11 @@
|
||||
@@ -253,6 +255,11 @@
|
||||
|
||||
itemstack = new ItemStack(Item.getById(short0), b0, short1);
|
||||
itemstack.setTag(this.j());
|
||||
|
Reference in New Issue
Block a user