Skip to content

Commit

Permalink
Add Haunted Mansion
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph T. McQuigg <[email protected]>
  • Loading branch information
JT122406 committed Nov 29, 2024
1 parent 77a8115 commit 46ed296
Show file tree
Hide file tree
Showing 15 changed files with 235 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# 1.1.3-Beta
- Add Haunted Mansion Shrine

# 1.1.2-Beta
- Fix Meowth Balloon having sign and no loot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,22 @@
},
"trigger": "minecraft:location"
},
"haunted_mansion": {
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"structure": "generations_structures:shrines/haunted_mansion"
}
}
}
]
},
"trigger": "minecraft:location"
},
"lugia_shrine": {
"conditions": {
"player": [
Expand Down Expand Up @@ -189,6 +205,9 @@
],
[
"tapu_shrine"
],
[
"haunted_mansion"
]
],
"sends_telemetry_event": true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"values": [
{
"id": "#forge:is_spooky",
"required": false
},
{
"id": "#c:floral_forests",
"required": false
},
"minecraft:dark_forest",
"minecraft:flower_forest"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
{
"id": "generations_structures:shrines/tapu",
"required": false
},
{
"id": "generations_structures:shrines/haunted_mansion",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"processors": [
{
"processor_type": "moreprocessors:same_state_rule",
"rules": [
{
"input_predicate": {
"block": "minecraft:cobblestone_wall",
"predicate_type": "minecraft:random_block_match",
"probability": 0.5
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_location": "minecraft:mossy_cobblestone_wall"
}
]
},
{
"processor_type": "minecraft:rule",
"rules": [
{
"input_predicate": {
"block": "minecraft:dark_oak_slab",
"predicate_type": "minecraft:random_block_match",
"probability": 0.07
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "minecraft:cobweb"
}
},
{
"input_predicate": {
"block": "minecraft:dark_oak_slab",
"predicate_type": "minecraft:random_block_match",
"probability": 0.02
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "minecraft:air"
}
},
{
"input_predicate": {
"block": "minecraft:stone_bricks",
"predicate_type": "minecraft:random_block_match",
"probability": 0.25
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "minecraft:mossy_stone_bricks"
}
},
{
"input_predicate": {
"block": "minecraft:gray_concrete",
"predicate_type": "minecraft:random_block_match",
"probability": 0.25
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "minecraft:gray_concrete_powder"
}
},
{
"input_predicate": {
"block": "minecraft:gray_concrete",
"predicate_type": "minecraft:random_block_match",
"probability": 0.25
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_state": {
"Name": "minecraft:gray_wool"
}
}
]
},
{
"processor_type": "moreprocessors:compat_rule",
"rules": [
{
"input_predicate": {
"block": "minecraft:flower_pot",
"predicate_type": "minecraft:block_match"
},
"location_predicate": {
"predicate_type": "minecraft:always_true"
},
"output_location": "biomeswevegone:potted_black_rose",
"output_state": {
"Name": "biomeswevegone:potted_black_rose"
}
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "minecraft:jigsaw",
"biomes": "#generations_structures:has_structure/haunted_mansion",
"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/haunted_mansion",
"step": "surface_structures",
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"placement": {
"type": "minecraft:random_spread",
"salt": 282258907,
"separation": 350,
"spacing": 2000
},
"structures": [
{
"structure": "generations_structures:shrines/haunted_mansion",
"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/haunted_mansion",
"processors": "generations_structures:shrines/haunted_mansion_processor_list",
"projection": "rigid"
},
"weight": 1
}
],
"fallback": "minecraft:empty"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.levelgen.structure.templatesystem.*;
Expand Down Expand Up @@ -214,6 +215,29 @@ public class GenerationsProcessorLists {
)
)));

public static final ResourceKey<StructureProcessorList> HAUNTED_MANSION_PROCESSOR_LIST = register("shrines/haunted_mansion", context -> new StructureProcessorList(ImmutableList.of(
new SameStateRuleProcessor(
ImmutableList.of(
new SameStateProcessorRule(new RandomBlockMatchTest(Blocks.COBBLESTONE_WALL, 0.5f), Blocks.MOSSY_COBBLESTONE_WALL)
)
),
new RuleProcessor(
ImmutableList.of(
new ProcessorRule(new RandomBlockMatchTest(Blocks.DARK_OAK_SLAB, 0.07f), AlwaysTrueTest.INSTANCE, Blocks.COBWEB.defaultBlockState()),
new ProcessorRule(new RandomBlockMatchTest(Blocks.DARK_OAK_SLAB, 0.02f), AlwaysTrueTest.INSTANCE, Blocks.AIR.defaultBlockState()),
new ProcessorRule(new RandomBlockMatchTest(Blocks.STONE_BRICKS, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.MOSSY_STONE_BRICKS.defaultBlockState()),
new ProcessorRule(new RandomBlockMatchTest(Blocks.GRAY_CONCRETE, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.GRAY_CONCRETE_POWDER.defaultBlockState()),
new ProcessorRule(new RandomBlockMatchTest(Blocks.GRAY_CONCRETE, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.GRAY_WOOL.defaultBlockState())
)
),
new CompatRuleProcessor(
ImmutableList.of(
new CompatProcessorRule(new BlockMatchTest(Blocks.FLOWER_POT), BWGBlocks.BLACK_ROSE.getPottedBlock())
)
)

)));

public static final ResourceKey<StructureProcessorList> MEOWTH_BALLOON_PROCESSOR_LIST = register("meowth_balloon", context -> new StructureProcessorList(ImmutableList.of(
new SameStateRuleProcessor(
ImmutableList.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public class GenerationsStructureSettings {
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.TAPU_SHRINE), 1,
ConstantHeight.of(VerticalAnchor.absolute(1)), Heightmap.Types.WORLD_SURFACE_WG));

public static final ResourceKey<Structure> HAUNTED_MANSION = register("shrines/haunted_mansion", (context) ->
createJigsaw(structure(context.lookup(Registries.BIOME).getOrThrow(GenerationsBiomeTags.HAS_HAUNTED_MANSION), TerrainAdjustment.NONE),
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.HAUNTED_MANSION), 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 @@ -51,6 +51,9 @@ public class GenerationsBiomeTags {
/** the tag for biomes that can have a Tapu shrine */
public static final TagKey<Biome> HAS_TAPU_SHRINE = create("has_structure/tapu_shrine");

/** the tag for biomes that can have a haunted mansion */
public static final TagKey<Biome> HAS_HAUNTED_MANSION = create("has_structure/haunted_mansion");

/**
* 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 @@ -69,6 +69,8 @@ public static void init() {
register("shrines/groudon", GenerationsStructureSettings.GROUDON_SHRINE, 2000, 350, 629507014);

register("shrines/tapu", GenerationsStructureSettings.TAPU_SHRINE, 2000, 350, 647365027);

register("shrines/haunted_mansion", GenerationsStructureSettings.HAUNTED_MANSION, 2000, 350, 282258907);
}

private static void register(String id, StructureSetFactory factory) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public class GenerationsTemplatePools {

public static final ResourceKey<StructureTemplatePool> TAPU_SHRINE = registerSimple("shrines/tapu", GenerationsStructureSettings.TAPU_SHRINE, GenerationsProcessorLists.TAPU_SHRINE_PROCESSOR_LIST);

public static final ResourceKey<StructureTemplatePool> HAUNTED_MANSION = registerSimple("shrines/haunted_mansion", GenerationsStructureSettings.HAUNTED_MANSION, GenerationsProcessorLists.HAUNTED_MANSION_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),
createPoolElement(context, GenerationsStructuresKeys.PLAINS_POKECENTER_STREET_STRAIGHT_05, ProcessorLists.STREET_PLAINS, 1)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package generations.gg.generations.structures.generationsstructures.forge.datagen;

import biomesoplenty.api.biome.BOPBiomes;
//import biomesoplenty.api.biome.BOPBiomes;
import com.cobblemon.mod.common.CobblemonItems;
import com.google.common.collect.ImmutableList;
import generations.gg.generations.core.generationscore.common.GenerationsCore;
Expand Down Expand Up @@ -118,8 +118,8 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(GenerationsBiomeTags.HAS_FIERY_SHRINE)
.addTag(BiomeTags.IS_NETHER)
.addOptionalTag(Tags.Biomes.IS_DESERT)
.addOptionalTag(fabricTagMaker("desert"))
.addOptional(BOPBiomes.VOLCANIC_PLAINS.location());
.addOptionalTag(fabricTagMaker("desert"));
//.addOptional(BOPBiomes.VOLCANIC_PLAINS.location());

tag(GenerationsBiomeTags.HAS_STATIC_SHRINE)
.addTag(BiomeTags.IS_SAVANNA);
Expand Down Expand Up @@ -149,6 +149,11 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(GenerationsBiomeTags.HAS_TAPU_SHRINE)
.addTag(BiomeTags.IS_JUNGLE)
.addOptionalTag(fabricTagMaker("jungle"));

tag(GenerationsBiomeTags.HAS_HAUNTED_MANSION)
.addOptionalTag(Tags.Biomes.IS_SPOOKY)
.addOptionalTag(fabricTagMaker("floral_forests"))
.add(Biomes.DARK_FOREST, Biomes.FLOWER_FOREST);
}
}

Expand Down Expand Up @@ -179,15 +184,15 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
.addOptional(GenerationsStructureSettings.CREATION_TRIO_SHRINE.location())
.addOptional(GenerationsStructureSettings.FORCES_OF_NATURE_SHRINE.location())
.addOptional(GenerationsStructureSettings.GROUDON_SHRINE.location())
.addOptional(GenerationsStructureSettings.TAPU_SHRINE.location());
.addOptional(GenerationsStructureSettings.TAPU_SHRINE.location())
.addOptional(GenerationsStructureSettings.HAUNTED_MANSION.location());
tag(GenerationsStructureTags.GENERATIONS_STRUCTURES)
.addTag(GenerationsStructureTags.POKESHOP)
.addTag(GenerationsStructureTags.LOOT_BALLOONS)
//.addTag(GenerationsStructureTags.GYMS)
.addTag(GenerationsStructureTags.SHRINES)
.addOptional(GenerationsStructureSettings.COMET.location())
.addOptional(GenerationsStructureSettings.ISLANDS.location());

}
}

Expand Down Expand Up @@ -240,6 +245,7 @@ public void generate(HolderLookup.@NotNull Provider arg, @NotNull Consumer<Advan
.addCriterion("forces_of_nature_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.FORCES_OF_NATURE_SHRINE)))
.addCriterion("groudon_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.GROUDON_SHRINE)))
.addCriterion("tapu_shrine", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.TAPU_SHRINE)))
.addCriterion("haunted_mansion", PlayerTrigger.TriggerInstance.located(LocationPredicate.inStructure(GenerationsStructureSettings.HAUNTED_MANSION)))
.display(
GenerationsShrines.LUNAR_SHRINE.getOrNull(),
translateAble("title.shrines"),
Expand Down

0 comments on commit 46ed296

Please sign in to comment.