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

Maybe now? 👀

This commit is contained in:
TheBusyBiscuit 2020-10-04 12:16:32 +02:00
parent ceadd2147f
commit c8d2bea162
2 changed files with 2 additions and 4 deletions

View File

@ -124,7 +124,6 @@ public class ClimbingPick extends SimpleSlimefunItem<ItemUseHandler> implements
ClimbableSurface surface = surfaces.get(type);
if (surface != null) {
System.out.println(surface.getValue());
return surface.getValue();
}
else {

View File

@ -64,7 +64,6 @@ class TestClimbingPick implements SlimefunItemTest<ClimbingPick> {
}
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]) {
@Override
@ -75,6 +74,7 @@ class TestClimbingPick implements SlimefunItemTest<ClimbingPick> {
};
pick.register(plugin);
Assertions.assertFalse(pick.getClimbableSurfaces().isEmpty());
return pick;
}
@ -124,7 +124,6 @@ class TestClimbingPick implements SlimefunItemTest<ClimbingPick> {
@DisplayName("Test Climbing Pick on various Block Faces")
@EnumSource(value = BlockFace.class, names = { "UP", "DOWN", "NORTH", "EAST", "SOUTH", "WEST" })
void testItemUse(BlockFace face) {
server.getPluginManager().clearEvents();
PlayerMock player = server.addPlayer();
ClimbingPick pick = registerSlimefunItem(plugin, "TEST_CLIMBING_PICK_" + face.name());
Location blockLocation = new Location(player.getLocation().getWorld(), player.getLocation().getBlockX() + 1, player.getLocation().getBlockY(), player.getLocation().getBlockZ());
@ -137,7 +136,7 @@ class TestClimbingPick implements SlimefunItemTest<ClimbingPick> {
if (shouldFireEvent) {
Assertions.assertTrue(pick.getClimbingSpeed(block.getType()) > 0);
Assertions.assertTrue(player.getVelocity().length() > 0);
server.getPluginManager().assertEventFired(ClimbingPickLaunchEvent.class);
server.getPluginManager().assertEventFired(ClimbingPickLaunchEvent.class, e -> e.getPlayer() == player && e.getPick() == pick);
}
else {
Assertions.assertEquals(0, player.getVelocity().length());