mirror of https://github.com/PaperMC/Paper.git
15 lines
909 B
Diff
15 lines
909 B
Diff
--- a/net/minecraft/server/commands/LootCommand.java
|
|
+++ b/net/minecraft/server/commands/LootCommand.java
|
|
@@ -248,8 +247,9 @@
|
|
private static int dropInWorld(CommandSourceStack commandsourcestack, Vec3 vec3, List<ItemStack> list, LootCommand.Callback lootcommand_callback) throws CommandSyntaxException {
|
|
ServerLevel serverlevel = commandsourcestack.getLevel();
|
|
|
|
- list.forEach((itemstack) -> {
|
|
- ItemEntity itementity = new ItemEntity(serverlevel, vec3.x, vec3.y, vec3.z, itemstack.copy());
|
|
+ items.removeIf(ItemStack::isEmpty); // CraftBukkit - SPIGOT-6959 Remove empty items for avoid throw an error in new EntityItem
|
|
+ items.forEach((itemstack) -> {
|
|
+ ItemEntity entityitem = new ItemEntity(worldserver, pos.x, pos.y, pos.z, itemstack.copy());
|
|
|
|
itementity.setDefaultPickUpDelay();
|
|
serverlevel.addFreshEntity(itementity);
|