Add environment variable (PAPER_DISABLE_SERVER_GUI) to disable server gui

This commit is contained in:
Riley Park 2021-05-17 00:39:56 -07:00
parent 6ecbe57765
commit 18ad2c9ddb
No known key found for this signature in database
GPG Key ID: D831AF236C834E45

View File

@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Riley Park <riley.park@meino.net>
Date: Mon, 17 May 2021 00:34:55 -0700
Subject: [PATCH] Add environment variable to disable server gui
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 6818f8496ab76ee6ffc747bd6848b43830ec8914..bf4051349917cc1d727fc5544237e0291cb6f1e6 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -233,6 +233,7 @@ public class Main {
*/
boolean flag1 = !optionset.has("nogui") && !optionset.nonOptionArguments().contains("nogui");
+ if(!Boolean.parseBoolean(System.getenv().getOrDefault("PAPER_DISABLE_SERVER_GUI", String.valueOf(false)))) // Paper
if (flag1 && !GraphicsEnvironment.isHeadless()) {
dedicatedserver1.bd();
}