mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Guard against instances where the GLWindow is closed without being opened (#Forge)
This commit is contained in:
parent
9f3042356b
commit
0bf874c1f9
1 changed files with 27 additions and 0 deletions
|
@ -1,10 +1,14 @@
|
|||
package com.voxelmodpack.hdskins.upload;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mumfrey.liteloader.util.ModUtilities;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.DefaultResourcePack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.opengl.DisplayMode;
|
||||
|
@ -38,6 +42,8 @@ public class GLWindow extends DropTarget {
|
|||
@Nullable
|
||||
private static GLWindow instance = null;
|
||||
|
||||
private static final Logger logger = LogManager.getLogger();
|
||||
|
||||
/**
|
||||
* Gets or creates the current GLWindow context.
|
||||
*/
|
||||
|
@ -162,6 +168,27 @@ public class GLWindow extends DropTarget {
|
|||
}
|
||||
|
||||
private synchronized void close() {
|
||||
if (frame == null) {
|
||||
String msg = "GLClose was called in an illegal state! You cannot close the GLWindow before it has been opened.";
|
||||
|
||||
if (ModUtilities.fmlIsPresent()) {
|
||||
logger.fatal("========================================================");
|
||||
logger.fatal("!!!!!! MINECRAFT FORGE / FORGE MODLOADER DETECTED !!!!!!");
|
||||
logger.fatal("FML was detected! Forge is known to cause severe incompatibilities and instability with other mods"
|
||||
+ " above and beyond interfering with the normal functioning of existing game registries,"
|
||||
+ " blocking system calls / AWT functions,"
|
||||
+ " obfuscating/deobfuscating parts of minecraft and mod code."
|
||||
+ " .jar signature invalidation"
|
||||
+ " and/or deep and irreversible core modifications to the game.");
|
||||
logger.fatal("A full stacktrace is provided below for debugging purposes.");
|
||||
logger.fatal(msg, new IllegalStateException(msg));
|
||||
logger.fatal("========================================================");
|
||||
} else {
|
||||
logger.fatal(msg);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
closeRequested = true;
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in a new issue