Yatopia/patches/server/0023-Global-Eula-file.patch
budgidiere c09ee99f7e
Hydrinity optimizations & Lithium generation patches & more
Closes #257 

Ports 2 patches from Purpur: Infinity-bow-settings & Allow-infinite-and-mending-enchantments-together
Added an option for infinity with no arrows too.

Option for custom locale has come! You can put a locale.json file in your server folder to change it. 

We've got the finest patches from Hydrinity ( Mykyta approved & allowed ) too.

We have some amazing new options in yatopia.yml, we're gonna have documentation for them soon so stay tuned!
Last but not least, chunk generation patches. We've tested them extensively so no weirdness happens.

Thanks for using Yatopia as your production server software.

Co-authored-by: Ivan Pekov <ivan@mrivanplays.com>
2020-10-27 21:15:13 +02:00

40 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: tr7zw <tr7zw@live.de>
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 229c3b0f0c650b501f31147adaa17194af57fedd..345f8b811946fd11695dd718d060c5a86cd64703 100644
--- a/src/main/java/net/minecraft/server/EULA.java
+++ b/src/main/java/net/minecraft/server/EULA.java
@@ -15,12 +15,25 @@ 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();
+ 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;