aboutsummaryrefslogtreecommitdiff
path: root/src/nodedef.cpp
Commit message (Expand)AuthorAge
* WIP node metadata, node timersKahrl2012-06-03
* Allow group:groupname in ABM definition and implement minetest.hash_node_posi...Perttu Ahola2012-03-31
* Some serialization version stuffPerttu Ahola2012-03-25
* Add sound.digPerttu Ahola2012-03-24
* Add sounds, tune thingsPerttu Ahola2012-03-24
* Add event manager and use it to trigger soundsPerttu Ahola2012-03-24
* Unknown nodes can be dugPerttu Ahola2012-03-19
* MapBlockMesh, mesh animation system, urgent mesh updates, athmospheric light,...Kahrl2012-03-15
* Clean up log messages everywherePerttu Ahola2012-03-11
* itemgroup.h and ItemGroupList typedefPerttu Ahola2012-03-10
* Digging time groups WIPPerttu Ahola2012-03-10
* Cleanup (some stuff went wrong when reverting 4-byte mapnodes); fix legacy_wa...Kahrl2012-01-22
* Node placement / mineral / serialization / iron freq / node_dig callbackKahrl2012-01-22
* The huge item definition and item namespace unification patch (itemdef), see ...Kahrl2012-01-12
* Make ToolItem and MaterialItem to convert names by aliases at creation time t...Perttu Ahola2011-12-04
* Modify a commit in tooldef.cpp and nodedef.cppPerttu Ahola2011-12-04
* Add serialization for node aliases to let client show inventory images correctlyPerttu Ahola2011-12-04
* Node definition aliasesPerttu Ahola2011-12-03
* Allow digging unknown nodesPerttu Ahola2011-12-03
* Fix non-fancy leaves not making faces with waterPerttu Ahola2011-12-01
* Make non-fancy leaf texture to go in texture atlas tooPerttu Ahola2011-12-01
* Remove +"^[forcesingle" from ContentFeatures::setInventoryTexture, because 1)...Perttu Ahola2011-12-01
* Fix texture atlas not being created correctlyPerttu Ahola2011-12-01
* Fix liquid source backface culling (was not turned off)Perttu Ahola2011-11-29
* Make node definitions available to LuaPerttu Ahola2011-11-29
* Add node definitions in Lua and do not use content_mapnode_init anymore (exce...Kahrl2011-11-29
* Modify CONTENT_AIR and CONTENT_IGNORE handling in nodedef.cppPerttu Ahola2011-11-29
* Make liquid_alternative_* to be stringsPerttu Ahola2011-11-29
* Store metadata as metadata name in node definitionPerttu Ahola2011-11-29
* Add texture modifier [brighten and modify [toalpha to modify existing texture...Perttu Ahola2011-11-29
* Mess up with node definitions to make CONTENT_IGNORE be correctly interpreted...Perttu Ahola2011-11-29
* Optimize map generator for the dynamic content ids a bitPerttu Ahola2011-11-29
* Fix another silly mistake making CONTENT_IGNORE definition not being what it ...Perttu Ahola2011-11-29
* Improved MaterialItem (stores nodename)Perttu Ahola2011-11-29
* Node definition namesPerttu Ahola2011-11-29
* Add name field to ContentFeaturesPerttu Ahola2011-11-29
* Remove burn time definitions from FurnaceNodeMetadataPerttu Ahola2011-11-29
* Move cook result properly to ContentFeaturesPerttu Ahola2011-11-29
* Clean nodefeat and content_mapnode a bitPerttu Ahola2011-11-29
* Fix flowing water being always opaquePerttu Ahola2011-11-29
* Node definitions transferPerttu Ahola2011-11-29
* Completely generalized mesh generation; ContentFeatures serializationPerttu Ahola2011-11-29
* Clean morePerttu Ahola2011-11-29
* Prepare more for node definition serializationPerttu Ahola2011-11-29
* Better node texture generationPerttu Ahola2011-11-29
* Update inventory texture tooPerttu Ahola2011-11-29
* Properly update textures in node definitionsPerttu Ahola2011-11-29
* Make possible and do update textures in node definitions after late texture a...Perttu Ahola2011-11-29
* GameDef compilesPerttu Ahola2011-11-29
/span> /* Some more dynamic interface */ virtual void setPos(v3f pos) { setBasePosition(pos); } // continuous: if true, object does not stop immediately at pos virtual void moveTo(v3f pos, bool continuous) { setBasePosition(pos); } // If object has moved less than this and data has not changed, // saving to disk may be omitted virtual float getMinimumSavedMovement() { return 2.0*BS; } virtual bool isPeaceful(){return true;} virtual std::string getDescription(){return "SAO";} /* Step object in time. Messages added to messages are sent to client over network. send_recommended: True at around 5-10 times a second, same for all objects. This is used to let objects send most of the data at the same time so that the data can be combined in a single packet. */ virtual void step(float dtime, bool send_recommended){} /* The return value of this is passed to the client-side object when it is created */ virtual std::string getClientInitializationData(){return "";} /* The return value of this is passed to the server-side object when it is created (converted from static to active - actually the data is the static form) */ virtual std::string getStaticData() { assert(isStaticAllowed()); return ""; } /* Return false in here to never save and instead remove object on unload. getStaticData() will not be called in that case. */ virtual bool isStaticAllowed() const {return true;} // Returns tool wear virtual int punch(v3f dir, const ToolCapabilities *toolcap=NULL, ServerActiveObject *puncher=NULL, float time_from_last_punch=1000000) { return 0; } virtual void rightClick(ServerActiveObject *clicker) {} virtual void setHP(s16 hp) {} virtual s16 getHP() const { return 0; } virtual void setArmorGroups(const ItemGroupList &armor_groups) {} virtual ObjectProperties* accessObjectProperties() { return NULL; } virtual void notifyObjectPropertiesModified() {} // Inventory and wielded item virtual Inventory* getInventory() { return NULL; } virtual const Inventory* getInventory() const { return NULL; } virtual InventoryLocation getInventoryLocation() const { return InventoryLocation(); } virtual void setInventoryModified() {} virtual std::string getWieldList() const { return ""; } virtual int getWieldIndex() const { return 0; } virtual ItemStack getWieldedItem() const; virtual bool setWieldedItem(const ItemStack &item); /* Number of players which know about this object. Object won't be deleted until this is 0 to keep the id preserved for the right object. */ u16 m_known_by_count; /* - Whether this object is to be removed when nobody knows about it anymore. - Removal is delayed to preserve the id for the time during which it could be confused to some other object by some client. - This is set to true by the step() method when the object wants to be deleted. - This can be set to true by anything else too. */ bool m_removed; /* This is set to true when an object should be removed from the active object list but couldn't be removed because the id has to be reserved for some client. The environment checks this periodically. If this is true and also m_known_by_count is true, object is deleted from the active object list. */ bool m_pending_deactivation; /* Whether the object's static data has been stored to a block */ bool m_static_exists; /* The block from which the object was loaded from, and in which a copy of the static data resides. */ v3s16 m_static_block; /* Queue of messages to be sent to the client */ Queue<ActiveObjectMessage> m_messages_out; protected: // Used for creating objects based on type typedef ServerActiveObject* (*Factory) (ServerEnvironment *env, v3f pos, const std::string &data); static void registerType(u16 type, Factory f); ServerEnvironment *m_env; v3f m_base_position; private: // Used for creating objects based on type static core::map<u16, Factory> m_types; }; #endif