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
    • loadBlocksAndItemsAndTags

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

      public static List<MCItem> loadBlocksAndItemsAndTagsAndPotions(Workspace workspace)
      Loads all mod elements and all Minecraft elements (blocks and items), including elements that are wildcard elements to subtypes (wood -> oak wood, birch wood, ...) This list also provides potions from both Minecraft elements and mod elements
      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 mod elements and all Minecraft elements (blocks and items) without elements that are wildcard elements to subtypes (wood -> oak wood, birch wood, ...) so only oak wood, birch wood, ... are loaded, without wildcard wood element This list also provides potions from both Minecraft elements and mod elements
      Returns:
      All Blocks and Items and Potions from both Minecraft and custom elements with or without metadata
    • loadBlocksAndItems

      public static List<MCItem> loadBlocksAndItems(Workspace workspace)
      Loads all mod elements and all Minecraft elements (blocks and items) without elements that are wildcard elements to subtypes (wood -> oak wood, birch wood, ...) so only oak wood, birch wood, ... are loaded, without wildcard wood element
      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 mod elements and all Minecraft blocks without elements that are wildcard elements to subtypes (wood -> oak wood, birch wood, ...) so only oak wood, birch 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 elements that are wildcard elements to subtypes (wood -> oak wood, birch wood, ...)
      Returns:
      All Blocks 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()
    • loadEnchantmentTypes

      public static List<DataListEntry> loadEnchantmentTypes()
    • 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)
    • 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)
    • 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