| 1 | package sh.okx.rankup.requirements.requirement; | |
| 2 | ||
| 3 | import org.bukkit.entity.Player; | |
| 4 | import sh.okx.rankup.RankupPlugin; | |
| 5 | import sh.okx.rankup.economy.Economy; | |
| 6 | import sh.okx.rankup.requirements.DeductibleRequirement; | |
| 7 | import sh.okx.rankup.requirements.Requirement; | |
| 8 | ||
| 9 | public class MoneyDeductibleRequirement extends MoneyRequirement implements DeductibleRequirement { | |
| 10 | ||
| 11 | public MoneyDeductibleRequirement(RankupPlugin plugin, String name) { | |
| 12 | super(plugin, name); | |
| 13 | } | |
| 14 | ||
| 15 | protected MoneyDeductibleRequirement(MoneyDeductibleRequirement clone) { | |
| 16 | super(clone); | |
| 17 | } | |
| 18 | ||
| 19 | @Override | |
| 20 | public void apply(Player player, double multiplier) { | |
| 21 | Economy economy = plugin.getEconomy(); | |
| 22 |
2
1. apply : Replaced double multiplication with division → SURVIVED 2. apply : removed call to sh/okx/rankup/economy/Economy::withdrawPlayer → KILLED |
economy.withdrawPlayer(player, getValueDouble() * multiplier); |
| 23 | } | |
| 24 | ||
| 25 | @Override | |
| 26 | public Requirement clone() { | |
| 27 |
1
1. clone : replaced return value with null for sh/okx/rankup/requirements/requirement/MoneyDeductibleRequirement::clone → KILLED |
return new MoneyDeductibleRequirement(this); |
| 28 | } | |
| 29 | } | |
Mutations | ||
| 22 |
1.1 2.2 |
|
| 27 |
1.1 |