mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-18 19:39:14 +00:00
77 lines
3.3 KiB
Java
77 lines
3.3 KiB
Java
/*
|
|
* This file is part of Sponge, licensed under the MIT License (MIT).
|
|
*
|
|
* Copyright (c) SpongePowered.org <http://www.spongepowered.org>
|
|
* Copyright (c) contributors
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
* of this software and associated documentation files (the "Software"), to deal
|
|
* in the Software without restriction, including without limitation the rights
|
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the Software is
|
|
* furnished to do so, subject to the following conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be included in
|
|
* all copies or substantial portions of the Software.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
* THE SOFTWARE.
|
|
*/
|
|
package org.spongepowered.asm.mixin;
|
|
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.lang.annotation.Target;
|
|
|
|
/**
|
|
* Decorator for mixin classes
|
|
*/
|
|
@Target(ElementType.TYPE)
|
|
@Retention(RetentionPolicy.CLASS)
|
|
public @interface Mixin {
|
|
|
|
/**
|
|
* Target class(es) for this mixin
|
|
*/
|
|
public Class<?>[] value() default { };
|
|
|
|
/**
|
|
* Since specifying targets in {@link #value} requires that the classes be
|
|
* publicly visible, this property is provided to allow package-private,
|
|
* anonymous innner, and private inner classes to be referenced. Referencing
|
|
* an otherwise public class using this property is an error condition and
|
|
* will throw an exception at runtime. It is completely fine to specify both
|
|
* public and private targets for the same mixin however.
|
|
*/
|
|
public String[] targets() default { };
|
|
|
|
/**
|
|
* Priority for the mixin, relative to other mixins targetting the same
|
|
* classes
|
|
*/
|
|
public int priority() default 1000;
|
|
|
|
/**
|
|
* By default, the annotation processor will attempt to locate an
|
|
* obfuscation mapping for all {@link Shadow} and
|
|
* {@link org.spongepowered.asm.mixin.injection.Inject} annotated members
|
|
* since it is anticipated that in general the target of a {@link Mixin}
|
|
* will be an obfuscated class and all annotated members will need to be
|
|
* added to the obfuscation table. However since it is possible to also
|
|
* apply mixins to non-obfuscated targets it may be desirable to suppress
|
|
* the compiler warnings which would otherwise be generated. This can be
|
|
* done on an individual member basis by setting <code>remap</code> to
|
|
* <em>false</em> on the individual annotations, or disabled for the entire
|
|
* mixin by setting the value here to <em>false</em>. Doing so will cause
|
|
* the annotation processor to skip all annotations in this mixin when
|
|
* building the obfuscation table.
|
|
*/
|
|
public boolean remap() default true;
|
|
}
|