Class BakedPipeline.Builder

java.lang.Object
codechicken.lib.model.pipeline.BakedPipeline.Builder
Enclosing class:
BakedPipeline

public static class BakedPipeline.Builder extends Object
The builder associated with the BakedPipeline. You must create a BakedPipeline with this, once created a pipeline cannot be modified, modifying should not be needed as you can enable and disable elements with ease.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • addFirst

      public BakedPipeline.Builder addFirst(String name, IPipelineElementFactory<?> factory)
      Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      Returns:
      The same builder.
    • addFirst

      public BakedPipeline.Builder addFirst(String name, IPipelineElementFactory<?> factory, boolean defaultState)
      Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      defaultState - The default state for this element.
      Returns:
      The same builder.
    • addFirst

      public <T extends IPipelineConsumer> BakedPipeline.Builder addFirst(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter)
      Inserts an element to the front of the list, Useful if you have a more complex system and each system need to be independent from each other, but this element must be first.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      defaultState - The default state for this element.
      defaultsSetter - A callback used to set any defaults on the transformer.
      Returns:
      The same builder.
    • addElement

      public BakedPipeline.Builder addElement(String name, IPipelineElementFactory<?> factory)
      Adds an element at the end of the transform list, Suitable for 99% of cases.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      Returns:
      The same builder.
    • addElement

      public BakedPipeline.Builder addElement(String name, IPipelineElementFactory<?> factory, boolean defaultState)
      Adds an element at the end of the transform list, Suitable for 99% of cases.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      defaultState - The default state for this element.
      Returns:
      The same builder.
    • addElement

      public <T extends IPipelineConsumer> BakedPipeline.Builder addElement(String name, IPipelineElementFactory<T> factory, boolean defaultState, Consumer<T> defaultsSetter)
      Adds an element at the end of the transform list, Suitable for 99% of cases.
      Parameters:
      name - The name to identify this element, used as an identifier when setting state, and retrieving the element.
      factory - The factory used to create the Transformer.
      defaultState - The default state for this element.
      defaultsSetter - A callback used to set any defaults on the transformer.
      Returns:
      The same builder.
    • build

      public BakedPipeline build()
      Call this once you are finished to build your BakedPipeline!
      Returns:
      The new Pipeline.