Class RegistryData
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, @NotNull RegistryData.Properties main) static RegistryData.BlockEntry
block
(String namespace, @NotNull RegistryData.Properties main) static RegistryData.BlockEntry
block
(String namespace, @NotNull 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>>
@NotNull Registry<T> createStaticRegistry
(@NotNull net.kyori.adventure.key.Key registryKey, @NotNull RegistryData.Loader<T> loader) Instantiates a static registry from a resource file.static RegistryData.EntityEntry
entity
(String namespace, @NotNull RegistryData.Properties main) featureFlag
(String namespace, @NotNull RegistryData.Properties main) static RegistryData.FluidEntry
fluid
(String namespace, @NotNull RegistryData.Properties main) static RegistryData.GameEventEntry
gameEventEntry
(String namespace, RegistryData.Properties properties) static RegistryData.Properties
static @Nullable InputStream
loadRegistryFile
(@NotNull String path) static RegistryData.MaterialEntry
material
(String namespace, @NotNull RegistryData.Properties main) potionEffect
(String namespace, @NotNull RegistryData.Properties main) villagerProfession
(String namespace, @NotNull RegistryData.Properties main)
-
Constructor Details
-
RegistryData
public RegistryData()
-
-
Method Details
-
block
@Internal public static RegistryData.BlockEntry block(String namespace, @NotNull @NotNull RegistryData.Properties main) -
block
@Internal public static RegistryData.BlockEntry block(String namespace, @NotNull @NotNull 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, @NotNull @NotNull RegistryData.Properties main) -
entity
@Internal public static RegistryData.EntityEntry entity(String namespace, @NotNull @NotNull RegistryData.Properties main) -
villagerProfession
@Internal public static RegistryData.VillagerProfessionEntry villagerProfession(String namespace, @NotNull @NotNull RegistryData.Properties main) -
featureFlag
@Internal public static RegistryData.FeatureFlagEntry featureFlag(String namespace, @NotNull @NotNull RegistryData.Properties main) -
fluid
@Internal public static RegistryData.FluidEntry fluid(String namespace, @NotNull @NotNull RegistryData.Properties main) -
potionEffect
@Internal public static RegistryData.PotionEffectEntry potionEffect(String namespace, @NotNull @NotNull RegistryData.Properties main) -
attribute
@Internal public static RegistryData.AttributeEntry attribute(String namespace, @NotNull @NotNull 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
@Nullable public static @Nullable InputStream loadRegistryFile(@NotNull @NotNull String path) throws IOException - Parameters:
path
- The path without a leading slash, e.g. "blocks.json"- Throws:
IOException
-
load
-
createStaticRegistry
@Internal @NotNull public static <T extends StaticProtocolObject<T>> @NotNull Registry<T> createStaticRegistry(@NotNull @NotNull net.kyori.adventure.key.Key registryKey, @NotNull @NotNull 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
-