diff --git a/src/client/fm_client.cpp b/src/client/fm_client.cpp index 89a0fed68..c97edc861 100644 --- a/src/client/fm_client.cpp +++ b/src/client/fm_client.cpp @@ -109,6 +109,7 @@ void Client::handleCommand_FreeminerInit(NetworkPacket *pkt) << "' not valid; falling back to " << Mapgen::getMapgenName(FARMESH_DEFAULT_MAPGEN) << std::endl; mgtype = FARMESH_DEFAULT_MAPGEN; + far_container.use_weather = false; } MakeEmerge(settings, mgtype); @@ -230,7 +231,7 @@ void Client::handleCommand_BlockDataFm(NetworkPacket *pkt) block->humidity = h; if (m_localdb && !is_simple_singleplayer_game) { - if (const auto db = GetFarDatabase({}, far_dbases, m_world_path, step); db) { + if (const auto db = GetFarDatabase({}, far_dbases, m_world_path, step); db) { ServerMap::saveBlock(block.get(), db); if (!step) { diff --git a/src/client/fm_far_container.cpp b/src/client/fm_far_container.cpp index 52a7f7c8a..4c2b97d4b 100644 --- a/src/client/fm_far_container.cpp +++ b/src/client/fm_far_container.cpp @@ -89,7 +89,7 @@ const MapNode &FarContainer::getNodeRefUnsafe(const v3pos_t &pos) block_cache = block; } - if (const auto &v = m_mg->visible_content(pos); v.getContent()) { + if (const auto &v = m_mg->visible_content(pos, use_weather); v.getContent()) { return v; } diff --git a/src/client/fm_far_container.h b/src/client/fm_far_container.h index 0ee296c8a..26868d7aa 100644 --- a/src/client/fm_far_container.h +++ b/src/client/fm_far_container.h @@ -12,7 +12,7 @@ class FarContainer : public NodeContainer public: Mapgen *m_mg{}; - + bool use_weather {true}; FarContainer(Client *client); const MapNode &getNodeRefUnsafe(const v3pos_t &p) override; }; diff --git a/src/client/fm_farmesh.cpp b/src/client/fm_farmesh.cpp index 673d79a8a..5cad40385 100644 --- a/src/client/fm_farmesh.cpp +++ b/src/client/fm_farmesh.cpp @@ -222,6 +222,7 @@ FarMesh::FarMesh(Client *client, Server *server, MapDrawControl *control) : settings.set("mg_name", Mapgen::getMapgenName(mgtype)); m_client->MakeEmerge(settings, mgtype); emerge_use = m_client->m_emerge.get(); + m_client->far_container.use_weather = false; } if (emerge_use) { diff --git a/src/mapgen/mapgen.cpp b/src/mapgen/mapgen.cpp index 436bc4931..78a3efb29 100644 --- a/src/mapgen/mapgen.cpp +++ b/src/mapgen/mapgen.cpp @@ -1229,12 +1229,14 @@ bool Mapgen::visible(const v3pos_t &p) return getGroundLevelAtPoint({p.X, p.Z}) >= p.Y; } -const MapNode &Mapgen::visible_content(const v3pos_t &p) +const MapNode &Mapgen::visible_content(const v3pos_t &p, bool use_weather) { const auto v = visible(p); const auto vw = visible_water_level(p); if (!v && !vw) return visible_transparent; + if (!use_weather) + return visible_surface_green; const auto heat = m_emerge->biomemgr->calcBlockHeat(p, seed, env ? env->getTimeOfDay() * env->m_time_of_day_speed : 0, env ? env->getGameTime() : 0, !!env && env->m_use_weather); diff --git a/src/mapgen/mapgen.h b/src/mapgen/mapgen.h index c1d50ed63..3713fa04d 100644 --- a/src/mapgen/mapgen.h +++ b/src/mapgen/mapgen.h @@ -256,7 +256,7 @@ class Mapgen { virtual bool visible(const v3pos_t &p); virtual bool visible_water_level(const v3pos_t &p); - virtual const MapNode &visible_content(const v3pos_t &p); + virtual const MapNode &visible_content(const v3pos_t &p, bool use_weather); virtual bool surface_2d() { return true; }; // getSpawnLevelAtPoint() is a function within each mapgen that returns a diff --git a/src/mapgen/mapgen_earth.cpp b/src/mapgen/mapgen_earth.cpp index 034d8b6e8..d67d9b283 100644 --- a/src/mapgen/mapgen_earth.cpp +++ b/src/mapgen/mapgen_earth.cpp @@ -218,12 +218,16 @@ bool MapgenEarth::visible(const v3pos_t &p) return p.Y < get_height(p.X, p.Z); } -const MapNode &MapgenEarth::visible_content(const v3pos_t &p) +const MapNode &MapgenEarth::visible_content(const v3pos_t &p, bool use_weather) { const auto v = visible(p); const auto vw = visible_water_level(p); - if (!v && !vw) + if (!v && !vw) { return visible_transparent; + } + if (!use_weather) { + return visible_surface_green; + } auto heat = 10; heat += p.Y / -100; // upper=colder, lower=hotter, 3c per 1000 diff --git a/src/mapgen/mapgen_earth.h b/src/mapgen/mapgen_earth.h index 42013333f..6b942460e 100644 --- a/src/mapgen/mapgen_earth.h +++ b/src/mapgen/mapgen_earth.h @@ -85,7 +85,7 @@ class MapgenEarth : public MapgenV7 MapNode layers_get(float value, float max); bool visible(const v3pos_t &p) override; - const MapNode &visible_content(const v3pos_t &p) override; + const MapNode &visible_content(const v3pos_t &p, bool use_weather) override; hgts hgt_reader;