diff --git a/gradle.properties b/gradle.properties index 31f19850e..7ca9a0695 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,5 +4,5 @@ packaging=jar description=Mixin url=https://www.spongepowered.org organization=SpongePowered -buildVersion=0.7.10 +buildVersion=0.7.11 buildType=SNAPSHOT diff --git a/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java b/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java index 60be5f76a..c659d2a3b 100644 --- a/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java +++ b/src/main/java/org/spongepowered/asm/launch/MixinBootstrap.java @@ -34,11 +34,11 @@ import org.spongepowered.asm.service.MixinService; /** - * Bootstaps the mixin subsystem. This class acts as a bridge between the mixin + * Bootstraps the mixin subsystem. This class acts as a bridge between the mixin * subsystem and the tweaker or coremod which is boostrapping it. Without this * class, a coremod may cause classload of MixinEnvironment in the * LaunchClassLoader before we have a chance to exclude it. By placing the main - * bootstap logic here we avoid the need for consumers to add the classloader + * bootstrap logic here we avoid the need for consumers to add the classloader * exclusion themselves. * *
In development, where (because of the classloader environment at dev time) @@ -51,7 +51,7 @@ * its constructor and that would be the end of the story. However we also need * to register the additional tweaker for environment to detect the transition * from pre-init to default and we cannot do this within the tweaker constructor - * witout triggering a ConcurrentModificationException in the tweaker list. To + * without triggering a ConcurrentModificationException in the tweaker list. To * work around this we register the secondary tweaker from within the mixin * tweaker's acceptOptions method instead.
*/ @@ -60,7 +60,7 @@ public abstract class MixinBootstrap { /** * Subsystem version */ - public static final String VERSION = "0.7.10"; + public static final String VERSION = "0.7.11"; /** * Log all the things diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java b/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java index eb8284475..dfbfea970 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/InjectionPoint.java @@ -160,10 +160,9 @@ enum ShiftByViolationBehaviour { public static final int DEFAULT_ALLOWED_SHIFT_BY = 0; /** - * Hard limit on the value of {@link At#by} which triggers warning/error - * (based on environment) + * Hard limit on the value of {@link At#by} which triggers error */ - public static final int MAX_ALLOWED_SHIFT_BY = 0; + public static final int MAX_ALLOWED_SHIFT_BY = 5; /** * Available injection point types @@ -665,6 +664,8 @@ private static void validateByValue(IMixinContext context, MethodNode method, An return; } + String limitBreached = "the maximum allowed value: "; + String advice = "Increase the value of maxShiftBy to suppress this warning."; int allowed = InjectionPoint.DEFAULT_ALLOWED_SHIFT_BY; if (context instanceof MixinTargetContext) { allowed = ((MixinTargetContext)context).getMaxShiftByValue(); @@ -674,11 +675,17 @@ private static void validateByValue(IMixinContext context, MethodNode method, An return; } - String message = String.format("@%s(%s) Shift.BY=%d on %s::%s exceeds the maximum allowed value %d.", Bytecode.getSimpleName(parent), point, - by, context, method.name, allowed); + if (by > InjectionPoint.MAX_ALLOWED_SHIFT_BY) { + limitBreached = "MAX_ALLOWED_SHIFT_BY="; + advice = "You must use an alternate query or a custom injection point."; + allowed = InjectionPoint.MAX_ALLOWED_SHIFT_BY; + } + + String message = String.format("@%s(%s) Shift.BY=%d on %s::%s exceeds %s%d. %s", Bytecode.getSimpleName(parent), point, + by, context, method.name, limitBreached, allowed, advice); - if (err == ShiftByViolationBehaviour.WARN) { - LogManager.getLogger("mixin").warn("{} Increase the value of maxShiftBy to suppress this warning.", message); + if (err == ShiftByViolationBehaviour.WARN && allowed < InjectionPoint.MAX_ALLOWED_SHIFT_BY) { + LogManager.getLogger("mixin").warn(message); return; }