Skip to content

Commit

Permalink
Check to make sure Feature isn't present before adding it (#4323)
Browse files Browse the repository at this point in the history
(cherry picked from commit b1c29d8)
  • Loading branch information
JT122406 authored and modmuss50 committed Dec 30, 2024
1 parent cb44d14 commit add2a48
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,14 @@ public void addFeature(GenerationStep.Feature step, RegistryKey<PlacedFeature> e
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;
Expand Down

0 comments on commit add2a48

Please sign in to comment.