public class RegistryHelper
extends java.lang.Object
Constructor and Description |
---|
RegistryHelper() |
Modifier and Type | Method and Description |
---|---|
static net.minecraft.world.gen.feature.template.StructureProcessorList |
combineProcessors(net.minecraft.world.gen.feature.template.StructureProcessorList... lists)
Merges the passed
StructureProcessorList array and returns the
result. |
static net.minecraft.world.gen.feature.template.StructureProcessorList |
combineProcessors(net.minecraft.world.gen.feature.template.StructureProcessorList list,
java.util.List<net.minecraft.world.gen.feature.template.StructureProcessor> processors)
Merges the
StructureProcessorList with the list of
StructureProcessor s and returns the resulting
StructureProcessorList . |
static <T> java.util.Optional<net.minecraft.util.RegistryKey<T>> |
getKey(net.minecraft.world.IWorld world,
net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry,
T value)
Returns an optional containing the registry key associated with the value
passed.
|
static <T> java.util.Optional<net.minecraft.util.RegistryKey<T>> |
getKey(net.minecraft.world.World world,
net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry,
T value)
Returns an optional containing the registry key associated with the value
passed.
TODO remove in 1.17 in favor of IWorld version. |
static <T> java.util.Optional<T> |
getValue(net.minecraft.world.IWorld world,
net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry,
net.minecraft.util.RegistryKey<T> key)
Returns an optional containing the value of the registry key passed.
|
static <T> java.util.Optional<T> |
getValue(net.minecraft.world.World world,
net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry,
net.minecraft.util.RegistryKey<T> key)
Returns an optional containing the value of the registry key passed.
TODO remove in 1.17 in favor of IWorld version. |
static <R extends IRegistrar<R>> |
handleRegistrar(R registrar)
Executes the handle method in the registrar.
|
static <R extends IForgeRegistrar<R,V>,V extends net.minecraftforge.registries.IForgeRegistryEntry<V>> |
handleRegistrar(R registrar,
net.minecraftforge.registries.IForgeRegistry<V> registry)
Executes the handleForge method in the registrar.
|
static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> |
register(net.minecraftforge.registries.IForgeRegistry<T> registry,
net.minecraft.util.ResourceLocation key,
T registryObject)
Deprecated.
Use
registerExact(IForgeRegistry, ResourceLocation, IForgeRegistryEntry) .
TODO Remove in 1.17. |
static <FC extends net.minecraft.world.gen.feature.IFeatureConfig,F extends net.minecraft.world.gen.feature.Feature<FC>> |
registerConfiguredFeature(net.minecraft.util.ResourceLocation key,
net.minecraft.world.gen.feature.ConfiguredFeature<FC,F> configuredFeature)
Registers the configured feature.
|
static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>,C extends T> |
registerExact(net.minecraftforge.registries.IForgeRegistry<T> registry,
net.minecraft.util.ResourceLocation key,
C registryObject)
Simple means of registering to a forge registry.
|
static net.minecraft.village.PointOfInterestType |
registerPOI(net.minecraftforge.registries.IForgeRegistry<net.minecraft.village.PointOfInterestType> registry,
net.minecraft.village.PointOfInterestType poi)
Registers the
PointOfInterestType properly since the methods to do it
are private normally. |
static net.minecraft.world.gen.feature.template.StructureProcessorList |
registerProcessor(net.minecraft.util.ResourceLocation key,
java.util.List<net.minecraft.world.gen.feature.template.StructureProcessor> processors)
Registers the list of
StructureProcessor s as a
StructureProcessorList |
static net.minecraft.world.gen.feature.template.StructureProcessorList |
registerProcessor(net.minecraft.util.ResourceLocation key,
net.minecraft.world.gen.feature.template.StructureProcessor processor)
Registers the
StructureProcessor as a StructureProcessorList . |
static net.minecraft.world.gen.feature.template.StructureProcessorList |
registerProcessor(net.minecraft.util.ResourceLocation key,
net.minecraft.world.gen.feature.template.StructureProcessorList processorList)
Registers the
StructureProcessorList . |
static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>> |
registerStructure(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.gen.feature.structure.Structure<?>> registry,
net.minecraft.util.ResourceLocation key,
S structure,
net.minecraft.world.gen.GenerationStage.Decoration generationStage)
Registers the input structure to both the forge Feature registry and the
Structure Feature registry
|
static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,P extends net.minecraft.world.gen.feature.structure.IStructurePieceType> |
registerStructureAndPiece(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.gen.feature.structure.Structure<?>> registry,
net.minecraft.util.ResourceLocation key,
S structure,
net.minecraft.world.gen.GenerationStage.Decoration generationStage,
P pieceType)
Deprecated.
|
static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,SF extends net.minecraft.world.gen.feature.StructureFeature<C,S>> |
registerStructureFeature(net.minecraft.util.ResourceLocation key,
SF structureFeature)
Registers the structure as a feature for world generation.
|
static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,SF extends net.minecraft.world.gen.feature.StructureFeature<C,S>> |
registerStructureFeature(SF structureFeature)
Registers the structure as a feature for world generation.
|
static <P extends net.minecraft.world.gen.feature.structure.IStructurePieceType> |
registerStructurePiece(net.minecraft.util.ResourceLocation key,
P pieceType)
Registers the input
IStructurePieceType |
public static <T> java.util.Optional<net.minecraft.util.RegistryKey<T>> getKey(net.minecraft.world.World world, net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry, T value)
world
- registry
- value
- Optional
public static <T> java.util.Optional<net.minecraft.util.RegistryKey<T>> getKey(net.minecraft.world.IWorld world, net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry, T value)
world
- registry
- value
- Optional
public static <T> java.util.Optional<T> getValue(net.minecraft.world.World world, net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry, net.minecraft.util.RegistryKey<T> key)
world
- registry
- key
- Optional
public static <T> java.util.Optional<T> getValue(net.minecraft.world.IWorld world, net.minecraft.util.RegistryKey<net.minecraft.util.registry.Registry<T>> registry, net.minecraft.util.RegistryKey<T> key)
world
- registry
- key
- Optional
@Deprecated public static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>> T register(net.minecraftforge.registries.IForgeRegistry<T> registry, net.minecraft.util.ResourceLocation key, T registryObject)
registerExact(IForgeRegistry, ResourceLocation, IForgeRegistryEntry)
.
TODO Remove in 1.17.registry
- key
- registryObject
- public static <T extends net.minecraftforge.registries.IForgeRegistryEntry<T>,C extends T> C registerExact(net.minecraftforge.registries.IForgeRegistry<T> registry, net.minecraft.util.ResourceLocation key, C registryObject)
registry
- key
- registryObject
- public static net.minecraft.village.PointOfInterestType registerPOI(net.minecraftforge.registries.IForgeRegistry<net.minecraft.village.PointOfInterestType> registry, net.minecraft.village.PointOfInterestType poi)
PointOfInterestType
properly since the methods to do it
are private normally.registry
- poi
- PointOfInterestType
public static <FC extends net.minecraft.world.gen.feature.IFeatureConfig,F extends net.minecraft.world.gen.feature.Feature<FC>> net.minecraft.world.gen.feature.ConfiguredFeature<FC,F> registerConfiguredFeature(net.minecraft.util.ResourceLocation key, net.minecraft.world.gen.feature.ConfiguredFeature<FC,F> configuredFeature)
key
- configuredFeature
- ConfiguredFeature
public static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>> S registerStructure(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.gen.feature.structure.Structure<?>> registry, net.minecraft.util.ResourceLocation key, S structure, net.minecraft.world.gen.GenerationStage.Decoration generationStage)
registry
- key
- structure
- generationStage
- Structure
public static <P extends net.minecraft.world.gen.feature.structure.IStructurePieceType> P registerStructurePiece(net.minecraft.util.ResourceLocation key, P pieceType)
IStructurePieceType
key
- pieceType
- IStructurePieceType
@Deprecated public static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,P extends net.minecraft.world.gen.feature.structure.IStructurePieceType> com.mojang.datafixers.util.Pair<S,P> registerStructureAndPiece(net.minecraftforge.registries.IForgeRegistry<net.minecraft.world.gen.feature.structure.Structure<?>> registry, net.minecraft.util.ResourceLocation key, S structure, net.minecraft.world.gen.GenerationStage.Decoration generationStage, P pieceType)
handleRegistrar(IForgeRegistrar, IForgeRegistry)
Structure
and IStructurePieceType
.registry
- key
- structure
- generationStage
- pieceType
- Pair
public static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,SF extends net.minecraft.world.gen.feature.StructureFeature<C,S>> SF registerStructureFeature(net.minecraft.util.ResourceLocation key, SF structureFeature)
key
- structureFeature
- StructureFeature
public static <C extends net.minecraft.world.gen.feature.IFeatureConfig,S extends net.minecraft.world.gen.feature.structure.Structure<C>,SF extends net.minecraft.world.gen.feature.StructureFeature<C,S>> SF registerStructureFeature(SF structureFeature)
structureFeature
- StructureFeature
public static <R extends IRegistrar<R>> R handleRegistrar(R registrar)
registrar
- IRegistrar
public static <R extends IForgeRegistrar<R,V>,V extends net.minecraftforge.registries.IForgeRegistryEntry<V>> R handleRegistrar(R registrar, net.minecraftforge.registries.IForgeRegistry<V> registry)
registrar
- registry
- IForgeRegistrar
public static net.minecraft.world.gen.feature.template.StructureProcessorList registerProcessor(net.minecraft.util.ResourceLocation key, net.minecraft.world.gen.feature.template.StructureProcessor processor)
StructureProcessor
as a StructureProcessorList
.key
- processor
- StructureProcessorList
public static net.minecraft.world.gen.feature.template.StructureProcessorList registerProcessor(net.minecraft.util.ResourceLocation key, net.minecraft.world.gen.feature.template.StructureProcessorList processorList)
StructureProcessorList
.key
- processorList
- StructureProcessorList
public static net.minecraft.world.gen.feature.template.StructureProcessorList registerProcessor(net.minecraft.util.ResourceLocation key, java.util.List<net.minecraft.world.gen.feature.template.StructureProcessor> processors)
StructureProcessor
s as a
StructureProcessorList
key
- processors
- StructureProcessorList
public static net.minecraft.world.gen.feature.template.StructureProcessorList combineProcessors(net.minecraft.world.gen.feature.template.StructureProcessorList... lists)
StructureProcessorList
array and returns the
result.lists
- StructureProcessorList
public static net.minecraft.world.gen.feature.template.StructureProcessorList combineProcessors(net.minecraft.world.gen.feature.template.StructureProcessorList list, java.util.List<net.minecraft.world.gen.feature.template.StructureProcessor> processors)
StructureProcessorList
with the list of
StructureProcessor
s and returns the resulting
StructureProcessorList
.list
- processors
- StructureProcessorList