Add WorldTileProvider to tshock config

This allows the tshock tile providers to be switched via the config instead of cli args via tsapi, for environments where the command line args cannot be changed.
This commit is contained in:
Luke 2022-11-12 07:28:26 +10:00
parent 5d84192624
commit 0f46b1255a
3 changed files with 18 additions and 0 deletions

View file

@ -383,6 +383,19 @@ namespace TShockAPI
if (Config.Settings.EnableGeoIP && File.Exists(geoippath))
Geo = new GeoIPCountry(geoippath);
// check if a custom tile provider is to be used
switch(Config.Settings.WorldTileProvider)
{
case "heaptile":
Log.ConsoleInfo(GetString($"Using {nameof(HeapTile)} for tile implementation"), TraceLevel.Info);
Main.tile = new TileProvider();
break;
case "constileation":
Log.ConsoleInfo(GetString($"Using {nameof(ConstileationProvider)} for tile implementation"), TraceLevel.Info);
Main.tile = new ConstileationProvider();
break;
}
Log.ConsoleInfo(GetString("TShock {0} ({1}) now running.", Version, VersionCodename));
ServerApi.Hooks.GamePostInitialize.Register(this, OnPostInit);