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.Gets the income data for this source that determines the money gained when the source is gained.getType()
@Nullable String
getUnitName
(Locale locale) Gets theSourceValues
object that contains data about the source.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
-
getIncome
SourceIncome getIncome()Gets the income data for this source that determines the money gained when the source is gained. Income is only gained if jobs are enabled.- Returns:
- the source income data
-
getValues
SourceValues getValues()Gets theSourceValues
object that contains data about the source. All the information in the source values is already accessible through other methods in this interface.- Returns:
- the source values
-
isVersionValid
default boolean isVersionValid()Checks if the XP source is valid on the server's Minecraft version.- Returns:
- whether the XP source is valid
-