Skip to content

Commit

Permalink
Move Structures to match where the key location is.
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Nov 28, 2023
1 parent 49dc786 commit 2b63193
Show file tree
Hide file tree
Showing 20 changed files with 19 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/comet",
"location": "generations_structures:comet",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/loot_balloon/beast_balloon",
"location": "generations_structures:loot_balloon/beast_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/loot_balloon/great_balloon",
"location": "generations_structures:loot_balloon/great_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/loot_balloon/master_balloon",
"location": "generations_structures:loot_balloon/master_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/loot_balloon/meowth_balloon",
"location": "generations_structures:loot_balloon/meowth_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/normal_balloon/beast_balloon",
"location": "generations_structures:loot_balloon/normal_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/loot_balloon/ultra_balloon",
"location": "generations_structures:loot_balloon/ultra_balloon",
"processors": "minecraft:empty",
"projection": "rigid"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:overworld/scarlet_pokeshop",
"location": "generations_structures:scarlet_pokeshop",
"processors": {
"processors": []
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"element": {
"element_type": "minecraft:single_pool_element",
"location": "generations_structures:nether/spike",
"location": "generations_structures:spike",
"processors": "minecraft:empty",
"projection": "terrain_matching"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.collect.ImmutableList;
import com.mojang.datafixers.util.Pair;
import generations.gg.generations.structures.generationsstructures.GenerationsStructures;
import generations.gg.generations.structures.generationsstructures.structures.GenerationsStructuresKeys;
import net.minecraft.core.Holder;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstapContext;
Expand Down Expand Up @@ -31,41 +32,41 @@ public class GenerationsTemplatePools {

public static void bootstrap(BootstapContext<StructureTemplatePool> context) {
register(context, BEAST_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("loot_balloon/beast_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.BEAST_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, GREAT_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("loot_balloon/great_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.GREAT_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, MASTER_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("loot_balloon/master_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.MASTER_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, MEOWTH_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("loot_balloon/meowth_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.MEOWTH_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, NORMAL_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("normal_balloon/beast_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.NORMAL_BALLOON.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, ULTRA_BALLOON, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("loot_balloon/ultra_balloon"), getProcessor(context, ProcessorLists.EMPTY)), 1)
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(getOverworldPath("comet"), getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.COMET.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.RIGID);

register(context, SCARLET_POKESHOP, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single(getOverworldPath("scarlet_pokeshop")), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.SCARLET_POKESHOP.location().toString()), 1)
), StructureTemplatePool.Projection.RIGID);


register(context, SPIKE, Pools.EMPTY, ImmutableList.of(
Pair.of(StructurePoolElement.single("generations_structures:nether/spike", getProcessor(context, ProcessorLists.EMPTY)), 1)
Pair.of(StructurePoolElement.single(GenerationsStructuresKeys.SPIKE.location().toString(), getProcessor(context, ProcessorLists.EMPTY)), 1)
), StructureTemplatePool.Projection.TERRAIN_MATCHING);
}

Expand All @@ -77,10 +78,6 @@ private static void register(BootstapContext<StructureTemplatePool> context, Res
context.register(key, new StructureTemplatePool(context.lookup(Registries.TEMPLATE_POOL).getOrThrow(fallback), rawTemplateFactories, projection));
}

private static String getOverworldPath(String name) {
return "generations_structures:overworld/" + name;
}

private static Holder.Reference<StructureProcessorList> getProcessor(BootstapContext<StructureTemplatePool> context, ResourceKey<StructureProcessorList> processorList) {
return context.lookup(Registries.PROCESSOR_LIST).getOrThrow(processorList);
}
Expand Down

0 comments on commit 2b63193

Please sign in to comment.