-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8f178ac
commit 3e60b63
Showing
3 changed files
with
24 additions
and
22 deletions.
There are no files selected for viewing
38 changes: 16 additions & 22 deletions
38
src/main/java/artifality/registry/ArtifalityFeatures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,26 @@ | ||
package artifality.registry; | ||
|
||
import static artifality.ArtifalityMod.id; | ||
|
||
import artifality.ArtifalityMod; | ||
import artifality.worldgen.feature.CrystalFeature; | ||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
|
||
import java.util.List; | ||
import net.fabricmc.fabric.api.biome.v1.ModificationPhase; | ||
import net.minecraft.registry.*; | ||
import net.minecraft.registry.tag.BiomeTags; | ||
import net.minecraft.world.gen.GenerationStep; | ||
import net.minecraft.world.gen.feature.*; | ||
|
||
@SuppressWarnings("deprecation") | ||
public class ArtifalityFeatures { | ||
// public static final Feature<DefaultFeatureConfig> CRYSTAL_FEATURE = new CrystalFeature(); | ||
// public static final ConfiguredFeature<?, ?> CRYSTAL_FEATURE_CONFIG = new ConfiguredFeature<>(CRYSTAL_FEATURE, new DefaultFeatureConfig()); | ||
// public static final PlacedFeature CRYSTAL_FEATURE_PLACED = new PlacedFeature(Holder.createDirect(CRYSTAL_FEATURE_CONFIG), List.of(PlacedFeatureUtil.BOTTOM_TO_MAX_TERRAIN_HEIGHT_RANGE)); | ||
public static final Feature<DefaultFeatureConfig> CRYSTAL_FEATURE = new CrystalFeature(); | ||
public static final RegistryKey<ConfiguredFeature<?,?>> CRYSTAL_FEATURE_CONFIG = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, ArtifalityMod.id("crystals")); | ||
public static final RegistryKey<PlacedFeature> CRYSTAL_FEATURE_PLACED = RegistryKey.of(RegistryKeys.PLACED_FEATURE, ArtifalityMod.id("crystals")); | ||
|
||
public static void init() { | ||
// Registry.register(Registries.FEATURE, id("crystal_feature"), CRYSTAL_FEATURE); | ||
// Registry.register(BuiltinRegistries.CONFIGURED_FEATURE, id("crystal_feature"), CRYSTAL_FEATURE_CONFIG); | ||
// Registry.register(BuiltinRegistries.PLACED_FEATURE, id("crystal_feature"), CRYSTAL_FEATURE_PLACED); | ||
// | ||
// BiomeModifications.addFeature( | ||
// ctx -> { | ||
// Biome.Category category = Biome.getCategory(ctx.getBiomeRegistryEntry()); | ||
// return !category.equals(Biome.Category.NETHER) && !category.equals(Biome.Category.THEEND); | ||
// }, | ||
// GenerationStep.Feature.UNDERGROUND_DECORATION, | ||
// BuiltinRegistries.PLACED_FEATURE.getKey(CRYSTAL_FEATURE_PLACED).orElseThrow() | ||
// ); | ||
Registry.register(Registries.FEATURE, ArtifalityMod.id("crystals"), CRYSTAL_FEATURE); | ||
|
||
BiomeModifications.create(ArtifalityMod.id("features")) | ||
.add(ModificationPhase.ADDITIONS, ctx -> { | ||
var entry = ctx.getBiomeRegistryEntry(); | ||
return !entry.isIn(BiomeTags.IS_NETHER) && !entry.isIn(BiomeTags.IS_END); | ||
}, ctx -> ctx.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_DECORATION, CRYSTAL_FEATURE_PLACED)); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/resources/data/artifality/worldgen/configured_feature/crystals.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "artifality:crystals", | ||
"config": {} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/resources/data/artifality/worldgen/placed_feature/crystals.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"feature": "artifality:crystals", | ||
"placement": [] | ||
} |