Class ReplacerAction
java.lang.Object
com.blamejared.crafttweaker.api.action.recipe.replace.ReplacerAction
- All Implemented Interfaces:
IAction,IRuntimeAction
-
Constructor Summary
ConstructorsConstructorDescriptionReplacerAction(ITargetingRule targetingRule, boolean isSimple, List<IReplacementRule> replacementRules, Collection<net.minecraft.resources.ResourceLocation> defaultExclusions, Function<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> generatorFunction, boolean suppressWarnings) -
Method Summary
Methods 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, shouldApplyOn
-
Constructor Details
-
ReplacerAction
public ReplacerAction(ITargetingRule targetingRule, boolean isSimple, List<IReplacementRule> replacementRules, Collection<net.minecraft.resources.ResourceLocation> defaultExclusions, Function<net.minecraft.resources.ResourceLocation, net.minecraft.resources.ResourceLocation> generatorFunction, boolean suppressWarnings)
-
-
Method Details
-
apply
public void apply()Description copied from interface:IActionApplies the action, executing all code necessary. -
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. -
validate
public boolean validate(org.apache.logging.log4j.Logger logger) Description copied from interface:IActionValidates the action, ensuring no erroneous information is present.Implementations should validate all action information and log errors using the provided
Loggerif anything is incorrect. It is highly suggested to specify exactly what is wrong in the most precise yet brief way possible, to ensure script writers know why their actions are not being applied.If validation fails for whatever reason,
IAction.apply()will not be called.
-