Пример #1
0
        private void TestWgen(IServerPlayer player, CmdArgs arguments)
        {
            NoiseLandforms.ReloadLandforms(api);

            api.ModLoader.GetModSystem <GenVegetation>().GameWorldLoaded();
            api.ModLoader.GetModSystem <GenMaps>().GameWorldLoaded();
            api.ModLoader.GetModSystem <GenLakes>().GameWorldLoaded();
            api.ModLoader.GetModSystem <GenTerra>().GameWorldLoaded();
            api.ModLoader.GetModSystem <GenBlockLayers>().GameWorldLoaded();

            Regen(player, arguments, false);
        }
Пример #2
0
        public MapLayerLandforms(long seed, NoiseClimate climateNoise, ICoreServerAPI api) : base(seed)
        {
            this.climateNoise = climateNoise;
            noiseLandforms    = new NoiseLandforms(seed, api);

            int   woctaves     = 2;
            float wscale       = 2f * TerraGenConfig.landformMapScale;
            float wpersistence = 0.9f;

            wobbleIntensity = TerraGenConfig.landformMapScale * 1.5f;
            noisegenX       = NormalizedSimplexNoise.FromDefaultOctaves(woctaves, 1 / wscale, wpersistence, seed + 2);
            noisegenY       = NormalizedSimplexNoise.FromDefaultOctaves(woctaves, 1 / wscale, wpersistence, seed + 1231296);
        }
Пример #3
0
        public MapLayerLandforms(long seed, NoiseClimate climateNoise, ICoreServerAPI api) : base(seed)
        {
            this.climateNoise = climateNoise;

            float scale = TerraGenConfig.landformMapScale;

            if (GameVersion.IsAtLeastVersion(api.WorldManager.SaveGame.CreatedGameVersion, "1.11.0-dev.1"))
            {
                scale *= Math.Max(1, api.WorldManager.MapSizeY / 256f);
            }

            noiseLandforms = new NoiseLandforms(seed, api, scale);

            int   woctaves     = 2;
            float wscale       = 2f * TerraGenConfig.landformMapScale;
            float wpersistence = 0.9f;

            wobbleIntensity = TerraGenConfig.landformMapScale * 1.5f;
            noisegenX       = NormalizedSimplexNoise.FromDefaultOctaves(woctaves, 1 / wscale, wpersistence, seed + 2);
            noisegenY       = NormalizedSimplexNoise.FromDefaultOctaves(woctaves, 1 / wscale, wpersistence, seed + 1231296);
        }
Пример #4
0
        private void RegenChunks(IServerPlayer player, CmdArgs arguments, bool aroundPlayer = false, bool randomSeed = false)
        {
            int seedDiff = randomSeed ? api.World.Rand.Next(100000) : 0;

            if (randomSeed)
            {
                player.SendMessage(GlobalConstants.CurrentChatGroup, "Using random seed diff " + seedDiff, EnumChatType.Notification);
            }

            player.SendMessage(GlobalConstants.CurrentChatGroup, "Waiting for chunk thread to pause...", EnumChatType.Notification);

            if (api.Server.PauseThread("chunkdbthread"))
            {
                NoiseLandforms.ReloadLandforms(api);

                api.ModLoader.GetModSystem <GenTerra>().initWorldGen();
                api.ModLoader.GetModSystem <GenMaps>().initWorldGen();
                api.ModLoader.GetModSystem <GenRockStrataNew>().initWorldGen(seedDiff);

                if (ModStdWorldGen.DoDecorationPass)
                {
                    api.ModLoader.GetModSystem <GenVegetation>().initWorldGen();
                    api.ModLoader.GetModSystem <GenLakes>().initWorldGen();
                    api.ModLoader.GetModSystem <GenBlockLayers>().InitWorldGen();
                    api.ModLoader.GetModSystem <GenCaves>().initWorldGen();
                    api.ModLoader.GetModSystem <GenDeposits>().initWorldGen();
                }

                Regen(player, arguments, false, aroundPlayer);
            }
            else
            {
                player.SendMessage(GlobalConstants.CurrentChatGroup, "Unable to regenerate chunks. Was not able to pause the chunk gen thread", EnumChatType.Notification);
            }

            api.Server.ResumeThread("chunkdbthread");
            player.CurrentChunkSentRadius = 0;
        }