private void LevelFinalizeInit() { base.Initialize(); simSounds.Initialize(); simParticles.Initialize(); cloudRenderer = new CloudRenderer(capi, this); smoothedLightLevel = capi.World.BlockAccessor.GetLightLevel(capi.World.Player.Entity.Pos.AsBlockPos, EnumLightLevelType.OnlySunLight); dummySim = new WeatherSimulationRegion(this, 0, 0); dummySim.Initialize(); adjacentSims[0] = dummySim; adjacentSims[1] = dummySim; adjacentSims[2] = dummySim; adjacentSims[3] = dummySim; capi.Ambient.CurrentModifiers.InsertBefore("serverambient", "weather", blendedWeatherData.Ambient); haveLevelFinalize = true; // Pre init the clouds. capi.Ambient.UpdateAmbient(0.1f); CloudRenderer renderer = this.cloudRenderer as CloudRenderer; renderer.blendedCloudDensity = capi.Ambient.BlendedCloudDensity; renderer.blendedGlobalCloudBrightness = capi.Ambient.BlendedCloudBrightness; renderer.CloudTick(0.1f); }
private void cTileLength(int groupId, CmdArgs args) { CloudRenderer renderer = this.cloudRenderer as CloudRenderer; if (args.Length == 0) { capi.ShowChatNotification(string.Format("Current view distance: {0}", cloudRenderer.CloudTileLength * renderer.CloudTileSize)); return; } try { int dist = int.Parse(args[0]); renderer.InitCloudTiles(dist); renderer.UpdateCloudTiles(); renderer.LoadCloudModel(); capi.ShowChatNotification(string.Format("New view distance {0} set.", dist)); } catch (Exception) { capi.ShowChatNotification("Exception when parsing params"); } }
private void LevelFinalizeInit() { InitDummySim(); WeatherDataAtPlayer = getWeatherDataReaderPreLoad(); WeatherDataSlowAccess = getWeatherDataReader(); simSounds.Initialize(); simParticles.Initialize(); cloudRenderer = new CloudRenderer(capi, this); smoothedLightLevel = capi.World.BlockAccessor.GetLightLevel(capi.World.Player.Entity.Pos.AsBlockPos, EnumLightLevelType.OnlySunLight); capi.Ambient.CurrentModifiers.InsertBefore("serverambient", "weather", WeatherDataAtPlayer.BlendedWeatherData.Ambient); haveLevelFinalize = true; // Pre init the clouds. capi.Ambient.UpdateAmbient(0.1f); CloudRenderer renderer = this.cloudRenderer as CloudRenderer; renderer.blendedCloudDensity = capi.Ambient.BlendedCloudDensity; renderer.blendedGlobalCloudBrightness = capi.Ambient.BlendedCloudBrightness; renderer.CloudTick(0.1f); }
private void InitWeatherSim() { weatherSim = new WeatherSimulation(this); if (api.Side == EnumAppSide.Client) { cloudRenderer = new CloudRenderer(capi, weatherSim); } weatherSim.Initialize(); if (initialWeatherFromServer != null) { OnWeatherUpdate(initialWeatherFromServer); initialWeatherFromServer = null; } // Pre init the clouds. if (api.Side == EnumAppSide.Client) { capi.Ambient.UpdateAmbient(0.1f); CloudRenderer renderer = this.cloudRenderer as CloudRenderer; renderer.blendedCloudDensity = capi.Ambient.BlendedCloudDensity; renderer.blendedGlobalCloudBrightness = capi.Ambient.BlendedCloudBrightness; renderer.UpdateWindAndClouds(0.1f); } }