From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: tr7zw Date: Sat, 25 Jul 2020 17:16:18 +0200 Subject: [PATCH] Global Eula file diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java index 87891161f5b06bb8be0e2016b490484e6daca9d7..b6d94005cb2d7f28fc4f0b78191ef1ba13190e56 100644 --- a/src/main/java/net/minecraft/server/EULA.java +++ b/src/main/java/net/minecraft/server/EULA.java @@ -17,12 +17,25 @@ public class EULA { public EULA(Path path) { this.b = path; - this.c = SharedConstants.d || this.b(); + this.c = SharedConstants.d || globalEula() || this.b(this.b); // Yatopia } - private boolean b() { + // Yatopia start + private boolean globalEula() { + java.io.File globalEula = new java.io.File(System.getProperty("user.home"), "eula.txt"); + + if (globalEula.exists()) { + return b(globalEula.toPath()); + } else { + System.out.println("No global eula found at " + globalEula.getAbsolutePath()); + } + return false; + } + // Yatopia end + + private boolean b(java.nio.file.Path path) { // Yatopia try { - InputStream inputstream = Files.newInputStream(this.b); + InputStream inputstream = Files.newInputStream(path); Throwable throwable = null; boolean flag;