Exemplo n.º 1
0
        public void Init(ICoreServerAPI api, RockStrataConfig rockstrata, Random rnd)
        {
            if (NoiseAmplitudes != null && NoiseFrequencies != null)
            {
                noise = new ClampedSimplexNoise(NoiseAmplitudes, NoiseFrequencies, rnd.Next());
            }

            ResolveBlockIds(api, rockstrata);
        }
Exemplo n.º 2
0
        public void InitWorldGen()
        {
            LoadGlobalConfig(api);

            IAsset           asset      = api.Assets.Get("worldgen/rockstrata.json");
            RockStrataConfig rockstrata = asset.ToObject <RockStrataConfig>();

            asset            = api.Assets.Get("worldgen/blocklayers.json");
            blockLayerConfig = asset.ToObject <BlockLayerConfig>();
            blockLayerConfig.ResolveBlockIds(api, rockstrata);

            rnd          = new LCGRandom(api.WorldManager.Seed);
            grassDensity = new ClampedSimplexNoise(new double[] { 4 }, new double[] { 0.5 }, rnd.NextInt());
            grassHeight  = new ClampedSimplexNoise(new double[] { 1.5 }, new double[] { 0.5 }, rnd.NextInt());

            mapheight = api.WorldManager.MapSizeY;
        }