diff --git a/TShockAPI/Configuration/TShockConfig.cs b/TShockAPI/Configuration/TShockConfig.cs index d6f9743e..efeeae86 100644 --- a/TShockAPI/Configuration/TShockConfig.cs +++ b/TShockAPI/Configuration/TShockConfig.cs @@ -55,6 +55,10 @@ namespace TShockAPI.Configuration [Description("Allows stacks in chests to go beyond the stack limit during world loading.")] public bool IgnoreChestStacksOnLoad = false; + /// Allows changing of the default world tile provider. + [Description("Allows changing of the default world tile provider.")] + public string WorldTileProvider = "default"; + #endregion diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 8346e71c..2eb53c97 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -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?.ToLower()) + { + 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); diff --git a/docs/changelog.md b/docs/changelog.md index 35e8c596..8f27918e 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -78,6 +78,8 @@ Use past tense when adding new entries; sign your name off when you add or chang * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. --> ## Upcoming changes +* Your changes could be here! +* Added `WorldTileProvider` to the tshock config with values `default`, `constileation` or `heaptile`. This allows tile providers to be changed in environments where CLI args cannot be altered. See the documentation website for more info about these providers. (@SignatureBeef) * Updated the Utils.FindByIdOrName to follow same logic. Now fuzzy match fallback to `StartsWith` and then `Contains`. (@sgkoishi) * Added `ShadowCandle` and `BrainOfConfusionBuff` (BoC dodge buff) to the `PlayerAddBuffWhitelist` (@drunderscore) * Improved rejection message and code duplication in `OnPlayerBuff` (@drunderscore)