Fix boats/minecarts not dropping when destroyed

Diff to clone the item was lost, which meant that the spawned
item was air.
This commit is contained in:
Spottedleaf 2024-10-25 15:04:29 -07:00
parent 9f5bf318a5
commit d6cb65cd0f
2 changed files with 3 additions and 2 deletions

View file

@ -28,7 +28,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return null;
}
// CraftBukkit end
ItemEntity entityitem = new ItemEntity(world, this.getX(), this.getY() + (double) yOffset, this.getZ(), stack);
- ItemEntity entityitem = new ItemEntity(world, this.getX(), this.getY() + (double) yOffset, this.getZ(), stack);
+ ItemEntity entityitem = new ItemEntity(world, this.getX(), this.getY() + (double) yOffset, this.getZ(), stack.copy()); // Paper - copy so we can destroy original
+ stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
entityitem.setDefaultPickUpDelay();

View file

@ -80,7 +80,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return null;
}
// CraftBukkit end
ItemEntity entityitem = new ItemEntity(world, this.getX(), this.getY() + (double) yOffset, this.getZ(), stack);
ItemEntity entityitem = new ItemEntity(world, this.getX(), this.getY() + (double) yOffset, this.getZ(), stack.copy()); // Paper - copy so we can destroy original
stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
- entityitem.setDefaultPickUpDelay();