Skip to content

Commit

Permalink
Add Desert Pokecenter and marts
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph T. McQuigg <[email protected]>
  • Loading branch information
JT122406 committed Aug 31, 2024
1 parent 0845f15 commit 2aa5ffc
Show file tree
Hide file tree
Showing 16 changed files with 108 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"elements": [
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/pokecenter_1",
"processors": {
"processors": []
},
"projection": "rigid"
},
"weight": 1
},
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/pokecenter_2",
"processors": {
"processors": []
},
"projection": "rigid"
},
"weight": 1
},
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/pokecenter_3",
"processors": {
"processors": []
},
"projection": "rigid"
},
"weight": 1
}
],
"fallback": "generations_structures:village/desert/pokecenter"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"elements": [
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/streets/pokecenter/corner_01",
"processors": "minecraft:empty",
"projection": "terrain_matching"
},
"weight": 1
},
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/streets/pokecenter/straight_05",
"processors": "minecraft:empty",
"projection": "terrain_matching"
},
"weight": 1
}
],
"fallback": "minecraft:village/plains/streets"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"elements": [
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/streets/pokemart/corner_01",
"processors": "minecraft:empty",
"projection": "terrain_matching"
},
"weight": 1
},
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:village/desert/streets/pokemart/straight_05",
"processors": "minecraft:empty",
"projection": "terrain_matching"
},
"weight": 1
}
],
"fallback": "minecraft:village/plains/streets"
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private ResourceKey<StructureTemplatePool> modifyPoolKey(ResourceKey<StructureTe
String poolPath = key.location().getPath();
if (poolPath.endsWith("/streets")) {
VanillaVillages village = VanillaVillages.containsName(poolPath);
if (village != VanillaVillages.PLAINS) return key;
if (village != VanillaVillages.PLAINS && village != VanillaVillages.DESERT) return key;
if (!hasPokeCenter && pools.getHolder(village.getPokeCenterStreets()).isPresent()) {
hasPokeCenter = true;
return village.getPokeCenterStreets();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,16 @@ public interface GenerationsStructuresKeys {
ResourceKey<Structure> PLAINS_POKECENTER_3 = createKey("village/plains/pokecenter_3");


ResourceKey<Structure> DESERT_POKEMART_STREET_STRAIGHT_05 = createKey("village/desert/streets/pokemart/straight_05");
ResourceKey<Structure> DESERT_POKEMART_STREET_CORNER_01 = createKey("village/desert/streets/pokemart/corner_01");
ResourceKey<Structure> DESERT_POKECENTER_STREET_STRAIGHT_05 = createKey("village/desert/streets/pokecenter/straight_05");
ResourceKey<Structure> DESERT_POKECENTER_STREET_CORNER_01 = createKey("village/desert/streets/pokecenter/corner_01");
ResourceKey<Structure> DESERT_POKEMART_1 = createKey("village/desert/pokemart_1");
ResourceKey<Structure> DESERT_POKEMART_2 = createKey("village/desert/pokemart_2");
ResourceKey<Structure> DESERT_POKEMART_3 = createKey("village/desert/pokemart_3");
ResourceKey<Structure> DESERT_POKECENTER_1 = createKey("village/desert/pokecenter_1");
ResourceKey<Structure> DESERT_POKECENTER_2 = createKey("village/desert/pokecenter_2");
ResourceKey<Structure> DESERT_POKECENTER_3 = createKey("village/desert/pokecenter_3");
/**
* Creates a ResourceKey for the structure.
* @param name The name of the structure or directory with name.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.Pools;
import net.minecraft.data.worldgen.ProcessorLists;
import net.minecraft.data.worldgen.VillagePools;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
Expand Down Expand Up @@ -145,11 +143,27 @@ public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.PLAINS_POKEMART_3.location().toString()), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, DESERT_VILLAGE_POKEMART_STREETS, VanillaVillages.DESERT.getVillagePool("streets"), ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKEMART_STREET_CORNER_01.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKEMART_STREET_STRAIGHT_05.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.TERRAIN_MATCHING);

register(context, DESERT_VILLAGE_POKECENTER_STREETS, VanillaVillages.DESERT.getVillagePool("streets"), ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKECENTER_STREET_CORNER_01.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKECENTER_STREET_STRAIGHT_05.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.TERRAIN_MATCHING);

register(context, DESERT_VILLAGE_POKEMART, DESERT_VILLAGE_POKEMART, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKEMART_1.location().toString()), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKEMART_2.location().toString()), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKEMART_3.location().toString()), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, DESERT_VILLAGE_POKECENTER, DESERT_VILLAGE_POKECENTER, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKECENTER_1.location().toString()), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKECENTER_2.location().toString()), 1),
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.DESERT_POKECENTER_3.location().toString()), 1)
), StructureTemplatePool.Projection.RIGID);
}

private static ResourceKey<StructureTemplatePool> create(String name) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 2aa5ffc

Please sign in to comment.