Исправление фикса для 1.12

This commit is contained in:
Gravit 2018-09-29 14:16:53 +07:00
parent a8bdebd767
commit b6d0692a1e
4 changed files with 19 additions and 3 deletions

View file

@ -16,6 +16,7 @@
-repackageclasses 'ru.gravit.launcher'
-keep class ru.zaxar163.*
-keep class cpw.mods.fml.*
-keep class net.minecraftforge.fml.*
-keepattributes SourceFile,LineNumberTable,*Annotation*
-renamesourcefileattribute SourceFile
-keepattributes Signature

View file

@ -0,0 +1,9 @@
package cpw.mods.fml;
// FMLSecurityManager запрещает делать System.exit из классов
// Не входящих в пакеты самого Forge
public class SafeExitJVMLegacy {
public static void exit(int code)
{
System.exit(code);
}
}

View file

@ -1,4 +1,4 @@
package cpw.mods.fml;
package net.minecraftforge.fml;
// FMLSecurityManager запрещает делать System.exit из классов
// Не входящих в пакеты самого Forge
public class SafeExitJVM {

View file

@ -15,7 +15,8 @@
import java.util.LinkedList;
import java.util.Objects;
import cpw.mods.fml.SafeExitJVM;
import cpw.mods.fml.SafeExitJVMLegacy;
import net.minecraftforge.fml.SafeExitJVM;
import ru.gravit.launcher.LauncherAPI;
import ru.gravit.launcher.hasher.HashedEntry.Type;
import ru.gravit.utils.helper.IOHelper;
@ -67,7 +68,12 @@ public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) th
private static void handleError(Throwable e) {
LogHelper.error(e);
SafeExitJVM.exit(-123);
try {
SafeExitJVMLegacy.exit(-123);
} catch (Throwable ignored)
{
SafeExitJVM.exit(-123);
}
}
private static Deque<String> toPath(Iterable<Path> path) {