#creative_mode = false
# Enable players getting damage and dying
#enable_damage = false
+# Despawn all non-peaceful mobs
+#only_peaceful_mobs = false
# A chosen map seed for a new map, leave empty for random
#fixed_map_seed =
# Gives some stuff to players at the beginning
return 65536/100;
}
+bool MobV2SAO::isPeaceful()
+{
+ return m_properties->getBool("is_peaceful");
+}
+
void MobV2SAO::sendPosition()
{
m_last_sent_position = m_base_position;
void MobV2SAO::setPropertyDefaults()
{
+ m_properties->setDefault("is_peaceful", "false");
m_properties->setDefault("move_type", "ground_nodes");
m_properties->setDefault("speed", "(0,0,0)");
m_properties->setDefault("age", "0");
std::string getStaticData();
InventoryItem* createPickedUpItem(){return NULL;}
u16 punch(const std::string &toolname, v3f dir);
+ bool isPeaceful(){return false;}
private:
void doDamage(u16 d);
InventoryItem* createPickedUpItem(){return NULL;}
u16 punch(const std::string &toolname, v3f dir,
const std::string &playername);
+ bool isPeaceful();
private:
void sendPosition();
void setPropertyDefaults();
settings->setDefault("strict_protocol_version_checking", "true");
settings->setDefault("creative_mode", "false");
settings->setDefault("enable_damage", "true");
+ settings->setDefault("only_peaceful_mobs", "false");
settings->setDefault("fixed_map_seed", "");
settings->setDefault("give_initial_stuff", "false");
settings->setDefault("default_password", "");
i.atEnd()==false; i++)
{
ServerActiveObject* obj = i.getNode()->getValue();
+ // Remove non-peaceful mobs on peaceful mode
+ if(g_settings->getBool("only_peaceful_mobs")){
+ if(!obj->isPeaceful())
+ obj->m_removed = true;
+ }
// Don't step if is to be removed or stored statically
if(obj->m_removed || obj->m_pending_deactivation)
continue;
/*
*/
virtual void rightClick(Player *player){}
+
+ virtual bool isPeaceful(){return true;}
/*
Number of players which know about this object. Object won't be