mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 16:18:02 +01:00
094bb03a37
- Lots of itemstack cloning removed. Only clone if the item is actually moved - Return true when a plugin cancels inventory move item event instead of false, as false causes pulls to cycle through all items. However, pushes do not exhibit the same behavior, so this is not something plugins could of been relying on. - Add option (Default on) to cooldown hoppers when they fail to move an item due to full inventory - Skip subsequent InventoryMoveItemEvents if a plugin does not use the item after first event fire for an iteration
23 lines
1.1 KiB
Diff
23 lines
1.1 KiB
Diff
From ed42fa5362cb89e856e137f264bd18318ea3631e Mon Sep 17 00:00:00 2001
|
|
From: kashike <kashike@vq.lc>
|
|
Date: Sun, 9 Apr 2017 23:50:15 -0700
|
|
Subject: [PATCH] Fix NFE when attempting to read EMPTY ItemStack
|
|
|
|
Thanks @gabizou
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java
|
|
index 9465f4c16..52cb34abd 100644
|
|
--- a/src/main/java/net/minecraft/server/ItemStack.java
|
|
+++ b/src/main/java/net/minecraft/server/ItemStack.java
|
|
@@ -119,7 +119,7 @@ public final class ItemStack {
|
|
|
|
// CraftBukkit - break into own method
|
|
public void load(NBTTagCompound nbttagcompound) {
|
|
- this.item = Item.b(nbttagcompound.getString("id"));
|
|
+ this.item = nbttagcompound.hasKeyOfType("id", 8) ? Item.b(nbttagcompound.getString("id")) : Item.getItemOf(Blocks.AIR); // Paper - fix NumberFormatException caused by attempting to read an EMPTY ItemStack
|
|
this.count = nbttagcompound.getByte("Count");
|
|
// CraftBukkit start - Route through setData for filtering
|
|
// this.damage = Math.max(0, nbttagcompound.getShort("Damage"));
|
|
--
|
|
2.16.1
|
|
|