Skip to content

Commit

Permalink
Add Lugia Shrine
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Jan 21, 2024
1 parent f7d287c commit b7aecd4
Show file tree
Hide file tree
Showing 12 changed files with 88 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values": [
"#minecraft:is_mountain",
"#minecraft:is_forest"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"id": "generations_structures:shrines/static_shrine",
"required": false
},
{
"id": "generations_structures:shrines/lugia_shrine",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:jigsaw",
"biomes": "#generations_structures:has_structure/lugia_shrine",
"max_distance_from_center": 40,
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"size": 1,
"spawn_overrides": {},
"start_height": {
"absolute": 1
},
"start_pool": "generations_structures:shrines/lugia_shrine",
"step": "surface_structures",
"terrain_adaptation": "beard_thin",
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"placement": {
"type": "minecraft:random_spread",
"salt": 751341351,
"separation": 500,
"spacing": 4096
},
"structures": [
{
"structure": "generations_structures:shrines/lugia_shrine",
"weight": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"elements": [
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:shrines/lugia_shrine",
"processors": "minecraft:empty",
"projection": "rigid"
},
"weight": 1
}
],
"fallback": "minecraft:empty"
}
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,22 @@ public static void bootstrap(BootstapContext<Structure> context) {
40
));

registerStructure(context, GenerationsStructuresKeys.LUGIA_SHRINE, createJigsaw(
new Structure.StructureSettings(
biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_LUGIA_SHRINE),
Map.of(),
GenerationStep.Decoration.SURFACE_STRUCTURES,
TerrainAdjustment.BEARD_THIN
),
poolHolderGetter.getOrThrow(GenerationsTemplatePools.LUGIA_SHRINE),
Optional.empty(),
1,
ConstantHeight.of(VerticalAnchor.absolute(1)),
false,
Optional.of(Heightmap.Types.WORLD_SURFACE_WG),
40
));

registerStructure(context, GenerationsStructuresKeys.ISLANDS, createJigsaw(
new Structure.StructureSettings(
biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_ISLANDS),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public interface GenerationsStructuresKeys {
ResourceKey<Structure> FROZEN_SHRINE = createKey("shrines/frozen_shrine");
ResourceKey<Structure> FIERY_SHRINE = createKey("shrines/fiery_shrine");
ResourceKey<Structure> STATIC_SHRINE = createKey("shrines/static_shrine");
ResourceKey<Structure> LUGIA_SHRINE = createKey("shrines/lugia_shrine");

/**
* Holds the ResourceKeys for the village roads.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public class GenerationsBiomeTags {
/** the tag for biomes that can have a static shrine */
public static final TagKey<Biome> HAS_STATIC_SHRINE = create("has_structure/static_shrine");

/** the tag for biomes that can have a Lugia shrine */
public static final TagKey<Biome> HAS_LUGIA_SHRINE = create("has_structure/lugia_shrine");

/**
* Creates a new {@link TagKey} for the given name.
* @param name The name of the tag.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class GenerationsStructureSets {
public static ResourceKey<StructureSet> FROZEN_SHRINE = create("frozen_shrine");
public static ResourceKey<StructureSet> FIERY_SHRINE = create("fiery_shrine");
public static ResourceKey<StructureSet> STATIC_SHRINE = create("static_shrine");
public static ResourceKey<StructureSet> LUGIA_SHRINE = create("lugia_shrine");
public static ResourceKey<StructureSet> ISLANDS = create("islands");

/**
Expand Down Expand Up @@ -66,6 +67,9 @@ public static void bootstrap(BootstapContext<StructureSet> context) {

register(context, STATIC_SHRINE, GenerationsStructuresKeys.STATIC_SHRINE,
new RandomSpreadStructurePlacement(4096, 500, RandomSpreadType.LINEAR, 442038945));

register(context, LUGIA_SHRINE, GenerationsStructuresKeys.LUGIA_SHRINE,
new RandomSpreadStructurePlacement(4096, 500, RandomSpreadType.LINEAR, 751341351));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class GenerationsTemplatePools {
public static final ResourceKey<StructureTemplatePool> FROZEN_SHRINE = create("shrines/frozen_shrine");
public static final ResourceKey<StructureTemplatePool> FIERY_SHRINE = create("shrines/fiery_shrine");
public static final ResourceKey<StructureTemplatePool> STATIC_SHRINE = create("shrines/static_shrine");
public static final ResourceKey<StructureTemplatePool> LUGIA_SHRINE = create("shrines/lugia_shrine");


public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
Expand Down Expand Up @@ -97,6 +98,10 @@ public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
register(context, STATIC_SHRINE, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.STATIC_SHRINE.location().toString(), getProcessor(context, GenerationsProcessorLists.STATIC_SHRINE_PROCESSOR_LIST)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, LUGIA_SHRINE, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.LUGIA_SHRINE.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);
}

private static ResourceKey<StructureTemplatePool> create(String name) {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {

tag(GenerationsBiomeTags.HAS_STATIC_SHRINE)
.addTag(BiomeTags.IS_SAVANNA);

tag(GenerationsBiomeTags.HAS_LUGIA_SHRINE)
.addTag(BiomeTags.IS_MOUNTAIN)
.addTag(BiomeTags.IS_FOREST);
}
}

Expand Down Expand Up @@ -128,7 +132,8 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(GenerationsStructureTags.SHRINES)
.addOptional(GenerationsStructuresKeys.FROZEN_SHRINE.location())
.addOptional(GenerationsStructuresKeys.FIERY_SHRINE.location())
.addOptional(GenerationsStructuresKeys.STATIC_SHRINE.location());
.addOptional(GenerationsStructuresKeys.STATIC_SHRINE.location())
.addOptional(GenerationsStructuresKeys.LUGIA_SHRINE.location());
}
}

Expand Down

0 comments on commit b7aecd4

Please sign in to comment.