Class EnumRule

java.lang.Object
io.papermc.reflectionrewriter.EnumRule

public final class EnumRule extends Object
Rule for rewriting enum valueOf calls. Not normally needed as all common remapping software only remaps enum field names, not the ldc insn for the name of the enum constant.

This rule expects the following methods to be present on your reflection proxy class.

 public static <E extends Enum<E>> E enumConstant(
     final MethodHandles.Lookup lookup,
     final String name,
     final Class<E> type
 ) {
     // Implementation ...
 }

 public static <E extends Enum<E>> E valueOf(
     final Class<E> enumClass,
     final String name
 ) {
     // Implementation...
 }

 public static <E extends Enum<E>> E valueOf(
     final String name,
     final Class<E> enumClass
 ) {
     return valueOf(enumClass, name);
 }
 
  • Method Details

    • create

      public static io.papermc.asm.rules.RewriteRule create(String proxyClassName, Predicate<String> ownerPredicate)
    • minecraft

      public static io.papermc.asm.rules.RewriteRule minecraft(String proxyClassName)