Meteorite Worldgen

This commit is contained in:
Sebastian Hartte
2020-06-21 13:38:13 +02:00
parent afe98cbe04
commit 6d76bb989c
26 changed files with 642 additions and 330 deletions
+10 -8
View File
@@ -202,7 +202,7 @@ import appeng.tile.AEBaseTile;
import appeng.tile.crafting.MolecularAssemblerRenderer;
import appeng.worldgen.ChargedQuartzOreConfig;
import appeng.worldgen.ChargedQuartzOreFeature;
import appeng.worldgen.MeteoriteWorldGen;
import appeng.worldgen.MeteoriteStructure;
final class Registration {
@@ -648,13 +648,14 @@ final class Registration {
}
ForgeRegistries.BIOMES.forEach(b -> {
b.addFeature(GenerationStage.Decoration.TOP_LAYER_MODIFICATION,
new ConfiguredFeature<NoFeatureConfig, Feature<NoFeatureConfig>>(MeteoriteWorldGen.INSTANCE,
IFeatureConfig.NO_FEATURE_CONFIG));
// b.addFeature(GenerationStage.Decoration.TOP_LAYER_MODIFICATION,
// new ConfiguredFeature<NoFeatureConfig, Feature<NoFeatureConfig>>(MeteoriteWorldGen.INSTANCE,
// IFeatureConfig.NO_FEATURE_CONFIG));
b.addFeature(GenerationStage.Decoration.UNDERGROUND_ORES,
new ConfiguredFeature<NoFeatureConfig, Feature<NoFeatureConfig>>(MeteoriteWorldGen.INSTANCE,
IFeatureConfig.NO_FEATURE_CONFIG));
b.addStructure(MeteoriteStructure.INSTANCE.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG));
b.addFeature(GenerationStage.Decoration.TOP_LAYER_MODIFICATION,
MeteoriteStructure.INSTANCE.withConfiguration(IFeatureConfig.NO_FEATURE_CONFIG)
.withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG)));
if (AEConfig.instance().isFeatureEnabled(AEFeature.CERTUS_QUARTZ_WORLD_GEN)) {
BlockState quartzOre = AEApi.instance().definitions().blocks().quartzOre().block().getDefaultState();
@@ -683,7 +684,8 @@ final class Registration {
public void registerWorldGen(RegistryEvent.Register<Feature<?>> evt) {
IForgeRegistry<Feature<?>> r = evt.getRegistry();
r.register(MeteoriteWorldGen.INSTANCE);
// r.register(MeteoriteWorldGen.INSTANCE);
r.register(MeteoriteStructure.INSTANCE);
r.register(ChargedQuartzOreFeature.INSTANCE);
}
@@ -21,6 +21,7 @@ package appeng.core.features.registries;
import java.util.HashSet;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.IWorld;
import net.minecraft.world.World;
import net.minecraft.world.dimension.Dimension;
@@ -72,7 +73,7 @@ public final class WorldGenRegistry implements IWorldGen {
}
@Override
public boolean isWorldGenEnabled(final WorldGenType type, final World w) {
public boolean isWorldGenEnabled(final WorldGenType type, final IWorld w) {
if (type == null) {
throw new IllegalArgumentException("Bad Type Passed");
}
@@ -81,8 +82,8 @@ public final class WorldGenRegistry implements IWorldGen {
throw new IllegalArgumentException("Bad Provider Passed");
}
ResourceLocation id = w.dimension.getDimension().getType().getRegistryName();
final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains(w.dimension.getClass());
ResourceLocation id = w.getDimension().getType().getRegistryName();
final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains(w.getDimension().getClass());
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id);
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id);