Skip to content

Commit 46ed296

Browse files
committed
Add Haunted Mansion
Signed-off-by: Joseph T. McQuigg <J.T.McQuigg12@gmail.com>
1 parent 77a8115 commit 46ed296

File tree

15 files changed

+235
-5
lines changed

15 files changed

+235
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# 1.1.3-Beta
2+
- Add Haunted Mansion Shrine
23

34
# 1.1.2-Beta
45
- Fix Meowth Balloon having sign and no loot

common/src/main/generated/resources/data/generations_structures/advancements/generations_structures/shrines.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,22 @@
8181
},
8282
"trigger": "minecraft:location"
8383
},
84+
"haunted_mansion": {
85+
"conditions": {
86+
"player": [
87+
{
88+
"condition": "minecraft:entity_properties",
89+
"entity": "this",
90+
"predicate": {
91+
"location": {
92+
"structure": "generations_structures:shrines/haunted_mansion"
93+
}
94+
}
95+
}
96+
]
97+
},
98+
"trigger": "minecraft:location"
99+
},
84100
"lugia_shrine": {
85101
"conditions": {
86102
"player": [
@@ -189,6 +205,9 @@
189205
],
190206
[
191207
"tapu_shrine"
208+
],
209+
[
210+
"haunted_mansion"
192211
]
193212
],
194213
"sends_telemetry_event": true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"values": [
3+
{
4+
"id": "#forge:is_spooky",
5+
"required": false
6+
},
7+
{
8+
"id": "#c:floral_forests",
9+
"required": false
10+
},
11+
"minecraft:dark_forest",
12+
"minecraft:flower_forest"
13+
]
14+
}

common/src/main/generated/resources/data/generations_structures/tags/worldgen/structure/shrines.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
{
3636
"id": "generations_structures:shrines/tapu",
3737
"required": false
38+
},
39+
{
40+
"id": "generations_structures:shrines/haunted_mansion",
41+
"required": false
3842
}
3943
]
4044
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
{
2+
"processors": [
3+
{
4+
"processor_type": "moreprocessors:same_state_rule",
5+
"rules": [
6+
{
7+
"input_predicate": {
8+
"block": "minecraft:cobblestone_wall",
9+
"predicate_type": "minecraft:random_block_match",
10+
"probability": 0.5
11+
},
12+
"location_predicate": {
13+
"predicate_type": "minecraft:always_true"
14+
},
15+
"output_location": "minecraft:mossy_cobblestone_wall"
16+
}
17+
]
18+
},
19+
{
20+
"processor_type": "minecraft:rule",
21+
"rules": [
22+
{
23+
"input_predicate": {
24+
"block": "minecraft:dark_oak_slab",
25+
"predicate_type": "minecraft:random_block_match",
26+
"probability": 0.07
27+
},
28+
"location_predicate": {
29+
"predicate_type": "minecraft:always_true"
30+
},
31+
"output_state": {
32+
"Name": "minecraft:cobweb"
33+
}
34+
},
35+
{
36+
"input_predicate": {
37+
"block": "minecraft:dark_oak_slab",
38+
"predicate_type": "minecraft:random_block_match",
39+
"probability": 0.02
40+
},
41+
"location_predicate": {
42+
"predicate_type": "minecraft:always_true"
43+
},
44+
"output_state": {
45+
"Name": "minecraft:air"
46+
}
47+
},
48+
{
49+
"input_predicate": {
50+
"block": "minecraft:stone_bricks",
51+
"predicate_type": "minecraft:random_block_match",
52+
"probability": 0.25
53+
},
54+
"location_predicate": {
55+
"predicate_type": "minecraft:always_true"
56+
},
57+
"output_state": {
58+
"Name": "minecraft:mossy_stone_bricks"
59+
}
60+
},
61+
{
62+
"input_predicate": {
63+
"block": "minecraft:gray_concrete",
64+
"predicate_type": "minecraft:random_block_match",
65+
"probability": 0.25
66+
},
67+
"location_predicate": {
68+
"predicate_type": "minecraft:always_true"
69+
},
70+
"output_state": {
71+
"Name": "minecraft:gray_concrete_powder"
72+
}
73+
},
74+
{
75+
"input_predicate": {
76+
"block": "minecraft:gray_concrete",
77+
"predicate_type": "minecraft:random_block_match",
78+
"probability": 0.25
79+
},
80+
"location_predicate": {
81+
"predicate_type": "minecraft:always_true"
82+
},
83+
"output_state": {
84+
"Name": "minecraft:gray_wool"
85+
}
86+
}
87+
]
88+
},
89+
{
90+
"processor_type": "moreprocessors:compat_rule",
91+
"rules": [
92+
{
93+
"input_predicate": {
94+
"block": "minecraft:flower_pot",
95+
"predicate_type": "minecraft:block_match"
96+
},
97+
"location_predicate": {
98+
"predicate_type": "minecraft:always_true"
99+
},
100+
"output_location": "biomeswevegone:potted_black_rose",
101+
"output_state": {
102+
"Name": "biomeswevegone:potted_black_rose"
103+
}
104+
}
105+
]
106+
}
107+
]
108+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "minecraft:jigsaw",
3+
"biomes": "#generations_structures:has_structure/haunted_mansion",
4+
"max_distance_from_center": 80,
5+
"project_start_to_heightmap": "WORLD_SURFACE_WG",
6+
"size": 1,
7+
"spawn_overrides": {},
8+
"start_height": {
9+
"absolute": 1
10+
},
11+
"start_pool": "generations_structures:shrines/haunted_mansion",
12+
"step": "surface_structures",
13+
"use_expansion_hack": false
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"placement": {
3+
"type": "minecraft:random_spread",
4+
"salt": 282258907,
5+
"separation": 350,
6+
"spacing": 2000
7+
},
8+
"structures": [
9+
{
10+
"structure": "generations_structures:shrines/haunted_mansion",
11+
"weight": 1
12+
}
13+
]
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"elements": [
3+
{
4+
"element": {
5+
"element_type": "minecraft:single_pool_element",
6+
"location": "generations_structures:shrines/haunted_mansion",
7+
"processors": "generations_structures:shrines/haunted_mansion_processor_list",
8+
"projection": "rigid"
9+
},
10+
"weight": 1
11+
}
12+
],
13+
"fallback": "minecraft:empty"
14+
}

