Jump to content
Team Avolition


  • Content Count

  • Joined

  • Last visited

Everything posted by Sirenfal

  1. Sirenfal


    Don't worry about it Remember the community mostly hangs out on Discord now
  2. 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 });
  3. Sirenfal

    Still active?

  4. The server the forum was hosted on was compromised via another site on the same box. At this time I don't believe any forum data was stolen, but you should change your password here and anywhere else you reused it just to be safe. As long as I was reformatting that box anyway, I went ahead and updated the forum to IPS4. I copied the theme from another website I run and stuck a background because that's less eyebleed than a flat color. I may or may not make a new dark theme soon, I'm not sure yet. Since we're on IPS4 I also replaced the old shoutbox with a shoutbox I wrote that's nicer. Welcome back, please let me know if you run into any issues. This was a big upgrade and I'd be surprised if there weren't some problems lurking.
  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

  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

  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. Sirenfal

    Hello, I'm Rain.

  15. Sirenfal

    A Player Has Jointed the Struggle

    I'll look into the avatar upload At Some Point(TM) Discord's hilariously bad servers had some downtime recently, try again
  16. Sirenfal

    Well, I'm here now.

    Welcome! Join us on the Discord :3 https://discord.gg/DYNJ6Zk
  17. Sirenfal

    Entrance: New Player Joins

    Screenshot the profile picture thing
  18. Sirenfal

    What do the bird does?

    A novel about what though?
  19. Sirenfal

    Who is the person speaking at 3:39 and 3:47?

    That's Sinkip. We were dating at the time.
  20. Sirenfal

    Feeling welcome!

    >Quake 3 SMART
  21. Sirenfal

    Hello World

    We use Discord for that now. Don't worry!
  22. Sirenfal

    Hello World

  23. Sirenfal

    Deadmau5 Professional Griefers theories

    I don't have any evidence, but I remember it came out right around our height. It would make sense given not just his history with Minecraft, but his personality on livestreams in the past year. I hope we made him laugh, personally. Seems like a nice guy.
  24. Sirenfal

    Corrupt A Wish

    We're not together anymore, so. You have to answer the previous wish to make a wish.
  25. Sirenfal

    Sativa gives you the shits.

    idk why you felt the need to post this thread