/// <summary> /// Called with the root json node to load the data from /// </summary> public virtual void LoadJSON(JSONNode node) { JSONNode array = node.GetAs <JSONNode>("array"); for (int i = 0; i < array.ChildCount; i++) { GrowableBlockManager.RegisterGrowableBlock(MakeGrowableBlock(array[i])); } }
public override void FinishLoading() { base.FinishLoading(); if (updatableBlocks != null) { JSONNode array; if (updatableBlocks.TryGetChild("wheat", out array)) { Log.Write("Loading {0} legacy blocks to type wheat", array.ChildCount); for (int i = 0; i < array.ChildCount; i++) { GrowableBlockManager.RegisterGrowableBlock(MakeGrowableBlockLegacy(array[i])); } } } }
public override void FinishLoading() { base.FinishLoading(); if (updatableBlocks != null) { JSONNode array; if (updatableBlocks.TryGetChild("sappling", out array)) { Log.Write("Loading {0} legacy blocks to type temperate sapling", array.ChildCount); for (int i = 0; i < array.ChildCount; i++) { GrowableBlockManager.RegisterGrowableBlock(MakeGrowableBlockLegacy(array[i])); } } General.Application.StartAsyncQuitToComplete(delegate() { Log.Write("Queueing delete of legacy updatableblocks.json"); Thread.Sleep(15000); Log.Write("Deleting legacy updatableblocks.json"); File.Delete(string.Format("gamedata/savegames/{0}/updatableblocks.json", ServerManager.WorldName)); }); } }