- f->param_type = CPT_LIGHT;
- f->light_propagates = true;
- f->walkable = false;
- f->pointable = false;
- f->diggable = false;
- f->buildable_to = true;
- f->liquid_type = LIQUID_SOURCE;
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
-
- i = CONTENT_TORCH;
- f = &g_content_features[i];
- f->setInventoryTexture("torch_on_floor.png");
- f->param_type = CPT_LIGHT;
- f->light_propagates = true;
- f->sunlight_propagates = true;
- f->solidness = 0; // drawn separately, makes no faces
- f->walkable = false;
- f->wall_mounted = true;
- f->air_equivalent = true;
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
-
- i = CONTENT_SIGN_WALL;
- f = &g_content_features[i];
- f->setInventoryTexture("sign_wall.png");
- f->param_type = CPT_LIGHT;
- f->light_propagates = true;
- f->sunlight_propagates = true;
- f->solidness = 0; // drawn separately, makes no faces
- f->walkable = false;
- f->wall_mounted = true;
- f->air_equivalent = true;
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
- if(f->initial_metadata == NULL)
- f->initial_metadata = new SignNodeMetadata("Some sign");
-
- i = CONTENT_CHEST;
- f = &g_content_features[i];
- f->param_type = CPT_FACEDIR_SIMPLE;
- f->setAllTextures("chest_side.png");
- f->setTexture(0, "chest_top.png");
- f->setTexture(1, "chest_top.png");
- f->setTexture(5, "chest_front.png"); // Z-
- f->setInventoryTexture("chest_top.png");
- //f->setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
- if(f->initial_metadata == NULL)
- f->initial_metadata = new ChestNodeMetadata();
-
- i = CONTENT_FURNACE;
- f = &g_content_features[i];
- f->param_type = CPT_FACEDIR_SIMPLE;
- f->setAllTextures("furnace_side.png");
- f->setTexture(5, "furnace_front.png"); // Z-
- f->setInventoryTexture("furnace_front.png");
- //f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
- f->dug_item = std::string("MaterialItem ")+itos(CONTENT_COBBLE)+" 6";
- if(f->initial_metadata == NULL)
- f->initial_metadata = new FurnaceNodeMetadata();
-
- i = CONTENT_COBBLE;
- f = &g_content_features[i];
- f->setAllTextures("cobble.png");
- f->setInventoryTextureCube("cobble.png", "cobble.png", "cobble.png");
- f->param_type = CPT_NONE;
- f->is_ground_content = true;
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
-
- i = CONTENT_STEEL;
- f = &g_content_features[i];
- f->setAllTextures("steel_block.png");
- f->setInventoryTextureCube("steel_block.png", "steel_block.png",
- "steel_block.png");
- f->param_type = CPT_NONE;
- f->is_ground_content = true;
- f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
-
- // NOTE: Remember to add frequently used stuff to the texture atlas in tile.cpp
+ const ContentFeatures &f = nodemgr->get(*this);
+ if (f.param_type_2 == CPT2_FLOWINGLIQUID
+ || f.liquid_type == LIQUID_FLOWING
+ || f.liquid_type == LIQUID_SOURCE) {
+ if (level >= LIQUID_LEVEL_SOURCE) {
+ rest = level - LIQUID_LEVEL_SOURCE;
+ setContent(nodemgr->getId(f.liquid_alternative_source));
+ } else {
+ setContent(nodemgr->getId(f.liquid_alternative_flowing));
+ setParam2(level & LIQUID_LEVEL_MASK);
+ }
+ } else if (f.leveled || f.param_type_2 == CPT2_LEVELED) {
+ if (level > LEVELED_MAX) {
+ rest = level - LEVELED_MAX;
+ level = LEVELED_MAX;
+ }
+ setParam2(level & LEVELED_MASK);
+ }
+ return rest;