mojira.dev
MC-261387

Redundant block_predicate_filter check in mangrove tree placement

Mangrove tree placement runs two block_predicate_filter checks for each placement, which is redundant as if the first one passes the second one will be guaranteed to pass.

The Mangrove Swamp biome references the trees_mangrove placed feature, which does the usual stuff with tree placement (increase count, randomize placement in chunk, adjust to heightmap, check for biome), but it also runs a block_predicate_filter to check that a Mangrove Propagule can survive at the given location. This placed feature then references the mangrove_vegetation configured feature, which chooses to either place the mangrove_checked or tall_mangrove_checked placed feature. Both of these placed features run their own block_predicate_filter to check that a Mangrove Propagule can survive at that location for no reason.

Attached are the JSON files for all of the referenced configured and placed features, taken directly from 1.19.4's jar file.

Attachments

Comments 1

Can confirm. The issue is in the mangrove_trees placed feature, or VegetationPlacements#bootstrap (at the very bottom of the method). All other tree vegetations end with BiomeFilter.biome(), but this placed feature has the additional (and thus duplicate) BlockPredicateFilter.forPredicate(...) placement modifier.

Apollo

slicedlime

Confirmed

Platform

Low

Performance, World generation

1.19.4, 23w12a, 1.20.1, 23w32a, 1.20.4, 24w03b

Future Update

Retrieved