All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sucy.skill.api.event.SignalEmitEvent Maven / Gradle / Ivy

Go to download

A Minecraft Bukkit plugin aiming to provide an easy code API and skill editor for all server owners to create unique and fully custom classes and skills.

There is a newer version: 1.3.1-R1
Show newest version
package com.sucy.skill.api.event;

import com.sucy.skill.api.skills.Skill;
import lombok.Getter;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import java.util.List;

@Getter
public class SignalEmitEvent extends Event {

    private static final HandlerList  handlers = new HandlerList();
    private final        Skill        skill;
    private final        LivingEntity emitter;
    private final        LivingEntity receiver;
    private final        String       signal;
    private final        List arguments;
    private final        boolean      selfHandling;

    /**
     * Event to call custom signal
     *
     * @param skill        skill used to emit signal
     * @param emitter      entity that emitted signal
     * @param receiver     entity that will receive signal
     * @param signal       signal name and encrypted arguments
     * @param arguments    arguments use for handling signal
     * @param selfHandling whether the signal is handling by the emitter or by the receiver
     */
    public SignalEmitEvent(Skill skill,
                           LivingEntity emitter,
                           LivingEntity receiver,
                           String signal,
                           List arguments,
                           boolean selfHandling) {
        this.skill = skill;
        this.emitter = emitter;
        this.receiver = receiver;
        this.signal = signal;
        this.arguments = arguments;
        this.selfHandling = selfHandling;
    }

    /**
     * Retrieves the handlers for the event
     *
     * @return list of event handlers
     */
    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    /**
     * Retrieves the handlers for the event
     *
     * @return list of event handlers
     */
    public static HandlerList getHandlerList() {
        return handlers;
    }
}