generated from GenerationsMod/GenerationsModuleTemplateOld
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
48 changes: 48 additions & 0 deletions
48
...gg/generations/structures/generationsstructures/processors/GenerationsProcessorLists.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package generations.gg.generations.structures.generationsstructures.processors; | ||
|
||
import com.google.common.collect.ImmutableList; | ||
import generations.gg.generations.structures.generationsstructures.GenerationsStructures; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.data.worldgen.BootstapContext; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList; | ||
|
||
/** | ||
* This class is used to hold all the ProcessorLists | ||
* @see net.minecraft.data.worldgen.ProcessorLists | ||
* @author Joseph T. McQuigg | ||
*/ | ||
public class GenerationsProcessorLists { | ||
|
||
public static ResourceKey<StructureProcessorList> GYM_PROCESSOR_LIST = create("gym_processor_list"); | ||
public static ResourceKey<StructureProcessorList> SCARLET_POKESHOP_PROCESSOR_LIST = create("scarlet_pokeshop_processor_list"); | ||
|
||
/** | ||
* This method is used to bootstrap the processorlists. | ||
* @param context The bootstrap context | ||
*/ | ||
public static void bootstrap(BootstapContext<StructureProcessorList> context) { | ||
StructureProcessors.init(); | ||
register(context, SCARLET_POKESHOP_PROCESSOR_LIST, new StructureProcessorList(ImmutableList.of(new ScarletPokeShopProcessor()))); | ||
register(context, GYM_PROCESSOR_LIST, new StructureProcessorList(ImmutableList.of(new GymProcessor()))); | ||
} | ||
|
||
/** | ||
* Registers a ProcessorList with the given key and StructureProcessorList. | ||
* @param context The bootstrap context | ||
* @param key The key for the ProcessorList | ||
* @param structureProcessorList The StructureProcessorList to register | ||
*/ | ||
private static void register(BootstapContext<StructureProcessorList> context, ResourceKey<StructureProcessorList> key, StructureProcessorList structureProcessorList) { | ||
context.register(key, structureProcessorList); | ||
} | ||
|
||
/** | ||
* Creates a ResourceKey for the ProcessorList. | ||
* @param name of the structure set or directory with name. | ||
* @return ResourceKey<StructureProcessorList> | ||
*/ | ||
private static ResourceKey<StructureProcessorList> create(String name) { | ||
return ResourceKey.create(Registries.PROCESSOR_LIST, GenerationsStructures.id(name)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters