Source reformat
This commit is contained in:
@@ -6,8 +6,9 @@ sourceSets.main.java.srcDirs = ["src/"]
|
||||
project.ext.mainClassName = "io.anuke.mindustry.desktop.DesktopLauncher"
|
||||
project.ext.assetsDir = new File("../core/assets")
|
||||
|
||||
import com.badlogicgames.packr.PackrConfig
|
||||
|
||||
import com.badlogicgames.packr.Packr
|
||||
import com.badlogicgames.packr.PackrConfig
|
||||
|
||||
def JDK_DIR = "$System.env.PACKR_DIR"
|
||||
def ICON_DIR = new File("core/assets/sprites/icon.icns")
|
||||
@@ -146,7 +147,7 @@ task packrZip(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
finalizedBy "clearOut"
|
||||
|
||||
if(project.hasProperty("platform")){
|
||||
|
||||
+18
-21
@@ -3,24 +3,23 @@
|
||||
{
|
||||
"archive": "jre/lib/rt.jar",
|
||||
"paths": [
|
||||
|
||||
"javax/transaction",
|
||||
"javax/tools",
|
||||
"javax/swing",
|
||||
"javax/sql",
|
||||
"javax/smartcardio",
|
||||
"javax/rmi",
|
||||
"javax/print",
|
||||
"javax/naming",
|
||||
"javax/management",
|
||||
"javax/lang",
|
||||
"javax/jws",
|
||||
"javax/swing",
|
||||
"javax/imageio",
|
||||
"javax/annotation",
|
||||
"javax/activity",
|
||||
"javax/activation",
|
||||
"javax/accessibility",
|
||||
"javax/transaction",
|
||||
"javax/tools",
|
||||
"javax/swing",
|
||||
"javax/sql",
|
||||
"javax/smartcardio",
|
||||
"javax/rmi",
|
||||
"javax/print",
|
||||
"javax/naming",
|
||||
"javax/management",
|
||||
"javax/lang",
|
||||
"javax/jws",
|
||||
"javax/swing",
|
||||
"javax/imageio",
|
||||
"javax/annotation",
|
||||
"javax/activity",
|
||||
"javax/activation",
|
||||
"javax/accessibility",
|
||||
"com/sun/corba",
|
||||
"com/sun/jmx",
|
||||
"com/sun/org",
|
||||
@@ -37,9 +36,7 @@
|
||||
"com/sun/media",
|
||||
"com/sun/naming",
|
||||
"java/awt",
|
||||
|
||||
"com/sun/org/apache/xpath",
|
||||
|
||||
"com/sun/org/apache/xpath",
|
||||
"com/sun/rowset",
|
||||
"com/sun/script",
|
||||
"sun/applet",
|
||||
|
||||
@@ -57,8 +57,8 @@ public class CrashHandler{
|
||||
dialog(() -> TinyFileDialogs.tinyfd_messageBox("oh no",
|
||||
e.getMessage().contains("Couldn't create window") ? "A graphics initialization error has occured! Try to update your graphics drivers.\nReport this to the developer." :
|
||||
"Your graphics card does not support OpenGL 2.0!\n" +
|
||||
"Try to update your graphics drivers.\n\n" +
|
||||
"(If that doesn't work, your computer just doesn't support Mindustry.)", "ok", "error", true));
|
||||
"Try to update your graphics drivers.\n\n" +
|
||||
"(If that doesn't work, your computer just doesn't support Mindustry.)", "ok", "error", true));
|
||||
badGPU = true;
|
||||
}
|
||||
|
||||
@@ -93,12 +93,12 @@ public class CrashHandler{
|
||||
|
||||
try{
|
||||
Path path = Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes",
|
||||
"crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt");
|
||||
"crash-report-" + DateTimeFormatter.ofPattern("MM_dd_yyyy_HH_mm_ss").format(LocalDateTime.now()) + ".txt");
|
||||
Files.createDirectories(Paths.get(OS.getAppDataDirectoryString(Vars.appName), "crashes"));
|
||||
Files.write(path, parseException(e).getBytes());
|
||||
|
||||
if(!badGPU){
|
||||
dialog(() -> TinyFileDialogs.tinyfd_messageBox("oh no", "A crash has occured. It has been saved in:\n" + path.toAbsolutePath().toString(), "ok", "error", true));
|
||||
dialog(() -> TinyFileDialogs.tinyfd_messageBox("oh no", "A crash has occured. It has been saved in:\n" + path.toAbsolutePath().toString(), "ok", "error", true));
|
||||
}
|
||||
}catch(Throwable t){
|
||||
Log.err("Failed to save local crash report.");
|
||||
@@ -116,7 +116,10 @@ public class CrashHandler{
|
||||
});
|
||||
|
||||
//sleep for 10 seconds or until crash report is sent
|
||||
try{ Thread.sleep(10000); }catch(InterruptedException ignored){}
|
||||
try{
|
||||
Thread.sleep(10000);
|
||||
}catch(InterruptedException ignored){
|
||||
}
|
||||
}
|
||||
|
||||
private static void dialog(Runnable r){
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package io.anuke.mindustry.desktop;
|
||||
|
||||
import club.minnced.discord.rpc.DiscordEventHandlers;
|
||||
import club.minnced.discord.rpc.DiscordRPC;
|
||||
import club.minnced.discord.rpc.DiscordRichPresence;
|
||||
import club.minnced.discord.rpc.*;
|
||||
import io.anuke.arc.collection.Array;
|
||||
import io.anuke.arc.files.FileHandle;
|
||||
import io.anuke.arc.function.Consumer;
|
||||
@@ -85,7 +83,8 @@ public class DesktopPlatform extends Platform{
|
||||
try{
|
||||
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
|
||||
NetworkInterface out;
|
||||
for(out = e.nextElement(); (out.getHardwareAddress() == null || !validAddress(out.getHardwareAddress())) && e.hasMoreElements(); out = e.nextElement()) ;
|
||||
for(out = e.nextElement(); (out.getHardwareAddress() == null || !validAddress(out.getHardwareAddress())) && e.hasMoreElements(); out = e.nextElement())
|
||||
;
|
||||
|
||||
byte[] bytes = out.getHardwareAddress();
|
||||
byte[] result = new byte[8];
|
||||
|
||||
Reference in New Issue
Block a user