Interface IElevatorSetting<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull IElevatorSetting<T> addAction​(@NotNull java.lang.String action, @NotNull java.lang.String description)
      Adds an informational UI action line to this setting's icon/lore.
      boolean canBeEditedIndividually​(@NotNull IElevator elevator)
      Returns whether this setting supports per-elevator (individual) editing for the given elevator.
      void clickGlobal​(@NotNull org.bukkit.entity.Player player, @NotNull IElevatorType elevatorType, @NotNull java.lang.Runnable returnMethod, @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent)
      Handles a click on this setting in a "global" context.
      void clickIndividual​(@NotNull org.bukkit.entity.Player player, @NotNull IElevator elevator, @NotNull java.lang.Runnable returnMethod, @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent)
      Handles a click on this setting in an "individual" context.
      @NotNull org.bukkit.inventory.ItemStack createIcon​(@NotNull java.lang.Object value, boolean global)
      Creates an icon representing this setting and its current value for UI display.
      T getGlobalValue​(@NotNull IElevatorType elevatorType)
      Returns the global value of this setting for the given elevator type.
      T getIndividualValue​(@NotNull IElevator elevator)
      Returns the resolved value of this setting for a specific elevator.
      @NotNull org.bukkit.plugin.java.JavaPlugin getPlugin()
      Returns the plugin that provided/owns this setting.
      @NotNull java.lang.String getSettingName()
      Returns the internal setting name/key (server-wide).
      boolean isSettingGlobalOnly​(@NotNull IElevator elevator)
      Returns whether this setting is forced to be global-only for the given elevator.
      void onClickGlobal​(@NotNull org.bukkit.entity.Player player, @NotNull IElevatorType elevatorType, @NotNull java.lang.Runnable returnMethod, @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent, T currentValue)
      Called when the setting is clicked in a global context, with the current global value already provided.
      void onClickIndividual​(@NotNull org.bukkit.entity.Player player, @NotNull IElevator elevator, @NotNull java.lang.Runnable returnMethod, @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent, T currentValue)
      Called when the setting is clicked in an individual context, with the current individual value already provided.
      void setIndividualValue​(@NotNull IElevator elevator, T value)
      Sets the per-elevator override value for this setting.
    • Method Detail

      • addAction

        @NotNull
        @NotNull IElevatorSetting<T> addAction​(@NotNull
                                               @NotNull java.lang.String action,
                                               @NotNull
                                               @NotNull java.lang.String description)
        Adds an informational UI action line to this setting's icon/lore.

        This does not change the setting value; it only affects the generated icon lore.

        Parameters:
        action - non-null action label (e.g., "LEFT-CLICK")
        description - non-null action description
        Returns:
        this setting instance (for chaining)
        Throws:
        java.lang.NullPointerException - if any argument is null
      • isSettingGlobalOnly

        boolean isSettingGlobalOnly​(@NotNull
                                    @NotNull IElevator elevator)
        Returns whether this setting is forced to be global-only for the given elevator.

        This is typically true when the elevator type has disabled this setting by name or when individual editing is not supported for the elevator/context.

        Parameters:
        elevator - non-null elevator context
        Returns:
        true if individual overrides are not allowed; otherwise false
        Throws:
        java.lang.NullPointerException - if elevator is null
      • canBeEditedIndividually

        boolean canBeEditedIndividually​(@NotNull
                                        @NotNull IElevator elevator)
        Returns whether this setting supports per-elevator (individual) editing for the given elevator.

        If this returns false, the setting is effectively global-only for that elevator.

        Parameters:
        elevator - non-null elevator context
        Returns:
        true if per-elevator editing is supported; otherwise false
        Throws:
        java.lang.NullPointerException - if elevator is null
      • createIcon

        @NotNull
        @NotNull org.bukkit.inventory.ItemStack createIcon​(@NotNull
                                                           @NotNull java.lang.Object value,
                                                           boolean global)
        Creates an icon representing this setting and its current value for UI display.

        Contract: value must be non-null.

        Parameters:
        value - non-null current value (global or individual)
        global - whether the icon represents the global value or an individual value
        Returns:
        a non-null item stack icon (typically a clone of an internal template)
        Throws:
        java.lang.NullPointerException - if value is null
      • clickGlobal

        void clickGlobal​(@NotNull
                         @NotNull org.bukkit.entity.Player player,
                         @NotNull
                         @NotNull IElevatorType elevatorType,
                         @NotNull
                         @NotNull java.lang.Runnable returnMethod,
                         @NotNull
                         @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent)
        Handles a click on this setting in a "global" context.

        This convenience method typically calls getGlobalValue(IElevatorType) and then delegates to onClickGlobal(Player, IElevatorType, Runnable, InventoryClickEvent, Object).

        Parameters:
        player - non-null clicking player
        elevatorType - non-null elevator type being edited
        returnMethod - non-null callback to return to the previous UI
        clickEvent - non-null inventory click event
      • clickIndividual

        void clickIndividual​(@NotNull
                             @NotNull org.bukkit.entity.Player player,
                             @NotNull
                             @NotNull IElevator elevator,
                             @NotNull
                             @NotNull java.lang.Runnable returnMethod,
                             @NotNull
                             @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent)
        Handles a click on this setting in an "individual" context.

        This convenience method typically calls getIndividualValue(IElevator) and then delegates to onClickIndividual(Player, IElevator, Runnable, InventoryClickEvent, Object).

        Parameters:
        player - non-null clicking player
        elevator - non-null elevator being edited
        returnMethod - non-null callback to return to the previous UI
        clickEvent - non-null inventory click event
      • onClickGlobal

        void onClickGlobal​(@NotNull
                           @NotNull org.bukkit.entity.Player player,
                           @NotNull
                           @NotNull IElevatorType elevatorType,
                           @NotNull
                           @NotNull java.lang.Runnable returnMethod,
                           @NotNull
                           @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent,
                           @NotNull
                           T currentValue)
        Called when the setting is clicked in a global context, with the current global value already provided.
        Parameters:
        player - non-null clicking player
        elevatorType - non-null elevator type being edited
        returnMethod - non-null callback to return to the previous UI
        clickEvent - non-null inventory click event
        currentValue - current global value
      • onClickIndividual

        void onClickIndividual​(@NotNull
                               @NotNull org.bukkit.entity.Player player,
                               @NotNull
                               @NotNull IElevator elevator,
                               @NotNull
                               @NotNull java.lang.Runnable returnMethod,
                               @NotNull
                               @NotNull org.bukkit.event.inventory.InventoryClickEvent clickEvent,
                               @NotNull
                               T currentValue)
        Called when the setting is clicked in an individual context, with the current individual value already provided.
        Parameters:
        player - non-null clicking player
        elevator - non-null elevator being edited
        returnMethod - non-null callback to return to the previous UI
        clickEvent - non-null inventory click event
        currentValue - current individual value
      • getGlobalValue

        @NotNull
        T getGlobalValue​(@NotNull
                         @NotNull IElevatorType elevatorType)
        Returns the global value of this setting for the given elevator type.
        Parameters:
        elevatorType - non-null elevator type context
        Returns:
        the global value (implementations should not return null unless explicitly documented)
      • getIndividualValue

        @NotNull
        T getIndividualValue​(@NotNull
                             @NotNull IElevator elevator)
        Returns the resolved value of this setting for a specific elevator.

        If individual editing is supported and a datastore is configured, implementations typically read the stored override from the elevator's persistent data container; otherwise the global value is returned.

        Parameters:
        elevator - non-null elevator context
        Returns:
        the resolved value (typically non-null)
      • setIndividualValue

        void setIndividualValue​(@NotNull
                                @NotNull IElevator elevator,
                                @NotNull
                                T value)
        Sets the per-elevator override value for this setting.

        Side effects: Implementations will write to the elevator's persistent data container and update the backing block state.

        Optimization behavior: Implementations may remove the stored override when value equals the current global value.

        Parameters:
        elevator - non-null elevator to modify
        value - new value to store (may be treated as "remove override" when equal to global)
        Throws:
        java.lang.RuntimeException - if this setting does not support individual overrides (e.g., datastore not configured)
      • getSettingName

        @NotNull
        @NotNull java.lang.String getSettingName()
        Returns the internal setting name/key (server-wide).
        Returns:
        the non-null setting name
      • getPlugin

        @NotNull
        @NotNull org.bukkit.plugin.java.JavaPlugin getPlugin()
        Returns the plugin that provided/owns this setting.
        Returns:
        the non-null plugin