GithubHelp home page GithubHelp logo

neoforged / bus Goto Github PK

View Code? Open in Web Editor NEW
3.0 15.0 7.0 561 KB

Event firing and listening framework, based on the event bus concept

License: GNU Lesser General Public License v2.1

Java 100.00%
eventbus events java-library

bus's People

Contributors

apexmodder avatar coehlrich avatar cpw avatar gigaherz avatar ichttt avatar lexmanos avatar marchermans avatar matyrobbrt avatar mezz avatar shadows-of-fire avatar technici4n avatar tterrag1098 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bus's Issues

Make event priority use an int value instead of a list of enum values

Hi!
I've been discussing event priorities with someone over on the Twilight Forest Discord server as they wanted to change the priority of our death event so their mod would properly work. While doing this, we had the realization that only having 5 different priorities that had no sorting order (at least I don't think it does?) is a rather flawed system.

My proposal: take a page out of how Mixin does it and allow people to specify an int for the priority. The default could just be 0, and mods that need a lower priority could just specify a negative number if needed. Mods could then be sorted based on this priority (perhaps by the actual mod loading order if multiple mods use the same value) and it would allow for finer control of when things fire.

`Event`s should be resettable to a state where they can be posted again

As far as I can tell it's just a matter of adding such a method to Event:

    protected void reset() {
        isCanceled = false;
        result = Result.DEFAULT;
        phase = null;
    }

(event.setCanceled(false).setResult(Result.DEFAULT).setPhase(null) will not work due to setPhase)

Of course, this should come with a nice test too.

Remove `GenericEvent`

It doesn't seem too useful and right now it isn't particularly performant - once capabilities get reworked Forge won't be making use of it anymore.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.