Class FragmentsUtils

java.lang.Object
net.mcreator.generator.FragmentsUtils

public class FragmentsUtils extends Object
  • Constructor Details

    • FragmentsUtils

      public FragmentsUtils()
  • Method Details

    • collectFragments

      public static Map<String, List<String>> collectFragments(Generator generator, Map<ModElementType<?>, List<GeneratableElement>> modElementTypeListMap, Map<BaseType, List<GeneratableElement>> baseTypeListMap)
      Collects fragments defined in "fragments" lists of used mod element type definitions, used base type definitions and generator configuration. Each fragment defines "type" and either "template" to render or literal "content" (string or list of strings), and can optionally define a condition. Fragments of mod element types and base types get elements of their type in the data model of both the template and the condition.
      Parameters:
      generator - Generator to collect fragments for
      modElementTypeListMap - Generatable elements grouped by mod element type
      baseTypeListMap - Generatable elements grouped by base type they provide
      Returns:
      Fragments grouped by fragment type, types with a fragment definition file are always present