common/src/main/java/generations/gg/generations/structures/generationsstructures/processors/GenerationsProcessorLists.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import net.minecraft.core.HolderGetter;
1212
import net.minecraft.core.registries.Registries;
1313
import net.minecraft.resources.ResourceKey;
14+
import net.minecraft.world.level.block.Block;
1415
import net.minecraft.world.level.block.Blocks;
1516
import net.minecraft.world.level.block.LeavesBlock;
1617
import net.minecraft.world.level.levelgen.structure.templatesystem.*;
@@ -214,6 +215,29 @@ public class GenerationsProcessorLists {
214215
)
215216
)));
216217

218+
public static final ResourceKey<StructureProcessorList> HAUNTED_MANSION_PROCESSOR_LIST = register("shrines/haunted_mansion", context -> new StructureProcessorList(ImmutableList.of(
219+
new SameStateRuleProcessor(
220+
ImmutableList.of(
221+
new SameStateProcessorRule(new RandomBlockMatchTest(Blocks.COBBLESTONE_WALL, 0.5f), Blocks.MOSSY_COBBLESTONE_WALL)
222+
)
223+
),
224+
new RuleProcessor(
225+
ImmutableList.of(
226+
new ProcessorRule(new RandomBlockMatchTest(Blocks.DARK_OAK_SLAB, 0.07f), AlwaysTrueTest.INSTANCE, Blocks.COBWEB.defaultBlockState()),
227+
new ProcessorRule(new RandomBlockMatchTest(Blocks.DARK_OAK_SLAB, 0.02f), AlwaysTrueTest.INSTANCE, Blocks.AIR.defaultBlockState()),
228+
new ProcessorRule(new RandomBlockMatchTest(Blocks.STONE_BRICKS, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.MOSSY_STONE_BRICKS.defaultBlockState()),
229+
new ProcessorRule(new RandomBlockMatchTest(Blocks.GRAY_CONCRETE, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.GRAY_CONCRETE_POWDER.defaultBlockState()),
230+
new ProcessorRule(new RandomBlockMatchTest(Blocks.GRAY_CONCRETE, 0.25f), AlwaysTrueTest.INSTANCE, Blocks.GRAY_WOOL.defaultBlockState())
231+
)
232+
),
233+
new CompatRuleProcessor(
234+
ImmutableList.of(
235+
new CompatProcessorRule(new BlockMatchTest(Blocks.FLOWER_POT), BWGBlocks.BLACK_ROSE.getPottedBlock())
236+
)
237+
)
238+
239+
)));
240+
217241
public static final ResourceKey<StructureProcessorList> MEOWTH_BALLOON_PROCESSOR_LIST = register("meowth_balloon", context -> new StructureProcessorList(ImmutableList.of(
218242
new SameStateRuleProcessor(
219243
ImmutableList.of(

common/src/main/java/generations/gg/generations/structures/generationsstructures/structures/GenerationsStructureSettings.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public class GenerationsStructureSettings {
112112
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.TAPU_SHRINE), 1,
113113
ConstantHeight.of(VerticalAnchor.absolute(1)), Heightmap.Types.WORLD_SURFACE_WG));
114114

115+
public static final ResourceKey<Structure> HAUNTED_MANSION = register("shrines/haunted_mansion", (context) ->
116+
createJigsaw(structure(context.lookup(Registries.BIOME).getOrThrow(GenerationsBiomeTags.HAS_HAUNTED_MANSION), TerrainAdjustment.NONE),
117+
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.HAUNTED_MANSION), 1,
118+
ConstantHeight.of(VerticalAnchor.absolute(1)), Heightmap.Types.WORLD_SURFACE_WG));
119+
115120
public static final ResourceKey<Structure> ISLANDS = register("islands", (context) ->
116121
createJigsaw(structure(context.lookup(Registries.BIOME).getOrThrow(GenerationsBiomeTags.HAS_ISLANDS), TerrainAdjustment.NONE),
117122
context.lookup(Registries.TEMPLATE_POOL).getOrThrow(GenerationsTemplatePools.ISLANDS), 1,

0 commit comments

Comments
 (0)