Skip to content

Commit

Permalink
Remove Village Gen temp and refactor pokecenters
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Mar 27, 2024
1 parent d353729 commit 790ab1f
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
{
"id": "generations_structures:scarlet_pokecenter",
"required": false
},
{
"id": "generations_structures:large_pokecenter",
"required": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"type": "minecraft:jigsaw",
"biomes": "#generations_structures:has_structure/pokecenter",
"max_distance_from_center": 80,
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"size": 1,
"spawn_overrides": {},
"start_height": {
"absolute": 1
},
"start_pool": "generations_structures:large_pokecenter",
"step": "surface_structures",
"terrain_adaptation": "beard_thin",
"use_expansion_hack": false
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "minecraft:jigsaw",
"biomes": "#generations_structures:has_structure/scarlet_pokecenter",
"biomes": "#generations_structures:has_structure/pokecenter",
"max_distance_from_center": 80,
"project_start_to_heightmap": "WORLD_SURFACE_WG",
"size": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
{
"structure": "generations_structures:scarlet_pokecenter",
"weight": 1
},
{
"structure": "generations_structures:large_pokecenter",
"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:large_pokecenter",
"processors": "generations_structures:pokecenter_processor_list",
"projection": "rigid"
},
"weight": 1
}
],
"fallback": "minecraft:empty"
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static void bootstrap(BootstapContext<Structure> context) {
));
registerStructure(context, GenerationsStructuresKeys.SCARLET_POKECENTER, createJigsaw(
new Structure.StructureSettings(
biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_SCARLET_POKECENTER),
biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_POKECENTER),
Map.of(),
GenerationStep.Decoration.SURFACE_STRUCTURES,
TerrainAdjustment.BEARD_THIN
Expand All @@ -61,6 +61,19 @@ public static void bootstrap(BootstapContext<Structure> context) {
Heightmap.Types.WORLD_SURFACE_WG
));

registerStructure(context, GenerationsStructuresKeys.LARGE_POKECENTER, createJigsaw(
new Structure.StructureSettings(
biomeHolderGetter.getOrThrow(GenerationsBiomeTags.HAS_POKECENTER),
Map.of(),
GenerationStep.Decoration.SURFACE_STRUCTURES,
TerrainAdjustment.BEARD_THIN
),
poolHolderGetter.getOrThrow(GenerationsTemplatePools.LARGE_POKECENTER),
1,
ConstantHeight.of(VerticalAnchor.absolute(1)),
Heightmap.Types.WORLD_SURFACE_WG
));

