Skip to content

Commit

Permalink
fix transforming not-yet loaded classes
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazeMCworld committed Jul 2, 2023
1 parent a9df245 commit 17c848a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/de/blazemcworld/jsscripts/Injector.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ public static void transformBytes(String className, Function<byte[], byte[]> tra
className = Mappings.remapClass("named", Mappings.current(), className);
String slashName = className.replace('.', '/');

Class.forName(className); //ensure class is loaded

ClassFileTransformer classFileTransformer = new ClassFileTransformer() {
@Override
public byte[] transform(ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) {
Expand Down

0 comments on commit 17c848a

Please sign in to comment.