mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-16 13:21:24 +01:00
Allow specifying location of spigot.yml
As requested here: http://www.spigotmc.org/threads/specify-location-of-spigot-yml.67747/
This commit is contained in:
parent
dd2580a742
commit
8050f01466
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
+ // Spigot start
|
||||
+ this.a((PlayerList) (new DedicatedPlayerList(this)));
|
||||
+ org.spigotmc.SpigotConfig.init();
|
||||
+ org.spigotmc.SpigotConfig.init((File) options.valueOf("spigot-settings"));
|
||||
+ org.spigotmc.SpigotConfig.registerCommands();
|
||||
+ // Spigot end
|
||||
|
||||
@ -75,7 +75,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
logger.log(Level.WARNING, "Failed to load banned-players.json, " + ex.getMessage());
|
||||
}
|
||||
|
||||
+ org.spigotmc.SpigotConfig.init(); // Spigot
|
||||
+ org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
|
||||
for (WorldServer world : console.worlds) {
|
||||
world.worldData.setDifficulty(difficulty);
|
||||
world.setSpawnFlags(monsters, animals);
|
||||
@ -94,6 +94,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*");
|
||||
|
||||
int pollCount = 0;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
acceptsAll(asList("v", "version"), "Show the CraftBukkit Version");
|
||||
|
||||
acceptsAll(asList("demo"), "Demo mode");
|
||||
+
|
||||
+ // Spigot Start
|
||||
+ acceptsAll(asList("S", "spigot-settings"), "File for spigot settings")
|
||||
+ .withRequiredArg()
|
||||
+ .ofType(File.class)
|
||||
+ .defaultsTo(new File("spigot.yml"))
|
||||
+ .describedAs("Yml file");
|
||||
+ // Spigot End
|
||||
}
|
||||
};
|
||||
|
||||
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
@ -121,7 +140,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+public class SpigotConfig
|
||||
+{
|
||||
+
|
||||
+ private static final File CONFIG_FILE = new File( "spigot.yml" );
|
||||
+ private static File CONFIG_FILE;
|
||||
+ private static final String HEADER = "This is the main configuration file for Spigot.\n"
|
||||
+ + "As you can see, there's tons to configure. Some options may impact gameplay, so use\n"
|
||||
+ + "with caution, and make sure you know what each option does before configuring.\n"
|
||||
@ -139,8 +158,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ static Map<String, Command> commands;
|
||||
+ /*========================================================================*/
|
||||
+
|
||||
+ public static void init()
|
||||
+ public static void init(File configFile)
|
||||
+ {
|
||||
+ CONFIG_FILE = configFile;
|
||||
+ config = new YamlConfiguration();
|
||||
+ try
|
||||
+ {
|
||||
@ -315,4 +335,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -665,7 +665,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
/*========================================================================*/
|
||||
+ private static Metrics metrics;
|
||||
|
||||
public static void init()
|
||||
public static void init(File configFile)
|
||||
{
|
||||
@@ -0,0 +0,0 @@ public class SpigotConfig
|
||||
{
|
||||
@ -686,4 +686,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
}
|
||||
|
||||
static void readConfig(Class<?> clazz, Object instance)
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -31,4 +31,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ logCommands = getBoolean( "commands.log", true );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -48,4 +48,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ tabComplete = getInt( "commands.tab-complete", 0 );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -102,4 +102,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ outdatedServerMessage = transform( getString( "messages.outdated-server", outdatedServerMessage ) );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -313,4 +313,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -211,4 +211,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ bungee = getBoolean( "settings.bungeecord", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -52,4 +52,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Bukkit.getLogger().log( Level.INFO, "Using {0} threads for Netty based IO", count );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -31,4 +31,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
System.out.println("Loading libraries, please wait...");
|
||||
MinecraftServer.main(options);
|
||||
} catch (Throwable t) {
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -57,4 +57,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ lateBind = getBoolean( "settings.late-bind", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -88,4 +88,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -160,4 +160,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ + ( ( tps > 20.0 ) ? "*" : "" ) + Math.min( Math.round( tps * 100.0 ) / 100.0, 20.0 );
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -38,4 +38,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ System.out.println( "Server Ping Player Sample Count: " + playerSample );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -38,4 +38,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ playerShuffle = getInt( "settings.player-shuffle", 0 );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -56,4 +56,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ } ) );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -32,4 +32,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ silentCommandBlocks = getBoolean( "commands.silent-commandblock-console", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -32,4 +32,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ filterCreativeItems = getBoolean( "settings.filter-creative-items", true );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -75,4 +75,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ Arrays.asList( "setblock", "summon", "testforblock", "tellraw" ) ) );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -32,4 +32,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ userCacheCap = getInt( "settings.user-cache-size", 1000 );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -51,4 +51,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ saveUserCacheOnStopOnly = getBoolean( "settings.save-user-cache-on-stop-only", false );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -57,4 +57,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ intCacheLimit = getInt( "settings.int-cache-limit", 1024 );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -33,4 +33,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ movedWronglyThreshold = getDouble( "settings.moved-wrongly-threshold", 0.0625D );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -33,4 +33,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ movedTooQuicklyThreshold = getDouble( "settings.moved-too-quickly-threshold", 100.0D );
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -70,4 +70,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ ( (AttributeRanged) GenericAttributes.ATTACK_DAMAGE ).b = attackDamage;
|
||||
+ }
|
||||
}
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
@ -62,4 +62,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
</Root>
|
||||
</Loggers>
|
||||
</Configuration>
|
||||
--
|
||||
--
|
||||
1.9.0.msysgit.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user