Features fixes
This commit is contained in:
parent
35d8c14d20
commit
89ddb7cf33
5 changed files with 22 additions and 8 deletions
|
@ -4,7 +4,7 @@ import ru.betterend.world.features.EndFeature;
|
||||||
import ru.betterend.world.features.StoneSpiralFeature;
|
import ru.betterend.world.features.StoneSpiralFeature;
|
||||||
|
|
||||||
public class FeatureRegistry {
|
public class FeatureRegistry {
|
||||||
public static final EndFeature STONE_SPIRAL = new EndFeature("stone_spiral", new StoneSpiralFeature());
|
public static final EndFeature STONE_SPIRAL = new EndFeature("stone_spiral", new StoneSpiralFeature(), 2);
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ public class BiomeFoggyMushroomland extends EndBiome {
|
||||||
public BiomeFoggyMushroomland() {
|
public BiomeFoggyMushroomland() {
|
||||||
super(new BiomeDefinition("foggy_mushroomland")
|
super(new BiomeDefinition("foggy_mushroomland")
|
||||||
.setFogColor(41, 122, 173)
|
.setFogColor(41, 122, 173)
|
||||||
.setFogDensity(5)
|
.setFogDensity(3)
|
||||||
.addFeature(FeatureRegistry.STONE_SPIRAL));
|
.addFeature(FeatureRegistry.STONE_SPIRAL));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
package ru.betterend.world.features;
|
||||||
|
|
||||||
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
|
|
||||||
|
public abstract class DefaultFeature extends Feature<DefaultFeatureConfig> {
|
||||||
|
public DefaultFeature() {
|
||||||
|
super(DefaultFeatureConfig.CODEC);
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ import net.minecraft.world.gen.decorator.ChanceDecoratorConfig;
|
||||||
import net.minecraft.world.gen.decorator.ConfiguredDecorator;
|
import net.minecraft.world.gen.decorator.ConfiguredDecorator;
|
||||||
import net.minecraft.world.gen.decorator.Decorator;
|
import net.minecraft.world.gen.decorator.Decorator;
|
||||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||||
|
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
import net.minecraft.world.gen.feature.Feature;
|
||||||
import net.minecraft.world.gen.feature.FeatureConfig;
|
import net.minecraft.world.gen.feature.FeatureConfig;
|
||||||
|
@ -32,6 +33,14 @@ public class EndFeature {
|
||||||
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(Decorator.CHANCE.configure(new ChanceDecoratorConfig(100))));
|
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(Decorator.CHANCE.configure(new ChanceDecoratorConfig(100))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EndFeature(String name, Feature<DefaultFeatureConfig> feature, int density) {
|
||||||
|
Identifier id = new Identifier(BetterEnd.MOD_ID, name);
|
||||||
|
this.featureStep = GenerationStep.Feature.VEGETAL_DECORATION;
|
||||||
|
this.feature = Registry.register(Registry.FEATURE, id, feature);
|
||||||
|
this.featureConfigured = Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(density));
|
||||||
|
//return new EndFeature(name, feature, GenerationStep.Feature.VEGETAL_DECORATION, feature.configure(FeatureConfig.DEFAULT).decorate(ConfiguredFeatures.Decorators.SQUARE_HEIGHTMAP).repeatRandomly(4));
|
||||||
|
}
|
||||||
|
|
||||||
public Feature<DefaultFeatureConfig> getFeature() {
|
public Feature<DefaultFeatureConfig> getFeature() {
|
||||||
return feature;
|
return feature;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,8 @@ import net.minecraft.world.Heightmap.Type;
|
||||||
import net.minecraft.world.StructureWorldAccess;
|
import net.minecraft.world.StructureWorldAccess;
|
||||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
import net.minecraft.world.gen.feature.Feature;
|
|
||||||
|
|
||||||
public class StoneSpiralFeature extends Feature<DefaultFeatureConfig> {
|
|
||||||
public StoneSpiralFeature() {
|
|
||||||
super(DefaultFeatureConfig.CODEC);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class StoneSpiralFeature extends DefaultFeature {
|
||||||
@Override
|
@Override
|
||||||
public boolean generate(StructureWorldAccess world, ChunkGenerator generator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
public boolean generate(StructureWorldAccess world, ChunkGenerator generator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||||
BlockPos topPos = world.getTopPosition(Type.WORLD_SURFACE, pos);
|
BlockPos topPos = world.getTopPosition(Type.WORLD_SURFACE, pos);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue