-
Notifications
You must be signed in to change notification settings - Fork 0
API
Currently the API allows you to register your own Rewards and Requirements. Unique Events will also be implemented at a later date and will end up being documented here.
A few examples of Rewards and Requirements can be found here.
To create a custom Reward or Requirement you'll need to create a new class which implements TechReward
or TechRequirement
respectively.
You'll need to overwrite different methods to define how the reward/requirement will work:
reward(Player)
runs when the entry in context is unlocked
setup(TechEntry, LineConfig)
is called when loading the reward from config.
(This is usually where you load the different arguments from the Line Configuration)
met(TechEntry, Player)
returns true if the requirements are met and false if they don't.
display(TechEntry, Player, boolean)
returns the string to represent the requirement in the entry lore.
It's recommended to use FormatManager.get().getFormat(key).getFormat(boolean)
to use the locked/unlocked formatting feature.
fulfill(TechEntry, Player)
runs when the entry in context is unlocked. Used to withdraw money or to take required items, etc.
setup(TechEntry, LineConfig)
is called when loading the requirement from config.
(This is usually where you load the different arguments from the Line Configuration)
To register your Rewards and Requirements, call APIManager.get().addRequirement()
and APIManager.get().addReward()
respectively.
It's recommended to register your rewards and requirements in the onLoad() method.
- Vault - Permission
- MMOCore - MMOExperience
- Vault - Money, Permission
- MMOItems - MMOItem
- MMOCore - MMOClass, MMOLevel, MMOProfLevel, MMOAttribute, MMOPoint, MMOResource
- ExecutableItems - ExecItem