aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch
diff options
context:
space:
mode:
authorNoah van der Aa <[email protected]>2021-12-01 02:31:13 +0100
committerGitHub <[email protected]>2021-11-30 17:31:13 -0800
commitcd9fe9ca642322f8ba560a8c0f86c877af2cd10f (patch)
tree0099ebdd316d7b54e32fde7c5039011555b330ad /patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch
parenteffa3bad36df91b9cca1920e357b963806f62ff6 (diff)
downloadPaper-cd9fe9ca642322f8ba560a8c0f86c877af2cd10f.tar.gz
Paper-cd9fe9ca642322f8ba560a8c0f86c877af2cd10f.zip
Port flat bedrock (generator settings) to 1.18 (#6960)
Diffstat (limited to 'patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch')
-rw-r--r--patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch44
1 files changed, 0 insertions, 44 deletions
diff --git a/patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch b/patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch
deleted file mode 100644
index 5b2955f3c1..0000000000
--- a/patches/server/0598-Allow-adding-items-to-BlockDropItemEvent.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: BillyGalbreath <[email protected]>
-Date: Wed, 20 Jan 2021 14:23:37 -0600
-Subject: [PATCH] Allow adding items to BlockDropItemEvent
-
-
-diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-index 5931cf0c05ca22f72a465d096dfb60508d84b859..5013a93f9bdc6d2c52239ca0434c7aa40f0572e1 100644
---- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
-@@ -395,13 +395,30 @@ public class CraftEventFactory {
- }
-
- public static void handleBlockDropItemEvent(Block block, BlockState state, ServerPlayer player, List<ItemEntity> items) {
-- BlockDropItemEvent event = new BlockDropItemEvent(block, state, player.getBukkitEntity(), Lists.transform(items, (item) -> (org.bukkit.entity.Item) item.getBukkitEntity()));
-+ // Paper start
-+ List<Item> list = new ArrayList<>();
-+ for (ItemEntity item : items) {
-+ list.add((Item) item.getBukkitEntity());
-+ }
-+ BlockDropItemEvent event = new BlockDropItemEvent(block, state, player.getBukkitEntity(), list);
-+ // Paper end
- Bukkit.getPluginManager().callEvent(event);
-
- if (!event.isCancelled()) {
-- for (ItemEntity item : items) {
-- item.level.addFreshEntity(item);
-+ // Paper start
-+ for (Item bukkit : list) {
-+ if (!bukkit.isValid()) {
-+ Entity item = ((org.bukkit.craftbukkit.entity.CraftItem) bukkit).getHandle();
-+ item.level.addFreshEntity(item);
-+ }
-+ }
-+ } else {
-+ for (Item bukkit : list) {
-+ if (bukkit.isValid()) {
-+ bukkit.remove();
-+ }
- }
-+ // Paper end
- }
- }
-