[Feature] Helper to register Processors in DataGen
This commit is contained in:
parent
236d773d08
commit
3a25f4a726
1 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
package org.betterx.bclib.api.v3.datagen;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.BootstapContext;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor;
|
||||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ProcessorHelper {
|
||||
public static ResourceKey<StructureProcessorList> createKey(ResourceLocation id) {
|
||||
return ResourceKey.create(Registries.PROCESSOR_LIST, id);
|
||||
}
|
||||
|
||||
public static void register(
|
||||
BootstapContext<StructureProcessorList> bootstapContext,
|
||||
ResourceKey<StructureProcessorList> resourceKey,
|
||||
List<StructureProcessor> list
|
||||
) {
|
||||
bootstapContext.register(resourceKey, new StructureProcessorList(list));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue