Исправление фикса для 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' -repackageclasses 'ru.gravit.launcher'
-keep class ru.zaxar163.* -keep class ru.zaxar163.*
-keep class cpw.mods.fml.* -keep class cpw.mods.fml.*
-keep class net.minecraftforge.fml.*
-keepattributes SourceFile,LineNumberTable,*Annotation* -keepattributes SourceFile,LineNumberTable,*Annotation*
-renamesourcefileattribute SourceFile -renamesourcefileattribute SourceFile
-keepattributes Signature -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 из классов // FMLSecurityManager запрещает делать System.exit из классов
// Не входящих в пакеты самого Forge // Не входящих в пакеты самого Forge
public class SafeExitJVM { public class SafeExitJVM {

View file

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