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 recordstatic final classstatic final recordstatic final classstatic interfacestatic final recordstatic final recordstatic final recordstatic interfaceRegistryData.Loader<T extends StaticProtocolObject<T>>static final classstatic final recordstatic interfacestatic enumstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RegistryData.AttributeEntryattribute(String namespace, RegistryData.Properties main) static RegistryData.BlockEntryblock(String namespace, RegistryData.Properties main) static RegistryData.BlockEntryblock(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(Key registryKey, RegistryData.Loader<T> loader) Instantiates a static registry from a resource file.static RegistryData.EntityEntryentity(String namespace, RegistryData.Properties main) featureFlag(String namespace, RegistryData.Properties main) static RegistryData.FluidEntryfluid(String namespace, RegistryData.Properties main) static RegistryData.GameEventEntrygameEventEntry(String namespace, RegistryData.Properties properties) static RegistryData.Propertiesstatic @Nullable InputStreamloadRegistryFile(String path) static RegistryData.MaterialEntrymaterial(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(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()}.jsonTags will be loaded from
/tags/{registryKey.path()}.json
-