fix(felling): support copper axes
Release / release (push) Successful in 2m17s
CI / build (push) Successful in 1m1s

This commit is contained in:
dmg
2026-08-11 19:54:07 -04:00
parent f26b7d0f0d
commit 3dfc1b71af
6 changed files with 11 additions and 3 deletions
@@ -9,6 +9,7 @@ public final class TreeTools {
private static final Set<Material> AXES = EnumSet.of(
Material.WOODEN_AXE,
Material.STONE_AXE,
Material.COPPER_AXE,
Material.IRON_AXE,
Material.GOLDEN_AXE,
Material.DIAMOND_AXE,
@@ -35,7 +35,7 @@ class TreeFellingListenerTest {
when(player.getName()).thenReturn("Player");
when(player.getGameMode()).thenReturn(GameMode.SURVIVAL);
when(player.getInventory()).thenReturn(inventory);
when(inventory.getItemInMainHand()).thenReturn(new ItemStack(Material.IRON_AXE));
when(inventory.getItemInMainHand()).thenReturn(new ItemStack(Material.COPPER_AXE));
TreeStructure tree = new TreeStructure(
TreeSpecies.OAK, List.of(new BlockPoint(0, 0, 0), new BlockPoint(0, 1, 0)));
PlayerTreeFellerState eligible = PlayerTreeFellerState.initial(playerId, "Player")
@@ -11,6 +11,7 @@ class TreeToolsTest {
void acceptsAxesButNotPickaxesOrOtherItems() {
assertTrue(TreeTools.isAxe(Material.WOODEN_AXE));
assertTrue(TreeTools.isAxe(Material.GOLDEN_AXE));
assertTrue(TreeTools.isAxe(Material.COPPER_AXE));
assertTrue(TreeTools.isAxe(Material.NETHERITE_AXE));
assertFalse(TreeTools.isAxe(Material.DIAMOND_PICKAXE));
assertFalse(TreeTools.isAxe(Material.AIR));