Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier Event System #2

Open
phase opened this issue Apr 21, 2015 · 4 comments
Open

Easier Event System #2

phase opened this issue Apr 21, 2015 · 4 comments

Comments

@phase
Copy link

phase commented Apr 21, 2015

Instead of implementing every Event in Sponge and transfering it to Bukkit (or vice versa), is there any way you could call the event based on the Bukkit event?

public class EventTranslator implements Listener {
    @EventHandler
    public void genericEvent(Event e){
        Sponge.Magic.call(e);
    }
}

Obvisouly that doesn't work, but there's probably some way to add a switch for each Event. Plus I don't know if a normal Event will be called.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@deathcap
Copy link
Contributor

Maybe there's a way to translate events like this, but I can't see a way to do it in general unfortunately, since the Bukkit and Sponge events are so different best I can do I believe is implementing each one individually.. but maybe something better is possible?

@deathcap
Copy link
Contributor

Also, Bukkit afaik won't call the event superclass handlers (including Event, but there was a PR to Glowstone proposing changing this), but SpongeAPI will

@jamierocks
Copy link

@Minecrell did dome cool stuff in https://github.com/LapisBlue/Pore that might help, related to events.

@phase
Copy link
Author

phase commented Apr 23, 2015

@jamierocks They're doing the same thing that Bukkit2Sponge is doing (LapisBlue/Pore@687e7e2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants