Index: binary-improvements2/MapRendering/src/MapRenderer.cs
===================================================================
--- binary-improvements2/MapRendering/src/MapRenderer.cs	(revision 391)
+++ binary-improvements2/MapRendering/src/MapRenderer.cs	(revision 402)
@@ -5,8 +5,8 @@
 using System.Text;
 using System.Threading;
-using AllocsFixes.FileCache;
-using AllocsFixes.JSON;
 using UnityEngine;
 using UnityEngine.Profiling;
+using Utf8Json;
+using Webserver.FileCache;
 using Object = UnityEngine.Object;
 
@@ -27,10 +27,8 @@
 
 		private MapRenderer () {
-			Constants.MapDirectory = GameIO.GetSaveGameDir () + "/map";
-
-			lock (lockObject) {
-				if (!LoadMapInfo ()) {
-					WriteMapInfo ();
-				}
+			Constants.MapDirectory = $"{GameIO.GetSaveGameDir ()}/map";
+
+			if (!LoadMapInfo ()) {
+				WriteMapInfo ();
 			}
 
@@ -47,5 +45,5 @@
 		public static MapRenderer Instance => instance ??= new MapRenderer ();
 
-		public static MapTileCache GetTileCache () {
+		public static AbstractCache GetTileCache () {
 			return Instance.cache;
 		}
@@ -95,5 +93,5 @@
 						}
 					} catch (Exception e) {
-						Log.Out ("Exception in MapRendering.RenderSingleChunk(): " + e);
+						Log.Out ($"Exception in MapRendering.RenderSingleChunk(): {e}");
 					}
 				}, _chunk);
@@ -161,5 +159,5 @@
 							}
 						} catch (Exception e) {
-							Log.Out ("Exception: " + e);
+							Log.Out ($"Exception: {e}");
 						}
 					}
@@ -177,5 +175,5 @@
 			if (fullMapTexture != null) {
 				byte[] array = fullMapTexture.EncodeToPNG ();
-				File.WriteAllBytes (Constants.MapDirectory + "/map.png", array);
+				File.WriteAllBytes ($"{Constants.MapDirectory}/map.png", array);
 				Object.Destroy (fullMapTexture);
 			}
@@ -183,6 +181,6 @@
 			renderingFullMap = false;
 
-			Log.Out ("Generating map took: " + microStopwatch.ElapsedMilliseconds + " ms");
-			Log.Out ("World extent: " + minPos + " - " + maxPos);
+			Log.Out ($"Generating map took: {microStopwatch.ElapsedMilliseconds} ms");
+			Log.Out ($"World extent: {minPos} - {maxPos}");
 		}
 
@@ -307,35 +305,42 @@
 
 		private void WriteMapInfo () {
-			JsonObject mapInfo = new JsonObject ();
-			mapInfo.Add ("blockSize", new JsonNumber (Constants.MapBlockSize));
-			mapInfo.Add ("maxZoom", new JsonNumber (Constants.Zoomlevels - 1));
+			JsonWriter writer = new JsonWriter ();
+			writer.WriteBeginObject ();
+			
+			writer.WriteString ("blockSize");
+			writer.WriteNameSeparator ();
+			writer.WriteInt32 (Constants.MapBlockSize);
+			
+			writer.WriteValueSeparator ();
+			writer.WriteString ("maxZoom");
+			writer.WriteNameSeparator ();
+			writer.WriteInt32 (Constants.Zoomlevels - 1);
+			
+			writer.WriteEndObject ();
 
 			Directory.CreateDirectory (Constants.MapDirectory);
-			File.WriteAllText (Constants.MapDirectory + "/mapinfo.json", mapInfo.ToString (), Encoding.UTF8);
+			File.WriteAllBytes ($"{Constants.MapDirectory}/mapinfo.json", writer.ToUtf8ByteArray ());
 		}
 
 		private bool LoadMapInfo () {
-			if (!File.Exists (Constants.MapDirectory + "/mapinfo.json")) {
+			if (!File.Exists ($"{Constants.MapDirectory}/mapinfo.json")) {
 				return false;
 			}
 
-			string json = File.ReadAllText (Constants.MapDirectory + "/mapinfo.json", Encoding.UTF8);
+			string json = File.ReadAllText ($"{Constants.MapDirectory}/mapinfo.json", Encoding.UTF8);
 			try {
-				JsonNode node = Parser.Parse (json);
-				if (node is JsonObject jo) {
-					if (jo.ContainsKey ("blockSize")) {
-						Constants.MapBlockSize = ((JsonNumber) jo ["blockSize"]).GetInt ();
-					}
-
-					if (jo.ContainsKey ("maxZoom")) {
-						Constants.Zoomlevels = ((JsonNumber) jo ["maxZoom"]).GetInt () + 1;
-					}
-
-					return true;
-				}
-			} catch (MalformedJsonException e) {
-				Log.Out ("Exception in LoadMapInfo: " + e);
-			} catch (InvalidCastException e) {
-				Log.Out ("Exception in LoadMapInfo: " + e);
+				IDictionary<string,object> inputJson = JsonSerializer.Deserialize<IDictionary<string, object>> (json);
+
+				if (inputJson.TryGetValue ("blockSize", out object fieldNode) && fieldNode is double value) {
+					Constants.MapBlockSize = (int)value;
+				}
+
+				if (inputJson.TryGetValue ("maxZoom", out fieldNode) && fieldNode is double value2) {
+					Constants.Zoomlevels = (int)value2 + 1;
+				}
+
+				return true;
+			} catch (Exception e) {
+				Log.Out ($"Exception in LoadMapInfo: {e}");
 			}
 
