diff --git a/build.gradle b/build.gradle index dfaeed0..0a8489c 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ targetCompatibility = 8 group = "com.unascribed" archivesBaseName = "NilLoader" -version = "1.3.1" +version = "1.3.2" tasks.withType(JavaCompile) { options.release = 8 diff --git a/src/main/java/nilloader/NilAgent.java b/src/main/java/nilloader/NilAgent.java index 9561837..8e84828 100644 --- a/src/main/java/nilloader/NilAgent.java +++ b/src/main/java/nilloader/NilAgent.java @@ -880,7 +880,7 @@ public static void registerTransformer(ClassTransformer transformer) { public static void setTargetMapping(String mod, String id) { if (mod == null) throw new IllegalStateException("Can only call this method during an entrypoint"); - if (frozen) throw new IllegalStateException("Mappings must be set during the premain entrypoint"); + if (frozen) throw new IllegalStateException("Mappings must be set during the premain/hijack entrypoint"); activeModMappings.put(mod, id); } diff --git a/src/main/java/nilloader/annotate/OriginallySynthetic.java b/src/main/java/nilloader/annotate/OriginallySynthetic.java new file mode 100644 index 0000000..7880e59 --- /dev/null +++ b/src/main/java/nilloader/annotate/OriginallySynthetic.java @@ -0,0 +1,19 @@ +package nilloader.annotate; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.CLASS; + +import java.lang.annotation.Documented; +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Marks a member or class as having originally been marked as synthetic, but it was untagged by + * NilGradle's remapping to allow it to be referenced in source code. + */ +@Retention(CLASS) +@Target({ TYPE, FIELD, METHOD }) +@Documented +public @interface OriginallySynthetic {} diff --git a/src/main/java/nilloader/api/lib/mini/PatchContext.java b/src/main/java/nilloader/api/lib/mini/PatchContext.java index 0f6b2c5..38320af 100644 --- a/src/main/java/nilloader/api/lib/mini/PatchContext.java +++ b/src/main/java/nilloader/api/lib/mini/PatchContext.java @@ -146,7 +146,7 @@ public void jumpBefore() { public SearchResult next() { assertSuccessful(); assertValid(); - return searchFrom(reverse ? code.indexOf(start) : code.indexOf(end), query, reverse); + return searchFrom(reverse ? code.indexOf(start) : code.indexOf(end)+1, query, reverse); } /**