fix: attach glow lichen, vines and other multiface plants to a block - #556
Merged
Conversation
Multiface plants were placed with setType, which gives them their default block data - a state with no face set at all. The client draws that state on all six sides, so it looked like a lichen cube, but the server treats it as unsupported: the first block update deletes it, and bone meal has no face to spread from. Confirmed on Paper 26.2 - a faceless lichen is removed by the next neighbour update while glow_lichen[down=true] on moss survives. Not one glow lichen block has ever persisted in a OneBlock world. Now the plant is attached to whichever neighbours of the magic block have a full solid face, so it survives, shears drop it and bone meal spreads it. If the magic block is floating with nothing to cling to - where bone meal would have nowhere to spread anyway - it becomes the plant's support block and the plant grows on the first free side of it: lichen lies on the top face, vines go on a side since they cannot hang off an underside. Covers GLOW_LICHEN (Lush Caves) and VINE (Mangrove Swamp), plus SCULK_VEIN and RESIN_CLUMP for custom phases. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ijeqd5GdQNHbJQh6MwQyP
|
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.



The bug
Glow lichen in the Lush Caves phase cannot be obtained or used: it is deleted the moment anything updates next to it, and bone meal will not spread it.
spawnBlockplaces it withblock.setType(Material.GLOW_LICHEN, false), which gives the block its default block data — and glow lichen's default state has every face false:That one fact explains all of the symptoms:
MultifaceBlock.canSurvivereturns false when no face is set, so placing a block next to it deletes it.VINEin the Mangrove Swamp phase (weight 80) has the identical default state and the identical bug.Corroboration: scanning every region file of every local AOneBlock test world turned up zero persisted glow lichen blocks.
Verified on a real Paper 26.2 server (console only, fresh world):
The fix
spawnMultifaceBlockhandlesGLOW_LICHEN,VINE,SCULK_VEINandRESIN_CLUMP:BlockData.isFaceSturdy(face, BlockSupport.FULL)) gets a face set on the plant. In normal play the magic block sits in the player's platform, so this is the usual case — the lichen is then a valid block that survives updates, drops to shears and spreads with bone meal.MOSS_BLOCKfor lichen and vines,SCULKfor sculk veins) and the plant grows on the first free side of it — lichen lies on the top face, vines go on a side since they cannot hang off an underside.If the material is not
MultipleFacingon the running server version, it is placed as before.Testing
BlockListenerTest2: attach-to-neighbours, lichen with no support, vine with no support.Not changed
blocks:pool into12000_lush_caves_chests.yml.CAVE_VINES_PLANT,MOSS_CARPETandSPORE_BLOSSOMalso cannot survive an update while floating, but they render and drop normally when mined, so they are a much smaller problem.🤖 Generated with Claude Code
https://claude.ai/code/session_016ijeqd5GdQNHbJQh6MwQyP