use of com.winthier.skills.Reward in project Skills by StarTux.
the class BukkitSkillSacrifice method onItemSacrificed.
void onItemSacrificed(Item item) {
if (!item.isValid())
return;
UUID uuid = dropped.remove(item.getUniqueId());
if (uuid == null)
return;
Player player = getPlugin().getServer().getPlayer(uuid);
if (player == null)
return;
if (!allowPlayer(player))
return;
List<Reward> rewards = rewardsForItem(item.getItemStack());
if (rewards.isEmpty())
return;
double factor = (double) item.getItemStack().getAmount();
item.remove();
for (Reward reward : rewards) giveReward(player, reward, factor);
}
use of com.winthier.skills.Reward in project Skills by StarTux.
the class BukkitSkillSacrifice method fullRewardForItem.
/**
* Utility function for the checkitem command. Do not use for
* actual rewarding!
*/
public Reward fullRewardForItem(ItemStack item) {
float skillPoints = 0;
float money = 0;
float exp = 0;
for (Reward reward : rewardsForItem(item)) {
skillPoints += reward.getSkillPoints();
money += reward.getMoney();
exp += reward.getExp();
}
return new CustomReward(skillPoints, money, exp);
}
Aggregations