Class EnhancedFlowAction<P extends EnhancedFlowAction.EnhancedFlowParameters<?>>

java.lang.Object
net.minecraftforge.gradleutils.shared.EnhancedFlowAction<P>
Type Parameters:
P - The type of enhanced flow parameters to use
All Implemented Interfaces:
FlowAction<P>

public abstract class EnhancedFlowAction<P extends EnhancedFlowAction.EnhancedFlowParameters<?>> extends Object implements FlowAction<P>
The enhanced flow action adds convenience methods to the standard flow action provided by Gradle.
Implementation Note:
Consumers must set the EnhancedFlowAction.EnhancedFlowParameters.getFailure() property in order for it to work properly. The build failure is provided by FlowProviders.getBuildWorkResult() mapped by BuildWorkResult.getFailure().
  • Constructor Details

    • EnhancedFlowAction

      protected EnhancedFlowAction()
      The base constructor for the flow action.
      Implementation Requirements:
      Must override with public and @Inject
  • Method Details

    • contains

      protected static boolean contains(Throwable e, String s)
      Checks if a given throwable's message contains the given string (ignoring case). This check includes checking all the throwable's causes.
      Parameters:
      e - The throwable to check
      s - The string to match for (ignoring case)
      Returns:
      If the throwable's message contains the string
    • execute

      public final void execute(P parameters)
      Executes this flow action.
      Specified by:
      execute in interface FlowAction<P extends EnhancedFlowAction.EnhancedFlowParameters<?>>
      Parameters:
      parameters - The parameters for this action
      Implementation Note:
      This method is final to avoid Gradle eating any exceptions thrown by it. Consumers should instead implement run(EnhancedFlowParameters).
    • run

      protected abstract void run(P parameters) throws Exception
      Runs this flow action. Used by execute(EnhancedFlowParameters).
      Parameters:
      parameters - The parameters for this action
      Throws:
      Exception - If any error occurs