Package me.lokka30.levelledmobs
Interface LevelInterface
- All Known Implementing Classes:
LevelManager
public interface LevelInterface
Welcome to the LevelInterface, this class is a 'global' interface for LM itself AND other plugins
to apply and modify the main functions of LevelledMobs.
- Since:
- 2.5
-
Method Summary
Modifier and TypeMethodDescriptionvoid
applyLevelToMob
(@NotNull LivingEntityWrapper lmEntity, int level, boolean isSummoned, boolean bypassLimits, @NotNull HashSet<AdditionalLevelInformation> additionalLevelInformation) This method applies a level to the target mob.int
generateLevel
(@NotNull LivingEntityWrapper lmEntity) This method generates a level for the mob.int
generateLevel
(@NotNull LivingEntityWrapper lmEntity, int minLevel, int maxLevel) This method generates a level for the mob.@NotNull LevellableState
getLevellableState
(@NotNull LivingEntityInterface lmInterface) Check if an existing mob is allowed to be levelled, according to the user's configuration.int
getLevelOfMob
(@NotNull org.bukkit.entity.LivingEntity livingEntity) Retrieve the level of a levelled mob.boolean
isLevelled
(@NotNull org.bukkit.entity.LivingEntity livingEntity) Check if a LivingEntity is a levelled mob or not.void
removeLevel
(@NotNull LivingEntityWrapper lmEntity) Un-level a mob.
-
Method Details
-
getLevellableState
@NotNull @NotNull LevellableState getLevellableState(@NotNull @NotNull LivingEntityInterface lmInterface) Check if an existing mob is allowed to be levelled, according to the user's configuration.Thread-safety intended, but not tested.
- Parameters:
lmInterface
- target mob- Returns:
- if the mob is allowed to be levelled (yes/no), with reason
-
generateLevel
This method generates a level for the mob. It utilises the levelling mode specified by the administrator through the settings.yml configuration.Thread-safety intended, but not tested.
- Parameters:
lmEntity
- the entity to generate a level for- Returns:
- a level for the entity
-
generateLevel
This method generates a level for the mob. It utilises the levelling mode specified by the administrator through the settings.yml configuration.Thread-safety intended, but not tested.
- Parameters:
lmEntity
- the entity to generate a level forminLevel
- the minimum level to be used for the mobmaxLevel
- the maximum level to be used for the mob- Returns:
- a level for the entity
-
applyLevelToMob
void applyLevelToMob(@NotNull @NotNull LivingEntityWrapper lmEntity, int level, boolean isSummoned, boolean bypassLimits, @NotNull @NotNull HashSet<AdditionalLevelInformation> additionalLevelInformation) This method applies a level to the target mob.You can run this method on a mob regardless if they are already levelled or not.
This method DOES NOT check if it is LEVELLABLE. It is assumed that plugins make sure this is the case (unless they intend otherwise).
It is highly recommended to leave bypassLimits = false, unless the desired behaviour is to override the user-configured limits.
Thread-safety intended, but not tested.
- Parameters:
lmEntity
- target moblevel
- the level the mob should haveisSummoned
- if the mob was spawned by LevelledMobs, not by the serverbypassLimits
- whether LM should disregard max level, etc.additionalLevelInformation
- used to determine the source event
-
isLevelled
boolean isLevelled(@NotNull @NotNull org.bukkit.entity.LivingEntity livingEntity) Check if a LivingEntity is a levelled mob or not. This is determined *after* MobPreLevelEvent.Thread-safety intended, but not tested.
- Parameters:
livingEntity
- living entity to check- Returns:
- if the mob is levelled or not
-
getLevelOfMob
int getLevelOfMob(@NotNull @NotNull org.bukkit.entity.LivingEntity livingEntity) Retrieve the level of a levelled mob.Thread-safety intended, but not tested.
- Parameters:
livingEntity
- the levelled mob to get the level of- Returns:
- the mob's level
-
removeLevel
Un-level a mob.- Parameters:
lmEntity
- levelled mob to un-level
-