Class VanillaClassToKey

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

@Internal public class VanillaClassToKey extends Object
  • Constructor Details

    • VanillaClassToKey

      public VanillaClassToKey()
  • Method Details

    • convert

      public static net.minecraft.resources.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.

      Parameters:
      cls - The class to convert.
      Returns:
      A lower_snake_case representation of that class's original PascalCase name.
      Throws:
      IllegalArgumentException - if the class is not from Minecraft, or if the class does not have a simple name.