registerStructure(context, GenerationsStructuresKeys.SPIKE,
createJigsaw(
new Structure.StructureSettings(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public interface GenerationsStructuresKeys {
ResourceKey<Structure> COMET = createKey("comet");

/** PokeShop Structure ResourceKey **/
ResourceKey<Structure> POKESHOP = createKey("pokeshop");
ResourceKey<Structure> LARGE_POKESHOP = createKey("large_pokeshop");

/** PokeCenter Structure ResourceKey **/
ResourceKey<Structure> POKECENTER = createKey("pokecenter");
ResourceKey<Structure> LARGE_POKECENTER = createKey("large_pokecenter");

/** Island Structure ResourceKey **/
ResourceKey<Structure> ISLANDS = createKey("islands");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class GenerationsBiomeTags {
public static final TagKey<Biome> IS_NOT_MOUNTAIN = create("is_not_mountain");

/** the tag for biomes that have a Scarlet Pokeshop */
public static final TagKey<Biome> HAS_SCARLET_POKECENTER = create("has_structure/scarlet_pokecenter");
public static final TagKey<Biome> HAS_POKECENTER = create("has_structure/pokecenter");

/** the tag for biomes that have a Loot Balloon */
public static final TagKey<Biome> HAS_LOOT_BALLOON = create("has_structure/loot_balloon");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ public static void bootstrap(BootstapContext<StructureSet> context) {
register(context, COMET, GenerationsStructuresKeys.COMET,
new RandomSpreadStructurePlacement(150, 85, RandomSpreadType.LINEAR, 1189082690));

register(context, POKESHOPS, GenerationsStructuresKeys.SCARLET_POKECENTER,
register(context, POKESHOPS,
ImmutableList.of(
createStructureSelectionEntry(context, GenerationsStructuresKeys.SCARLET_POKECENTER, 1),
createStructureSelectionEntry(context, GenerationsStructuresKeys.LARGE_POKECENTER, 1)
),
new RandomSpreadStructurePlacement(400, 250, RandomSpreadType.LINEAR, 293756737));

register(context, SPIKE, GenerationsStructuresKeys.SPIKE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.data.worldgen.PlainVillagePools;
import net.minecraft.data.worldgen.Pools;
import net.minecraft.data.worldgen.ProcessorLists;
import net.minecraft.resources.ResourceKey;
Expand All @@ -31,8 +30,8 @@ public class GenerationsTemplatePools {
public static final ResourceKey<StructureTemplatePool> COMET = create("comet");
public static final ResourceKey<StructureTemplatePool> SCARLET_POKECENTER = create("scarlet_pokecenter");
public static final ResourceKey<StructureTemplatePool> SCARLET_POKECENTER_ANTENNA = create("scarlet_pokecenter_antenna");
public static final ResourceKey<StructureTemplatePool> LARGE_POKECENTER = create("large_pokecenter");
public static final ResourceKey<StructureTemplatePool> SPIKE = create("spike");
public static final ResourceKey<StructureTemplatePool> POKE_VILLAGE = create("village/plains/poke_village");
public static final ResourceKey<StructureTemplatePool> ISLANDS = create("islands");
public static final ResourceKey<StructureTemplatePool> FROZEN_SHRINE = create("shrines/frozen_shrine");
public static final ResourceKey<StructureTemplatePool> FIERY_SHRINE = create("shrines/fiery_shrine");
Expand Down Expand Up @@ -65,7 +64,6 @@ public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.ULTRA_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);


register(context, COMET, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.COMET.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);
Expand All @@ -82,9 +80,8 @@ public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.SPIKE.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.TERRAIN_MATCHING);

register(context, POKE_VILLAGE, context.lookup(Registries.TEMPLATE_POOL).getOrThrow(PlainVillagePools.TERMINATORS_KEY).key(), ImmutableList.of(
Pair.of(StructurePoolElement.legacy(GenerationsStructuresKeys.POKESHOP.location().toString(), getProcessor(context, GenerationsProcessorLists.POKECENTER_PROCESSOR_LIST)), 2),
Pair.of(StructurePoolElement.legacy(GenerationsStructuresKeys.POKECENTER.location().toString(), getProcessor(context, GenerationsProcessorLists.POKECENTER_PROCESSOR_LIST)), 2)
register(context, LARGE_POKECENTER, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.LARGE_POKECENTER.location().toString(), getProcessor(context, GenerationsProcessorLists.POKECENTER_PROCESSOR_LIST)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, ISLANDS, Pools.EMPTY, ImmutableList.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public class GenerationsStructuresFabric implements ModInitializer {
public void onInitialize() {
GenerationsStructures.init(new Default()); //TODO: FabricLoader.getInstance().isModLoaded(potionstudios.byg.BYG.MOD_ID) ? new BYG() : new Default()
StructureProcessors.init();
ServerLifecycleEvents.SERVER_STARTING.register(PlaceInVillage::addStructuresToVillages);
//ServerLifecycleEvents.SERVER_STARTING.register(PlaceInVillage::addStructuresToVillages);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public GenerationsStructuresForge() {
GenerationsStructures.init(integration);
IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus();
bus.addListener(this::commonSetup);
MinecraftForge.EVENT_BUS.addListener(LifeCycleEvents::aboutToStartEvent);
//MinecraftForge.EVENT_BUS.addListener(LifeCycleEvents::aboutToStartEvent);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected void addTags(HolderLookup.@NotNull Provider provider) {
.addOptionalTag(Tags.Biomes.IS_PLAINS).addOptionalTag(Tags.Biomes.IS_DESERT)
.addOptionalTag(fabricTagMaker("plains"));

tag(GenerationsBiomeTags.HAS_SCARLET_POKECENTER)
tag(GenerationsBiomeTags.HAS_POKECENTER)
.addTag(BiomeTags.IS_OVERWORLD)
.addOptionalTag(Tags.Biomes.IS_PLAINS.location())
.addOptionalTag(fabricTagMaker("plains"));
Expand Down Expand Up @@ -115,7 +115,9 @@ public GenerationsStructureTagsProvider(PackOutput arg, CompletableFuture<Holder

@Override
protected void addTags(HolderLookup.@NotNull Provider provider) {
tag(GenerationsStructureTags.POKESHOP).addOptional(GenerationsStructuresKeys.SCARLET_POKECENTER.location());
tag(GenerationsStructureTags.POKESHOP)
.addOptional(GenerationsStructuresKeys.SCARLET_POKECENTER.location())
.addOptional(GenerationsStructuresKeys.LARGE_POKECENTER.location());
tag(GenerationsStructureTags.LOOT_BALLOONS)
.addOptional(GenerationsStructuresKeys.POKE_BALLOON.location())
.addOptional(GenerationsStructuresKeys.GREAT_BALLOON.location())
Expand Down

0 comments on commit 790ab1f

Please sign in to comment.