Class ContentRegistrar
- All Implemented Interfaces:
Registered,Registered.All,Registered.Client,Registered.Common,Registered.Generated,Registered.Server
- Direct Known Subclasses:
AstralActions,AstralBlocks,AstralConditions,AstralData,AstralDataLoaders,AstralGamerules,AstralItemGroups,AstralItems,AstralPotions,AstralPowers,AstralSoundEvents,AstralStatusEffects,AstralTrinketPredicates,CustomContent
Extending classes should typically be final and only contain subclasses or public static final
fields. They should be singletons with their only instance being placed within the CustomContent class.
- Since:
- 1.5.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate()Generates game assets or data.net.minecraft.util.IdentifierReturns this value's associated registry identifier.Returns this value's associated registry identifier path.final voidRegisters this value on the client environment.final voidRegisters this value on both the client and server environments.final voidRegisters this value on the server environment.
-
Constructor Details
-
ContentRegistrar
public ContentRegistrar()
-
-
Method Details
-
getRegistryPath
Description copied from interface:RegisteredReturns this value's associated registry identifier path.This is by default used to determine the
Identifierprovided byRegistered.getRegistryId(). For example, returning"my_item"will cause the associated identifier to beastral:my_item.- Specified by:
getRegistryPathin interfaceRegistered- Returns:
- An identifier path.
-
getRegistryId
public net.minecraft.util.Identifier getRegistryId()Description copied from interface:RegisteredReturns this value's associated registry identifier.This is used to uniquely distinguish this instance from other equally-typed instances.
- Specified by:
getRegistryIdin interfaceRegistered- Returns:
- A new identifier.
-
registerCommon
public final void registerCommon()Description copied from interface:Registered.CommonRegisters this value on both the client and server environments.The contained code will run for both environments. If you only want one or the other, see its sister interfaces.
- Specified by:
registerCommonin interfaceRegistered.Common- See Also:
-
registerClient
public final void registerClient()Description copied from interface:Registered.ClientRegisters this value on the client environment.The contained code will only ever run on the game client. If you only want the server or want both, see its sister interfaces.
- Specified by:
registerClientin interfaceRegistered.Client- See Also:
-
registerServer
public final void registerServer()Description copied from interface:Registered.ServerRegisters this value on the server environment.The contained code will only ever run on the game server. If you only want the client or want both, see its sister interfaces.
- Specified by:
registerServerin interfaceRegistered.Server- See Also:
-
generate
public void generate()Description copied from interface:Registered.GeneratedGenerates game assets or data.It should be assumed that the contained code will only ever run on the server environment.
- Specified by:
generatein interfaceRegistered.Generated
-