}
+ internal void ClearMetadata( )
+ {
+ this.HeightMap = null;
+ this.RockRatio = null;
+ this._flattened_HeightMap = null;
+ }
internal ColumnMeta Reload(ICoreClientAPI clientAPI)
{
{
for (int i = 0, maxItemsCount = this.Items.Count; i < maxItemsCount; i++) {
ColumnMeta entry = this.Items[i];
- entry.HeightMap = null;
- entry.RockRatio = null;//Also regenerated when any chunk in a column is changed...
+ entry.ClearMetadata( );
}
}
using System.Collections.Generic;
using System.Drawing;
using System.Text;
+using System.Text.RegularExpressions;
+
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Common.Entities;
{
public static class DefaultDesignators
{
+ private static Regex stripControlChars = new Regex(@"\s", RegexOptions.Multiline);
+
public static BlockDesignator Roads =
new BlockDesignator(
new AssetLocation("game", "stonepath"),
Name = "Sign",
PrettyLocation = posn.PrettyCoords(clientAPI),
Location = posn.Copy(),
- Notes = signEntity.text.Replace("\n"," "),
+ Notes = stripControlChars.Replace(signEntity.text, " "),
Timestamp = DateTime.UtcNow,
}
);
Name = "Signpost",
PrettyLocation = posn.PrettyCoords(clientAPI),
Location = posn.Copy(),
- Notes = string.Join(",", signEntity.textByCardinalDirection).Replace("\n", " "),
+ Notes = stripControlChars.Replace(string.Join(",", signEntity.textByCardinalDirection), " "),
Timestamp = DateTime.UtcNow,
}
);
#endif
}
}
- //Cleanup in-memory Metadata...
- chunkTopMetadata.ClearMetadata();
}
UpdateStatus(this.updatedChunksTotal, this.nullChunkCount, updatedChunks);
updatedChunksTotal += updatedChunks;
JsonGenerator.GenerateJSONMetadata(chunkTopMetadata, startChunkColumn, POIs, EOIs, RockIdCodes);
updatedChunks = 0;
+
+ //Cleanup in-memory Metadata...
+ chunkTopMetadata.ClearMetadata( );
}
//Then sleep until interupted again, and repeat