From 10eacaf6783291fd60380040f66e28713104d184 Mon Sep 17 00:00:00 2001 From: Martijn Muijsers Date: Wed, 13 May 2026 13:31:23 +0200 Subject: [PATCH] Use internal block to item conversion for flower pots. Before this change, the Bukkit ItemStack passed to the event is constructed from a Bukkit Material, which relies on the Bukkit mapping from blocks to items being the same as the Minecraft mapping from blocks to items. However, it is not the same. For example, new ItemStack(Material.POTATOES) does not give an ItemStack of type Material.POTATO as it should. So a flower pot block created as new FlowerPotBlock(Blocks.POTATOES, properties) will crash the server. After this change, the Bukkit ItemStack passed to the event is constructed from the Minecraft ItemStack, which relies on the Minecraft mapping from blocks to items being correct. --- .../net/minecraft/world/level/block/FlowerPotBlock.java.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/patches/sources/net/minecraft/world/level/block/FlowerPotBlock.java.patch b/paper-server/patches/sources/net/minecraft/world/level/block/FlowerPotBlock.java.patch index 34e617023453..1dc3f0b9ee5a 100644 --- a/paper-server/patches/sources/net/minecraft/world/level/block/FlowerPotBlock.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/level/block/FlowerPotBlock.java.patch @@ -25,7 +25,7 @@ ItemStack plant = new ItemStack(this.potted); + // Paper start - Add PlayerFlowerPotManipulateEvent + org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(level, pos); -+ org.bukkit.inventory.ItemStack pottedStack = new org.bukkit.inventory.ItemStack(org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.potted)); ++ org.bukkit.inventory.ItemStack pottedStack = org.bukkit.craftbukkit.inventory.CraftItemStack.asBukkitCopy(plant); + + io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent event = new io.papermc.paper.event.player.PlayerFlowerPotManipulateEvent((org.bukkit.entity.Player) player.getBukkitEntity(), block, pottedStack, false); + if (!event.callEvent()) {