2020-07-25 17:16:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: tr7zw <tr7zw@live.de>
|
|
|
|
Date: Sat, 25 Jul 2020 17:16:18 +0200
|
2020-07-29 14:30:48 +02:00
|
|
|
Subject: [PATCH] Global Eula file
|
2020-07-25 17:16:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EULA.java b/src/main/java/net/minecraft/server/EULA.java
|
2020-08-03 18:48:42 +02:00
|
|
|
index 229c3b0f0c650b501f31147adaa17194af57fedd..e70da06948abf2aa2223a037aeb5f58fb0a466e3 100644
|
2020-07-25 17:16:49 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/EULA.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EULA.java
|
|
|
|
@@ -1,9 +1,11 @@
|
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.nio.file.Files;
|
|
|
|
import java.util.Properties;
|
|
|
|
+
|
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
|
|
|
|
|
@@ -15,12 +17,27 @@ public class EULA {
|
|
|
|
|
|
|
|
public EULA(java.nio.file.Path java_nio_file_path) {
|
|
|
|
this.b = java_nio_file_path;
|
|
|
|
- this.c = SharedConstants.d || this.b();
|
2020-08-03 18:48:42 +02:00
|
|
|
+ this.c = SharedConstants.d || globalEula() || this.b(this.b); // Yatopia
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Yatopia start
|
|
|
|
+
|
|
|
|
+ private boolean globalEula() {
|
|
|
|
+ File globalEula = new 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;
|
2020-07-25 17:16:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
- private boolean b() {
|
2020-08-03 18:48:42 +02:00
|
|
|
+ // Yatopia end
|
2020-07-25 17:16:49 +02:00
|
|
|
+
|
2020-08-03 18:48:42 +02:00
|
|
|
+ private boolean b(java.nio.file.Path path) { // Yatopia
|
2020-07-25 17:16:49 +02:00
|
|
|
try {
|
|
|
|
- InputStream inputstream = Files.newInputStream(this.b);
|
|
|
|
+ InputStream inputstream = Files.newInputStream(path);
|
|
|
|
Throwable throwable = null;
|
|
|
|
|
|
|
|
boolean flag;
|