Search in sources :

Example 6 with PlayerSpecialRewardEvent

use of com.bencodez.votingplugin.events.PlayerSpecialRewardEvent in project VotingPlugin by Ben12345rocks.

the class SpecialRewards method giveMilestoneVoteReward.

public void giveMilestoneVoteReward(VotingPluginUser user, boolean online, int milestone, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.MILESTONE.setAmount(milestone));
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    new RewardBuilder(plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getMilestoneRewardsPath(milestone)).setOnline(online).withPlaceHolder("Milestone", "" + milestone).setServer(forceBungee).send(user);
}
Also used : RewardBuilder(com.bencodez.advancedcore.api.rewards.RewardBuilder) PlayerSpecialRewardEvent(com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)

Aggregations

PlayerSpecialRewardEvent (com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)6 RewardBuilder (com.bencodez.advancedcore.api.rewards.RewardBuilder)3 RewardOptions (com.bencodez.advancedcore.api.rewards.RewardOptions)3