Fix OFFLINE_GROWTH: block vine spread and tree growth from saplings#2968
Draft
Fix OFFLINE_GROWTH: block vine spread and tree growth from saplings#2968
Conversation
Open
…tructureGrowEvent - Remove the restrictive material filter from onSpread (was KELP/BAMBOO/BAMBOO_SAPLING only) so vines, cave vines, twisting vines, weeping vines, and all other spreading plants are now blocked when island members are offline - Use e.getSource().getLocation() for the island check in onSpread (source = the plant causing the spread, always on the island) - Add onStructureGrow(StructureGrowEvent) handler so trees and mushrooms that grow from saplings (birch, spruce, acacia, mangrove, etc.) are blocked when offline - Extract repeated island-member check into private checkGrowth() helper - Update testOnSpreadMembersOfflineTree: all spread is now blocked (no material filter) - Add 6 new tests covering the StructureGrowEvent handler (doNothing, membersOnline, membersOffline, nonIsland, nonBentoBoxWorld, boneMealMembersOffline) Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/31b42c78-d289-4a32-bded-77f467a43797 Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
…dback) Agent-Logs-Url: https://github.com/BentoBoxWorld/BentoBox/sessions/31b42c78-d289-4a32-bded-77f467a43797 Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix offline growth behavior for all plant types
Fix OFFLINE_GROWTH: block vine spread and tree growth from saplings
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OFFLINE_GROWTH=offcorrectly blocked crops but left vines (and other spreading plants) and all tree types growing freely. Two root causes:onSpread(BlockSpreadEvent)had a hard-coded material allowlist (KELP,BAMBOO,BAMBOO_SAPLING) — everything else (vines, cave vines, twisting/weeping vines, glow lichen, …) passed through unchecked.StructureGrowEvent, notBlockGrowEvent— no handler existed for it at all.Changes
OfflineGrowthListeneronSpreadentirely; allBlockSpreadEvents on protected islands are now checked. Switch island lookup toe.getSource().getLocation()(the existing plant, always on the island) instead of the destination block which may be outside the protection zone.onStructureGrow(StructureGrowEvent)handler — covers all tree and mushroom growth from saplings (oak, birch, spruce, jungle, acacia, dark oak, mangrove, …).checkGrowth(Location, Cancellable)helper shared by all three handlers.OfflineGrowthListenerTesttestOnSpreadMembersOfflineAnyMaterial(formerly…Tree): now usesMaterial.VINEand asserts the spread is blocked.onStructureGrow: flag allowed, member online, member offline, non-island, non-BentoBox world, and bone-meal-triggered growth.