Merge branch 'dev/0.5' into forge

This commit is contained in:
Juuxel
2020-12-03 18:10:27 +02:00
2 changed files with 18 additions and 0 deletions

View File

@@ -247,6 +247,12 @@ public class LoomGradleExtension {
}
public File getNativesDirectory() {
Object customNativesDir = project.getProperties().get("fabric.loom.natives.dir");
if (customNativesDir != null) {
return new File((String) customNativesDir);
}
File natives = new File(getUserCache(), "natives/" + getMinecraftProvider().getMinecraftVersion());
if (!natives.exists()) {
@@ -256,6 +262,10 @@ public class LoomGradleExtension {
return natives;
}
public boolean hasCustomNatives() {
return project.getProperties().get("fabric.loom.natives.dir") != null;
}
public File getDevLauncherConfig() {
return new File(getProjectPersistentCache(), "launch.cfg");
}

View File

@@ -45,6 +45,14 @@ public class MinecraftNativesProvider {
File nativesDir = extension.getNativesDirectory();
File jarStore = extension.getNativesJarStore();
if (extension.hasCustomNatives()) {
if (!nativesDir.exists()) {
throw new RuntimeException("Could no find custom natives directory at " + nativesDir.getAbsolutePath());
}
return;
}
for (MinecraftVersionInfo.Library library : versionInfo.libraries) {
File libJarFile = library.getFile(jarStore);