oωo (owo-lib)

oωo (owo-lib)

23M Downloads

Components on an ItemStack should be immutable - DerivedComponentMap

someaddons opened this issue · 1 comments

commented

The components on an itemstack should be immutable and should be not exchanged on the fly as you're trying to do with your wrapper. This does and will cause issues with other mods, e.g. when putting stacks into a set or other uses for the immutability.

public class DerivedComponentMap implements ComponentMap {

commented

Okay?
Derived components explicitly only depend on the components the stack actually carries and the item's default components, and are only recalculated whenever Item#postProcessComponents is called by the ItemStack.
If you are talking about the fact that the DerivedComponentMap's equality and hash code depend on the derived components, that was fixed by making it just pass through to the actual default component map of the item.

I would prefer if you actually specified what the specific bug/crash is instead of saying 'you are doing this, don't do that' and vaguely pointing to some issue. (and also please test whether it still breaks with the latest version of owo-lib)