Class MixinTransformer<M>

  • Type Parameters:
    M - The modularity attachment type. Modularity attachments are needed to pin down the source of a mixin. This reduces the chance of incompatibilities between mods loaded by two different classloaders. The modularity attachment should ideally implement Object.equals(Object) and Object.hashCode() if the identity comparison semantics of the default implementations are a potential issue. A recommended type can be ClassLoader, but really anything goes, Void for example is perfectly fine as long as the BytecodeProvider accounts for null attachments. All methods in MixinTransformer support null attachments internally, albeit it is not recommended to use null for any method.

    public class MixinTransformer<M>
    extends java.lang.Object
    The central brain of Micromixin. An instance of this class stores all mixin-related matters. Multiple instances can be used at the same time, as long as their inputs are separated.
    • Method Detail

      • addMixin

        public void addMixin​(M attachment,
                             @NotNull
                             MixinConfig config)
      • isDelayingParseExceptions

        public boolean isDelayingParseExceptions()
      • isMergingClassFileVersions

        public boolean isMergingClassFileVersions()
      • isMixin

        public boolean isMixin​(M attachment,
                               @NotNull
                               java.lang.String internalName)
        Returns whether a package or a class is within a mixin. Such classes or packages should not be loaded by the classloader.

        The internal name must be represented as a fully qualified name using slashes ('/') as package separators.

        Parameters:
        attachment - The modularity attachment to use
        internalName - The internal name of the package or class
        Returns:
        True if it is within the package, false otherwise.
      • isMixinTarget

        public boolean isMixinTarget​(@NotNull
                                     java.lang.String name)
      • setDelayParseExceptions

        public void setDelayParseExceptions​(boolean delayParseExceptions)
      • setMergeClassFileVersions

        public void setMergeClassFileVersions​(boolean mergeClassFileVersions)
      • transform

        @Deprecated
        @Obsolete
        public void transform​(@NotNull
                              org.objectweb.asm.tree.ClassNode in)
        Deprecated.
      • transform

        @AvailableSince("0.7.0-a20241008")
        public void transform​(@NotNull
                              org.objectweb.asm.tree.ClassNode in,
                              @Nullable
                              java.net.URI classCodeSourceURI)