-
-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
daf6aa5
commit 8cb622f
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 7037860af3e5c75edbb10461c821912432c69809 Mon Sep 17 00:00:00 2001 | ||
From: William Blake Galbreath <Blake.Galbreath@GMail.com> | ||
Date: Sat, 7 Dec 2019 14:35:43 -0600 | ||
Subject: [PATCH] Double Click Jar Check | ||
|
||
--- | ||
src/main/java/org/bukkit/craftbukkit/Main.java | 6 ++++++ | ||
1 file changed, 6 insertions(+) | ||
|
||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java | ||
index 31af710a07..f9e7577e1c 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java | ||
@@ -20,6 +20,12 @@ public class Main { | ||
public static boolean useConsole = true; | ||
|
||
public static void main(String[] args) { | ||
+ // Purpur start | ||
+ if (System.console() == null) { | ||
+ javax.swing.JOptionPane.showMessageDialog(null, "Please do not run this server by double clicking the jar!"); | ||
+ return; | ||
+ } | ||
+ // Purpur end | ||
// Todo: Installation script | ||
OptionParser parser = new OptionParser() { | ||
{ | ||
-- | ||
2.24.0.rc1 | ||
|
8cb622f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BillyGalbreath This commit seems to prevent me from launching purpur via multicraft with CentOS. :(
Downgrading to purpur dev 333, all is well again.
8cb622f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need a condition like GraphicsEnvironment#isHeadless() before trying to show message dialog. So changing
if (System.console() == null) {
toif (System.console() == null && !java.awt.GraphicsEnvironment.isHeadless()) {
might fix the problem.