Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3dfc1b71af | ||
|
|
f26b7d0f0d |
@@ -79,7 +79,7 @@ Administrative commands require `treefeller.admin`, granted to server operators
|
|||||||
- Crimson and warped fungi
|
- Crimson and warped fungi
|
||||||
- Giant red and brown mushrooms
|
- Giant red and brown mushrooms
|
||||||
|
|
||||||
Azalea-grown logs count as oak. Bamboo is not treated as a tree.
|
Azalea-grown logs count as oak. Unlock progress counts unstripped natural log and Nether stem materials even after the surrounding tree has been disrupted; wood, hyphae, stripped variants, and bamboo do not count. Player-placed qualifying materials are indistinguishable from generated materials in Spigot and therefore also count. Giant mushroom stems require enough cap context to identify their species.
|
||||||
|
|
||||||
## Configuration and state
|
## Configuration and state
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ Player preferences, administrative locks, progress, unlocks, and known names are
|
|||||||
|
|
||||||
Tree detection searches matching natural trunk blocks laterally and upward, never below the initiating chop, and requires corresponding foliage or caps. Search bounds prevent unbounded traversal. Leaves, caps, roots, vines, and decorations are not automatically broken.
|
Tree detection searches matching natural trunk blocks laterally and upward, never below the initiating chop, and requires corresponding foliage or caps. Search bounds prevent unbounded traversal. Leaves, caps, roots, vines, and decorations are not automatically broken.
|
||||||
|
|
||||||
Additional trunk blocks use Spigot's `Player.breakBlock` path so block-break cancellation, drops, experience, enchantments, and axe durability remain authoritative. Protection plugins should cancel `BlockBreakEvent` normally. A cancelled additional break stops the remaining felling.
|
Automatic felling supports Spigot 26.2 wooden, stone, copper, iron, golden, diamond, and netherite axes. Additional trunk blocks use Spigot's `Player.breakBlock` path so block-break cancellation, drops, experience, enchantments, and axe durability remain authoritative. Protection plugins should cancel `BlockBreakEvent` normally. A cancelled additional break stops the remaining felling.
|
||||||
|
|
||||||
## Releases
|
## Releases
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
|
|
||||||
## 2026-08-11
|
## 2026-08-11
|
||||||
|
|
||||||
|
### US-003 copper axe support corrected
|
||||||
|
|
||||||
|
- Reproduced copper axes failing automatic-felling eligibility because the explicit Spigot 26.2 axe-material set omitted `COPPER_AXE`.
|
||||||
|
- Added copper axes alongside wooden, stone, iron, golden, diamond, and netherite axes without broadening eligibility to pickaxes or other tools.
|
||||||
|
- Verified copper-axe classification, end-to-end felling activation, non-axe rejection, and the complete build with `./gradlew clean check jar`.
|
||||||
|
|
||||||
|
### US-001 disrupted-tree progress corrected
|
||||||
|
|
||||||
|
- Reproduced remaining lower logs failing to count after an upper trunk block was removed because progression unnecessarily re-ran full intact-tree validation.
|
||||||
|
- Progress now classifies unstripped natural `*_LOG`, crimson stem, and warped stem materials directly, so each qualifying block counts even after the tree structure is disrupted.
|
||||||
|
- Wood, hyphae, stripped variants, and bamboo remain excluded; player-placed qualifying materials count because Spigot does not expose generation provenance.
|
||||||
|
- Giant mushroom stems retain cap-based validation because their shared stem material cannot distinguish red from brown, while automatic felling still requires a validated intact tree and an axe.
|
||||||
|
- Verified disrupted-tree progress, excluded processed materials, tool-independent progress, axe-only felling, and the complete build with `./gradlew clean check jar`.
|
||||||
|
|
||||||
### US-001 tool-independent progress corrected
|
### US-001 tool-independent progress corrected
|
||||||
|
|
||||||
- Reproduced the progression gap caused by sharing the automatic-felling axe restriction with manual unlock progress.
|
- Reproduced the progression gap caused by sharing the automatic-felling axe restriction with manual unlock progress.
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ As a **survival player**, I want to unlock Tree Feller by practicing with each t
|
|||||||
|
|
||||||
- [x] Progress is tracked independently for oak, spruce, birch, jungle, acacia, dark oak, mangrove, cherry, pale oak, crimson fungi, warped fungi, giant red mushrooms, and giant brown mushrooms as represented by Spigot 26.2 materials.
|
- [x] Progress is tracked independently for oak, spruce, birch, jungle, acacia, dark oak, mangrove, cherry, pale oak, crimson fungi, warped fungi, giant red mushrooms, and giant brown mushrooms as represented by Spigot 26.2 materials.
|
||||||
- [x] Azalea-grown oak logs contribute to oak progress, and bamboo does not contribute to any tree species.
|
- [x] Azalea-grown oak logs contribute to oak progress, and bamboo does not contribute to any tree species.
|
||||||
- [x] A block contributes progress when a player manually breaks it in Survival mode from a structure that passes Tree Feller's tree validation, regardless of whether the player uses an axe, another tool, or an empty hand.
|
- [x] A manually broken unstripped natural trunk material with an unambiguous species contributes Survival progress even when the remaining structure no longer passes full tree validation.
|
||||||
|
- [x] Natural trunk materials include the supported `*_LOG`, `CRIMSON_STEM`, and `WARPED_STEM` blocks; wood, hyphae, stripped variants, and bamboo do not contribute.
|
||||||
|
- [x] Giant mushroom stems contribute only when surrounding cap context allows Tree Feller to distinguish red from brown.
|
||||||
|
- [x] Player-placed blocks using an otherwise qualifying natural trunk material contribute because Spigot does not expose reliable generation provenance.
|
||||||
|
- [x] A qualifying block contributes regardless of whether the player uses an axe, another tool, or an empty hand.
|
||||||
- [x] Creative-mode breaks, cancelled breaks, and blocks removed by automatic felling do not contribute progress.
|
- [x] Creative-mode breaks, cancelled breaks, and blocks removed by automatic felling do not contribute progress.
|
||||||
- [x] Each qualifying manually mined block contributes exactly one point to its species.
|
- [x] Each qualifying manually mined block contributes exactly one point to its species.
|
||||||
- [x] Each species has an independently configurable unlock threshold that defaults to 100 blocks.
|
- [x] Each species has an independently configurable unlock threshold that defaults to 100 blocks.
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ As a **player with an unlocked species**, I want its trees to break progressivel
|
|||||||
|
|
||||||
## Acceptance criteria
|
## Acceptance criteria
|
||||||
|
|
||||||
- [x] Automatic felling is considered only for a non-cancelled Survival-mode block break made with an axe against a species the player has unlocked.
|
- [x] Automatic felling is considered only for a non-cancelled Survival-mode block break made with a supported wooden, stone, copper, iron, golden, diamond, or netherite axe against a species the player has unlocked.
|
||||||
- [x] Sneaking when the initiating block is broken always bypasses automatic felling and leaves the ordinary single-block break intact.
|
- [x] Sneaking when the initiating block is broken always bypasses automatic felling and leaves the ordinary single-block break intact.
|
||||||
- [x] A disabled or administratively locked player receives the ordinary single-block break without automatic felling.
|
- [x] A disabled or administratively locked player receives the ordinary single-block break without automatic felling.
|
||||||
- [x] Tree detection follows connected blocks of the initiating trunk family laterally and upward, including diagonal branches, but never follows trunk blocks below the initiating block.
|
- [x] Tree detection follows connected blocks of the initiating trunk family laterally and upward, including diagonal branches, but never follows trunk blocks below the initiating block.
|
||||||
|
|||||||
@@ -43,12 +43,16 @@ public final class TreeProgressListener implements Listener {
|
|||||||
|| automaticBreaks.isMarked(event.getBlock())) {
|
|| automaticBreaks.isMarked(event.getBlock())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Optional<TreeStructure> detected = detector.detect(event.getBlock());
|
Optional<TreeSpecies> classified = TreeTaxonomy.directSpecies(event.getBlock().getType());
|
||||||
if (detected.isEmpty()) {
|
if (classified.isEmpty()
|
||||||
|
&& event.getBlock().getType() == org.bukkit.Material.MUSHROOM_STEM) {
|
||||||
|
classified = detector.detect(event.getBlock()).map(TreeStructure::species);
|
||||||
|
}
|
||||||
|
if (classified.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
TreeSpecies species = detected.orElseThrow().species();
|
TreeSpecies species = classified.orElseThrow();
|
||||||
PlayerTreeFellerState state = states.load(player.getUniqueId())
|
PlayerTreeFellerState state = states.load(player.getUniqueId())
|
||||||
.orElseGet(() -> PlayerTreeFellerState.initial(
|
.orElseGet(() -> PlayerTreeFellerState.initial(
|
||||||
player.getUniqueId(), player.getName()));
|
player.getUniqueId(), player.getName()));
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ public final class TreeTools {
|
|||||||
private static final Set<Material> AXES = EnumSet.of(
|
private static final Set<Material> AXES = EnumSet.of(
|
||||||
Material.WOODEN_AXE,
|
Material.WOODEN_AXE,
|
||||||
Material.STONE_AXE,
|
Material.STONE_AXE,
|
||||||
|
Material.COPPER_AXE,
|
||||||
Material.IRON_AXE,
|
Material.IRON_AXE,
|
||||||
Material.GOLDEN_AXE,
|
Material.GOLDEN_AXE,
|
||||||
Material.DIAMOND_AXE,
|
Material.DIAMOND_AXE,
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class TreeFellingListenerTest {
|
|||||||
when(player.getName()).thenReturn("Player");
|
when(player.getName()).thenReturn("Player");
|
||||||
when(player.getGameMode()).thenReturn(GameMode.SURVIVAL);
|
when(player.getGameMode()).thenReturn(GameMode.SURVIVAL);
|
||||||
when(player.getInventory()).thenReturn(inventory);
|
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(
|
TreeStructure tree = new TreeStructure(
|
||||||
TreeSpecies.OAK, List.of(new BlockPoint(0, 0, 0), new BlockPoint(0, 1, 0)));
|
TreeSpecies.OAK, List.of(new BlockPoint(0, 0, 0), new BlockPoint(0, 1, 0)));
|
||||||
PlayerTreeFellerState eligible = PlayerTreeFellerState.initial(playerId, "Player")
|
PlayerTreeFellerState eligible = PlayerTreeFellerState.initial(playerId, "Player")
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test;
|
|||||||
|
|
||||||
class TreeProgressListenerTest {
|
class TreeProgressListenerTest {
|
||||||
@Test
|
@Test
|
||||||
void recordsManualSurvivalBreaksWithAnEmptyHandOrAnyToolFromValidatedTrees() throws Exception {
|
void recordsNaturalTrunkMaterialAfterTheTreeStructureIsNoLongerIntact() throws Exception {
|
||||||
UUID playerId = UUID.randomUUID();
|
UUID playerId = UUID.randomUUID();
|
||||||
Player player = mock(Player.class);
|
Player player = mock(Player.class);
|
||||||
PlayerInventory inventory = mock(PlayerInventory.class);
|
PlayerInventory inventory = mock(PlayerInventory.class);
|
||||||
@@ -31,15 +31,15 @@ class TreeProgressListenerTest {
|
|||||||
when(player.getInventory()).thenReturn(inventory);
|
when(player.getInventory()).thenReturn(inventory);
|
||||||
when(inventory.getItemInMainHand()).thenReturn(new ItemStack(Material.IRON_AXE));
|
when(inventory.getItemInMainHand()).thenReturn(new ItemStack(Material.IRON_AXE));
|
||||||
when(block.getWorld()).thenReturn(world);
|
when(block.getWorld()).thenReturn(world);
|
||||||
|
when(block.getType()).thenReturn(Material.OAK_LOG);
|
||||||
when(world.getUID()).thenReturn(UUID.randomUUID());
|
when(world.getUID()).thenReturn(UUID.randomUUID());
|
||||||
when(block.getX()).thenReturn(1);
|
when(block.getX()).thenReturn(1);
|
||||||
when(block.getY()).thenReturn(64);
|
when(block.getY()).thenReturn(64);
|
||||||
when(block.getZ()).thenReturn(2);
|
when(block.getZ()).thenReturn(2);
|
||||||
TreeStructure tree = new TreeStructure(TreeSpecies.OAK, List.of(new BlockPoint(0, 0, 0)));
|
|
||||||
InMemoryStateStore states = new InMemoryStateStore();
|
InMemoryStateStore states = new InMemoryStateStore();
|
||||||
AutomaticBreakRegistry automaticBreaks = new AutomaticBreakRegistry();
|
AutomaticBreakRegistry automaticBreaks = new AutomaticBreakRegistry();
|
||||||
TreeProgressListener listener = new TreeProgressListener(
|
TreeProgressListener listener = new TreeProgressListener(
|
||||||
ignored -> Optional.of(tree),
|
ignored -> Optional.empty(),
|
||||||
states,
|
states,
|
||||||
ignored -> 100,
|
ignored -> 100,
|
||||||
automaticBreaks,
|
automaticBreaks,
|
||||||
|
|||||||
@@ -26,5 +26,8 @@ class TreeTaxonomyTest {
|
|||||||
expected.forEach((material, species) ->
|
expected.forEach((material, species) ->
|
||||||
assertEquals(species, TreeTaxonomy.directSpecies(material).orElseThrow()));
|
assertEquals(species, TreeTaxonomy.directSpecies(material).orElseThrow()));
|
||||||
assertTrue(TreeTaxonomy.directSpecies(Material.BAMBOO).isEmpty());
|
assertTrue(TreeTaxonomy.directSpecies(Material.BAMBOO).isEmpty());
|
||||||
|
assertTrue(TreeTaxonomy.directSpecies(Material.OAK_WOOD).isEmpty());
|
||||||
|
assertTrue(TreeTaxonomy.directSpecies(Material.STRIPPED_OAK_LOG).isEmpty());
|
||||||
|
assertTrue(TreeTaxonomy.directSpecies(Material.CRIMSON_HYPHAE).isEmpty());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ class TreeToolsTest {
|
|||||||
void acceptsAxesButNotPickaxesOrOtherItems() {
|
void acceptsAxesButNotPickaxesOrOtherItems() {
|
||||||
assertTrue(TreeTools.isAxe(Material.WOODEN_AXE));
|
assertTrue(TreeTools.isAxe(Material.WOODEN_AXE));
|
||||||
assertTrue(TreeTools.isAxe(Material.GOLDEN_AXE));
|
assertTrue(TreeTools.isAxe(Material.GOLDEN_AXE));
|
||||||
|
assertTrue(TreeTools.isAxe(Material.COPPER_AXE));
|
||||||
assertTrue(TreeTools.isAxe(Material.NETHERITE_AXE));
|
assertTrue(TreeTools.isAxe(Material.NETHERITE_AXE));
|
||||||
assertFalse(TreeTools.isAxe(Material.DIAMOND_PICKAXE));
|
assertFalse(TreeTools.isAxe(Material.DIAMOND_PICKAXE));
|
||||||
assertFalse(TreeTools.isAxe(Material.AIR));
|
assertFalse(TreeTools.isAxe(Material.AIR));
|
||||||
|
|||||||
Reference in New Issue
Block a user