// 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;
// Whether this content type often contains mineral.
// Used for texture atlas creation.
// Currently only enabled for CONTENT_STONE.
std::string extra_dug_item;
// Usual get interval for extra dug item
s32 extra_dug_item_rarity;
- // Initial metadata is cloned from this
- NodeMetadata *initial_metadata;
+ // Metadata name of node (eg. "furnace")
+ std::string metadata_name;
// Whether the node is non-liquid, source liquid or flowing liquid
enum LiquidType liquid_type;
// If the content is liquid, this is the flowing version of the liquid.
- content_t liquid_alternative_flowing;
+ std::string liquid_alternative_flowing;
// If the content is liquid, this is the source version of the liquid.
- content_t liquid_alternative_source;
+ std::string liquid_alternative_source;
// Viscosity for fluid flow, ranging from 1 to 7, with
// 1 giving almost instantaneous propagation and 7 being
// the slowest possible
// Get node definition
virtual const ContentFeatures& get(content_t c) const=0;
virtual const ContentFeatures& get(const MapNode &n) const=0;
+ virtual bool getId(const std::string &name, content_t &result) const=0;
+ virtual content_t getId(const std::string &name) const=0;
+ virtual const ContentFeatures& get(const std::string &name) const=0;
+ virtual std::string getAlias(const std::string &name) const =0;
virtual void serialize(std::ostream &os)=0;
};
// Get node definition
virtual const ContentFeatures& get(content_t c) const=0;
virtual const ContentFeatures& get(const MapNode &n) const=0;
+ virtual bool getId(const std::string &name, content_t &result) const=0;
+ virtual content_t getId(const std::string &name) const=0;
+ // If not found, returns the features of CONTENT_IGNORE
+ virtual const ContentFeatures& get(const std::string &name) const=0;
+ virtual std::string getAlias(const std::string &name) const =0;
// Register node definition
virtual void set(content_t c, const ContentFeatures &def)=0;
- virtual ContentFeatures* getModifiable(content_t c)=0;
+ // Register node definition by name (allocate an id)
+ // If returns CONTENT_IGNORE, could not allocate id
+ virtual content_t set(const std::string &name,
+ const ContentFeatures &def)=0;
+ // If returns CONTENT_IGNORE, could not allocate id
+ virtual content_t allocateDummy(const std::string &name)=0;
+ // Set an alias so that nodes named <name> will load as <convert_to>.
+ // Alias is not set if <name> has already been defined.
+ // Alias will be removed if <name> is defined at a later point of time.
+ virtual void setAlias(const std::string &name,
+ const std::string &convert_to)=0;
/*
Update tile textures to latest return values of TextueSource.