Skip to content

aebrn/eventsystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eventsystem

Simple Java eventsystem.

Calling

  • Call your event where it needs to be invoked
    EventManager.getInstance().call(new MyEvent());
  • Another way if you need to access fields or methods in the event class
    MyEvent myEvent = new MyEvent();
    myEvent.doStuff();
    EventManager.getInstance().call(myEvent);
  • As well as
    new MyEvent().call();

Listening

  • Listen for events in the class
    EventManager.getInstance().register(this);
  • Stop listening
    EventManager.getInstance().unregister(this);
  • The listener will look for methods containing the Listener annotation
    @Listener
    public void onMyEvent(MyEvent event) {
    doStuff();
    }

About

Simple Java eventsystem.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages