Skip to content

Use internal block to item conversion for flower pots#13880

Open
MartijnMuijsers wants to merge 1 commit into
PaperMC:mainfrom
MartijnMuijsers:use-internal-block-to-item-for-flower-pot
Open

Use internal block to item conversion for flower pots#13880
MartijnMuijsers wants to merge 1 commit into
PaperMC:mainfrom
MartijnMuijsers:use-internal-block-to-item-for-flower-pot

Conversation

@MartijnMuijsers
Copy link
Copy Markdown
Contributor

@MartijnMuijsers MartijnMuijsers commented May 13, 2026

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 this code would expect.
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 has already been created based on the Minecraft mapping from blocks to items.

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.
@MartijnMuijsers MartijnMuijsers requested a review from a team as a code owner May 13, 2026 11:31
@github-project-automation github-project-automation Bot moved this to Awaiting review in Paper PR Queue May 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Awaiting review

Development

Successfully merging this pull request may close these issues.

2 participants