Skip to content

Use internal block to item conversion for flower pots#13880

Merged
lynxplay merged 1 commit into
PaperMC:mainfrom
MartijnMuijsers:use-internal-block-to-item-for-flower-pot
Jun 2, 2026
Merged

Use internal block to item conversion for flower pots#13880
lynxplay merged 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.

@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
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.
@lynxplay lynxplay force-pushed the use-internal-block-to-item-for-flower-pot branch from 10eacaf to 674a3f9 Compare June 2, 2026 11:43
@lynxplay lynxplay merged commit 3580fa4 into PaperMC:main Jun 2, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Awaiting review to Merged in Paper PR Queue Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Merged

Development

Successfully merging this pull request may close these issues.

3 participants