public class DimensionRegistrar extends java.lang.Object implements IRegistrar<DimensionRegistrar>
RegisterDimensionEvent
to have it automatically register a dimension
with the values passed in.Constructor and Description |
---|
DimensionRegistrar(RegisterDimensionEvent event,
net.minecraft.util.ResourceLocation key,
java.util.function.Supplier<net.minecraft.world.DimensionType> type,
java.util.function.Function<net.minecraft.util.RegistryKey<net.minecraft.world.gen.DimensionSettings>,net.minecraft.world.gen.DimensionSettings> settings,
java.util.function.BiFunction<RegisterDimensionEvent,net.minecraft.world.gen.DimensionSettings,net.minecraft.world.gen.ChunkGenerator> chunkGenerator) |
Modifier and Type | Method and Description |
---|---|
net.minecraft.util.RegistryKey<net.minecraft.world.Dimension> |
getDimensionKey()
Returns the dimension registry key.
|
net.minecraft.util.RegistryKey<net.minecraft.world.gen.DimensionSettings> |
getSettingsKey()
Returns the dimension settings registry key.
|
net.minecraft.util.RegistryKey<net.minecraft.world.DimensionType> |
getTypeKey()
Returns the dimension type registry key.
|
net.minecraft.util.RegistryKey<net.minecraft.world.World> |
getWorldKey()
Returns the world key.
|
DimensionRegistrar |
handle()
Registers the data inside and returns the registrar.
|
public DimensionRegistrar(RegisterDimensionEvent event, net.minecraft.util.ResourceLocation key, java.util.function.Supplier<net.minecraft.world.DimensionType> type, java.util.function.Function<net.minecraft.util.RegistryKey<net.minecraft.world.gen.DimensionSettings>,net.minecraft.world.gen.DimensionSettings> settings, java.util.function.BiFunction<RegisterDimensionEvent,net.minecraft.world.gen.DimensionSettings,net.minecraft.world.gen.ChunkGenerator> chunkGenerator)
event
- The event that stores data needed to register your dimension.key
- The name of your dimension, dimension type, and dimension
settings.type
- A Supplier
that returns your DimensionType
. Check
DimensionTypeBuilder
.settings
- A Function
that creates your
DimensionSettings
with the passed RegistryKey
.chunkGenerator
- A BiFunction
that creates your
ChunkGenerator
with the passed
RegisterDimensionEvent
and DimensionSettings
.public net.minecraft.util.RegistryKey<net.minecraft.world.Dimension> getDimensionKey()
RegistryKey
public net.minecraft.util.RegistryKey<net.minecraft.world.DimensionType> getTypeKey()
RegistryKey
public net.minecraft.util.RegistryKey<net.minecraft.world.gen.DimensionSettings> getSettingsKey()
RegistryKey
public net.minecraft.util.RegistryKey<net.minecraft.world.World> getWorldKey()
RegistryKey
public DimensionRegistrar handle()
IRegistrar
handle
in interface IRegistrar<DimensionRegistrar>
IRegistrar