std::vector<content_t> connects_to_ids;
// Post effect color, drawn when the camera is inside the node.
video::SColor post_effect_color;
- // Flowing liquid or snow, value = default level
+ // Flowing liquid or leveled nodebox, value = default level
u8 leveled;
+ // Maximum value for leveled nodes
+ u8 leveled_max;
// --- LIGHTING-RELATED ---
enum LiquidType liquid_type;
// If the content is liquid, this is the flowing version of the liquid.
std::string liquid_alternative_flowing;
+ content_t liquid_alternative_flowing_id;
// If the content is liquid, this is the source version of the liquid.
std::string liquid_alternative_source;
+ content_t liquid_alternative_source_id;
// Viscosity for fluid flow, ranging from 1 to 7, with
// 1 giving almost instantaneous propagation and 7 being
// the slowest possible
*/
ContentFeatures();
- ~ContentFeatures() = default;
+ ~ContentFeatures();
void reset();
void serialize(std::ostream &os, u16 protocol_version) const;
void deSerialize(std::istream &is);
}
bool sameLiquid(const ContentFeatures &f) const{
if(!isLiquid() || !f.isLiquid()) return false;
- return (liquid_alternative_flowing == f.liquid_alternative_flowing);
+ return (liquid_alternative_flowing_id == f.liquid_alternative_flowing_id);
}
int getGroup(const std::string &group) const
void resetNodeResolveState();
/*!
- * Resolves the IDs to which connecting nodes connect from names.
+ * Resolves (caches the IDs) cross-references between nodes,
+ * like liquid alternatives.
* Must be called after node registration has finished!
*/
- void mapNodeboxConnections();
+ void resolveCrossrefs();
private:
/*!
virtual ~NodeResolver();
virtual void resolveNodeNames() = 0;
+ // required because this class is used as mixin for ObjDef
+ void cloneTo(NodeResolver *res) const;
+
bool getIdFromNrBacklog(content_t *result_out,
const std::string &node_alt, content_t c_fallback,
bool error_on_fallback = true);