Class EntityActionMap
public final class EntityActionMap
Stores the named
EntityAction instances registered on an Entity. Provides registration, lookup and removal by name.-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether an action with the supplied name is registered.Returns the action registered under the supplied name.Returns an unmodifiable view of all registered actions.voidregister(EntityAction action) Registers the suppliedEntityAction.Registers a newEntityActionbacked by the supplied runnable.voidunregister(EntityAction action) Unregisters the suppliedEntityAction.voidunregister(String actionName) Unregisters theEntityActionwith the supplied name.
-
Method Details
-
register
Registers a newEntityActionbacked by the supplied runnable.- Parameters:
name- the action nameaction- the runnable executed when the action is triggered- Returns:
- the registered action, or
nullif the parameters are invalid
-
register
Registers the suppliedEntityAction.- Parameters:
action- the action to register; ignored ifnull
-
unregister
Unregisters the suppliedEntityAction.- Parameters:
action- the action to unregister; ignored ifnull
-
unregister
Unregisters theEntityActionwith the supplied name.- Parameters:
actionName- the action name; ignored if blank
-
getActions
Returns an unmodifiable view of all registered actions.- Returns:
- the registered actions
-
get
Returns the action registered under the supplied name.- Parameters:
actionName- the action name- Returns:
- the action, or
nullif not found
-
exists
Returns whether an action with the supplied name is registered.- Parameters:
actionName- the action name- Returns:
trueif registered
-