java.lang.Object
net.minestom.server.registry.RegistryData
Handles registry data, used by
StaticProtocolObject
implementations and is strictly internal.
Use at your own risk.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final class
static final record
static final class
static interface
static final record
static final record
static final record
static interface
RegistryData.Loader<T extends StaticProtocolObject<T>>
static final class
static final record
static interface
static enum
static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RegistryData.AttributeEntry
attribute
(String namespace, RegistryData.Properties main) static RegistryData.BlockEntry
block
(String namespace, RegistryData.Properties main) static RegistryData.BlockEntry
block
(String namespace, RegistryData.Properties main, HashMap<Object, Object> internCache, @Nullable RegistryData.BlockEntry parent, @Nullable RegistryData.Properties parentProperties) blockSoundTypeEntry
(String namespace, RegistryData.Properties properties) static <T extends StaticProtocolObject<T>>
Registry<T> createStaticRegistry
(net.kyori.adventure.key.Key registryKey, RegistryData.Loader<T> loader) Instantiates a static registry from a resource file.static RegistryData.EntityEntry
entity
(String namespace, RegistryData.Properties main) featureFlag
(String namespace, RegistryData.Properties main) static RegistryData.FluidEntry
fluid
(String namespace, RegistryData.Properties main) static RegistryData.GameEventEntry
gameEventEntry
(String namespace, RegistryData.Properties properties) static RegistryData.Properties
static @Nullable InputStream
loadRegistryFile
(String path) static RegistryData.MaterialEntry
material
(String namespace, RegistryData.Properties main) potionEffect
(String namespace, RegistryData.Properties main) villagerProfession
(String namespace, RegistryData.Properties main)
-
Constructor Details
-
RegistryData
public RegistryData()
-
-
Method Details
-
block
@Internal public static RegistryData.BlockEntry block(String namespace, RegistryData.Properties main) -
block
@Internal public static RegistryData.BlockEntry block(String namespace, RegistryData.Properties main, HashMap<Object, Object> internCache, @Nullable @Nullable RegistryData.BlockEntry parent, @Nullable @Nullable RegistryData.Properties parentProperties) -
material
@Internal public static RegistryData.MaterialEntry material(String namespace, RegistryData.Properties main) -
entity
@Internal public static RegistryData.EntityEntry entity(String namespace, RegistryData.Properties main) -
villagerProfession
@Internal public static RegistryData.VillagerProfessionEntry villagerProfession(String namespace, RegistryData.Properties main) -
featureFlag
@Internal public static RegistryData.FeatureFlagEntry featureFlag(String namespace, RegistryData.Properties main) -
fluid
@Internal public static RegistryData.FluidEntry fluid(String namespace, RegistryData.Properties main) -
potionEffect
@Internal public static RegistryData.PotionEffectEntry potionEffect(String namespace, RegistryData.Properties main) -
attribute
@Internal public static RegistryData.AttributeEntry attribute(String namespace, RegistryData.Properties main) -
gameEventEntry
public static RegistryData.GameEventEntry gameEventEntry(String namespace, RegistryData.Properties properties) -
blockSoundTypeEntry
public static RegistryData.BlockSoundTypeEntry blockSoundTypeEntry(String namespace, RegistryData.Properties properties) -
loadRegistryFile
- Parameters:
path
- The path without a leading slash, e.g. "blocks.json"- Throws:
IOException
-
load
-
createStaticRegistry
@Internal public static <T extends StaticProtocolObject<T>> Registry<T> createStaticRegistry(net.kyori.adventure.key.Key registryKey, RegistryData.Loader<T> loader) Instantiates a static registry from a resource file. The resource file is resolved using the registryKey first from the classpath, then from the working directory.The data file should be at
./{registryKey.path()}.json
Tags will be loaded from
/tags/{registryKey.path()}.json
-