Skip to content

make Bukkit ItemStack defer to CB ItemStack where possible #6414

@electronicboy

Description

@electronicboy

This has some technical challenges, but, is something I've had a few ideas for, but, generally wanna outline the core issue here while I have enough energy left to do so, especially as I hit this stupidity earlier

Bukkit has two implementations of ItemStack, ItemStack, exposed in the API, and CraftItemStack, which is the NMS backed ItemStack, there is a lot of inconsistencies which form in this due to bugs in the Bukkit side which are often baked with other issues around how the API works which makes solving these types of issues "fun", it can also cause many traps when people do stuff like new ItemStack(craftStack) expecting the two items to actually be similar

This also has many issues around comparisons of items which have touched vanilla logic and gone through any paths which vanilla uses for setting various bits of data,

idea would be to, hopefully, make API ItemStack serve as a wrapper style object which primarily aims to refer to proxy to a "real" item stack, this, ofc, might cause some headaches for other projects, but, getting rid of API stacks as they're currently implemented has been a long but untenable dream, we will need to keep an API Impl somewhere which would be used for testing, etc, however, but, this would primarily be used for testing frameworks and such where CraftServer may not be set, just another thing which needs investigating...

Ofc, these are still early thoughts of a long time dream of ours which has been hitting my head a fair few number of times recently, especially as I got hit by this a few hours ago which was causing a duplication issue in a plugin due to this inconsistency \o/

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: futureIssue scheduled for resolution at some point in the future.status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: featureRequest for a new Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions