Class WaypointTriggerRegistry
java.lang.Object
net.citizensnpcs.trait.waypoint.triggers.WaypointTriggerRegistry
- All Implemented Interfaces:
Persister<WaypointTrigger>
Registers valid
WaypointTrigger
classes and their chat configuration prompts. WaypointTriggers are persisted
using PersistenceLoader
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
addTrigger
(String name, Class<? extends WaypointTrigger> triggerClass, Class<? extends WaypointTriggerPrompt> promptClass) Creates an object instance from the givenDataKey
.static String
static Prompt
getTriggerPromptFrom
(String input) void
save
(WaypointTrigger instance, DataKey root) Saves the object instance to the givenDataKey
.
-
Constructor Details
-
WaypointTriggerRegistry
public WaypointTriggerRegistry()
-
-
Method Details
-
create
Description copied from interface:Persister
Creates an object instance from the givenDataKey
. Should not return null unless no data is present.- Specified by:
create
in interfacePersister<WaypointTrigger>
- Parameters:
root
- The root key to load from- Returns:
- The created instance, or null if no data was present
-
save
Description copied from interface:Persister
Saves the object instance to the givenDataKey
.- Specified by:
save
in interfacePersister<WaypointTrigger>
- Parameters:
instance
- The object instance to saveroot
- The key to save into
-
addTrigger
public static void addTrigger(String name, Class<? extends WaypointTrigger> triggerClass, Class<? extends WaypointTriggerPrompt> promptClass) -
describeValidTriggerNames
-
getTriggerPromptFrom
-