Closed FirstMegaGame4 closed 2 months ago
You told me to done this via mixins, but I honestly felt it'd be better with an official api.
This PR proposes two new events: DefautDisplayEvents#APPEND_DISPLAY_LOGIC and DefaultDisplayEvents#MODIFY_DISPLAY_LOGIC.
DefautDisplayEvents#APPEND_DISPLAY_LOGIC
DefaultDisplayEvents#MODIFY_DISPLAY_LOGIC
Explanations (same as in the javadocs):
DefautDisplayEvents#APPEND_DISPLAY_LOGIC allows to append a format applied on one or more DamageType for the default configuration. Example:
DamageType
DefaultDisplayEvents.APPEND_DISPLAY_LOGIC.register((lookup, logics) -> { logics.add(firstDamageFormat, firstDamageTypes...); logics.add(secondDamageFormat, secondDamageTypes...); logics.add(thirdDamageFormat, thirdDamageTypes...); return logics; });
DefaultDisplayEvents#MODIFY_DISPLAY_LOGIC allows to modify a format applied on one or more DamageType for the default configuration. Example:
DefaultDisplayEvents.MODIFY_DISPLAY_LOGIC.register((lookup, types, format) -> { if (types.contains(DamageTypes.OUT_OF_WORLD)) { return yourModifiedFormat; } return format; });
You told me to done this via mixins, but I honestly felt it'd be better with an official api.
This PR proposes two new events:
DefautDisplayEvents#APPEND_DISPLAY_LOGIC
andDefaultDisplayEvents#MODIFY_DISPLAY_LOGIC
.Explanations (same as in the javadocs):
DefautDisplayEvents#APPEND_DISPLAY_LOGIC allows to append a format applied on one or more
DamageType
for the default configuration. Example:DefaultDisplayEvents#MODIFY_DISPLAY_LOGIC allows to modify a format applied on one or more
DamageType
for the default configuration. Example: