some liquid tweaks

This commit is contained in:
darkrose 2013-11-19 21:10:29 +10:00
parent fce3b8a674
commit e44d39d824
6 changed files with 28 additions and 20 deletions

View File

@ -119,8 +119,8 @@
#motd = Welcome to this awesome Minetest server!
# Maximum number of players connected simultaneously
#max_users = 20
# Set to false to allow old clients to connect
#strict_protocol_version_checking = true
# Set to true to prevent old clients connecting
#strict_protocol_version_checking = false
# Set to true to enable creative mode (unlimited inventory)
#creative_mode = false
# Enable players getting damage and dying

View File

@ -434,7 +434,7 @@ void Client::step(float dtime)
snprintf((char*)&data[23], PASSWORD_SIZE, "%s", m_password.c_str());
// This should be incremented in each version
writeU16(&data[51], 3);
writeU16(&data[51], PROTOCOL_VERSION);
// Send as unreliable
Send(0, data, false);

View File

@ -2269,6 +2269,7 @@ void content_mapnode_init()
f->description = std::string("Water");
f->setInventoryTextureCube("water.png", "water.png", "water.png");
f->param_type = CPT_LIGHT;
f->param2_type = CPT_LIQUID;
f->draw_type = CDT_LIQUID;
f->light_propagates = true;
f->solidness = 0; // Drawn separately, makes no faces
@ -2334,6 +2335,7 @@ void content_mapnode_init()
#endif
}
f->param_type = CPT_LIGHT;
f->param2_type = CPT_LIQUID;
f->draw_type = CDT_LIQUID_SOURCE;
f->light_propagates = true;
f->walkable = false;
@ -2372,6 +2374,7 @@ void content_mapnode_init()
f->setInventoryTextureCube("lava.png", "lava.png", "lava.png");
f->used_texturenames["lava.png"] = true;
f->param_type = CPT_LIGHT;
f->param2_type = CPT_LIQUID;
f->draw_type = CDT_LIQUID;
f->light_propagates = false;
f->light_source = LIGHT_MAX-1;
@ -2437,6 +2440,7 @@ void content_mapnode_init()
#endif
}
f->param_type = CPT_LIGHT;
f->param2_type = CPT_LIQUID;
f->draw_type = CDT_LIQUID_SOURCE;
f->light_propagates = false;
f->light_source = LIGHT_MAX-1;

View File

@ -86,7 +86,7 @@ void set_default_settings(Settings *settings)
// "map-dir" doesn't exist by default.
settings->setDefault("motd", "");
settings->setDefault("max_users", "20");
settings->setDefault("strict_protocol_version_checking", "true");
settings->setDefault("strict_protocol_version_checking", "false");
settings->setDefault("creative_mode", "false");
settings->setDefault("enable_damage", "true");
settings->setDefault("only_peaceful_mobs", "false");

View File

@ -1614,21 +1614,21 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
u8 liquid_kind = CONTENT_IGNORE;
LiquidType liquid_type = content_features(n0.getContent()).liquid_type;
switch (liquid_type) {
case LIQUID_SOURCE:
liquid_level = LIQUID_LEVEL_SOURCE;
liquid_kind = content_features(n0.getContent()).liquid_alternative_flowing;
break;
case LIQUID_FLOWING:
liquid_level = (n0.param2 & LIQUID_LEVEL_MASK);
liquid_kind = n0.getContent();
break;
case LIQUID_NONE:
// if this is an air node, it *could* be transformed into a liquid. otherwise,
// continue with the next node.
if (n0.getContent() != CONTENT_AIR)
continue;
liquid_kind = CONTENT_AIR;
break;
case LIQUID_SOURCE:
liquid_level = LIQUID_LEVEL_SOURCE;
liquid_kind = content_features(n0.getContent()).liquid_alternative_flowing;
break;
case LIQUID_FLOWING:
liquid_level = (n0.param2 & LIQUID_LEVEL_MASK);
liquid_kind = n0.getContent();
break;
case LIQUID_NONE:
// if this is an air node, it *could* be transformed into a liquid. otherwise,
// continue with the next node.
if (n0.getContent() != CONTENT_AIR)
continue;
liquid_kind = CONTENT_AIR;
break;
}
/*
@ -1669,6 +1669,9 @@ void Map::transformLiquids(core::map<v3s16, MapBlock*> & modified_blocks)
if (nb.t == NEIGHBOR_LOWER) {
flowing_down = true;
}
}else if (nb.t == NEIGHBOR_LOWER && nb.n.getContent() == CONTENT_IGNORE) {
flowing_down = true;
neutrals[num_neutrals++] = nb;
} else {
neutrals[num_neutrals++] = nb;
}

View File

@ -109,7 +109,8 @@ enum ContentParamType
CPT_LIGHT,
CPT_MINERAL,
// Direction for chests and furnaces and such
CPT_FACEDIR_SIMPLE
CPT_FACEDIR_SIMPLE,
CPT_LIQUID
};
enum LiquidType