diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/LootCommand.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/LootCommand.java.patch | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/LootCommand.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/LootCommand.java.patch new file mode 100644 index 0000000000..1ab5f0f7ac --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/server/commands/LootCommand.java.patch @@ -0,0 +1,22 @@ +--- a/net/minecraft/server/commands/LootCommand.java ++++ b/net/minecraft/server/commands/LootCommand.java +@@ -392,11 +245,14 @@ + } + + private static int dropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> items, LootCommand.Callback callback) throws CommandSyntaxException { +- ServerLevel level = source.getLevel(); +- items.forEach(itemStack -> { +- ItemEntity itemEntity = new ItemEntity(level, pos.x, pos.y, pos.z, itemStack.copy()); +- itemEntity.setDefaultPickUpDelay(); +- level.addFreshEntity(itemEntity); ++ ServerLevel worldserver = source.getLevel(); ++ ++ 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()); ++ ++ entityitem.setDefaultPickUpDelay(); ++ worldserver.addFreshEntity(entityitem); + }); + callback.accept(items); + return items.size(); |