generated from GenerationsMod/GenerationsModuleTemplateOld
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Structure Datagen Start (I am very proud of myself for this)
- Loading branch information
Showing
10 changed files
with
136 additions
and
8 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
.../resources/data/generations_structures/worldgen/structure/loot_balloon/beast_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/beast_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
13 changes: 13 additions & 0 deletions
13
.../resources/data/generations_structures/worldgen/structure/loot_balloon/great_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/great_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
13 changes: 13 additions & 0 deletions
13
...resources/data/generations_structures/worldgen/structure/loot_balloon/master_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/master_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
13 changes: 13 additions & 0 deletions
13
...resources/data/generations_structures/worldgen/structure/loot_balloon/meowth_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/meowth_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
13 changes: 13 additions & 0 deletions
13
...resources/data/generations_structures/worldgen/structure/loot_balloon/normal_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/normal_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
13 changes: 13 additions & 0 deletions
13
.../resources/data/generations_structures/worldgen/structure/loot_balloon/ultra_balloon.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,13 @@ | ||
{ | ||
"type": "minecraft:jigsaw", | ||
"biomes": "#generations_structures:has_structure/loot_balloon", | ||
"max_distance_from_center": 80, | ||
"size": 1, | ||
"spawn_overrides": {}, | ||
"start_height": { | ||
"above_bottom": 150 | ||
}, | ||
"start_pool": "generations_structures:loot_balloon/ultra_balloon", | ||
"step": "surface_structures", | ||
"use_expansion_hack": false | ||
} |
55 changes: 53 additions & 2 deletions
55
...generations/structures/generationsstructures/structures/GenerationsStructureSettings.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,19 +1,70 @@ | ||
package generations.gg.generations.structures.generationsstructures.structures; | ||
|
||
import generations.gg.generations.structures.generationsstructures.tags.GenerationsBiomeTags; | ||
import generations.gg.generations.structures.generationsstructures.worldgen.template_pool.GenerationsTemplatePools; | ||
import net.minecraft.core.Holder; | ||
import net.minecraft.core.HolderGetter; | ||
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.world.level.biome.Biome; | ||
import net.minecraft.world.level.levelgen.GenerationStep; | ||
import net.minecraft.world.level.levelgen.Heightmap; | ||
import net.minecraft.world.level.levelgen.VerticalAnchor; | ||
import net.minecraft.world.level.levelgen.heightproviders.ConstantHeight; | ||
import net.minecraft.world.level.levelgen.heightproviders.HeightProvider; | ||
import net.minecraft.world.level.levelgen.structure.Structure; | ||
import net.minecraft.world.level.levelgen.structure.TerrainAdjustment; | ||
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; | ||
import net.minecraft.world.level.levelgen.structure.structures.JigsawStructure; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
public class GenerationsStructureSettings { | ||
|
||
public static void bootstrap(BootstapContext<Structure> context) { | ||
HolderGetter<Biome> biomeHolderGetter = context.lookup(Registries.BIOME); | ||
HolderGetter<StructureTemplatePool> poolHolderGetter = context.lookup(Registries.TEMPLATE_POOL); | ||
|
||
registerJigsaw(context, GenerationsStructuresKeys.BEAST_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.BEAST_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
registerJigsaw(context, GenerationsStructuresKeys.GREAT_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.GREAT_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
registerJigsaw(context, GenerationsStructuresKeys.MASTER_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.MASTER_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
registerJigsaw(context, GenerationsStructuresKeys.NORMAL_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.NORMAL_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
registerJigsaw(context, GenerationsStructuresKeys.ULTRA_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.ULTRA_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
registerJigsaw(context, GenerationsStructuresKeys.MEOWTH_BALLOON, balloonJigsawStructure(poolHolderGetter.getOrThrow(GenerationsTemplatePools.MEOWTH_BALLOON), biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LOOT_BALLOON))); | ||
} | ||
|
||
private static void registerJigsaw(BootstapContext<Structure> context, ResourceKey<Structure> structureResourceKey, Structure structure){ | ||
context.register(structureResourceKey, structure); | ||
} | ||
|
||
private static JigsawStructure createJigsaw(Structure.StructureSettings settings, | ||
Holder<StructureTemplatePool> startPool, | ||
Optional<ResourceLocation> startJigsawName, | ||
int maxDepth, | ||
HeightProvider startHeight, | ||
boolean useExpansionHack, | ||
Optional<Heightmap.Types> projectStartToHeightmap, | ||
int maxDistanceToCenter){ | ||
return new JigsawStructure(settings, startPool, startJigsawName, maxDepth, startHeight, useExpansionHack, projectStartToHeightmap, maxDistanceToCenter); | ||
} | ||
|
||
private static void registerJigsaw(BootstapContext<Structure> context, ResourceKey<Structure> structure, Structure.StructureSettings settings, ResourceKey<StructureTemplatePool> pool, int min, int mac){ | ||
context.register(structure, new JigsawStructure(settings, context.lookup(Registries.TEMPLATE_POOL).getOrThrow(pool))); | ||
private static JigsawStructure balloonJigsawStructure(Holder<StructureTemplatePool> poolHolderGetter, HolderSet<Biome> biomeHolderGetter){ | ||
return new JigsawStructure(new Structure.StructureSettings( | ||
biomeHolderGetter, | ||
Map.of(), | ||
GenerationStep.Decoration.SURFACE_STRUCTURES, | ||
TerrainAdjustment.NONE | ||
), | ||
poolHolderGetter, | ||
Optional.empty(), | ||
1, | ||
ConstantHeight.of(VerticalAnchor.aboveBottom(150)), | ||
false, | ||
Optional.empty(), | ||
80); | ||
} | ||
} |
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