NeoForge icon indicating copy to clipboard operation
NeoForge copied to clipboard

Make `HeartType` an extensible enum and add a hook for `HeartType.forPlayer`

Open Shadows-of-Fire opened this issue 1 month ago • 0 comments

Following the GUI rendering changes in 1.20.5, HeartType no longer references hardcoded U/V coordinates and instead references individual sprites. This means that it is possible to add new HeartType(s) by providing the sprites, which can be done by making the enum extensible.

If we allow that, we also need to permit custom logic for setting the HeartType, which can be done either by adding an event to HeartType.forPlayer or by making custom HeartType(s) provide a Predicate<Player> for when they activate.

Shadows-of-Fire avatar May 15 '24 02:05 Shadows-of-Fire