Package dev.kitteh.factions.upgrade
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 ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic final recordOptional helper record for creating a reactive upgrade.static final recordstatic interfaceHelper interface for responding to level changes.static final recordOptional helper record for creating a non-reactive upgrade.static final record -
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.text.ComponentGet's the upgrade's generic description as a decorated component.net.kyori.adventure.text.Componentdetails(UpgradeSettings settings, int level) Gets details about a specific level of the upgrade, using available upgrade settings.intmaxLevel()Gets the max level this upgrade could possible be configured, typically 1 for boolean upgrades andInteger.MAX_VALUEotherwise.name()Gets the upgrade's name as a simple string.net.kyori.adventure.text.ComponentGets the upgrade's name as a decorated component.default voidCalled 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
Gets details about a specific level of the upgrade, using available upgrade settings.- Parameters:
settings- upgrade settingslevel- level- Returns:
- decorated details
-
maxLevel
int maxLevel()Gets the max level this upgrade could possible be configured, typically 1 for boolean upgrades andInteger.MAX_VALUEotherwise.- 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
Called by the plugin when a faction changes level of this upgrade, potentially executing code.- Parameters:
faction- faction experiencing level changeoldLevel- old levelnewLevel- new level
-