2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
|
|
|
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -10,8 +10,14 @@
|
2021-03-15 23:00:00 +01:00
|
|
|
import net.minecraft.world.level.EnumGamemode;
|
|
|
|
import net.minecraft.world.level.levelgen.GeneratorSettings;
|
2019-04-23 04:00:00 +02:00
|
|
|
|
2021-03-08 22:47:33 +01:00
|
|
|
+// CraftBukkit start
|
|
|
|
+import joptsimple.OptionSet;
|
2021-03-15 23:00:00 +01:00
|
|
|
+import net.minecraft.server.dedicated.PropertyManager.EditableProperty;
|
2021-03-08 22:47:33 +01:00
|
|
|
+// CraftBukkit end
|
|
|
|
+
|
2019-04-23 04:00:00 +02:00
|
|
|
public class DedicatedServerProperties extends PropertyManager<DedicatedServerProperties> {
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
+ public final boolean debug = this.get("debug", false); // CraftBukkit
|
|
|
|
public final boolean onlineMode = this.get("online-mode", true);
|
|
|
|
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
|
|
|
|
public final String serverIp = this.get("server-ip", "");
|
|
|
|
@@ -67,8 +73,10 @@
|
2021-06-11 07:00:00 +02:00
|
|
|
@Nullable
|
2021-07-06 16:00:00 +02:00
|
|
|
private GeneratorSettings worldGenSettings;
|
2019-04-23 04:00:00 +02:00
|
|
|
|
2021-06-11 07:00:00 +02:00
|
|
|
- public DedicatedServerProperties(Properties properties) {
|
2019-04-23 04:00:00 +02:00
|
|
|
- super(properties);
|
|
|
|
+ // CraftBukkit start
|
2021-06-11 07:00:00 +02:00
|
|
|
+ public DedicatedServerProperties(Properties properties, OptionSet optionset) {
|
2019-04-23 04:00:00 +02:00
|
|
|
+ super(properties, optionset);
|
|
|
|
+ // CraftBukkit end
|
2021-11-21 23:00:00 +01:00
|
|
|
this.difficulty = (EnumDifficulty) this.get("difficulty", dispatchNumberOrString(EnumDifficulty::byId, EnumDifficulty::byName), EnumDifficulty::getKey, EnumDifficulty.EASY);
|
|
|
|
this.gamemode = (EnumGamemode) this.get("gamemode", dispatchNumberOrString(EnumGamemode::byId, EnumGamemode::byName), EnumGamemode::getName, EnumGamemode.SURVIVAL);
|
|
|
|
this.levelName = this.get("level-name", "world");
|
2021-06-11 07:00:00 +02:00
|
|
|
@@ -112,13 +120,15 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
this.whiteList = this.getMutable("white-list", false);
|
2019-04-23 04:00:00 +02:00
|
|
|
}
|
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
- public static DedicatedServerProperties fromFile(Path path) {
|
|
|
|
- return new DedicatedServerProperties(loadFromFile(path));
|
2019-04-23 04:00:00 +02:00
|
|
|
+ // CraftBukkit start
|
2021-11-21 23:00:00 +01:00
|
|
|
+ public static DedicatedServerProperties fromFile(Path path, OptionSet optionset) {
|
|
|
|
+ return new DedicatedServerProperties(loadFromFile(path), optionset);
|
2019-04-23 04:00:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-08-11 23:00:00 +02:00
|
|
|
- protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties) {
|
2021-06-11 07:00:00 +02:00
|
|
|
- DedicatedServerProperties dedicatedserverproperties = new DedicatedServerProperties(properties);
|
2020-08-11 23:00:00 +02:00
|
|
|
+ protected DedicatedServerProperties reload(IRegistryCustom iregistrycustom, Properties properties, OptionSet optionset) {
|
2021-06-11 07:00:00 +02:00
|
|
|
+ DedicatedServerProperties dedicatedserverproperties = new DedicatedServerProperties(properties, optionset);
|
2019-04-23 04:00:00 +02:00
|
|
|
+ // CraftBukkit end
|
2021-06-11 07:00:00 +02:00
|
|
|
|
2021-11-21 23:00:00 +01:00
|
|
|
dedicatedserverproperties.getWorldGenSettings(iregistrycustom);
|
2021-06-11 07:00:00 +02:00
|
|
|
return dedicatedserverproperties;
|