Interface Upgrade

All Known Subinterfaces:
Upgrade.Impl
All Known Implementing Classes:
Upgrade.Reactive, Upgrade.ReactiveImpl, Upgrade.Simple, Upgrade.SimpleImpl

@AvailableSince("4.0.0") @NullMarked public interface Upgrade
An upgrade. Custom upgrades can be created, potentially using optional helper records Upgrade.Simple and Upgrade.Reactive.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
    static final record 
    Optional helper record for creating a reactive upgrade.
    static final record 
     
    static interface 
    Helper interface for responding to level changes.
    static final record 
    Optional helper record for creating a non-reactive upgrade.
    static final record 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.kyori.adventure.text.Component
    Get's the upgrade's generic description as a decorated component.
    net.kyori.adventure.text.Component
    details(UpgradeSettings settings, int level)
    Gets details about a specific level of the upgrade, using available upgrade settings.
    int
    Gets the max level this upgrade could possible be configured, typically 1 for boolean upgrades and Integer.MAX_VALUE otherwise.
    Gets the upgrade's name as a simple string.
    net.kyori.adventure.text.Component
    Gets the upgrade's name as a decorated component.
    default void
    onChange(Faction faction, int oldLevel, int newLevel)
    Called by the plugin when a faction changes level of this upgrade, potentially executing code.
    Gets the variables this upgrade tracks for its levels, if any.
  • Method Details

    • name

      String name()
      Gets the upgrade's name as a simple string.
      Returns:
      name
    • nameComponent

      net.kyori.adventure.text.Component nameComponent()
      Gets the upgrade's name as a decorated component.
      Returns:
      decorated name
    • description

      net.kyori.adventure.text.Component description()
      Get's the upgrade's generic description as a decorated component.
      Returns:
      decorated description
    • details

      net.kyori.adventure.text.Component details(UpgradeSettings settings, int level)
      Gets details about a specific level of the upgrade, using available upgrade settings.
      Parameters:
      settings - upgrade settings
      level - level
      Returns:
      decorated details
    • maxLevel

      int maxLevel()
      Gets the max level this upgrade could possible be configured, typically 1 for boolean upgrades and Integer.MAX_VALUE otherwise.
      Returns:
      max level configurable
    • variables

      Set<UpgradeVariable> variables()
      Gets the variables this upgrade tracks for its levels, if any.
      Returns:
      set of any variables this upgrade uses
    • onChange

      default void onChange(Faction faction, int oldLevel, int newLevel)
      Called by the plugin when a faction changes level of this upgrade, potentially executing code.
      Parameters:
      faction - faction experiencing level change
      oldLevel - old level
      newLevel - new level