1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Maybe fixed the unit tests?

This commit is contained in:
TheBusyBiscuit 2020-10-04 11:22:56 +02:00
parent 4df4f6d4c9
commit 2ff105dabe
2 changed files with 9 additions and 1 deletions

View File

@ -139,7 +139,7 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
double speed = getClimbingSpeed(type);
int efficiencyLevel = item.getEnchantmentLevel(Enchantment.DIG_SPEED);
if (efficiencyLevel > 0) {
if (speed > 0 && efficiencyLevel > 0) {
speed += efficiencyLevel * EFFICIENCY_MODIFIER;
}

View File

@ -55,6 +55,14 @@ class TestClimbingPick implements SlimefunItemTest<ClimbingPick> {
@Override
public ClimbingPick registerSlimefunItem(SlimefunPlugin plugin, String id) {
try {
SlimefunTag.CLIMBING_PICK_WEAK_SURFACES.reload();
SlimefunTag.CLIMBING_PICK_STRONG_SURFACES.reload();
}
catch (TagMisconfigurationException e) {
Assertions.fail(e);
}
SlimefunItemStack item = new SlimefunItemStack(id, Material.IRON_PICKAXE, "&5Test Pick");
ClimbingPick pick = new ClimbingPick(TestUtilities.getCategory(plugin, "climbing_pick"), item, RecipeType.NULL, new ItemStack[9]) {