-
Notifications
You must be signed in to change notification settings - Fork 267
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
Showing
21 changed files
with
316 additions
and
57 deletions.
There are no files selected for viewing
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
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
17 changes: 17 additions & 0 deletions
17
common/src/generated/resources/data/biomesoplenty/worldgen/configured_feature/null_lake.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,17 @@ | ||
{ | ||
"type": "minecraft:lake", | ||
"config": { | ||
"barrier": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "biomesoplenty:null_end_stone" | ||
} | ||
}, | ||
"fluid": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "biomesoplenty:null_block" | ||
} | ||
} | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
common/src/generated/resources/data/biomesoplenty/worldgen/configured_feature/null_tree.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,49 @@ | ||
{ | ||
"type": "biomesoplenty:basic_tree", | ||
"config": { | ||
"alt_foliage_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "minecraft:air" | ||
} | ||
}, | ||
"decorators": [], | ||
"foliage_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "biomesoplenty:null_block" | ||
} | ||
}, | ||
"hanging_chance": 0.0, | ||
"hanging_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "minecraft:air" | ||
} | ||
}, | ||
"leaf_layers": 4, | ||
"leaves_layer_height": 2, | ||
"leaves_offset": 1, | ||
"max_height": 7, | ||
"max_leaves_radius": 1, | ||
"min_height": 4, | ||
"trunk_fruit_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "minecraft:air" | ||
} | ||
}, | ||
"trunk_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "biomesoplenty:null_end_stone" | ||
} | ||
}, | ||
"vine_provider": { | ||
"type": "minecraft:simple_state_provider", | ||
"state": { | ||
"Name": "minecraft:air" | ||
} | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...on/src/generated/resources/data/biomesoplenty/worldgen/configured_feature/null_trees.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,12 @@ | ||
{ | ||
"type": "minecraft:random_selector", | ||
"config": { | ||
"default": "biomesoplenty:null_tree", | ||
"features": [ | ||
{ | ||
"chance": 0.075, | ||
"feature": "biomesoplenty:null_tree" | ||
} | ||
] | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
common/src/generated/resources/data/biomesoplenty/worldgen/placed_feature/null_lake.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,19 @@ | ||
{ | ||
"feature": "biomesoplenty:null_lake", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 1 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:heightmap", | ||
"heightmap": "MOTION_BLOCKING" | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
17 changes: 17 additions & 0 deletions
17
common/src/generated/resources/data/biomesoplenty/worldgen/placed_feature/null_tree.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,17 @@ | ||
{ | ||
"feature": "biomesoplenty:null_tree", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:block_predicate_filter", | ||
"predicate": { | ||
"type": "minecraft:matching_blocks", | ||
"blocks": "minecraft:end_stone", | ||
"offset": [ | ||
0, | ||
-1, | ||
0 | ||
] | ||
} | ||
} | ||
] | ||
} |
35 changes: 35 additions & 0 deletions
35
common/src/generated/resources/data/biomesoplenty/worldgen/placed_feature/null_trees.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,35 @@ | ||
{ | ||
"feature": "biomesoplenty:null_trees", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": { | ||
"type": "minecraft:weighted_list", | ||
"distribution": [ | ||
{ | ||
"data": 0, | ||
"weight": 4 | ||
}, | ||
{ | ||
"data": 1, | ||
"weight": 1 | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:surface_water_depth_filter", | ||
"max_water_depth": 0 | ||
}, | ||
{ | ||
"type": "minecraft:heightmap", | ||
"heightmap": "OCEAN_FLOOR" | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
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
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
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
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
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
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
54 changes: 54 additions & 0 deletions
54
common/src/main/java/biomesoplenty/worldgen/feature/BOPEndFeatures.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 |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/******************************************************************************* | ||
* Copyright 2022, the Glitchfiend Team. | ||
* All rights reserved. | ||
******************************************************************************/ | ||
package biomesoplenty.worldgen.feature; | ||
|
||
import biomesoplenty.api.block.BOPBlocks; | ||
import biomesoplenty.util.worldgen.BOPFeatureUtils; | ||
import biomesoplenty.worldgen.placement.BOPTreePlacements; | ||
import com.google.common.collect.ImmutableList; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.HolderGetter; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.data.worldgen.BootstapContext; | ||
import net.minecraft.data.worldgen.features.FeatureUtils; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; | ||
import net.minecraft.world.level.levelgen.feature.Feature; | ||
import net.minecraft.world.level.levelgen.feature.LakeFeature; | ||
import net.minecraft.world.level.levelgen.feature.WeightedPlacedFeature; | ||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; | ||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; | ||
import net.minecraft.world.level.levelgen.feature.configurations.RandomFeatureConfiguration; | ||
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration; | ||
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider; | ||
import net.minecraft.world.level.levelgen.placement.PlacedFeature; | ||
|
||
public class BOPEndFeatures | ||
{ | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> ANOMALY = BOPFeatureUtils.createKey("anomaly"); | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> ENDERPHYTE_BONEMEAL = BOPFeatureUtils.createKey("enderphyte_bonemeal"); | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> FLOWER_END_WILDS = BOPFeatureUtils.createKey("flower_end_wilds"); | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> NULL_LAKE = BOPFeatureUtils.createKey("null_lake"); | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> NULL_TREES = BOPFeatureUtils.createKey("null_trees"); | ||
public static final ResourceKey<ConfiguredFeature<?, ?>> PATCH_ENDERPHYTES = BOPFeatureUtils.createKey("patch_enderphytes"); | ||
|
||
public static void bootstrap(BootstapContext<ConfiguredFeature<?, ?>> context) | ||
{ | ||
HolderGetter<PlacedFeature> placedFeatureGetter = context.lookup(Registries.PLACED_FEATURE); | ||
final Holder<PlacedFeature> NULL_TREE_CHECKED = placedFeatureGetter.getOrThrow(BOPTreePlacements.NULL_TREE_CHECKED); | ||
|
||
register(context, BOPEndFeatures.ANOMALY, BOPBaseFeatures.ANOMALY, NoneFeatureConfiguration.INSTANCE); | ||
register(context, BOPEndFeatures.ENDERPHYTE_BONEMEAL, Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ENDERPHYTE.defaultBlockState()))); | ||
register(context, BOPEndFeatures.FLOWER_END_WILDS, Feature.FLOWER, FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ALGAE_BLOOM)))); | ||
register(context, BOPEndFeatures.NULL_LAKE, Feature.LAKE, new LakeFeature.Configuration(BlockStateProvider.simple(BOPBlocks.NULL_BLOCK), BlockStateProvider.simple(BOPBlocks.NULL_END_STONE))); | ||
register(context, BOPEndFeatures.NULL_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfiguration(ImmutableList.of(new WeightedPlacedFeature(NULL_TREE_CHECKED, 0.075F)), NULL_TREE_CHECKED)); | ||
register(context, BOPEndFeatures.PATCH_ENDERPHYTES, Feature.RANDOM_PATCH, FeatureUtils.simplePatchConfiguration(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(BlockStateProvider.simple(BOPBlocks.ENDERPHYTE)))); | ||
} | ||
|
||
private static <FC extends FeatureConfiguration, F extends Feature<FC>> void register(BootstapContext<ConfiguredFeature<?, ?>> context, ResourceKey<ConfiguredFeature<?, ?>> configuredFeatureKey, F feature, FC configuration) | ||
{ | ||
context.register(configuredFeatureKey, new ConfiguredFeature<>(feature, configuration)); | ||
} | ||
} |
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
Oops, something went wrong.