Class RuntimeReferences


  • public final class RuntimeReferences
    extends Object
    Provides methods to perform runtime lookups of values by name (eg: enums)
    Author:
    crashdemons (crashenator at gmail.com)
    • Method Detail

      • getCompatibleMaterialByName

        public static CompatibleSkullMaterial getCompatibleMaterialByName​(String name)
        Retrieves the 'CompatibleSkullMaterial' (a possibly-supported vanilla head material) associated with a name.
        Parameters:
        name - The name of the CompatibleSkullMaterial (generally name-compatible with EntityType names)
        Returns:
        the matching CompatibleSkullMaterial, or null.
      • getEntityTypeByName

        public static EntityType getEntityTypeByName​(String name)
        Retrieves the entitytype from a name, or null
        Parameters:
        name -
        Returns:
        the entitytype, or null
      • getMaterialByName

        public static Material getMaterialByName​(String name)
        Retrieves the bukkit Material from a name, or null
        Parameters:
        name -
        Returns:
        the bukkit Material, or null
      • getSkullTypeByName

        public static SkullType getSkullTypeByName​(String name)
        Retrieves the SkullType (compatibility version) associated with a name
        Parameters:
        name -
        Returns:
        the SkullType, or null
      • getClass

        public static Class<?> getClass​(String classname)
        Retrieves a class associated with a name
        Parameters:
        classname -
        Returns:
        the class, or null
      • getMethod

        public static Method getMethod​(Class<?> classobj,
                                       String methodname,
                                       Class<?>... parameterTypes)
        Retrieves a method of a class by name
        Parameters:
        classobj -
        methodname -
        parameterTypes -
        Returns:
        the method, or null
      • getMethod

        public static Method getMethod​(String classname,
                                       String methodname,
                                       Class<?>... parameterTypes)
        Retrieves a method by name from a class (also retrieved by name)
        Parameters:
        classname -
        methodname -
        parameterTypes -
        Returns:
        the method, or null
      • hasClass

        public static boolean hasClass​(String classname)
        Checks whether a class exists (by name)
        Parameters:
        classname -
        Returns:
        whether the class exists