Skip to content

Commit

Permalink
Fix wrong class name passed to MixinApplicator/JavaPatcher causing pa…
Browse files Browse the repository at this point in the history
…tching to fail
  • Loading branch information
LunNova committed May 8, 2017
1 parent cbaae33 commit 5a6b4ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/me/nallar/modpatcher/ModPatcherTransformer.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ public byte[] transform(String name, String transformedName, byte[] bytes) {

final byte[] originalBytes = bytes;
if (mixinApplicator != null) {
bytes = getMixinApplicator().getMixinTransformer().transformClass(() -> originalBytes, name).get();
bytes = getMixinApplicator().getMixinTransformer().transformClass(() -> originalBytes, transformedName).get();
}

LaunchClassLoaderUtil.cacheSrgBytes(name, bytes);
LaunchClassLoaderUtil.cacheSrgBytes(transformedName, bytes);
try {
bytes = patcher.patch(name, bytes);
bytes = patcher.patch(transformedName, bytes);
} catch (Throwable t) {
PatcherLog.error("Failed to patch " + name, t);
PatcherLog.error("Failed to patch " + transformedName, t);
} finally {
LaunchClassLoaderUtil.releaseSrgBytes(name);
LaunchClassLoaderUtil.releaseSrgBytes(transformedName);
}

if (originalBytes != bytes)
Expand Down

0 comments on commit 5a6b4ab

Please sign in to comment.