Class StructureCompiler

java.lang.Object
com.comphenix.protocol.reflect.compiler.StructureCompiler

public final class StructureCompiler extends Object
Represents a StructureModifier compiler.
Author:
Kristian
  • Field Details

    • REPORT_TOO_MANY_GENERATED_CLASSES

      public static final ReportType REPORT_TOO_MANY_GENERATED_CLASSES
    • attemptClassLoad

      public static boolean attemptClassLoad
  • Method Details

    • lookupClassLoader

      public <TField> boolean lookupClassLoader(StructureModifier<TField> source)
      Lookup the current class loader for any previously generated classes before we attempt to generate something.
      Type Parameters:
      TField - Type
      Parameters:
      source - - the structure modifier to look up.
      Returns:
      TRUE if we successfully found a previously generated class, FALSE otherwise.
    • compile

      public <TField> StructureModifier<TField> compile(StructureModifier<TField> source)
      Compiles the given structure modifier.

      WARNING: Do NOT call this method in the main thread. Compiling may easily take 10 ms, which is already over 1/4 of a tick (50 ms). Let the background thread automatically compile the structure modifiers instead.

      Type Parameters:
      TField - Type
      Parameters:
      source - - structure modifier to compile.
      Returns:
      A compiled structure modifier.