Search in sources :

Example 1 with PlayerSpecialRewardEvent

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

the class SpecialRewards method giveAllSitesRewards.

public void giveAllSitesRewards(VotingPluginUser user, boolean online, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.ALLSITE);
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    RewardHandler.getInstance().giveReward(user, plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getAllSitesRewardPath(), new RewardOptions().setServer(forceBungee).setOnline(online));
}
Also used : RewardOptions(com.bencodez.advancedcore.api.rewards.RewardOptions) PlayerSpecialRewardEvent(com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)

Example 2 with PlayerSpecialRewardEvent

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

the class SpecialRewards method giveFirstVoteTodayRewards.

public void giveFirstVoteTodayRewards(VotingPluginUser user, boolean online, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.FIRSTVOTETODAY);
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    RewardHandler.getInstance().giveReward(user, plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getFirstVoteTodayRewardsPath(), new RewardOptions().setServer(forceBungee).setOnline(online));
}
Also used : RewardOptions(com.bencodez.advancedcore.api.rewards.RewardOptions) PlayerSpecialRewardEvent(com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)

Example 3 with PlayerSpecialRewardEvent

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

the class SpecialRewards method giveFirstVoteRewards.

public void giveFirstVoteRewards(VotingPluginUser user, boolean online, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.FIRSTVOTE);
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    RewardHandler.getInstance().giveReward(user, plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getFirstVoteRewardsPath(), new RewardOptions().setServer(forceBungee).setOnline(online));
}
Also used : RewardOptions(com.bencodez.advancedcore.api.rewards.RewardOptions) PlayerSpecialRewardEvent(com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)

Example 4 with PlayerSpecialRewardEvent

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

the class SpecialRewards method giveVoteStreakReward.

public void giveVoteStreakReward(VotingPluginUser user, boolean online, String type, String string, int votes, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.VOTESTREAK.setType(type).setAmount(votes));
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    new RewardBuilder(plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getVoteStreakRewardsPath(type, string)).setOnline(online).withPlaceHolder("Type", type).setServer(forceBungee).withPlaceHolder("Streak", "" + votes).send(user);
}
Also used : RewardBuilder(com.bencodez.advancedcore.api.rewards.RewardBuilder) PlayerSpecialRewardEvent(com.bencodez.votingplugin.events.PlayerSpecialRewardEvent)

Example 5 with PlayerSpecialRewardEvent

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

the class SpecialRewards method giveCumulativeVoteReward.

public void giveCumulativeVoteReward(VotingPluginUser user, boolean online, int cumulative, boolean forceBungee) {
    PlayerSpecialRewardEvent event = new PlayerSpecialRewardEvent(user, SpecialRewardType.CUMMULATIVE.setAmount(cumulative));
    Bukkit.getPluginManager().callEvent(event);
    if (event.isCancelled()) {
        return;
    }
    new RewardBuilder(plugin.getSpecialRewardsConfig().getData(), plugin.getSpecialRewardsConfig().getCumulativeRewardsPath(cumulative)).setServer(forceBungee).setOnline(online).withPlaceHolder("Cumulative", "" + cumulative).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