Package dev.jaxydog.astral.content.power
Class AstralMetaAction
java.lang.Object
dev.jaxydog.astral.content.power.AstralMetaAction
- All Implemented Interfaces:
Registered,Registered.Common
- Direct Known Subclasses:
RepeatAction
An abstract class for easily implementing custom Origins actions with multiple expected data types.
This type is automatically registered.
- Since:
- 2.0.0
-
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 TypeMethodDescriptionabstract <T> voidexecute(io.github.apace100.calio.data.SerializableData.Instance data, T value) Executes the action.abstract <T> AstralActionFactory<T> factory(io.github.apace100.calio.data.SerializableDataType<io.github.apace100.apoli.power.factory.action.ActionFactory<T>.io.github.apace100.apoli.power.factory.action.ActionFactory.Instance> type) Returns the action's associated factory.Returns this value's associated registry identifier path.voidRegisters this value on both the client and server environments.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId
-
Constructor Details
-
AstralMetaAction
Creates a new action.- Parameters:
path- The action's identifier path.- Since:
- 2.0.0
-
-
Method Details
-
execute
public abstract <T> void execute(io.github.apace100.calio.data.SerializableData.Instance data, T value) Executes the action.- Parameters:
data- The action's associated data.value- The value to execute the action on.- Since:
- 2.0.0
-
factory
public abstract <T> AstralActionFactory<T> factory(io.github.apace100.calio.data.SerializableDataType<io.github.apace100.apoli.power.factory.action.ActionFactory<T>.io.github.apace100.apoli.power.factory.action.ActionFactory.Instance> type) Returns the action's associated factory.- Type Parameters:
T- The type of the expected value.- Parameters:
type- The action's type.- Returns:
- The action's associated factory.
- Since:
- 2.0.0
-
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.
-
registerCommon
public 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:
-