spigot/CraftBukkit-Patches/0078-Add-CommandLine-EULA-Flag.patch
2019-07-22 16:13:11 +10:00

34 lines
1.9 KiB
Diff

From 2c884f099b0aba46a5a28371aee6c57f33bc3cbd Mon Sep 17 00:00:00 2001
From: md_5 <git@md-5.net>
Date: Wed, 9 Jul 2014 10:35:44 +1000
Subject: [PATCH] Add CommandLine EULA Flag
This flag contains the same message as eula.txt (albeit with proper grammar for 3rd person plural). By setting this flag you are agreeing to the terms listed in the message printed upon setting this flag, which are no different from those agreed to by any other method.
This feature only exists for hosting companies and people who manage servers in bulk who wish to agree to the terms by setting a flag in a script.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f9158559e..8948b3697 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1147,7 +1147,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas
return;
}
- if (!eula.a()) {
+ // Spigot Start
+ boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
+ if ( eulaAgreed )
+ {
+ System.err.println( "You have used the Spigot command line EULA agreement flag." );
+ System.err.println( "By using this setting you are indicating your agreement to Mojang's EULA (https://account.mojang.com/documents/minecraft_eula)." );
+ System.err.println( "If you do not agree to the above EULA please stop your server and remove this flag immediately." );
+ }
+ // Spigot End
+ if (!eula.a() && !eulaAgreed) { // Spigot
MinecraftServer.LOGGER.info("You need to agree to the EULA in order to run the server. Go to eula.txt for more info.");
return;
}
--
2.20.1