Buff Implementation
public class MyCustomPotionProvider extends ArmorBoostProvider<[EVENT_NAME]> {
/**
* Constructor for the MyCustomPotionProvider
*
* @param instance the Phantom Armor Instance, which can be gotten via PhantomArmor.getInstance()
*/
public MyCustomPotionProvider(PhantomArmor instance) {
super(instance, "PROVIDER_PREFIX"); // an example of a prefix is phantomarmor-xp
PhantomArmor.getProviderManager().registerProvider([EVENT_NAME].class, this);
}
/**
* Event handler for the [EVENT_NAME]
*
* @param event the [EVENT_NAME]
*/
@EventHandler(priority = EventPriority.LOWEST)
@Override
public void onBoost([EVENT_NAME] event) {
// This is an example of how to get the total boost corresponding to the buff type.
// getTotalBoost() is inherited from the base class, you don't need to write your own logic.
double totalBoost = getTotalBoost(player, providerPrefix);
if (totalBoost > 0) {
event.setExp(((int)(event.getExp() * totalBoost)));
}
}
}Last updated