Fixed duplicate feature registration
This commit is contained in:
parent
6abf34d8bc
commit
544af449ee
2 changed files with 12 additions and 10 deletions
|
@ -60,9 +60,10 @@ public abstract class ModIntegration {
|
|||
}
|
||||
|
||||
public BCLFeature getFeature(String featureID, String placedFeatureID, GenerationStep.Decoration featureStep) {
|
||||
Feature<?> feature = Registry.FEATURE.get(getID(featureID));
|
||||
ResourceLocation id = getID(featureID);
|
||||
Feature<?> feature = Registry.FEATURE.get(id);
|
||||
PlacedFeature featureConfigured = BuiltinRegistries.PLACED_FEATURE.get(getID(placedFeatureID));
|
||||
return new BCLFeature(feature, featureConfigured, featureStep);
|
||||
return new BCLFeature(id, feature, featureStep, featureConfigured);
|
||||
}
|
||||
|
||||
public BCLFeature getFeature(String name, GenerationStep.Decoration featureStep) {
|
||||
|
|
|
@ -19,16 +19,17 @@ public class BCLFeature {
|
|||
private Decoration featureStep;
|
||||
private Feature<?> feature;
|
||||
|
||||
public BCLFeature(Feature<?> feature, PlacedFeature placedFeature, Decoration featureStep) {
|
||||
this.placedFeature = placedFeature;
|
||||
this.featureStep = featureStep;
|
||||
this.feature = feature;
|
||||
}
|
||||
|
||||
public BCLFeature(ResourceLocation id, Feature<?> feature, Decoration featureStep, PlacedFeature placedFeature) {
|
||||
this.placedFeature = Registry.register(BuiltinRegistries.PLACED_FEATURE, id, placedFeature);
|
||||
this.feature = Registry.register(Registry.FEATURE, id, feature);
|
||||
this.placedFeature = placedFeature;
|
||||
this.feature = feature;
|
||||
this.featureStep = featureStep;
|
||||
|
||||
if (!BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
|
||||
Registry.register(BuiltinRegistries.PLACED_FEATURE, id, placedFeature);
|
||||
}
|
||||
if (!Registry.FEATURE.containsKey(id)) {
|
||||
Registry.register(Registry.FEATURE, id, feature);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue