Comparing morphs
Tumlinh opened this issue ยท 1 comments
In the current state of the mod, morphs are compared according to the NBT of their associated entity.
As a result we can get plenty of morphs that "are the same", for instance I've got tens of chicken morphs because they're not exactly the same age.
That's an issue at different levels:
- display: bloats the survival morph menu
- in survival we might want to limit the amount of acquired morphs to make it more challenging
Problem: what does it mean to have equal morphs?
Some ideas:
- Morphs with the same entity type (we don't care about NBT)
- We could go further and normalise or discard their NBT so that entities spawn with a default NBT
- Limits: some NBT parameters are more interesting than others, e.g.
isBaby
, coat, etc.
- Morphs that look the same
- We could e.g. hash morph thumbnails
- Limits: some "hidden" NBT parameters, i.e. not being rendered, may be relevant (no example comes to mind)
- Morphs that are different according to their owner
- E.g. "favourite" flag
- Limits: it's up to the owner to choose, which is not automatic and potentially op
This issue is kind of abstract but I am willing to implement a solution.
These are the two real issues:
- Player acquires many morphs which are essentially duplicates
- The already-existing, configurable morphing blacklist does not support blacklisting by NBT tag
It sounds like you're mainly talking about 1.
The different solutions to 1, in order of how easy to implement:
- Continue to use the current NBT stripping system, and add nbt tag names that need to be removed due to creating duplicates (this is easy for a relatively inexperienced programmer to do)
- Make NBT stripping configurable. Continue to add nbt tag names that need to be removed due to creating duplicates
- Make NBT stripping configurable, but also maybe add a whitelist option on a per-mob basis
it's up to the owner to choose
hash morph thumbnails
These sound too complicated.
2 is an entirely separate issue. Blacklisting is already configurable, but only by mob name. Most of the time, the mob name is the only thing you care about for balancing purposes.