blob: 0f0029243512ce4b3f68007d8a56f9925c2b5927 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
--- 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);
|