Check to make sure Feature isn't present before adding it ()

(cherry picked from commit b1c29d8eb4)
(cherry picked from commit add2a486e4)
This commit is contained in:
Joseph T. McQuigg 2024-12-30 08:10:38 -05:00 committed by modmuss50
parent c24bd9945d
commit d527f9fdd9

View file

@ -289,7 +289,14 @@ public class BiomeModificationContextImpl implements BiomeModificationContext {
featureSteps.add(RegistryEntryList.of(Collections.emptyList()));
}
featureSteps.set(index, plus(featureSteps.get(index), getEntry(features, entry)));
RegistryEntry.Reference<PlacedFeature> feature = getEntry(features, entry);
// Don't add the feature if it's already present
if (featureSteps.get(index).contains(feature)) {
return;
}
featureSteps.set(index, plus(featureSteps.get(index), feature));
// Ensure the list of flower features is up-to-date
rebuildFeatures = true;