[ci skip] Add more identifying patch comments

This commit is contained in:
Nassim Jahnke
2024-01-19 22:13:42 +01:00
parent 3c246dc632
commit 66431e1300
84 changed files with 265 additions and 271 deletions

View File

@@ -13,19 +13,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
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
+ // Paper start - Allow adding items to BlockDropItemEvent
+ 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
+ // Paper end - Allow adding items to BlockDropItemEvent
Bukkit.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- for (ItemEntity item : items) {
- item.level().addFreshEntity(item);
+ // Paper start
+ // Paper start - Allow adding items to BlockDropItemEvent
+ for (Item bukkit : list) {
+ if (!bukkit.isValid()) {
+ Entity item = ((org.bukkit.craftbukkit.entity.CraftItem) bukkit).getHandle();
@@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ bukkit.remove();
+ }
}
+ // Paper end
+ // Paper end - Allow adding items to BlockDropItemEvent
}
}