类 VanillaClassToKey

java.lang.Object
net.neoforged.neoforge.common.util.VanillaClassToKey

@Internal public class VanillaClassToKey extends Object
  • 构造器详细资料

    • VanillaClassToKey

      public VanillaClassToKey()
  • 方法详细资料

    • convert

      public static ResourceLocation convert(Class<?> cls)
      Converts a vanilla class name into an identifier compliant with the rules set by ResourceLocation.

      This conversion is done by translating all uppercase characters into an underscore plus the lowercase version of the original character.

      参数:
      cls - The class to convert.
      返回:
      A lower_snake_case representation of that class's original PascalCase name.
      抛出:
      IllegalArgumentException - if the class is not from Minecraft, or if the class does not have a simple name.