| 1 | package sh.okx.rankup.requirements.requirement; | |
| 2 | ||
| 3 | import org.bukkit.Material; | |
| 4 | import org.bukkit.Statistic; | |
| 5 | import org.bukkit.entity.Player; | |
| 6 | import sh.okx.rankup.RankupPlugin; | |
| 7 | import sh.okx.rankup.requirements.ProgressiveRequirement; | |
| 8 | import sh.okx.rankup.requirements.Requirement; | |
| 9 | ||
| 10 | public class BlockBreakRequirement extends ProgressiveRequirement { | |
| 11 | public BlockBreakRequirement(RankupPlugin plugin) { | |
| 12 | super(plugin, "block-break", true); | |
| 13 | } | |
| 14 | ||
| 15 | protected BlockBreakRequirement(BlockBreakRequirement clone) { | |
| 16 | super(clone); | |
| 17 | } | |
| 18 | ||
| 19 | @Override | |
| 20 | public double getProgress(Player player) { | |
| 21 | Material material = Material.matchMaterial(getSub()); | |
| 22 |
2
1. getProgress : negated conditional → NO_COVERAGE 2. getProgress : negated conditional → NO_COVERAGE |
if (material == null || !material.isBlock()) { |
| 23 | throw new IllegalArgumentException("'" + getSub() + "' is not a valid block"); | |
| 24 | } | |
| 25 |
1
1. getProgress : replaced double return with 0.0d for sh/okx/rankup/requirements/requirement/BlockBreakRequirement::getProgress → NO_COVERAGE |
return player.getStatistic(Statistic.MINE_BLOCK, material); |
| 26 | } | |
| 27 | ||
| 28 | @Override | |
| 29 | public Requirement clone() { | |
| 30 |
1
1. clone : replaced return value with null for sh/okx/rankup/requirements/requirement/BlockBreakRequirement::clone → NO_COVERAGE |
return new BlockBreakRequirement(this); |
| 31 | } | |
| 32 | } | |
Mutations | ||
| 22 |
1.1 2.2 |
|
| 25 |
1.1 |
|
| 30 |
1.1 |