used_texturenames.clear();
/*
Actual data
+
+ NOTE: Most of this is always overridden by the default values given
+ in builtin.lua
*/
name = "";
drawtype = NDT_NORMAL;
climbable = false;
buildable_to = false;
wall_mounted = false;
- air_equivalent = false;
often_contains_mineral = false;
dug_item = "";
extra_dug_item = "";
extra_dug_item_rarity = 2;
metadata_name = "";
liquid_type = LIQUID_NONE;
- liquid_alternative_flowing = CONTENT_IGNORE;
- liquid_alternative_source = CONTENT_IGNORE;
+ liquid_alternative_flowing = "";
+ liquid_alternative_source = "";
liquid_viscosity = 0;
light_source = 0;
damage_per_second = 0;
writeU8(os, climbable);
writeU8(os, buildable_to);
writeU8(os, wall_mounted);
- writeU8(os, air_equivalent);
writeU8(os, often_contains_mineral);
os<<serializeString(dug_item);
os<<serializeString(extra_dug_item);
writeS32(os, extra_dug_item_rarity);
os<<serializeString(metadata_name);
writeU8(os, liquid_type);
- writeU16(os, liquid_alternative_flowing);
- writeU16(os, liquid_alternative_source);
+ os<<serializeString(liquid_alternative_flowing);
+ os<<serializeString(liquid_alternative_source);
writeU8(os, liquid_viscosity);
writeU8(os, light_source);
writeU32(os, damage_per_second);
climbable = readU8(is);
buildable_to = readU8(is);
wall_mounted = readU8(is);
- air_equivalent = readU8(is);
often_contains_mineral = readU8(is);
dug_item = deSerializeString(is);
extra_dug_item = deSerializeString(is);
extra_dug_item_rarity = readS32(is);
metadata_name = deSerializeString(is);
liquid_type = (enum LiquidType)readU8(is);
- liquid_alternative_flowing = readU16(is);
- liquid_alternative_source = readU16(is);
+ liquid_alternative_flowing = deSerializeString(is);
+ liquid_alternative_source = deSerializeString(is);
liquid_viscosity = readU8(is);
light_source = readU8(is);
damage_per_second = readU32(is);
f.pointable = false;
f.diggable = false;
f.buildable_to = true;
- f.air_equivalent = true;
- set(CONTENT_AIR, f);
+ // Insert directly into containers
+ content_t c = CONTENT_AIR;
+ m_content_features[c] = f;
+ m_name_id_mapping.set(c, f.name);
}
// Set CONTENT_IGNORE
{
ContentFeatures f;
f.name = "ignore";
f.drawtype = NDT_AIRLIKE;
- /*f.param_type = CPT_LIGHT;
- f.light_propagates = true;
- f.sunlight_propagates = true;*/
+ f.param_type = CPT_NONE;
+ f.light_propagates = false;
+ f.sunlight_propagates = false;
f.walkable = false;
f.pointable = false;
f.diggable = false;
- f.buildable_to = false;
- f.air_equivalent = true;
- set(CONTENT_IGNORE, f);
+ // A way to remove accidental CONTENT_IGNOREs
+ f.buildable_to = true;
+ // Insert directly into containers
+ content_t c = CONTENT_IGNORE;
+ m_content_features[c] = f;
+ m_name_id_mapping.set(c, f.name);
}
}
// CONTENT_IGNORE = not found
infostream<<"registerNode: registering content id \""<<c
<<"\": name=\""<<def.name<<"\""<<std::endl;
assert(c <= MAX_CONTENT);
+ // Don't allow redefining CONTENT_IGNORE (but allow air)
+ if(def.name == "ignore" || c == CONTENT_IGNORE){
+ infostream<<"registerNode: WARNING: Ignoring "
+ <<"CONTENT_IGNORE redefinition"<<std::endl;
+ return;
+ }
// Check that the special contents are not redefined as different id
// because it would mess up everything
if((def.name == "ignore" && c != CONTENT_IGNORE) ||
f->solidness = 1;
if(f->alpha == 255)
f->solidness = 2;
+ f->backface_culling = false;
}
break;
case NDT_FLOWINGLIQUID: