SPIGOT-7485: Allow air entity items since required for Vanilla logic
This commit is contained in:
parent
5dfd33dc27
commit
069495671e
@ -64,12 +64,7 @@
|
|||||||
this.discard();
|
this.discard();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,10 +275,15 @@
|
@@ -259,6 +279,11 @@
|
||||||
private static void merge(EntityItem entityitem, ItemStack itemstack, ItemStack itemstack1) {
|
|
||||||
ItemStack itemstack2 = merge(itemstack, itemstack1, 64);
|
|
||||||
|
|
||||||
- entityitem.setItem(itemstack2);
|
|
||||||
+ if (!itemstack2.isEmpty()) entityitem.setItem(itemstack2); // CraftBukkit - don't set empty stacks
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void merge(EntityItem entityitem, ItemStack itemstack, EntityItem entityitem1, ItemStack itemstack1) {
|
private static void merge(EntityItem entityitem, ItemStack itemstack, EntityItem entityitem1, ItemStack itemstack1) {
|
||||||
@ -140,11 +135,3 @@
|
|||||||
if (this.pickupDelay == 0 && (this.target == null || this.target.equals(entityhuman.getUUID())) && entityhuman.getInventory().add(itemstack)) {
|
if (this.pickupDelay == 0 && (this.target == null || this.target.equals(entityhuman.getUUID())) && entityhuman.getInventory().add(itemstack)) {
|
||||||
entityhuman.take(this, i);
|
entityhuman.take(this, i);
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
@@ -390,6 +460,7 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setItem(ItemStack itemstack) {
|
|
||||||
+ com.google.common.base.Preconditions.checkArgument(!itemstack.isEmpty(), "Cannot drop air"); // CraftBukkit
|
|
||||||
this.getEntityData().set(EntityItem.DATA_ITEM, itemstack);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user