Package net.eternalclient.api.listeners
Class Listeners
- java.lang.Object
-
- net.eternalclient.api.listeners.Listeners
-
public class Listeners extends java.lang.Object
The Listeners class is responsible for registering and deregistering various types of listeners used.
-
-
Constructor Summary
Constructors Constructor Description Listeners()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
clear()
Clears the script listeners by deregistering each listener and removing them from the list of script listeners.static java.util.List<Listener>
getClientListeners()
static java.util.List<Painter>
getPainters()
static java.util.List<Listener>
getScriptListeners()
static void
printClientListeners()
Prints the client listeners and their count.static void
printScriptListeners()
Prints the size and details of script listeners.static void
register(java.lang.Object object)
Registers an object with the default settings.static void
register(java.lang.Object object, boolean client)
Registers a listener object for different event types.static void
unregister(java.lang.Object object)
Deregisters the specified object from the system.static void
unregister(java.lang.Object object, boolean client)
Unregisters the specified object as a listener.
-
-
-
Method Detail
-
register
public static void register(java.lang.Object object)
Registers an object with the default settings.- Parameters:
object
- the object to be registered
-
register
public static void register(java.lang.Object object, boolean client)
Registers a listener object for different event types. Also registers the object with the event bus.- Parameters:
object
- the listener object to registerclient
- boolean indicating whether the object is a client listener or not
-
unregister
public static void unregister(java.lang.Object object)
Deregisters the specified object from the system.- Parameters:
object
- the object to be deregistered
-
unregister
public static void unregister(java.lang.Object object, boolean client)
Unregisters the specified object as a listener. If the object is an instance of any listener interface, it will be removed from the corresponding listener list. Also unregister the object from the event bus.- Parameters:
object
- the object to be deregistered as a listenerclient
- true if the object is a client listener, false if it is a script listener
-
clear
public static void clear()
Clears the script listeners by deregistering each listener and removing them from the list of script listeners. Also clears the script listeners from event bus.
-
printClientListeners
public static void printClientListeners()
Prints the client listeners and their count.
-
printScriptListeners
public static void printScriptListeners()
Prints the size and details of script listeners.
-
getPainters
public static java.util.List<Painter> getPainters()
-
getClientListeners
public static java.util.List<Listener> getClientListeners()
-
getScriptListeners
public static java.util.List<Listener> getScriptListeners()
-
-