Interface XpSource
- All Known Subinterfaces:
AnvilXpSource
,BlockXpSource
,BrewingXpSource
,DamageXpSource
,EnchantingXpSource
,EntityXpSource
,FishingXpSource
,GrindstoneXpSource
,ItemConsumeXpSource
,JumpingXpSource
,ManaAbilityUseXpSource
,PotionSplashXpSource
,StatisticXpSource
- All Known Implementing Classes:
CustomSource
public interface XpSource
-
Method Summary
Modifier and TypeMethodDescriptiongetDisplayName
(Locale locale) Gets the display name of the source.getId()
Gets the id of the source.getType()
@Nullable String
getUnitName
(Locale locale) double
getXp()
Gets the amount of xp the source gives.default boolean
Checks if the XP source is valid on the server's Minecraft version.name()
Gets the name of the source in all caps without a namespace.
-
Method Details
-
getId
NamespacedId getId()Gets the id of the source. Any source set in the plugin config will use the auraskills namespace. Repeated sources in different skills will have the same NamespacedId but are different instances.- Returns:
- The id
-
getType
SourceType getType() -
getDisplayName
Gets the display name of the source. Different sources may return the same name.- Parameters:
locale
- The locale to get the name in- Returns:
- The display name
-
getUnitName
-
name
String name()Gets the name of the source in all caps without a namespace. Different sources may return the same name.- Returns:
- The name in all caps
-
getXp
double getXp()Gets the amount of xp the source gives. The value is the base amount before any multipliers are applied.- Returns:
- The base xp of the source
-
isVersionValid
default boolean isVersionValid()Checks if the XP source is valid on the server's Minecraft version.- Returns:
- whether the XP source is valid
-