Migrated Feature Code to new BCLib API
This commit is contained in:
parent
031a14f278
commit
5c3a9986bc
45 changed files with 1363 additions and 629 deletions
|
@ -5,66 +5,89 @@ 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;
|
||||
import org.betterx.betterend.world.features.SinglePlantFeature;
|
||||
import org.betterx.betterend.world.features.VineFeature;
|
||||
import org.betterx.betterend.world.features.WallPlantFeature;
|
||||
import org.betterx.betterend.world.features.WallPlantOnLogFeature;
|
||||
import org.betterx.betterend.registry.EndFeatures;
|
||||
import org.betterx.betterend.world.features.*;
|
||||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
|
||||
public class BYGFeatures {
|
||||
public static final BCLFeature OLD_BULBIS_TREE = redisterVegetation(
|
||||
public static final BCLFeature<OldBulbisTreeFeature, NoneFeatureConfiguration> OLD_BULBIS_TREE = redisterVegetation(
|
||||
"old_bulbis_tree",
|
||||
new OldBulbisTreeFeature(),
|
||||
EndFeatures.inlineBuild("old_bulbis_tree_feature", new OldBulbisTreeFeature()),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature IVIS_SPROUT = redisterVegetation(
|
||||
public static final BCLFeature<SinglePlantFeature, SinglePlantFeatureConfig> IVIS_SPROUT = redisterVegetation(
|
||||
"ivis_sprout",
|
||||
new SinglePlantFeature(Integrations.BYG.getBlock("ivis_sprout"), 6, 2),
|
||||
EndFeatures.SINGLE_PLANT_FEATURE,
|
||||
new SinglePlantFeatureConfig(Integrations.BYG.getBlock("ivis_sprout"), 6, 2),
|
||||
6
|
||||
);
|
||||
public static final BCLFeature IVIS_VINE = redisterVegetation(
|
||||
public static final BCLFeature<VineFeature, VineFeatureConfig> IVIS_VINE = redisterVegetation(
|
||||
"ivis_vine",
|
||||
new VineFeature(BYGBlocks.IVIS_VINE, 24),
|
||||
EndFeatures.VINE_FEATURE,
|
||||
new VineFeatureConfig(BYGBlocks.IVIS_VINE, 24),
|
||||
5
|
||||
);
|
||||
public static final BCLFeature IVIS_MOSS = redisterVegetation(
|
||||
public static final BCLFeature<WallPlantFeature, WallPlantFeatureConfig> IVIS_MOSS = redisterVegetation(
|
||||
"ivis_moss",
|
||||
new WallPlantFeature(BYGBlocks.IVIS_MOSS, 6),
|
||||
EndFeatures.WALL_PLANT_FEATURE,
|
||||
new WallPlantFeatureConfig(BYGBlocks.IVIS_MOSS, 6),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation(
|
||||
public static final BCLFeature<WallPlantOnLogFeature, WallPlantFeatureConfig> IVIS_MOSS_WOOD = redisterVegetation(
|
||||
"ivis_moss_wood",
|
||||
new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6),
|
||||
EndFeatures.WALL_PLANT_ON_LOG_FEATURE,
|
||||
new WallPlantFeatureConfig(BYGBlocks.IVIS_MOSS, 6),
|
||||
15
|
||||
);
|
||||
public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation(
|
||||
public static final BCLFeature<WallPlantFeature, WallPlantFeatureConfig> NIGHTSHADE_MOSS = redisterVegetation(
|
||||
"nightshade_moss",
|
||||
new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5),
|
||||
EndFeatures.WALL_PLANT_FEATURE,
|
||||
new WallPlantFeatureConfig(BYGBlocks.NIGHTSHADE_MOSS, 5),
|
||||
2
|
||||
);
|
||||
public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation(
|
||||
public static final BCLFeature<WallPlantOnLogFeature, WallPlantFeatureConfig> NIGHTSHADE_MOSS_WOOD = redisterVegetation(
|
||||
"nightshade_moss_wood",
|
||||
new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5),
|
||||
EndFeatures.WALL_PLANT_ON_LOG_FEATURE,
|
||||
new WallPlantFeatureConfig(BYGBlocks.NIGHTSHADE_MOSS, 5),
|
||||
8
|
||||
);
|
||||
|
||||
public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation(
|
||||
public static final BCLFeature<NightshadeRedwoodTreeFeature, NoneFeatureConfiguration> NIGHTSHADE_REDWOOD_TREE = redisterVegetation(
|
||||
"nightshade_redwood_tree",
|
||||
new NightshadeRedwoodTreeFeature(),
|
||||
1
|
||||
);
|
||||
public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1);
|
||||
public static final BCLFeature<BigEtherTreeFeature, NoneFeatureConfiguration> BIG_ETHER_TREE = redisterVegetation(
|
||||
"big_ether_tree",
|
||||
new BigEtherTreeFeature(),
|
||||
1
|
||||
);
|
||||
|
||||
public static void register() {
|
||||
}
|
||||
|
||||
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
|
||||
private static <F extends Feature<NoneFeatureConfiguration>> BCLFeature<F, NoneFeatureConfiguration> redisterVegetation(
|
||||
String name,
|
||||
F feature,
|
||||
int density
|
||||
) {
|
||||
return redisterVegetation(name, feature, NoneFeatureConfiguration.NONE, density);
|
||||
}
|
||||
|
||||
private static <F extends Feature<FC>, FC extends FeatureConfiguration> BCLFeature<F, FC> redisterVegetation(
|
||||
String name,
|
||||
F feature,
|
||||
FC config,
|
||||
int density
|
||||
) {
|
||||
ResourceLocation id = BetterEnd.makeID(name);
|
||||
return BCLFeatureBuilder
|
||||
.start(id, feature)
|
||||
.configuration(config)
|
||||
.buildAndRegister()
|
||||
.place()
|
||||
.countMax(density)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue