Exemplo n.º 1
0
        /// <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]));
            }
        }
Exemplo n.º 2
0
 static void Load()
 {
     if (queuedDefinitions != null)
     {
         for (int i = 0; i < queuedDefinitions.Count; i++)
         {
             try {
                 GrowableBlockManager.RegisterGrowableBlockType((IGrowableBlockDefinition)Activator.CreateInstance(queuedDefinitions[i]));
             } catch (Exception e) {
                 Log.WriteException(e);
             }
         }
         queuedDefinitions = null;
     }
 }
Exemplo n.º 3
0
 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]));
             }
         }
     }
 }
Exemplo n.º 4
0
        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));
                });
            }
        }