Class ActionSetNameTag
java.lang.Object
com.blamejared.crafttweaker.api.action.internal.CraftTweakerAction
com.blamejared.crafttweaker.api.action.entity.ActionSetNameTag
- All Implemented Interfaces:
IAction,IRuntimeAction,IUndoableAction
-
Constructor Summary
ConstructorsConstructorDescriptionActionSetNameTag(Predicate<net.minecraft.world.entity.Entity> predicate, INameTagFunction function) -
Method Summary
Modifier and TypeMethodDescriptionvoidapply()Applies the action, executing all code necessary.describe()Gets a human-readable description of the action.Gets a human-readable description of the action rollback.booleanshouldApplyOn(IScriptLoadSource source, org.apache.logging.log4j.Logger logger) Determines whether an action should be applied for scripts loading in the givenIScriptLoadSource.voidundo()Undoes all changes carried out by the action.Methods inherited from class com.blamejared.crafttweaker.api.action.internal.CraftTweakerAction
systemNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.action.base.IAction
assertLoader, getDeclaredScriptPosition, logger, systemName, validate
-
Constructor Details
-
ActionSetNameTag
public ActionSetNameTag(Predicate<net.minecraft.world.entity.Entity> predicate, INameTagFunction function)
-
-
Method Details
-
apply
public void apply()Description copied from interface:IActionApplies the action, executing all code necessary. -
undo
public void undo()Description copied from interface:IUndoableActionUndoes all changes carried out by the action.- Specified by:
undoin interfaceIUndoableAction
-
describe
Description copied from interface:IActionGets a human-readable description of the action.This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the action as accurately as possible without being too verbose.
It is not allowed to return a
nullor otherwise empty description for the action: doing so will raise an error at runtime. -
describeUndo
Description copied from interface:IUndoableActionGets a human-readable description of the action rollback.This message is used for logging and to surface information to the user when something goes wrong. It is thus customary to describe the rollback as accurately as possible without being too verbose.
It is not allowed to return a
nullor otherwise empty description for the rollback: doing so will raise an error at runtime.- Specified by:
describeUndoin interfaceIUndoableAction- Returns:
- A description of the current action rollback.
-
shouldApplyOn
Description copied from interface:IActionDetermines whether an action should be applied for scripts loading in the givenIScriptLoadSource.- Specified by:
shouldApplyOnin interfaceIAction- Parameters:
source- TheIScriptLoadSourceresponsible for loading the scripts.logger- TheLoggerinstance that should be used to log error messages if needed.- Returns:
- If the action should be applied.
-