#include "treegen.h" // For treegen::make_tree
#include "main.h" // for g_settings
#include "map.h"
-#include "cpp_api/scriptapi.h"
+#include "scripting_game.h"
#include "log.h"
#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
{ return contents; }
virtual std::set<std::string> getRequiredNeighbors() {
std::set<std::string> neighbors;
- neighbors.insert("mapgen_air");
+ neighbors.insert("air");
return neighbors;
}
virtual float getTriggerInterval()
}
virtual std::set<std::string> getRequiredNeighbors() {
std::set<std::string> s;
- s.insert("mapgen_air");
+ s.insert("air");
s.insert("group:melts");
return s;
}
ServerMap *map = &env->getServerMap();
INodeDefManager *ndef = env->getGameDef()->ndef();
- float heat = map->getHeat(env, p);
+ float heat = map->updateBlockHeat(env, p);
//heater = rare
content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
//more chance to freeze if air at top
}
virtual std::set<std::string> getRequiredNeighbors() {
std::set<std::string> s;
- s.insert("mapgen_air");
+ s.insert("air");
s.insert("group:freezes");
return s;
}
ServerMap *map = &env->getServerMap();
INodeDefManager *ndef = env->getGameDef()->ndef();
- float heat = map->getHeat(env, p);
+ float heat = map->updateBlockHeat(env, p);
content_t c = map->getNodeNoEx(p - v3s16(0, -1, 0 )).getContent(); // top
if (heat >= 1 && (heat >= 40 || ((myrand_range(heat, 40)) >= (c == CONTENT_AIR ? 10 : 20)))) {
n.freezeMelt(ndef);
env->addActiveBlockModifier(new LiquidDropABM(env, nodedef));
env->addActiveBlockModifier(new LiquidMeltHot(env, nodedef));
//env->addActiveBlockModifier(new LiquidMeltAround(env, nodedef));
- if (g_settings->getBool("weather")) {
+ if (env->m_use_weather) {
env->addActiveBlockModifier(new LiquidFreeze(env, nodedef));
env->addActiveBlockModifier(new LiquidMeltWeather(env, nodedef));
}