-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #146 from Hojosa/development
fix salt ore generation
- Loading branch information
Showing
22 changed files
with
327 additions
and
23 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/growthcraft/forge/biome_modifier/add_deepslate_salt_ore.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,6 @@ | ||
{ | ||
"type": "forge:add_features", | ||
"biomes": "#minecraft:is_overworld", | ||
"features": "growthcraft:deepslate_salt_ore_placed", | ||
"step": "underground_ores" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/growthcraft/forge/biome_modifier/add_end_salt_ore.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,6 @@ | ||
{ | ||
"type": "forge:add_features", | ||
"biomes": "#minecraft:is_end", | ||
"features": "growthcraft:end_salt_ore_placed", | ||
"step": "underground_ores" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/growthcraft/forge/biome_modifier/add_nether_salt_ore.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,6 @@ | ||
{ | ||
"type": "forge:add_features", | ||
"biomes": "#minecraft:is_nether", | ||
"features": "growthcraft:nether_salt_ore_placed", | ||
"step": "underground_ores" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/data/growthcraft/forge/biome_modifier/add_salt_ore.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,6 @@ | ||
{ | ||
"type": "forge:add_features", | ||
"biomes": "#minecraft:is_overworld", | ||
"features": "growthcraft:salt_ore_placed", | ||
"step": "underground_ores" | ||
} |
18 changes: 18 additions & 0 deletions
18
src/generated/resources/data/growthcraft/worldgen/configured_feature/deepslate_salt_ore.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,18 @@ | ||
{ | ||
"type": "minecraft:ore", | ||
"config": { | ||
"discard_chance_on_air_exposure": 0.0, | ||
"size": 5, | ||
"targets": [ | ||
{ | ||
"state": { | ||
"Name": "growthcraft:salt_ore_deepslate" | ||
}, | ||
"target": { | ||
"predicate_type": "minecraft:tag_match", | ||
"tag": "minecraft:deepslate_ore_replaceables" | ||
} | ||
} | ||
] | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/generated/resources/data/growthcraft/worldgen/configured_feature/end_salt_ore.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,18 @@ | ||
{ | ||
"type": "minecraft:ore", | ||
"config": { | ||
"discard_chance_on_air_exposure": 0.0, | ||
"size": 5, | ||
"targets": [ | ||
{ | ||
"state": { | ||
"Name": "growthcraft:salt_ore_end" | ||
}, | ||
"target": { | ||
"block": "minecraft:end_stone", | ||
"predicate_type": "minecraft:block_match" | ||
} | ||
} | ||
] | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/generated/resources/data/growthcraft/worldgen/configured_feature/nether_salt_ore.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,18 @@ | ||
{ | ||
"type": "minecraft:ore", | ||
"config": { | ||
"discard_chance_on_air_exposure": 0.0, | ||
"size": 5, | ||
"targets": [ | ||
{ | ||
"state": { | ||
"Name": "growthcraft:salt_ore_nether" | ||
}, | ||
"target": { | ||
"block": "minecraft:netherrack", | ||
"predicate_type": "minecraft:block_match" | ||
} | ||
} | ||
] | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/generated/resources/data/growthcraft/worldgen/configured_feature/salt_ore.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,18 @@ | ||
{ | ||
"type": "minecraft:ore", | ||
"config": { | ||
"discard_chance_on_air_exposure": 0.0, | ||
"size": 5, | ||
"targets": [ | ||
{ | ||
"state": { | ||
"Name": "growthcraft:salt_ore" | ||
}, | ||
"target": { | ||
"predicate_type": "minecraft:tag_match", | ||
"tag": "minecraft:stone_ore_replaceables" | ||
} | ||
} | ||
] | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...nerated/resources/data/growthcraft/worldgen/placed_feature/deepslate_salt_ore_placed.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,27 @@ | ||
{ | ||
"feature": "growthcraft:deepslate_salt_ore", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 50 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:height_range", | ||
"height": { | ||
"type": "minecraft:uniform", | ||
"max_inclusive": { | ||
"absolute": 64 | ||
}, | ||
"min_inclusive": { | ||
"absolute": -32 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
src/generated/resources/data/growthcraft/worldgen/placed_feature/end_salt_ore_placed.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,27 @@ | ||
{ | ||
"feature": "growthcraft:end_salt_ore", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 50 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:height_range", | ||
"height": { | ||
"type": "minecraft:uniform", | ||
"max_inclusive": { | ||
"absolute": 64 | ||
}, | ||
"min_inclusive": { | ||
"absolute": -32 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
src/generated/resources/data/growthcraft/worldgen/placed_feature/nether_salt_ore_placed.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,27 @@ | ||
{ | ||
"feature": "growthcraft:nether_salt_ore", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 50 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:height_range", | ||
"height": { | ||
"type": "minecraft:uniform", | ||
"max_inclusive": { | ||
"absolute": 64 | ||
}, | ||
"min_inclusive": { | ||
"absolute": -32 | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "minecraft:biome" | ||
} | ||
] | ||
} |
27 changes: 27 additions & 0 deletions
27
src/generated/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.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,27 @@ | ||
{ | ||
"feature": "growthcraft:salt_ore", | ||
"placement": [ | ||
{ | ||
"type": "minecraft:count", | ||
"count": 10 | ||
}, | ||
{ | ||
"type": "minecraft:in_square" | ||
}, | ||
{ | ||
"type": "minecraft:height_range", | ||
"height": { | ||
"type": "minecraft:uniform", | ||
"max_inclusive": { | ||
"absolute": 64 | ||
}, | ||
"min_inclusive": { | ||
"absolute": -32 | ||
} | ||
} | ||
}, | ||
{ | ||
"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
32 changes: 32 additions & 0 deletions
32
src/main/java/growthcraft/core/datagen/providers/GrowthcraftCoreWorldGenProvider.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,32 @@ | ||
package growthcraft.core.datagen.providers; | ||
|
||
import java.util.Set; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
import growthcraft.core.shared.Reference; | ||
import growthcraft.core.world.GrowthcraftBiomeModifiers; | ||
import growthcraft.core.world.GrowthcraftConfiguredFeatures; | ||
import growthcraft.core.world.GrowthcraftPlacedFeatures; | ||
import net.minecraft.core.HolderLookup.Provider; | ||
import net.minecraft.core.RegistrySetBuilder; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; | ||
import net.minecraftforge.registries.ForgeRegistries; | ||
|
||
public class GrowthcraftCoreWorldGenProvider extends DatapackBuiltinEntriesProvider{ | ||
public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder() | ||
.add(Registries.CONFIGURED_FEATURE, GrowthcraftConfiguredFeatures::bootstrap) | ||
.add(Registries.PLACED_FEATURE, GrowthcraftPlacedFeatures::bootstrap) | ||
.add(ForgeRegistries.Keys.BIOME_MODIFIERS, GrowthcraftBiomeModifiers::bootstrap); | ||
|
||
public GrowthcraftCoreWorldGenProvider(PackOutput output, CompletableFuture<Provider> registries) { | ||
super(output, registries, BUILDER, Set.of(Reference.MODID)); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Growthcraft WorldGen"; | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/growthcraft/core/world/GrowthcraftBiomeModifiers.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,50 @@ | ||
package growthcraft.core.world; | ||
|
||
import growthcraft.core.shared.Reference; | ||
import net.minecraft.core.HolderSet; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.data.worldgen.BootstapContext; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.tags.BiomeTags; | ||
import net.minecraft.world.level.levelgen.GenerationStep; | ||
import net.minecraftforge.common.world.BiomeModifier; | ||
import net.minecraftforge.common.world.ForgeBiomeModifiers; | ||
import net.minecraftforge.registries.ForgeRegistries; | ||
|
||
public class GrowthcraftBiomeModifiers { | ||
public static final ResourceKey<BiomeModifier> ADD_SALT_ORE = registerKey("add_salt_ore"); | ||
public static final ResourceKey<BiomeModifier> ADD_DEEPSLATE_SALT_ORE = registerKey("add_deepslate_salt_ore"); | ||
public static final ResourceKey<BiomeModifier> ADD_NETHER_SALT_ORE = registerKey("add_nether_salt_ore"); | ||
public static final ResourceKey<BiomeModifier> ADD_END_SALT_ORE = registerKey("add_end_salt_ore"); | ||
|
||
|
||
public static void bootstrap(BootstapContext<BiomeModifier> context) { | ||
var placedFeatures = context.lookup(Registries.PLACED_FEATURE); | ||
var biomes = context.lookup(Registries.BIOME); | ||
|
||
context.register(ADD_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( | ||
biomes.getOrThrow(BiomeTags.IS_OVERWORLD), | ||
HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.SALT_ORE_PLACED_KEY)), | ||
GenerationStep.Decoration.UNDERGROUND_ORES)); | ||
|
||
context.register(ADD_DEEPSLATE_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( | ||
biomes.getOrThrow(BiomeTags.IS_OVERWORLD), | ||
HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.DEEPSLATE_SALT_ORE_PLACED_KEY)), | ||
GenerationStep.Decoration.UNDERGROUND_ORES)); | ||
|
||
context.register(ADD_NETHER_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( | ||
biomes.getOrThrow(BiomeTags.IS_NETHER), | ||
HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.NETHER_SALT_ORE_PLACED_KEY)), | ||
GenerationStep.Decoration.UNDERGROUND_ORES)); | ||
|
||
context.register(ADD_END_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( | ||
biomes.getOrThrow(BiomeTags.IS_END), | ||
HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.END_SALT_ORE_PLACED_KEY)), | ||
GenerationStep.Decoration.UNDERGROUND_ORES)); | ||
} | ||
|
||
private static ResourceKey<BiomeModifier> registerKey(String name) { | ||
return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Reference.MODID, name)); | ||
} | ||
} |
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.