Class PermissionModifier
java.lang.Object
de.Keyle.MyPet.api.skill.experience.modifier.ExperienceModifier
de.Keyle.MyPet.api.skill.experience.modifier.PermissionModifier
An experience modifier that grants bonus experience based on the pet owner's permissions.
When the permission-based modifier feature is enabled in configuration
(MyPetGlobal.LevelSystem.Experience.Modifier.PERMISSION), this modifier scans the pet owner's effective
permissions for nodes of the form MyPet.experience.multiplier.<percent>
where <percent> is any positive integer. The highest matching value is
applied as percent / 100.0:
MyPet.experience.multiplier.125→ 1.25xMyPet.experience.multiplier.183→ 1.83xMyPet.experience.multiplier.250→ 2.5xMyPet.experience.multiplier.50→ 0.5x (halved)
If the feature is disabled, the owner is offline, or no permission node matches, the experience passes through unchanged.
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionModifier(Pet pet) Creates a permission modifier bound to the specified pet. -
Method Summary
Modifier and TypeMethodDescriptiondoublemodify(double experience, double baseExperience) Applies this modifier to the given experience value.
-
Constructor Details
-
PermissionModifier
Creates a permission modifier bound to the specified pet.- Parameters:
pet- the pet whose owner's permissions will be checked
-
-
Method Details
-
modify
public double modify(double experience, double baseExperience) Applies this modifier to the given experience value. Applies the highest applicable permission-based multiplier.- Specified by:
modifyin classExperienceModifier- Parameters:
experience- the experience value as modified by prior modifiers in the chainbaseExperience- the original unmodified experience from the mob kill- Returns:
- the modified experience value to pass to the next modifier (or to award)
-