[Change] Migrated to new Feature API
This commit is contained in:
parent
0ec39fa2da
commit
031a14f278
16 changed files with 242 additions and 120 deletions
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.DragonTreeFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class DragonTreeSaplingBlock extends PottableFeatureSapling {
|
||||
public class DragonTreeSaplingBlock extends PottableFeatureSapling<DragonTreeFeature, NoneFeatureConfiguration> {
|
||||
public DragonTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.DRAGON_TREE);
|
||||
super((state) -> EndFeatures.DRAGON_TREE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.HelixTreeFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class HelixTreeSaplingBlock extends PottableFeatureSapling {
|
||||
public class HelixTreeSaplingBlock extends PottableFeatureSapling<HelixTreeFeature, NoneFeatureConfiguration> {
|
||||
public HelixTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.HELIX_TREE);
|
||||
super((state) -> EndFeatures.HELIX_TREE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.LacugroveFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class LacugroveSaplingBlock extends PottableFeatureSapling {
|
||||
public class LacugroveSaplingBlock extends PottableFeatureSapling<LacugroveFeature, NoneFeatureConfiguration> {
|
||||
public LacugroveSaplingBlock() {
|
||||
super((state) -> EndFeatures.LACUGROVE);
|
||||
super((state) -> EndFeatures.LACUGROVE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.LucerniaFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class LucerniaSaplingBlock extends PottableFeatureSapling {
|
||||
public class LucerniaSaplingBlock extends PottableFeatureSapling<LucerniaFeature, NoneFeatureConfiguration> {
|
||||
public LucerniaSaplingBlock() {
|
||||
super((state) -> EndFeatures.LUCERNIA);
|
||||
super((state) -> EndFeatures.LUCERNIA.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.MossyGlowshroomFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling {
|
||||
public class MossyGlowshroomSaplingBlock extends PottableFeatureSapling<MossyGlowshroomFeature, NoneFeatureConfiguration> {
|
||||
public MossyGlowshroomSaplingBlock() {
|
||||
super(7, (state) -> EndFeatures.MOSSY_GLOWSHROOM);
|
||||
super(7, (state) -> EndFeatures.MOSSY_GLOWSHROOM.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.PythadendronTreeFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class PythadendronSaplingBlock extends PottableFeatureSapling {
|
||||
public class PythadendronSaplingBlock extends PottableFeatureSapling<PythadendronTreeFeature, NoneFeatureConfiguration> {
|
||||
public PythadendronSaplingBlock() {
|
||||
super((state) -> EndFeatures.PYTHADENDRON_TREE);
|
||||
super((state) -> EndFeatures.PYTHADENDRON_TREE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,7 +33,7 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
BlockPos bigPos = growBig(world, pos);
|
||||
if (bigPos != null) {
|
||||
if (EndFeatures.GIGANTIC_AMARANITA.getFeature()
|
||||
.place(new FeaturePlaceContext<>(
|
||||
.place(new FeaturePlaceContext<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
|
@ -48,14 +48,15 @@ public class SmallAmaranitaBlock extends EndPlantBlock {
|
|||
}
|
||||
return;
|
||||
}
|
||||
EndFeatures.LARGE_AMARANITA.getFeature().place(new FeaturePlaceContext<>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
random,
|
||||
pos,
|
||||
null
|
||||
));
|
||||
EndFeatures.LARGE_AMARANITA.getFeature()
|
||||
.place(new FeaturePlaceContext<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
random,
|
||||
pos,
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,14 +105,15 @@ public class SmallJellyshroomBlock extends BaseAttachedBlock implements RenderLa
|
|||
@Override
|
||||
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
BlocksHelper.setWithUpdate(world, pos, Blocks.AIR);
|
||||
EndFeatures.JELLYSHROOM.getFeature().place(new FeaturePlaceContext<>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
random,
|
||||
pos,
|
||||
null
|
||||
));
|
||||
EndFeatures.JELLYSHROOM.getFeature()
|
||||
.place(new FeaturePlaceContext<net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
null,
|
||||
random,
|
||||
pos,
|
||||
null
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,17 @@ package org.betterx.betterend.blocks;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.TenaneaFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class TenaneaSaplingBlock extends PottableFeatureSapling {
|
||||
public class TenaneaSaplingBlock extends PottableFeatureSapling<TenaneaFeature, NoneFeatureConfiguration> {
|
||||
public TenaneaSaplingBlock() {
|
||||
super((state) -> EndFeatures.TENANEA);
|
||||
super((state) -> EndFeatures.TENANEA.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,15 +4,17 @@ import org.betterx.bclib.client.render.BCLRenderLayer;
|
|||
import org.betterx.betterend.blocks.basis.PottableFeatureSapling;
|
||||
import org.betterx.betterend.registry.EndBlocks;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.trees.UmbrellaTreeFeature;
|
||||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.LevelReader;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling {
|
||||
public class UmbrellaTreeSaplingBlock extends PottableFeatureSapling<UmbrellaTreeFeature, NoneFeatureConfiguration> {
|
||||
public UmbrellaTreeSaplingBlock() {
|
||||
super((state) -> EndFeatures.UMBRELLA_TREE);
|
||||
super((state) -> EndFeatures.UMBRELLA_TREE.configuredFeature);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
package org.betterx.betterend.blocks.basis;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.blocks.FeatureSaplingBlock;
|
||||
import org.betterx.betterend.interfaces.PottablePlant;
|
||||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||
|
||||
import java.util.function.Function;
|
||||
public abstract class PottableFeatureSapling<F extends Feature<FC>, FC extends FeatureConfiguration> extends FeatureSaplingBlock<F, FC> implements PottablePlant {
|
||||
|
||||
public abstract class PottableFeatureSapling extends FeatureSaplingBlock implements PottablePlant {
|
||||
public PottableFeatureSapling(Function<BlockState, BCLFeature> featureSupplier) {
|
||||
public PottableFeatureSapling(FeatureSupplier<F, FC> featureSupplier) {
|
||||
super(featureSupplier);
|
||||
}
|
||||
|
||||
public PottableFeatureSapling(int light, Function<BlockState, BCLFeature> featureSupplier) {
|
||||
public PottableFeatureSapling(int light, FeatureSupplier<F, FC> featureSupplier) {
|
||||
super(light, featureSupplier);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.betterx.betterend.integration.byg.features;
|
||||
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLCommonFeatures;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.integration.Integrations;
|
||||
import org.betterx.betterend.integration.byg.BYGBlocks;
|
||||
|
@ -10,6 +10,7 @@ import org.betterx.betterend.world.features.VineFeature;
|
|||
import org.betterx.betterend.world.features.WallPlantFeature;
|
||||
import org.betterx.betterend.world.features.WallPlantOnLogFeature;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
|
@ -61,6 +62,15 @@ public class BYGFeatures {
|
|||
}
|
||||
|
||||
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
|
||||
return BCLCommonFeatures.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
|
||||
ResourceLocation id = BetterEnd.makeID(name);
|
||||
return BCLFeatureBuilder
|
||||
.start(id, feature)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.countMax(density)
|
||||
.squarePlacement()
|
||||
.heightmap()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,10 +3,9 @@ package org.betterx.betterend.registry;
|
|||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiome;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLCommonFeatures;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeatureBuilder;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.features.DefaultFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
||||
import org.betterx.bclib.util.JsonFactory;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.complexmaterials.StoneMaterial;
|
||||
|
@ -29,11 +28,9 @@ import net.minecraft.world.level.block.Block;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep;
|
||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||
import net.minecraft.world.level.levelgen.VerticalAnchor;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.placement.CountPlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
|
@ -50,26 +47,54 @@ public class EndFeatures {
|
|||
new MossyGlowshroomFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature PYTHADENDRON_TREE = registerVegetation(
|
||||
public static final BCLFeature<PythadendronTreeFeature, NoneFeatureConfiguration> PYTHADENDRON_TREE = registerVegetation(
|
||||
"pythadendron_tree",
|
||||
new PythadendronTreeFeature(),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature LACUGROVE = registerVegetation("lacugrove", new LacugroveFeature(), 4);
|
||||
public static final BCLFeature DRAGON_TREE = registerVegetation("dragon_tree", new DragonTreeFeature(), 2);
|
||||
public static final BCLFeature TENANEA = registerVegetation("tenanea", new TenaneaFeature(), 2);
|
||||
public static final BCLFeature HELIX_TREE = registerVegetation("helix_tree", new HelixTreeFeature(), 1);
|
||||
public static final BCLFeature UMBRELLA_TREE = registerVegetation("umbrella_tree", new UmbrellaTreeFeature(), 2);
|
||||
public static final BCLFeature JELLYSHROOM = registerVegetation("jellyshroom", new JellyshroomFeature(), 2);
|
||||
public static final BCLFeature GIGANTIC_AMARANITA = registerVegetation(
|
||||
public static final BCLFeature<LacugroveFeature, NoneFeatureConfiguration> LACUGROVE = registerVegetation(
|
||||
"lacugrove",
|
||||
new LacugroveFeature(),
|
||||
4
|
||||
);
|
||||
public static final BCLFeature<DragonTreeFeature, NoneFeatureConfiguration> DRAGON_TREE = registerVegetation(
|
||||
"dragon_tree",
|
||||
new DragonTreeFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature<TenaneaFeature, NoneFeatureConfiguration> TENANEA = registerVegetation(
|
||||
"tenanea",
|
||||
new TenaneaFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature<HelixTreeFeature, NoneFeatureConfiguration> HELIX_TREE = registerVegetation(
|
||||
"helix_tree",
|
||||
new HelixTreeFeature(),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature<UmbrellaTreeFeature, NoneFeatureConfiguration> UMBRELLA_TREE = registerVegetation(
|
||||
"umbrella_tree",
|
||||
new UmbrellaTreeFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature<JellyshroomFeature, NoneFeatureConfiguration> JELLYSHROOM = registerVegetation(
|
||||
"jellyshroom",
|
||||
new JellyshroomFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature<GiganticAmaranitaFeature, NoneFeatureConfiguration> GIGANTIC_AMARANITA = registerVegetation(
|
||||
"gigantic_amaranita",
|
||||
new GiganticAmaranitaFeature(),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature LUCERNIA = registerVegetation("lucernia", new LucerniaFeature(), 3);
|
||||
public static final BCLFeature<LucerniaFeature, NoneFeatureConfiguration> LUCERNIA = registerVegetation(
|
||||
"lucernia",
|
||||
new LucerniaFeature(),
|
||||
3
|
||||
);
|
||||
|
||||
// Bushes //
|
||||
public static final BCLFeature PYTHADENDRON_BUSH = registerVegetation(
|
||||
public static final BCLFeature<BushFeature, NoneFeatureConfiguration> PYTHADENDRON_BUSH = registerVegetation(
|
||||
"pythadendron_bush",
|
||||
new BushFeature(
|
||||
EndBlocks.PYTHADENDRON_LEAVES,
|
||||
|
@ -77,7 +102,7 @@ public class EndFeatures {
|
|||
),
|
||||
3
|
||||
);
|
||||
public static final BCLFeature DRAGON_TREE_BUSH = registerVegetation(
|
||||
public static final BCLFeature<BushFeature, NoneFeatureConfiguration> DRAGON_TREE_BUSH = registerVegetation(
|
||||
"dragon_tree_bush",
|
||||
new BushFeature(
|
||||
EndBlocks.DRAGON_TREE_LEAVES,
|
||||
|
@ -85,14 +110,22 @@ public class EndFeatures {
|
|||
),
|
||||
5
|
||||
);
|
||||
public static final BCLFeature TENANEA_BUSH = registerVegetation("tenanea_bush", new TenaneaBushFeature(), 6);
|
||||
public static final BCLFeature LUMECORN = registerVegetation("lumecorn", new Lumecorn(), 5);
|
||||
public static final BCLFeature LARGE_AMARANITA = registerVegetation(
|
||||
public static final BCLFeature<TenaneaBushFeature, NoneFeatureConfiguration> TENANEA_BUSH = registerVegetation(
|
||||
"tenanea_bush",
|
||||
new TenaneaBushFeature(),
|
||||
6
|
||||
);
|
||||
public static final BCLFeature<Lumecorn, NoneFeatureConfiguration> LUMECORN = registerVegetation(
|
||||
"lumecorn",
|
||||
new Lumecorn(),
|
||||
5
|
||||
);
|
||||
public static final BCLFeature<LargeAmaranitaFeature, NoneFeatureConfiguration> LARGE_AMARANITA = registerVegetation(
|
||||
"large_amaranita",
|
||||
new LargeAmaranitaFeature(),
|
||||
5
|
||||
);
|
||||
public static final BCLFeature LUCERNIA_BUSH = registerVegetation(
|
||||
public static final BCLFeature<BushWithOuterFeature, NoneFeatureConfiguration> LUCERNIA_BUSH = registerVegetation(
|
||||
"lucernia_bush",
|
||||
new BushWithOuterFeature(
|
||||
EndBlocks.LUCERNIA_LEAVES,
|
||||
|
@ -101,7 +134,7 @@ public class EndFeatures {
|
|||
),
|
||||
10
|
||||
);
|
||||
public static final BCLFeature LUCERNIA_BUSH_RARE = registerVegetation(
|
||||
public static final BCLFeature<BushWithOuterFeature, NoneFeatureConfiguration> LUCERNIA_BUSH_RARE = registerVegetation(
|
||||
"lucernia_bush_rare",
|
||||
new BushWithOuterFeature(
|
||||
EndBlocks.LUCERNIA_LEAVES,
|
||||
|
@ -110,10 +143,14 @@ public class EndFeatures {
|
|||
),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature NEON_CACTUS = registerVegetation("neon_cactus", new NeonCactusFeature(), 2);
|
||||
public static final BCLFeature<NeonCactusFeature, NoneFeatureConfiguration> NEON_CACTUS = registerVegetation(
|
||||
"neon_cactus",
|
||||
new NeonCactusFeature(),
|
||||
2
|
||||
);
|
||||
|
||||
// Plants //
|
||||
public static final BCLFeature UMBRELLA_MOSS = registerVegetation(
|
||||
public static final BCLFeature<DoublePlantFeature, NoneFeatureConfiguration> UMBRELLA_MOSS = registerVegetation(
|
||||
"umbrella_moss",
|
||||
new DoublePlantFeature(
|
||||
EndBlocks.UMBRELLA_MOSS,
|
||||
|
@ -122,7 +159,7 @@ public class EndFeatures {
|
|||
),
|
||||
3
|
||||
);
|
||||
public static final BCLFeature CREEPING_MOSS = registerVegetation(
|
||||
public static final BCLFeature<SinglePlantFeature, NoneFeatureConfiguration> CREEPING_MOSS = registerVegetation(
|
||||
"creeping_moss",
|
||||
new SinglePlantFeature(
|
||||
EndBlocks.CREEPING_MOSS,
|
||||
|
@ -130,13 +167,17 @@ public class EndFeatures {
|
|||
),
|
||||
3
|
||||
);
|
||||
public static final BCLFeature BLUE_VINE = registerVegetation("blue_vine", new BlueVineFeature(), 1);
|
||||
public static final BCLFeature CHORUS_GRASS = registerVegetation(
|
||||
public static final BCLFeature<BlueVineFeature, NoneFeatureConfiguration> BLUE_VINE = registerVegetation(
|
||||
"blue_vine",
|
||||
new BlueVineFeature(),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature<SinglePlantFeature, NoneFeatureConfiguration> CHORUS_GRASS = registerVegetation(
|
||||
"chorus_grass",
|
||||
new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4),
|
||||
3
|
||||
);
|
||||
public static final BCLFeature CRYSTAL_GRASS = registerVegetation(
|
||||
public static final BCLFeature<SinglePlantFeature, NoneFeatureConfiguration> CRYSTAL_GRASS = registerVegetation(
|
||||
"crystal_grass",
|
||||
new SinglePlantFeature(
|
||||
EndBlocks.CRYSTAL_GRASS,
|
||||
|
@ -145,7 +186,7 @@ public class EndFeatures {
|
|||
),
|
||||
5
|
||||
);
|
||||
public static final BCLFeature SHADOW_PLANT = registerVegetation(
|
||||
public static final BCLFeature<SinglePlantFeature, NoneFeatureConfiguration> SHADOW_PLANT = registerVegetation(
|
||||
"shadow_plant",
|
||||
new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6),
|
||||
5
|
||||
|
@ -567,6 +608,8 @@ public class EndFeatures {
|
|||
BetterEnd.makeID("overworld_island"),
|
||||
new BiomeIslandFeature()
|
||||
)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.RAW_GENERATION)
|
||||
.buildAndRegister();
|
||||
public static final BCLFeature FLAMAEA = registerVegetation(
|
||||
|
@ -585,12 +628,18 @@ public class EndFeatures {
|
|||
public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8);
|
||||
public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8);
|
||||
public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8);
|
||||
public static final BCLFeature SULPHURIC_CAVE = BCLCommonFeatures.makeCountFeature(
|
||||
BetterEnd.makeID("sulphuric_cave"),
|
||||
Decoration.RAW_GENERATION,
|
||||
new SulphuricCaveFeature(),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature SULPHURIC_CAVE = BCLFeatureBuilder
|
||||
.start(
|
||||
BetterEnd.makeID("sulphuric_cave"),
|
||||
new SulphuricCaveFeature()
|
||||
)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.RAW_GENERATION)
|
||||
.count(2)
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
|
||||
public static final BCLFeature ICE_STAR_SMALL = registerRawGen(
|
||||
"ice_star_small",
|
||||
|
@ -610,11 +659,16 @@ public class EndFeatures {
|
|||
10
|
||||
);
|
||||
public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20);
|
||||
public static final BCLFeature TUNEL_CAVE = BCLCommonFeatures.makeChunkFeature(
|
||||
BetterEnd.makeID("tunel_cave"),
|
||||
Decoration.RAW_GENERATION,
|
||||
new TunelCaveFeature()
|
||||
);
|
||||
public static final BCLFeature TUNEL_CAVE = BCLFeatureBuilder
|
||||
.start(
|
||||
BetterEnd.makeID("tunel_cave"),
|
||||
new TunelCaveFeature()
|
||||
).buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.RAW_GENERATION)
|
||||
.count(1)
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
public static final BCLFeature UMBRALITH_ARCH = registerChanced("umbralith_arch", new ArchFeature(
|
||||
EndBlocks.UMBRALITH.stone,
|
||||
pos -> UmbraValleyBiome.getSurface(pos.getX(), pos.getZ()).defaultBlockState()
|
||||
|
@ -695,46 +749,73 @@ public class EndFeatures {
|
|||
int density
|
||||
) {
|
||||
ResourceLocation id = BetterEnd.makeID(name);
|
||||
return BCLFeatureBuilder.start(id, feature).countLayersMax(density).onlyInBiome().buildAndRegister();
|
||||
return BCLFeatureBuilder.start(id, feature)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.countMax(density)
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
|
||||
return BCLFeatureBuilder
|
||||
.start(BetterEnd.makeID(name), feature)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.RAW_GENERATION)
|
||||
.onceEvery(chance)
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.LAKES, feature, chance);
|
||||
return BCLFeatureBuilder
|
||||
.start(BetterEnd.makeID(name), feature)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.LAKES)
|
||||
.onceEvery(chance)
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
|
||||
return BCLCommonFeatures.makeChancedFeature(
|
||||
BetterEnd.makeID(name),
|
||||
Decoration.SURFACE_STRUCTURES,
|
||||
feature,
|
||||
chance
|
||||
);
|
||||
return
|
||||
BCLFeatureBuilder
|
||||
.start(BetterEnd.makeID(name), feature)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.SURFACE_STRUCTURES)
|
||||
.onceEvery(chance)
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize) {
|
||||
return BCLCommonFeatures.makeOreFeature(
|
||||
BetterEnd.makeID(name),
|
||||
blockOre,
|
||||
Blocks.END_STONE,
|
||||
veins,
|
||||
veinSize,
|
||||
0,
|
||||
HeightRangePlacement.uniform(
|
||||
VerticalAnchor.bottom(),
|
||||
VerticalAnchor.absolute(128)
|
||||
),
|
||||
false
|
||||
);
|
||||
return BCLFeatureBuilder
|
||||
.startOre(BetterEnd.makeID(name))
|
||||
.add(Blocks.END_STONE, blockOre)
|
||||
.veinSize(veinSize)
|
||||
.discardChanceOnAirExposure(0)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.UNDERGROUND_ORES)
|
||||
.count(veins)
|
||||
.randomHeight8FromFloorCeil()
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
|
||||
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
|
||||
return BCLFeatureBuilder
|
||||
.start(BetterEnd.makeID(name), layer)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(GenerationStep.Decoration.UNDERGROUND_ORES)
|
||||
.modifier(CountPlacement.of(count))
|
||||
.buildAndRegister();
|
||||
|
@ -784,12 +865,15 @@ public class EndFeatures {
|
|||
|
||||
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
|
||||
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
|
||||
Feature<?> feature = Registry.FEATURE.get(id);
|
||||
Feature<NoneFeatureConfiguration> feature = (Feature<NoneFeatureConfiguration>) Registry.FEATURE.get(id);
|
||||
return BCLFeatureBuilder
|
||||
.start(id, feature)
|
||||
.configuration((NoneFeatureConfiguration) placed.feature().value().config())
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.SURFACE_STRUCTURES)
|
||||
.modifier(placed.placement())
|
||||
.buildAndRegister(placed.feature().value().config());
|
||||
.buildAndRegister();
|
||||
}
|
||||
|
||||
String path = "/data/" + ns + "/structures/biome/" + nm + "/";
|
||||
|
@ -809,12 +893,17 @@ public class EndFeatures {
|
|||
list.add(new ListFeature.StructureInfo(structure, offsetY, terrainMerge));
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
return BCLCommonFeatures.makeChancedFeature(
|
||||
new ResourceLocation(ns, nm + "_structures"),
|
||||
Decoration.SURFACE_STRUCTURES,
|
||||
new BuildingListFeature(list, Blocks.END_STONE.defaultBlockState()),
|
||||
10
|
||||
);
|
||||
return BCLFeatureBuilder.start(
|
||||
new ResourceLocation(ns, nm + "_structures"),
|
||||
new BuildingListFeature(list, Blocks.END_STONE.defaultBlockState())
|
||||
)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(Decoration.SURFACE_STRUCTURES)
|
||||
.onceEvery(10)
|
||||
.squarePlacement()
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder;
|
|||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeBuilder.BiomeSupplier;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BCLBiomeSettings;
|
||||
import org.betterx.bclib.api.v2.levelgen.biomes.BiomeAPI;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLCommonFeatures;
|
||||
import org.betterx.bclib.api.v2.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeature;
|
||||
import org.betterx.bclib.api.v3.levelgen.features.BCLFeatureBuilder;
|
||||
import org.betterx.bclib.util.WeightedList;
|
||||
import org.betterx.betterend.BetterEnd;
|
||||
import org.betterx.betterend.registry.EndSounds;
|
||||
|
@ -28,11 +28,17 @@ public class EndCaveBiome extends EndBiome {
|
|||
|
||||
@Override
|
||||
protected void addCustomBuildData(BCLBiomeBuilder builder) {
|
||||
BCLFeature feature = BCLCommonFeatures.makeChunkFeature(
|
||||
BetterEnd.makeID(ID.getPath() + "_cave_populator"),
|
||||
GenerationStep.Decoration.RAW_GENERATION,
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(ID))
|
||||
);
|
||||
BCLFeature feature = BCLFeatureBuilder
|
||||
.start(
|
||||
BetterEnd.makeID(ID.getPath() + "_cave_populator"),
|
||||
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(ID))
|
||||
)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.decoration(GenerationStep.Decoration.RAW_GENERATION)
|
||||
.count(1)
|
||||
.onlyInBiome()
|
||||
.buildAndRegister();
|
||||
|
||||
builder.feature(feature)
|
||||
.music(EndSounds.MUSIC_CAVES)
|
||||
|
|
|
@ -88,7 +88,7 @@ public class FloatingSpireFeature extends SpireFeature {
|
|||
support.forEach((bpos) -> {
|
||||
if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||
EndFeatures.TENANEA_BUSH.getFeature()
|
||||
.place(new FeaturePlaceContext<>(
|
||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
chunkGenerator,
|
||||
|
|
|
@ -88,7 +88,7 @@ public class SpireFeature extends DefaultFeature {
|
|||
support.forEach((bpos) -> {
|
||||
if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
|
||||
EndFeatures.TENANEA_BUSH.getFeature()
|
||||
.place(new FeaturePlaceContext<>(
|
||||
.place(new FeaturePlaceContext<NoneFeatureConfiguration>(
|
||||
Optional.empty(),
|
||||
world,
|
||||
chunkGenerator,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue