make Bukkit ItemStack defer to CB ItemStack where possible #10525
Closed
electronicboy
started this conversation in
Ideas
Replies: 1 comment
-
We did this! All itemstacks are essentially CraftItemStack |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
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/
Beta Was this translation helpful? Give feedback.
All reactions