Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Fix classloading issues
Browse files Browse the repository at this point in the history
Fixes 1.16 loading from 1.15.2
  • Loading branch information
comp500 committed Jun 8, 2020
1 parent 67c4263 commit d994f26
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.0.6'
version = '1.0.7'
group = 'link.infra.jumploader' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'jumploader'

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
modGroup=link.infra.jumploader
modVersion=1.0.6
modVersion=1.0.7
modBaseName=jumploader
2 changes: 1 addition & 1 deletion src/main/java/link/infra/jumploader/Jumploader.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.Set;

public class Jumploader implements ITransformationService {
public static final String VERSION = "1.0.6";
public static final String VERSION = "1.0.7";
public static final String USER_AGENT = "Jumploader/" + VERSION;

private final Logger LOGGER = LogManager.getLogger();
Expand Down
18 changes: 17 additions & 1 deletion src/main/java/link/infra/jumploader/JumploaderClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,22 @@ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundE
}
}
}
return super.loadClass(name, resolve);
// Prioritise classes from self to parent classloader
synchronized (getClassLoadingLock(name)) {
Class<?> c = findLoadedClass(name);
if (c == null) {
try {
// Try to find from self
c = findClass(name);
} catch (ClassNotFoundException e) {
// If it failed, try the parent classloader
return super.loadClass(name, resolve);
}
}
if (resolve) {
resolveClass(c);
}
return c;
}
}
}
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "jumploader",
"version": "1.0.6",
"version": "1.0.7",

"name": "Jumploader",
"description": "Allows the use of Fabric mods in Twitch modpacks, by loading Fabric as if it were a Forge mod.",
Expand Down

0 comments on commit d994f26

Please sign in to comment.