Merge remote-tracking branch 'origin/config/WorldTileProvider' into general-devel

This commit is contained in:
Lucas Nicodemus 2022-11-27 23:46:18 -08:00
commit d0262656df
No known key found for this signature in database
3 changed files with 19 additions and 0 deletions

View file

@ -55,6 +55,10 @@ namespace TShockAPI.Configuration
[Description("Allows stacks in chests to go beyond the stack limit during world loading.")] [Description("Allows stacks in chests to go beyond the stack limit during world loading.")]
public bool IgnoreChestStacksOnLoad = false; public bool IgnoreChestStacksOnLoad = false;
/// <summary>Allows changing of the default world tile provider.</summary>
[Description("Allows changing of the default world tile provider.")]
public string WorldTileProvider = "default";
#endregion #endregion

View file

@ -383,6 +383,19 @@ namespace TShockAPI
if (Config.Settings.EnableGeoIP && File.Exists(geoippath)) if (Config.Settings.EnableGeoIP && File.Exists(geoippath))
Geo = new GeoIPCountry(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)); Log.ConsoleInfo(GetString("TShock {0} ({1}) now running.", Version, VersionCodename));
ServerApi.Hooks.GamePostInitialize.Register(this, OnPostInit); ServerApi.Hooks.GamePostInitialize.Register(this, OnPostInit);

View file

@ -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. --> * 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 ## 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) * 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) * Added `ShadowCandle` and `BrainOfConfusionBuff` (BoC dodge buff) to the `PlayerAddBuffWhitelist` (@drunderscore)
* Improved rejection message and code duplication in `OnPlayerBuff` (@drunderscore) * Improved rejection message and code duplication in `OnPlayerBuff` (@drunderscore)