Class ElementUtil

java.lang.Object
net.mcreator.minecraft.ElementUtil

public class ElementUtil extends Object
  • Constructor Details

    • ElementUtil

      public ElementUtil()
  • Method Details

    • typeMatches

      public static Predicate<DataListEntry> typeMatches(String... type)
      Provides a predicate to check the type of data list entries
      Parameters:
      type - The type that the entry has to match
      Returns:
      A predicate that checks if the type matches the parameter
    • loadDataListAndElements

      public static List<DataListEntry> loadDataListAndElements(Workspace workspace, String dataList, boolean sorted, @Nullable String typeFilter, @Nullable String... customEntryProviders)
      Loads a list of entries, with optional custom entries from the given mod element types, and with an optional filter for the entry type.

      NOTE: custom entries cannot specify a type yet, so the type filter will remove any custom entry

      Parameters:
      workspace - The current workspace
      dataList - The datalist from which to load the entries
      sorted - Whether the list should be sorted alphabetically
      typeFilter - If present, only entries whose type matches this parameter are loaded
      customEntryProviders - The string id of the mod element types that provide custom entries
      Returns:
      All entries from the given data list and the given mod element types, matching the optional filter
    • loadBlocksAndItems

      public static List<MCItem> loadBlocksAndItems(Workspace workspace)
      Loads all items (also blocks if they have item representation), but without those that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...) so only oak wood, cherry wood, ... are loaded, without wildcard wood element. This will not load blocks without item representation (example fire, water, ...).
      Returns:
      All Blocks and Items from both Minecraft and custom elements with or without metadata
    • loadBlocksAndItemsAndTags

      public static List<MCItem> loadBlocksAndItemsAndTags(Workspace workspace)
      Loads all items (also blocks if they have item representation), including elements that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...). This will not load blocks without item representation (example fire, water, ...).
      Returns:
      All Blocks and Items from both Minecraft and custom elements with or without metadata
    • loadBlocks

      public static List<MCItem> loadBlocks(Workspace workspace)
      Loads all blocks without those that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...) so only oak wood, cherry wood, ... are loaded, without wildcard wood element
      Returns:
      All Blocks from both Minecraft and custom elements with or without metadata
    • loadBlocksAndTags

      public static List<MCItem> loadBlocksAndTags(Workspace workspace)
      Loads all mod elements and all Minecraft blocks, including those that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...)
      Returns:
      All Blocks from both Minecraft and custom elements with or without metadata
    • loadBlocksAndItemsAndTagsAndPotions

      public static List<MCItem> loadBlocksAndItemsAndTagsAndPotions(Workspace workspace)
      Loads all items (also blocks if they have item representation), including those that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...) This list also provides potions from both Minecraft elements and mod elements. This will not load blocks without item representation (example fire, water, ...).
      Returns:
      All Blocks and Items and Potions from both Minecraft and custom elements with or without metadata
    • loadBlocksAndItemsAndPotions

      public static List<MCItem> loadBlocksAndItemsAndPotions(Workspace workspace)
      Loads all items (also blocks if they have item representation), without those that are wildcard elements to subtypes (wood: oak wood, cherry wood, ...) so only oak wood, cherry wood, ... are loaded, without wildcard wood element This list also provides potions from both Minecraft elements and mod elements. This will not load blocks without item representation (example fire, water, ...).
      Returns:
      All Blocks and Items and Potions from both Minecraft and custom elements with or without metadata
    • loadAllAchievements

      public static List<DataListEntry> loadAllAchievements(Workspace workspace)
    • loadAllTabs

      public static List<DataListEntry> loadAllTabs(Workspace workspace)
    • loadAllBiomes

      public static List<DataListEntry> loadAllBiomes(Workspace workspace)
    • loadAllEnchantments

      public static List<DataListEntry> loadAllEnchantments(Workspace workspace)
    • loadMaterials

      public static List<DataListEntry> loadMaterials()
    • loadMapColors

      public static List<DataListEntry> loadMapColors()
    • loadAnimations

      public static List<DataListEntry> loadAnimations(Workspace workspace)
    • loadAllEntities

      public static List<DataListEntry> loadAllEntities(Workspace workspace)
    • loadAllSpawnableEntities

      public static List<DataListEntry> loadAllSpawnableEntities(Workspace workspace)
      Returns all the spawnable entities, which include custom living entities and entities marked as "spawnable" in the data lists
      Parameters:
      workspace - The workspace from which to gather the entities
      Returns:
      All entities that can be spawned
    • loadCustomEntities

      public static List<DataListEntry> loadCustomEntities(Workspace workspace)
    • loadEntityDataListFromCustomEntity

      public static List<String> loadEntityDataListFromCustomEntity(Workspace workspace, String entityName, Class<? extends PropertyData<?>> type)
    • loadAllParticles

      public static List<DataListEntry> loadAllParticles(Workspace workspace)
    • loadAllPotionEffects

      public static List<DataListEntry> loadAllPotionEffects(Workspace workspace)
    • loadAllPotions

      public static List<DataListEntry> loadAllPotions(Workspace workspace)
    • loadAllVillagerProfessions

      public static List<DataListEntry> loadAllVillagerProfessions(Workspace workspace)
    • loadAllAttributes

      public static List<DataListEntry> loadAllAttributes(Workspace workspace)
    • loadAllPOIBlocks

      public static List<MItemBlock> loadAllPOIBlocks(Workspace workspace)
      Returns list of blocks attached to a POI for this workspace
      Parameters:
      workspace - Workspace to return for
      Returns:
      List of blocks attached to a POI for this workspace
    • getAllBooleanGameRules

      public static List<DataListEntry> getAllBooleanGameRules(Workspace workspace)
    • getAllNumberGameRules

      public static List<DataListEntry> getAllNumberGameRules(Workspace workspace)
    • loadAllFluids

      public static List<DataListEntry> loadAllFluids(Workspace workspace)
    • getAllSounds

      public static String[] getAllSounds(Workspace workspace)
    • loadAllConfiguredFeatures

      public static List<DataListEntry> loadAllConfiguredFeatures(Workspace workspace)
    • loadStepSounds

      public static List<DataListEntry> loadStepSounds()
    • loadArrowProjectiles

      public static List<DataListEntry> loadArrowProjectiles(Workspace workspace)
    • loadDirections

      public static String[] loadDirections()
    • loadBasicGUIs

      public static ArrayList<String> loadBasicGUIs(Workspace workspace)
    • getDataListAsStringArray

      public static String[] getDataListAsStringArray(String dataList)
    • getProceduresOfType

      public static String[] getProceduresOfType(Workspace workspace, VariableType type)

      Returns an array with the names of procedures that return the given variable type

      Parameters:
      workspace -

      The current workspace

      type -

      The VariableType that the procedures must return

      Returns:

      An array of strings containing the names of the procedures