Skip to content

Conversation

@emyfops
Copy link
Collaborator

@emyfops emyfops commented Nov 25, 2024

This pull request refactors the structure of the com.lambda.event.events files

  • Grouped some local player related events together (LocalPlayerEvent.kt)
  • Added more documentation for events I know for sure
  • Replaced super abstract classes to sealed classes for consistency

I also removed all Event interfaces to events that are never triggered
The following example is based from this file

sealed class ClientEvent {
    /**
     * Triggered upon client initialization
     */
    class Startup : Event

    /**
     * Triggered upon client shutdown
     */
    class Shutdown : Event
}

This way of creating event classes prevent the accidental registration of unused (never posted to TaskFlow) events as seen here

The only edge case where this is allowed is when the super class shares functions or variables for all the inner classes (example)

@github-actions github-actions bot added triage Requires labelling or review 1.20 labels Nov 25, 2024
@emyfops emyfops added ignore-for-release Don't include this label in the release changelog and removed triage Requires labelling or review labels Nov 25, 2024
@emyfops emyfops requested a review from Avanatiker November 25, 2024 20:36
@Avanatiker Avanatiker merged commit 611e1e9 into master Nov 27, 2024
2 checks passed
@emyfops emyfops deleted the refactor/events branch November 27, 2024 14:33
@emyfops emyfops changed the title [1.20.4] [All] Ref: Events structure [1.20.4] Ref: Events structure Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release Don't include this label in the release changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants