Exemple #1
0
        public void GameWorldLoaded()
        {
            LoadGlobalConfig(api);

            rnd       = new Random(api.WorldManager.Seed);
            chunksize = api.WorldManager.ChunkSize;

            treeSupplier.LoadTrees();

            worldheight     = api.WorldManager.MapSizeY;
            chunkMapSizeY   = api.WorldManager.MapSizeY / chunksize;
            regionChunkSize = api.WorldManager.RegionSize / chunksize;

            RockBlockIdsByType = new Dictionary <string, ushort>();
            RockstrataWorldProperty rockstrata = api.Assets.Get("worldgen/rockstrata.json").ToObject <RockstrataWorldProperty>();

            for (int i = 0; i < rockstrata.Variants.Length; i++)
            {
                RockBlockIdsByType.Add(rockstrata.Variants[i].RockType, api.World.GetBlock(rockstrata.Variants[i].BlockCode).BlockId);
            }
            IAsset asset = api.Assets.Get("worldgen/blockpatchconfig.json");

            bpc = asset.ToObject <BlockPatchConfig>();
            bpc.ResolveBlockIds(api, rockstrata);
        }
 private void initWorldGenForSuperflat()
 {
     treeSupplier.LoadTrees();
 }