Paper config files
== AT == public org.spigotmc.SpigotWorldConfig getBoolean(Ljava/lang/String;Z)Z public org.spigotmc.SpigotWorldConfig getDouble(Ljava/lang/String;)D public org.spigotmc.SpigotWorldConfig getDouble(Ljava/lang/String;D)D public org.spigotmc.SpigotWorldConfig getInt(Ljava/lang/String;)I public org.spigotmc.SpigotWorldConfig getInt(Ljava/lang/String;I)I public org.spigotmc.SpigotWorldConfig getList(Ljava/lang/String;Ljava/lang/Object;)Ljava/util/List; public org.spigotmc.SpigotWorldConfig getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/minecraft/core/RegistryAccess;Ljava/util/Properties;Ljoptsimple/OptionSet;)Lnet/minecraft/server/dedicated/DedicatedServerProperties; public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES
This commit is contained in:
@@ -967,6 +967,7 @@ public final class CraftServer implements Server {
|
||||
}
|
||||
|
||||
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
|
||||
this.console.paperConfigurations.reloadConfigs(this.console);
|
||||
for (ServerLevel world : this.console.getAllLevels()) {
|
||||
world.serverLevelData.setDifficulty(config.difficulty);
|
||||
world.setSpawnSettings(config.spawnMonsters);
|
||||
|
||||
@@ -142,6 +142,19 @@ public class Main {
|
||||
.defaultsTo(new File("spigot.yml"))
|
||||
.describedAs("Yml file");
|
||||
// Spigot End
|
||||
|
||||
// Paper start
|
||||
acceptsAll(asList("paper-dir", "paper-settings-directory"), "Directory for Paper settings")
|
||||
.withRequiredArg()
|
||||
.ofType(File.class)
|
||||
.defaultsTo(new File(io.papermc.paper.configuration.PaperConfigurations.CONFIG_DIR))
|
||||
.describedAs("Config directory");
|
||||
acceptsAll(asList("paper", "paper-settings"), "File for Paper settings")
|
||||
.withRequiredArg()
|
||||
.ofType(File.class)
|
||||
.defaultsTo(new File("paper.yml"))
|
||||
.describedAs("Yml file");
|
||||
// Paper end
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ public class SpigotConfig
|
||||
}
|
||||
}
|
||||
|
||||
static void readConfig(Class<?> clazz, Object instance)
|
||||
public static void readConfig(Class<?> clazz, Object instance) // Paper - package-private -> public
|
||||
{
|
||||
for ( Method method : clazz.getDeclaredMethods() )
|
||||
{
|
||||
|
||||
@@ -58,8 +58,14 @@ public class SpigotWorldConfig
|
||||
|
||||
public int getInt(String path, int def)
|
||||
{
|
||||
this.config.addDefault( "world-settings.default." + path, def );
|
||||
return this.config.getInt( "world-settings." + this.worldName + "." + path, this.config.getInt( "world-settings.default." + path ) );
|
||||
// Paper start - get int without setting default
|
||||
return this.getInt(path, def, true);
|
||||
}
|
||||
public int getInt(String path, int def, boolean setDef)
|
||||
{
|
||||
if (setDef) this.config.addDefault( "world-settings.default." + path, def );
|
||||
return this.config.getInt( "world-settings." + this.worldName + "." + path, this.config.getInt( "world-settings.default." + path, def ) );
|
||||
// Paper end
|
||||
}
|
||||
|
||||
public <T> List getList(String path, T def)
|
||||
@@ -138,14 +144,14 @@ public class SpigotWorldConfig
|
||||
public double itemMerge;
|
||||
private void itemMerge()
|
||||
{
|
||||
this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
|
||||
this.itemMerge = this.getDouble("merge-radius.item", 0.5 );
|
||||
this.log( "Item Merge Radius: " + this.itemMerge );
|
||||
}
|
||||
|
||||
public double expMerge;
|
||||
private void expMerge()
|
||||
{
|
||||
this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
|
||||
this.expMerge = this.getDouble("merge-radius.exp", -1 );
|
||||
this.log( "Experience Merge Radius: " + this.expMerge );
|
||||
}
|
||||
|
||||
@@ -197,7 +203,7 @@ public class SpigotWorldConfig
|
||||
|
||||
public int animalActivationRange = 32;
|
||||
public int monsterActivationRange = 32;
|
||||
public int raiderActivationRange = 48;
|
||||
public int raiderActivationRange = 64;
|
||||
public int miscActivationRange = 16;
|
||||
public boolean tickInactiveVillagers = true;
|
||||
public boolean ignoreSpectatorActivation = false;
|
||||
@@ -212,10 +218,10 @@ public class SpigotWorldConfig
|
||||
this.log( "Entity Activation Range: An " + this.animalActivationRange + " / Mo " + this.monsterActivationRange + " / Ra " + this.raiderActivationRange + " / Mi " + this.miscActivationRange + " / Tiv " + this.tickInactiveVillagers + " / Isa " + this.ignoreSpectatorActivation );
|
||||
}
|
||||
|
||||
public int playerTrackingRange = 48;
|
||||
public int animalTrackingRange = 48;
|
||||
public int monsterTrackingRange = 48;
|
||||
public int miscTrackingRange = 32;
|
||||
public int playerTrackingRange = 128;
|
||||
public int animalTrackingRange = 96;
|
||||
public int monsterTrackingRange = 96;
|
||||
public int miscTrackingRange = 96;
|
||||
public int displayTrackingRange = 128;
|
||||
public int otherTrackingRange = 64;
|
||||
private void trackingRange()
|
||||
|
||||
Reference in New Issue
Block a user