- // Type of MapNode::param1
- ContentParamType param_type;
-
- /*
- 0: up
- 1: down
- 2: right
- 3: left
- 4: back
- 5: front
- */
- TileSpec tiles[6];
-
- video::ITexture *inventory_texture;
-
- // True for all ground-like things like stone and mud, false for eg. trees
- bool is_ground_content;
- bool light_propagates;
- bool sunlight_propagates;
- u8 solidness; // Used when choosing which face is drawn
- // This is used for collision detection.
- // Also for general solidness queries.
- bool walkable;
- // Player can point to these
- bool pointable;
- // Player can dig these
- bool diggable;
- // Player can build on these
- bool buildable_to;
- // Whether the node has no liquid, source liquid or flowing liquid
- enum LiquidType liquid_type;
- // If true, param2 is set to direction when placed. Used for torches.
- // NOTE: the direction format is quite inefficient and should be changed
- bool wall_mounted;
- // If true, node is equivalent to air. Torches are, air is. Water is not.
- // Is used for example to check whether a mud block can have grass on.
- bool air_equivalent;
-
- // Inventory item string as which the node appears in inventory when dug.
- // Mineral overrides this.
- std::string dug_item;
-
- // Initial metadata is cloned from this
- NodeMetadata *initial_metadata;
-
- // If the content is liquid, this is the flowing version of the liquid.
- // If content is liquid, this is the same content.
- content_t liquid_alternative_flowing;
- // If the content is liquid, this is the source version of the liquid.
- content_t liquid_alternative_source;
-
- // Amount of light the node emits
- u8 light_source;
-
- // Digging properties for different tools
- DiggingPropertiesList digging_properties;
-
- // NOTE: Move relevant properties to here from elsewhere
-
- void reset()
- {
- param_type = CPT_NONE;
- inventory_texture = NULL;
- is_ground_content = false;
- light_propagates = false;
- sunlight_propagates = false;
- solidness = 2;
- walkable = true;
- pointable = true;
- diggable = true;
- buildable_to = false;
- liquid_type = LIQUID_NONE;
- wall_mounted = false;
- air_equivalent = false;
- dug_item = "";
- initial_metadata = NULL;
- liquid_alternative_flowing = CONTENT_IGNORE;
- light_source = 0;
- digging_properties.clear();
- }
-
- ContentFeatures()
- {
- reset();
- }
-
- ~ContentFeatures();
-
- /*
- Quickhands for simple materials
- */
-
- void setTexture(u16 i, std::string name, u8 alpha=255);
-
- void setAllTextures(std::string name, u8 alpha=255)
- {
- for(u16 i=0; i<6; i++)
- {
- setTexture(i, name, alpha);
- }
- // Force inventory texture too
- setInventoryTexture(name);
- }
-
- void setTile(u16 i, const TileSpec &tile)
- {
- tiles[i] = tile;
- }
- void setAllTiles(const TileSpec &tile)
- {
- for(u16 i=0; i<6; i++)
- {
- setTile(i, tile);
- }
- }
-
- void setInventoryTexture(std::string imgname);
-
- void setInventoryTextureCube(std::string top,
- std::string left, std::string right);