Interface FeatherElectionAPI

package me.leo_s.featheredelection.api;

import me.leo_s.featheredelection.objects.trigger.Trigger;
import me.leo_s.featheredelection.objects.trigger.TriggerData;
import org.bukkit.entity.Player;

/**
 * The FeatherElectionAPI interface provides methods to interact with the FeatheredElection effects and triggers system.
 */
public interface FeatherElectionAPI {

    /**
     * Forces the execution of an effect on a specific player.
     *
     * @param effectId Unique identifier of the effect to be executed.
     * @param player   The player on whom the effect will be executed.
     * @return `true` if the effect execution was successful, `false` otherwise.
     */
    boolean forceExecuteEffect(String effectId, Player player);

    /**
     * Forces the execution of an effect on a specific player with additional provided data.
     *
     * @param effectId Unique identifier of the effect to be executed.
     * @param player   The player on whom the effect will be executed.
     * @param data     Additional data to be provided when executing the effect.
     * @return `true` if the effect execution was successful, `false` otherwise.
     */
    boolean forceExecuteEffect(String effectId, Player player, TriggerData data);

    /**
     * Registers a new effect trigger in the system.
     *
     * @param trigger The effect trigger to be registered.
     * @return `true` if the registration was successful, `false` otherwise.
     */
    boolean registerNewTriggerEffect(Trigger trigger);
}

The FeatherElectionAPI interface provides methods to interact with the effects and triggers system of FeatheredElection, a Minecraft plugin. It is designed to provide a clear and consistent interface for developers to integrate and use the features provided by FeatheredElection. Each of the interface methods is detailed below:

MethodforceExecuteEffect(String effectId, Player player)

This method forces the execution of a specific effect on a particular player.

  • Parameters:

    • effectId: Unique identifier of the effect to be executed.

    • player: The player on which the effect will be executed.

  • Returns:

    • true whether the execution of the effect was successful.

    • false otherwise.

MethodforceExecuteEffect(String effectId, Player player, TriggerData data)

This method extends the functionality of forceExecuteEffect by allowing the provision of additional data for the execution of the effect.

  • Parameters:

    • effectId: Unique identifier of the effect to be executed.

    • player: The player on which the effect will be executed.

    • data: Additional data to be provided when running the effect.

  • Returns:

    • true whether the execution of the effect was successful.

    • false otherwise.

Method registerNewTriggerEffect(Trigger trigger)

This method registers a new effect trigger in the system.

  • Parameters:

    • trigger: The effect trigger to register.

  • Returns:

    • true if the registration was successful.

    • false otherwise.

Last updated