SkyCrypt
SkyCrypt copied to clipboard
Refactor/optimize `piece-shine` and `is-enchanted`
(piece-shine
is the item background animation, is-enchanted
is the enchant glint applied as a mask on item icons)
Currently piece-shine
and is-enchanted
are a bit weird, this is how I would change it:
- Both properties are no longer calculated on the frontside but rather on the backend, at the end of
getItems()
-
piece-shine
is renamed tois-highlighted
(to prevent confusion with the newshiny
item attribute) - the item object will end up with 2 new properties:
isEnchanted
andisHighlighted
, both booleans
isEnchanted
will be true if:
- item has vanilla
ench
attribute (Array.isArray(item.tag.ench)
) - item has the new
shiny
property (making issue #1202 obsolete), should be automatically handled by the condition above - item is one of [enchanted book, bottle o' enchanting, nether star]
- item is a potion with effects (so not just a water bottle)
- item is not a custom head
isHighlighted
will be true if:
- item rarity is one of [very special, special, supreme, divine, mythic]
Currently there's also item.glowing
property which was added to make some items in the HotM menu enchanted, like they are in game. This property can be replaced with item.isEnchanted
directly so glowing
will be deprecated.
A cool enhancement would be to make the glint effect more visible, maybe with some sort of animation... needs to be tested
how does the Minecraft client know whether or not to shoe a glint on shiny items?
if there is some nbt then we should look directly at that
other than that this seams like a good idea
how does the Minecraft client know whether or not to shoe a glint on shiny items?
if there is some nbt then we should look directly at that
other than that this seams like a good idea
I think it just checks for the item.tag.ench
to exist, shiny items in /ah have item.tag.ench = []
and are showing the glint while other items (not shiny) without item.tag.ench
are not showing any glint.
Edited the issue so now it checks if the array exists at all, not if length > 0
@metalcupcake5