| 1 | package sh.okx.rankup.requirements; | |
| 2 | ||
| 3 | import org.bukkit.entity.Player; | |
| 4 | import sh.okx.rankup.RankupPlugin; | |
| 5 | ||
| 6 | public abstract class ProgressiveRequirement extends Requirement { | |
| 7 | public ProgressiveRequirement(RankupPlugin plugin, String name) { | |
| 8 | super(plugin, name); | |
| 9 | } | |
| 10 | ||
| 11 | public ProgressiveRequirement(RankupPlugin plugin, String name, boolean subRequirement) { | |
| 12 | super(plugin, name, subRequirement); | |
| 13 | } | |
| 14 | ||
| 15 | protected ProgressiveRequirement(Requirement clone) { | |
| 16 | super(clone); | |
| 17 | } | |
| 18 | ||
| 19 | @Override | |
| 20 | public boolean check(Player player) { | |
| 21 |
3
1. check : changed conditional boundary → KILLED 2. check : negated conditional → KILLED 3. check : replaced boolean return with true for sh/okx/rankup/requirements/ProgressiveRequirement::check → KILLED |
return getRemaining(player) <= 0; |
| 22 | } | |
| 23 | ||
| 24 | @Override | |
| 25 | public double getRemaining(Player player) { | |
| 26 |
2
1. getRemaining : Replaced double subtraction with addition → KILLED 2. getRemaining : replaced double return with 0.0d for sh/okx/rankup/requirements/ProgressiveRequirement::getRemaining → KILLED |
return Math.max(0, getTotal(player) - getProgress(player)); |
| 27 | } | |
| 28 | ||
| 29 | @Override | |
| 30 | public double getTotal(Player player) { | |
| 31 |
1
1. getTotal : replaced double return with 0.0d for sh/okx/rankup/requirements/ProgressiveRequirement::getTotal → KILLED |
return getValueDouble(); |
| 32 | } | |
| 33 | ||
| 34 | public abstract double getProgress(Player player); | |
| 35 | } | |
Mutations | ||
| 21 |
1.1 2.2 3.3 |
|
| 26 |
1.1 2.2 |
|
| 31 |
1.1 |