Settable Event

Quick way to create a event with a single variable.

Creating

public class EventName extends SettableEvent<String> {

    public final @NotNull String parameter;

    public EventName(@NotNull String parameter) {
        this.parameter = parameter;
    }
}

Listening

client.registerListener((EventListener<EventName>) event -> {
    return event.set("Test");
});

Calling

CompletableResultSet<EventName> resultCollection = client
        .callEvent(new PingEvent("Somthing"));


// Wait for the final result.
List<EventName> result = resultCollection.waitForFinalResult();

// Quick way to check if it contains an event that has completed set to true.
boolean containsSpecificSettable = resultCollection.containsSettable("Test");

Last updated