Jump to content
Team Avolition

Sirenfal

Administrators
  • Content Count

    2574
  • Joined

  • Last visited

Community Reputation

4040 Excellent

About Sirenfal

  • Rank
    Servant of Chuck Knoblock the one armed one man army
  • Birthday 12/25/1995

Contact Methods

  • Skype
    Sirenfal

Profile Information

  • Gender
    Female
  • Location
    Florida
  • Interests
    Being tied up

Recent Profile Visitors

110994 profile views
  1. Sirenfal

    Hello World!

    You'll want to check the Discord
  2. Sirenfal

    Hmm

    Don't worry about it Remember the community mostly hangs out on Discord now
  3. Sirenfal

    Help Creating an Event Manager

    You make an abstract Event class from which all your events descend. You make an EventManager class that has a subscribe method that allows you to specify a method which should be called if an event of a particular type fires, and a call method that calls each of those subscribed event handlers whenever an event occurs. Then you make a class for each event type you need (ex. EntitySpawned, PlayerDied) Create a method to handle each event you care about and use EventManager.subscribe(EntitySpawned, handle_entity_spawned) So something like the following. I don't work in Java anymore, so you'll have to figure out the particular syntax yourself, I'm kinda fuzzy on Java 8 features. I left comments so you have some idea of what to Google. public class Event {} public class PlayerKilled extends Event { // fields, constructor... } // Java 8 function interface - each event handler probably needs an anonymous class? I don't know public interface EventFunction { void call(Event event); } public class EventManager { // a mapping of class types inheriting from Event to a list of function handlers for that event type // ex. PlayerKilled -> call(PlayerKilled event) private HashMap<Class<Event>, ArrayList<EventFunction>> handlers = new HashMap(); public void subscribe(Class<Event> event_type, EventFunction func) { // if this is the first event for this type we need to create the ArrayList they're stored in first if(!handlers.containsKey(event_type)) { handlers.put(event_type, new ArrayList<EventFunction>()); } handlers.get(event_type).add(func); } public void call(Event event) { // call all event handlers using a Java 8 lambda expression (Array.forEach lambda) handlers.get(event.class).forEach(handler -> { handler.call(event); }); } } For any further help consider joining the aVo Discord and asking in the #developers channel (check the thread in the Random section, it's stickied). EDIT: I don't know the exact syntax for the subscribe method, but you want a "SAM type". See these links- https://ocpjava.wordpress.com/2016/04/05/java-8-functional-interfaces-sam/ https://stackoverflow.com/questions/17913409/what-is-a-sam-type-in-java Something like whatever.subscribe(PlayerKilled.class, (event) -> { // do stuff with event });
  4. Sirenfal

    Still active?

    Nope
  5. Sirenfal

    What’s up Gamers

    We still talk to him, yeah. He doesn't post on the forums
  6. Sirenfal

    What’s up Gamers

    kek
  7. Sirenfal

    we still active on the forums or nah

    mostly on Discord now
  8. Sirenfal

    Anybody here play on nerd.nu?

    Either someone made it up, or people fell for the ol' fans claiming to be us meme
  9. Sirenfal

    Anybody here play on nerd.nu?

    Nope, we never did. I hadn't even heard of it until two weeks ago
  10. Sirenfal

    Anybody here play on nerd.nu?

    99.9% sure nerd.nu is older that 2b2t btw
  11. Sirenfal

    Jellal's Introduction

    https://discord.gg/DYNJ6Zk
  12. Sirenfal

    Avo Diablo 3 Archive?

    I don't think there is
  13. Sirenfal

    How to join Discord

    You sure you copied the whole link? It seems to be working fine when I tested it - https://discordapp.com/invite/DYNJ6Zk
  14. Hello huge fan and loved your work 

  15. Sirenfal

    Hello, I'm Rain.

    WHEN IT RAINS IT POURS
×