Template with every listener?

Discussion in 'Plugin Development' started by Aetherspawn, Jan 28, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Aetherspawn

    Does one exist? I find it hard to lookup to docs and find the different listeners; the new event system is also a little confusing.

    It'd be nice if there was a template with a ton of sample .java files with blank listeners and I could add in the ones I want and RegisterEvent() them.
     
  2. Offline

    Milkywayz

    Yeah i know right, that's what i requested, no one will give you a template and if you post broken code people will only fix some of it or just tell you how which to the noob it makes it more confusing, but i guess only the worthy should know java and i guess I'm not one of them :(
     
  3. Offline

    darkmage0252

    One listener is all you need there all the same.
     
  4. Offline

    Milkywayz

    Well if you go to the wiki, theres a bunch of "templates" for basic plugins.. Those are really easy, if there was a template for every plugin it'd be too easy.. its just hard because you need to know how to implement stuff which takes awhile, i've been coding for... 4 days now. Lol
     
  5. Offline

    hammale

    I usualy just type a made up name and try that. If eclipse can't find it in the docs its off to Google! :D
     
  6. Offline

    Aetherspawn

    Lol I'm not looking for plugins already made. Just listener files that have all the events already in, and I can delete the ones I dont need to use.
     
  7. Offline

    RROD

    I'm quite surprised some sort of wiki thread doesn't contain this. The full list can be found here. All you need to do is modify the Event Handler, and it works like magic.
    Say if you had:
    public void onBlockPlace(BlockPlaceEvent event) {}

    You could change that to:
    public void onBlockPlace(BlockBreakEvent event) {}

    And it would still work like a BlockBreak. In programming terms, it's called polymorphisim. Because all events extend the class Event, it just handles an event.
     
Thread Status:
Not open for further replies.

Share This Page