-
Notifications
You must be signed in to change notification settings - Fork 517
Description
Hey there, I've been maintaining my multi-loader library Puzzles Lib for some years now. Among other things Puzzles Lib includes a huge collection of events ported more or less directly from NeoForge / Forge. While certainly not all, I think still a bunch of them will fit perfectly fine into Fabric Api itself.
I'm opening this issue to hopefully bring on a bit of a discussion and gather feedback regarding which events members of the community would find useful to have in Fabric Api, and also to explore some implementation details.
If there is a better place to talk about this let me know. I didn't want to post in some Discord channel though since I figured it would get lost quickly.
I'd be happy to make separate PRs later in the process for individual events.
Alright, so let's get into it. Here are my classes containing all Fabric events:
Common: https://github.com/Fuzss/puzzleslib/tree/main/1.21.6/Fabric/src/main/java/fuzs/puzzleslib/fabric/api/event/v1
Client: https://github.com/Fuzss/puzzleslib/tree/main/1.21.6/Fabric/src/main/java/fuzs/puzzleslib/fabric/api/client/event/v1
The actual event interfaces / classes are found within the common sub-project. Note that this is common code, so not all events necessarily lack a Fabric equivalent. The ones that do are exclusively found in the two packages linked above.
Common: https://github.com/Fuzss/puzzleslib/tree/main/1.21.6/Common/src/main/java/fuzs/puzzleslib/api/event/v1
Client: https://github.com/Fuzss/puzzleslib/tree/main/1.21.6/Common/src/main/java/fuzs/puzzleslib/api/client/event/v1
Please note that the API design of my events is rather opinionated: I've standardized return values (void, EventResult, EventResultHolder) and introduced mutable values for certain parameters, since I personally find Fabric's lack of standardization regarding return values a bit annoying to work with (like boolean returns sometimes cancelling vanilla when false, sometimes when true; and the worst offender events that return InteractionResult 😬).
But I will certainly adapt this to Fabric's more simple style.
Finally I'd like to mention that all events in Puzzles Lib have a purpose, meaning they are useful in at least one of my personal projects. I've not been blind-porting whatever I can find from NeoForge. So if necessary I should be able to provide existing use cases for every event.