Skip to content

Commit

Permalink
Regi Shrine
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph T. McQuigg <[email protected]>
  • Loading branch information
JT122406 committed Oct 5, 2024
1 parent 1a9912f commit 821e4df
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,22 @@
},
"trigger": "minecraft:location"
},
"regi_shrine": {
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"structure": "generations_structures:shrines/regi"
}
}
}
]
},
"trigger": "minecraft:location"
},
"static_shrine": {
"conditions": {
"player": [
Expand Down Expand Up @@ -93,6 +109,9 @@
],
[
"lugia_shrine"
],
[
"regi_shrine"
]
],
"sends_telemetry_event": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"values": [
{
"id": "#forge:is_snowy",
"required": false
},
{
"id": "#c:snowy",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
{
"id": "generations_structures:shrines/lugia",
"required": false
},
{
"id": "generations_structures:shrines/regi",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"processors": [
{
"processor_type": "minecraft:rule",
"rules": [
{
"input_predicate": {
"block": "minecraft:calcite",
"predicate_type": "minecraft:random_block_match",
"probability": 0.5
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "generations_core:bleach_stone"
}
}
]
},
{
"processor_type": "moreprocessors:same_state_rule",
"rules": [
{
"input_predicate": {
"block": "minecraft:diorite_wall",
"predicate_type": "minecraft:random_block_match",
"probability": 0.5
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_location": "generations_core:bleach_stone_wall"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:jigsaw",
"biomes": "#generations_structures:has_structure/regi_shrine",
"max_distance_from_center": 80,
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"size": 1,
"spawn_overrides": {},
"start_height": {
"absolute": 1
},
"start_pool": "generations_structures:shrines/regi",
"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": 423098801,
"separation": 350,
"spacing": 2000
},
"structures": [
{
"structure": "generations_structures:shrines/regi",
"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/regi",
"processors": "generations_structures:shrines/regi_processor_list",
"projection": "rigid"
},
"weight": 1
}
],
"fallback": "minecraft:empty"
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import biomesoplenty.api.block.BOPBlocks;
import com.google.common.collect.ImmutableList;
import generations.gg.generations.core.generationscore.common.world.level.block.GenerationsBlocks;
import generations.gg.generations.core.generationscore.common.world.level.block.GenerationsWood;
import generations.gg.generations.structures.generationsstructures.GenerationsStructures;
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
Expand Down Expand Up @@ -97,6 +98,19 @@ public class GenerationsProcessorLists {
)
)));

public static final ResourceKey<StructureProcessorList> REGI_SHRINE_PROCESSOR_LIST = register("shrines/regi", context -> new StructureProcessorList(ImmutableList.of(
new RuleProcessor(
ImmutableList.of(
new ProcessorRule(new RandomBlockMatchTest(Blocks.CALCITE, 0.5f), AlwaysTrueTest.INSTANCE, GenerationsBlocks.BLEACH_STONE_SET.getBaseBlock().defaultBlockState())
)
),
new SameStateRuleProcessor(
ImmutableList.of(
new SameStateProcessorRule(new RandomBlockMatchTest(Blocks.DIORITE_WALL, 0.5f), AlwaysTrueTest.INSTANCE, GenerationsBlocks.BLEACH_STONE_SET.getWall())
)
)
)));

private static StructureProcessorList createProcessorList(ProcessorRule... processors) {
return new StructureProcessorList(ImmutableList.of(new RuleProcessor(ImmutableList.copyOf(processors))));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public class GenerationsStructureSettings {
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.LUGIA_SHRINE), 1,
ConstantHeight.of(VerticalAnchor.absolute(1)), Heightmap.Types.WORLD_SURFACE_WG));

public static final ResourceKey<Structure> REGI_SHRINE = register("shrines/regi", (context) ->
createJigsaw(structure(context.lookup(Registries.BIOME).getOrThrow(GenerationsBiomeTags.HAS_REGI_SHRINE), TerrainAdjustment.BEARD_THIN),
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.REGI_SHRINE), 1,
ConstantHeight.of(VerticalAnchor.absolute(1)), Heightmap.Types.WORLD_SURFACE_WG));

public static final ResourceKey<Structure> ISLANDS = register("islands", (context) ->
createJigsaw(structure(context.lookup(Registries.BIOME).getOrThrow(GenerationsBiomeTags.HAS_ISLANDS), TerrainAdjustment.NONE),
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.ISLANDS), 1,
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 Lugia shrine */
public static final TagKey<Biome> HAS_LUGIA_SHRINE = create("has_structure/lugia_shrine");

/** the tag for biomes that can have a Regi shrine */
public static final TagKey<Biome> HAS_REGI_SHRINE = create("has_structure/regi_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 @@ -59,6 +59,8 @@ public static void init() {
register("shrines/static", GenerationsStructureSettings.STATIC_SHRINE, 2000, 350, 442038945);

register("shrines/lugia", GenerationsStructureSettings.LUGIA_SHRINE, 2000, 350, 495104284);

register("shrines/regi", GenerationsStructureSettings.REGI_SHRINE, 2000, 350, 423098801);
}

private static void register(String id, StructureSetFactory factory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class GenerationsTemplatePools {
public static final ResourceKey<StructureTemplatePool> FIERY_SHRINE = registerSimple("shrines/fiery", GenerationsStructureSettings.FIERY_SHRINE, GenerationsProcessorLists.FIERY_SHRINE_PROCESSOR_LIST);
public static final ResourceKey<StructureTemplatePool> STATIC_SHRINE = registerSimple("shrines/static", GenerationsStructureSettings.STATIC_SHRINE, GenerationsProcessorLists.STATIC_SHRINE_PROCESSOR_LIST);
public static final ResourceKey<StructureTemplatePool> LUGIA_SHRINE = registerSimple("shrines/lugia", GenerationsStructureSettings.LUGIA_SHRINE, GenerationsProcessorLists.LUGIA_SHRINE_PROCESSOR_LIST);
public static final ResourceKey<StructureTemplatePool> REGI_SHRINE = registerSimple("shrines/regi", GenerationsStructureSettings.REGI_SHRINE, GenerationsProcessorLists.REGI_SHRINE_PROCESSOR_LIST);

public static final ResourceKey<StructureTemplatePool> PLAINS_VILLAGE_POKECENTER_STREETS = register("village/plains/streets/pokecenter", context -> createTemplatePool(getPool(context, VanillaVillages.PLAINS.getVillagePool("streets")), ImmutableList.of(
createPoolElement(context, GenerationsStructuresKeys.PLAINS_POKECENTER_STREET_CORNER_01, ProcessorLists.STREET_PLAINS, 1),
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(GenerationsBiomeTags.HAS_LUGIA_SHRINE)
.addTag(BiomeTags.IS_MOUNTAIN)
.addTag(BiomeTags.IS_FOREST);

tag(GenerationsBiomeTags.HAS_REGI_SHRINE)
.addOptionalTag(Tags.Biomes.IS_SNOWY)
.addOptionalTag(fabricTagMaker("snowy"));
}
}

Expand All @@ -144,7 +148,8 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
.addOptional(GenerationsStructureSettings.FROZEN_SHRINE.location())
.addOptional(GenerationsStructureSettings.FIERY_SHRINE.location())
.addOptional(GenerationsStructureSettings.STATIC_SHRINE.location())
.addOptional(GenerationsStructureSettings.LUGIA_SHRINE.location());
.addOptional(GenerationsStructureSettings.LUGIA_SHRINE.location())
.addOptional(GenerationsStructureSettings.REGI_SHRINE.location());

tag(GenerationsStructureTags.GENERATIONS_STRUCTURES)
.addTag(GenerationsStructureTags.POKESHOP)
Expand Down Expand Up @@ -201,6 +206,7 @@ public void generate(HolderLookup.@NotNull Provider arg, @NotNull Consumer<Advan
.addCriterion("fiery_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.FIERY_SHRINE)))
.addCriterion("static_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.STATIC_SHRINE)))
.addCriterion("lugia_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.LUGIA_SHRINE)))
.addCriterion("regi_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.REGI_SHRINE)))
.display(
CobblemonItems.MASTER_BALL.asItem(),
translateAble("title.shrines"),
Expand Down

0 comments on commit 821e4df

Please sign in to comment.