add home flags

This commit is contained in:
darkrose 2014-09-20 02:36:05 +10:00
parent aea3b4882b
commit 4c0a057ac4
32 changed files with 2836 additions and 2385 deletions

BIN
data/textures/flag.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

BIN
data/textures/flag_blue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

BIN
data/textures/flag_end.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

BIN
data/textures/flag_post.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

BIN
data/textures/flag_red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 310 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

View File

@ -146,6 +146,8 @@ set(common_SRCS
content_mapnode_furniture.cpp content_mapnode_furniture.cpp
content_mapnode_stair.cpp content_mapnode_stair.cpp
content_mapnode_slab.cpp content_mapnode_slab.cpp
content_mapnode_special.cpp
content_mapnode_plants.cpp
content_mapnode_util.cpp content_mapnode_util.cpp
content_list.cpp content_list.cpp
content_nodebox.cpp content_nodebox.cpp

File diff suppressed because it is too large Load Diff

View File

@ -29,6 +29,8 @@ void content_mapnode_furniture(bool repeat);
void content_mapnode_door(bool repeat); void content_mapnode_door(bool repeat);
void content_mapnode_stair(bool repeat); void content_mapnode_stair(bool repeat);
void content_mapnode_slab(bool repeat); void content_mapnode_slab(bool repeat);
void content_mapnode_special(bool repeat);
void content_mapnode_plants(bool repeat);
extern content_t trans_table_19[21][2]; extern content_t trans_table_19[21][2];
@ -176,6 +178,14 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
#define CONTENT_COUCH_CHAIR_BLACK 0x865 #define CONTENT_COUCH_CHAIR_BLACK 0x865
// FREE 866-87F // FREE 866-87F
#define CONTENT_FLAG 0x870
#define CONTENT_FLAG_BLUE 0x871
#define CONTENT_FLAG_GREEN 0x872
#define CONTENT_FLAG_ORANGE 0x873
#define CONTENT_FLAG_PURPLE 0x874
#define CONTENT_FLAG_RED 0x875
#define CONTENT_FLAG_YELLOW 0x876
#define CONTENT_FLAG_BLACK 0x877
// plants // plants
#define CONTENT_WILDGRASS_SHORT 0x880 #define CONTENT_WILDGRASS_SHORT 0x880

View File

@ -0,0 +1,907 @@
/************************************************************************
* Minetest-c55
* Copyright (C) 2010 celeron55, Perttu Ahola <celeron55@gmail.com>
*
* content_mapnode_special.cpp
* Copyright (C) Lisa 'darkrose' Milne 2014 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
************************************************************************/
// For g_settings
#include "main.h"
#include "content_mapnode.h"
#include "content_nodebox.h"
#include "content_list.h"
#include "content_craft.h"
#include "content_nodemeta.h"
#include "settings.h"
void content_mapnode_plants(bool repeat)
{
bool new_style_leaves = g_settings->getBool("new_style_leaves");
content_t i;
ContentFeatures *f = NULL;
i = CONTENT_TREE;
f = &content_features(i);
f->description = std::string("Tree");
f->setAllTextures("tree.png");
f->setTexture(0, "tree_top.png");
f->setTexture(1, "tree_top.png");
f->setInventoryTextureCube("tree_top.png", "tree.png", "tree.png");
f->draw_type = CDT_CUBELIKE;
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_APPLE_TREE;
f = &content_features(i);
f->description = std::string("Apple Tree");
f->setAllTextures("apple_tree.png");
f->setTexture(0, "apple_tree_top.png");
f->setTexture(1, "apple_tree_top.png");
f->setInventoryTextureCube("apple_tree_top.png", "apple_tree.png", "apple_tree.png");
f->draw_type = CDT_CUBELIKE;
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_JUNGLETREE;
f = &content_features(i);
f->description = std::string("Jungle Tree");
f->setAllTextures("jungletree.png");
f->setTexture(0, "jungletree_top.png");
f->setTexture(1, "jungletree_top.png");
f->setInventoryTextureCube("jungletree_top.png", "jungletree.png", "jungletree.png");
f->draw_type = CDT_CUBELIKE;
//f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->fuel_time = 30;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
i = CONTENT_CONIFER_TREE;
f = &content_features(i);
f->description = std::string("Conifer Tree");
f->setAllTextures("conifer_tree.png");
f->setTexture(0, "conifer_tree_top.png");
f->setTexture(1, "conifer_tree_top.png");
f->is_ground_content = true;
f->flammable = 2; // can be set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->cook_result = std::string("CraftItem lump_of_charcoal 1");
f->fuel_time = 30;
f->draw_type = CDT_NODEBOX;
f->param_type = CPT_LIGHT;
f->light_propagates = true;
f->sunlight_propagates = true;
f->is_ground_content = true;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 0;
f->fuel_time = 25;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->setNodeBox(core::aabbox3d<f32>(
-0.4375*BS,
-0.5*BS,
-0.4375*BS,
0.4375*BS,
0.5*BS,
0.4375*BS
));
f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png");
f->type = CMT_WOOD;
f->hardness = 0.8;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_YOUNG_TREE;
f = &content_features(i);
f->description = std::string("Young Tree");
f->setAllTextures("tree.png");
f->setTexture(0, "tree_top.png");
f->setTexture(1, "tree_top.png");
f->draw_type = CDT_NODEBOX;
f->solidness = 0; // drawn separately, makes no faces
f->param_type = CPT_LIGHT;
content_nodebox_youngtree(f);
f->setInventoryTextureNodeBox(i,"tree_top.png", "tree.png", "tree.png");
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->special_alternate_node = CONTENT_LEAVES;
f->fuel_time = 20;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
i = CONTENT_YOUNG_JUNGLETREE;
f = &content_features(i);
f->description = std::string("Young Jungle Tree");
f->setAllTextures("jungletree.png");
f->setTexture(0, "jungletree_top.png");
f->setTexture(1, "jungletree_top.png");
f->draw_type = CDT_NODEBOX;
f->solidness = 0; // drawn separately, makes no faces
f->param_type = CPT_LIGHT;
content_nodebox_youngtree(f);
f->setInventoryTextureNodeBox(i,"jungletree_top.png", "jungletree.png", "jungletree.png");
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->special_alternate_node = CONTENT_JUNGLELEAVES;
f->fuel_time = 20;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
i = CONTENT_YOUNG_APPLE_TREE;
f = &content_features(i);
f->description = std::string("Young Apple Tree");
f->setAllTextures("apple_tree.png");
f->setTexture(0, "apple_tree_top.png");
f->setTexture(1, "apple_tree_top.png");
f->draw_type = CDT_NODEBOX;
f->solidness = 0; // drawn separately, makes no faces
f->param_type = CPT_LIGHT;
content_nodebox_youngtree(f);
f->setInventoryTextureNodeBox(i,"apple_tree_top.png", "apple_tree.png", "apple_tree.png");
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->special_alternate_node = CONTENT_APPLE_LEAVES;
f->fuel_time = 20;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
i = CONTENT_YOUNG_CONIFER_TREE;
f = &content_features(i);
f->description = std::string("Young Conifer Tree");
f->setAllTextures("conifer_tree.png");
f->setTexture(0, "conifer_tree_top.png");
f->setTexture(1, "conifer_tree_top.png");
f->draw_type = CDT_NODEBOX;
f->solidness = 0; // drawn separately, makes no faces
f->param_type = CPT_LIGHT;
content_nodebox_youngtree(f);
f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png");
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->special_alternate_node = CONTENT_CONIFER_LEAVES;
f->fuel_time = 20;
f->type = CMT_WOOD;
f->hardness = 1.0;
lists::add("creative",i);
i = CONTENT_JUNGLEGRASS;
f = &content_features(i);
f->description = std::string("Jungle Grass");
f->setInventoryTexture("junglegrass.png");
f->setAllTextures("junglegrass.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE_LGE;
//f->is_ground_content = true;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_LEAVES;
f = &content_features(i);
f->description = std::string("Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
//f->is_ground_content = true;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1";
f->extra_dug_item_rarity = 20;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("decrafting",i);
lists::add("cooking",i);
i = CONTENT_APPLE_LEAVES;
f = &content_features(i);
f->description = std::string("Apple Tree Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
//f->is_ground_content = true;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("apple_leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:apple_leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_SAPLING)+" 1";
f->extra_dug_item_rarity = 20;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("decrafting",i);
lists::add("cooking",i);
i = CONTENT_JUNGLELEAVES;
f = &content_features(i);
f->description = std::string("Jungle Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
//f->is_ground_content = true;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("jungleleaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:jungleleaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_JUNGLESAPLING)+" 1";
f->extra_dug_item_rarity = 20;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("decrafting",i);
lists::add("cooking",i);
i = CONTENT_CONIFER_LEAVES;
f = &content_features(i);
f->description = std::string("Conifer Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
//f->is_ground_content = true;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("conifer_leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:conifer_leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CONIFER_SAPLING)+" 1";
f->extra_dug_item_rarity = 20;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("decrafting",i);
lists::add("cooking",i);
i = CONTENT_TRIMMED_LEAVES;
f = &content_features(i);
f->description = std::string("Trimmed Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("leaves.png", "leaves.png", "leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_TRIMMED_APPLE_LEAVES;
f = &content_features(i);
f->description = std::string("Trimmed Apple Tree Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("apple_leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("apple_leaves.png", "apple_leaves.png", "apple_leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:apple_leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_TRIMMED_JUNGLE_LEAVES;
f = &content_features(i);
f->description = std::string("Trimmed Jungle Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("jungleleaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("jungleleaves.png", "jungleleaves.png", "jungleleaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:jungleleaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_TRIMMED_CONIFER_LEAVES;
f = &content_features(i);
f->description = std::string("Trimmed Conifer Leaves");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("conifer_leaves.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("conifer_leaves.png", "conifer_leaves.png", "conifer_leaves.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:conifer_leaves.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/16;
f->cook_result = std::string("CraftItem lump_of_resin 1");
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
lists::add("cooking",i);
i = CONTENT_APPLE_BLOSSOM;
f = &content_features(i);
f->description = std::string("Apple Tree Blossom");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
//f->is_ground_content = true;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("apple_leaves.png^apple_blossom.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->extra_dug_item = std::string("CraftItem apple_blossom 1");
f->extra_dug_item_rarity = 1;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_LEAVES)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("decrafting",i);
i = CONTENT_TRIMMED_APPLE_BLOSSOM;
f = &content_features(i);
f->description = std::string("Trimmed Apple Tree Blossom");
f->light_propagates = true;
f->param_type = CPT_LIGHT;
if (new_style_leaves) {
f->draw_type = CDT_GLASSLIKE;
f->solidness = 0; // drawn separately, makes no faces
f->visual_solidness = 1;
f->setAllTextures("apple_leaves.png^apple_blossom.png");
#ifndef SERVER
f->setAllTextureTypes(MATERIAL_ALPHA_SIMPLE);
#endif
f->setInventoryTextureCube("apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png", "apple_leaves.png^apple_blossom.png");
}else{
f->draw_type = CDT_CUBELIKE;
f->setAllTextures("[noalpha:apple_leaves.png^apple_blossom.png");
}
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_PLANT;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_CACTUS_BLOSSOM;
f = &content_features(i);
f->description = std::string("Cactus Blossom");
f->setInventoryTexture("cactus_blossom.png");
f->setAllTextures("cactus_blossom.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_CACTUS_FLOWER;
f = &content_features(i);
f->description = std::string("Cactus Flower");
f->setInventoryTexture("cactus_flower.png");
f->setAllTextures("cactus_flower.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_CACTUS_BLOSSOM)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
lists::add("decrafting",i);
i = CONTENT_CACTUS_FRUIT;
f = &content_features(i);
f->description = std::string("Cactus Berry");
f->setInventoryTexture("cactus_fruit.png");
f->setAllTextures("cactus_fruit.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("CraftItem cactus_fruit 1");
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_CACTUS;
f = &content_features(i);
f->description = std::string("Cactus");
f->setAllTextures("cactus_side.png");
f->setTexture(0, "cactus_top.png");
f->setTexture(1, "cactus_top.png");
f->draw_type = CDT_NODEBOX;
f->param_type = CPT_LIGHT;
f->light_propagates = true;
f->sunlight_propagates = true;
f->is_ground_content = true;
f->damage_per_second = 2;
f->solidness = 0; // drawn separately, makes no faces
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/4;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->setNodeBox(core::aabbox3d<f32>(
-0.4375*BS,
-0.5*BS,
-0.4375*BS,
0.4375*BS,
0.5*BS,
0.4375*BS
));
f->addNodeBox(core::aabbox3d<f32>(
-0.5*BS,
0.3125*BS,
-0.5*BS,
-0.4375*BS,
0.375*BS,
-0.4375*BS
));
f->addNodeBox(core::aabbox3d<f32>(
0.4375*BS,
0.125*BS,
0.4375*BS,
0.5*BS,
0.1875*BS,
0.5*BS
));
f->addNodeBox(core::aabbox3d<f32>(
0.4375*BS,
-0.1875*BS,
-0.5*BS,
0.5*BS,
-0.125*BS,
-0.4375*BS
));
f->addNodeBox(core::aabbox3d<f32>(
-0.5*BS,
-0.375*BS,
0.4375*BS,
-0.4375*BS,
-0.3125*BS,
0.5*BS
));
f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png");
f->type = CMT_WOOD;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_PAPYRUS;
f = &content_features(i);
f->description = std::string("Papyrus");
f->setInventoryTexture("papyrus.png");
f->setAllTextures("papyrus.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->type = CMT_WOOD;
f->hardness = 0.25;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_SAPLING;
f = &content_features(i);
f->description = std::string("Sapling");
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->setAllTextures("sapling.png");
f->setInventoryTexture("sapling.png");
f->setAllTextureFlags(0);
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->light_propagates = true;
f->air_equivalent = false;
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 1;
f->type = CMT_WOOD;
f->hardness = 0.0;
lists::add("creative",i);
i = CONTENT_APPLE_SAPLING;
f = &content_features(i);
f->description = std::string("Apple Tree Sapling");
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->setAllTextures("apple_sapling.png");
f->setInventoryTexture("apple_sapling.png");
f->setAllTextureFlags(0);
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->light_propagates = true;
f->air_equivalent = false;
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 1;
f->type = CMT_WOOD;
f->hardness = 0.0;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_JUNGLESAPLING;
f = &content_features(i);
f->description = std::string("Jungle Sapling");
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->setAllTextures("junglesapling.png");
f->setInventoryTexture("junglesapling.png");
f->setAllTextureFlags(0);
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->light_propagates = true;
f->air_equivalent = false;
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 1;
f->type = CMT_WOOD;
f->hardness = 0.0;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_CONIFER_SAPLING;
f = &content_features(i);
f->description = std::string("Conifer Sapling");
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->setAllTextures("conifer_sapling.png");
f->setInventoryTexture("conifer_sapling.png");
f->setAllTextureFlags(0);
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->light_propagates = true;
f->air_equivalent = false;
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 1;
f->type = CMT_WOOD;
f->hardness = 0.0;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_APPLE;
f = &content_features(i);
f->description = std::string("Apple");
f->setInventoryTexture("apple.png");
f->setAllTextures("apple.png");
f->setAllTextureFlags(0);
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE_SML;
f->light_propagates = true;
f->sunlight_propagates = true;
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->air_equivalent = true;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 1;
f->dug_item = std::string("CraftItem apple 1");
f->type = CMT_WOOD;
f->hardness = 0.0;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
// plants
i = CONTENT_WILDGRASS_SHORT;
f = &content_features(i);
f->description = std::string("Wild Grass");
f->setInventoryTexture("wildgrass_short.png");
f->setAllTextures("wildgrass_short.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
//f->pointable = false;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
i = CONTENT_WILDGRASS_LONG;
f = &content_features(i);
f->description = std::string("Wild Grass");
f->setInventoryTexture("wildgrass_long.png");
f->setAllTextures("wildgrass_long.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->air_equivalent = false; // grass grows underneath
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WILDGRASS_SHORT)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
i = CONTENT_DEADGRASS;
f = &content_features(i);
f->description = std::string("Dead Grass");
f->setInventoryTexture("deadgrass.png");
f->setAllTextures("deadgrass.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
i = CONTENT_FLOWER_STEM;
f = &content_features(i);
f->description = std::string("Flower Stem");
f->setInventoryTexture("flower_stem.png");
f->setAllTextures("flower_stem.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
i = CONTENT_FLOWER_ROSE;
f = &content_features(i);
f->description = std::string("Rose");
f->setInventoryTexture("flower_rose.png");
f->setAllTextures("flower_rose.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_FLOWER_DAFFODIL;
f = &content_features(i);
f->description = std::string("Daffodil");
f->setInventoryTexture("flower_daffodil.png");
f->setAllTextures("flower_daffodil.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
i = CONTENT_FLOWER_TULIP;
f = &content_features(i);
f->description = std::string("Tulip");
f->setInventoryTexture("flower_tulip.png");
f->setAllTextures("flower_tulip.png");
f->setAllTextureFlags(0);
f->light_propagates = true;
f->sunlight_propagates = true;
f->param_type = CPT_LIGHT;
f->draw_type = CDT_PLANTLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->walkable = false;
f->material_pointable = false;
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30/32;
f->buildable_to = true;
f->type = CMT_WOOD;
f->hardness = 0.10;
f->pressure_type = CST_CRUSHABLE;
lists::add("creative",i);
}

File diff suppressed because it is too large Load Diff

View File

@ -1411,3 +1411,13 @@ void content_nodebox_youngtree(ContentFeatures *f)
)); ));
} }
void content_nodebox_flag(ContentFeatures *f)
{
f->setNodeBox(core::aabbox3d<f32>(
-0.4375*BS,-0.5*BS,-0.1875*BS,-0.25*BS,0.5*BS,0.*BS
));
f->addNodeBox(core::aabbox3d<f32>(
-0.25*BS,0.*BS,-0.125*BS,0.4375*BS,0.4375*BS,-0.0625*BS
));
}

View File

@ -62,5 +62,6 @@ void content_nodebox_fence(ContentFeatures *f);
void content_nodebox_wall_inv(ContentFeatures *f); void content_nodebox_wall_inv(ContentFeatures *f);
void content_nodebox_wall(ContentFeatures *f); void content_nodebox_wall(ContentFeatures *f);
void content_nodebox_youngtree(ContentFeatures *f); void content_nodebox_youngtree(ContentFeatures *f);
void content_nodebox_flag(ContentFeatures *f);
#endif #endif

View File

@ -114,6 +114,42 @@ std::string LockingSignNodeMetadata::getDrawSpecString()
return std::string("field[text;;") + m_text + "]"; return std::string("field[text;;") + m_text + "]";
} }
/*
FlagNodeMetadata
*/
// Prototype
FlagNodeMetadata proto_FlagNodeMetadata();
FlagNodeMetadata::FlagNodeMetadata()
{
NodeMetadata::registerType(typeId(), create);
}
u16 FlagNodeMetadata::typeId() const
{
return CONTENT_FLAG;
}
NodeMetadata* FlagNodeMetadata::create(std::istream &is)
{
FlagNodeMetadata *d = new FlagNodeMetadata();
d->setOwner(deSerializeString(is));
return d;
}
NodeMetadata* FlagNodeMetadata::clone()
{
FlagNodeMetadata *d = new FlagNodeMetadata();
d->m_owner = m_owner;
return d;
}
void FlagNodeMetadata::serializeBody(std::ostream &os)
{
os<<serializeString(m_owner);
}
std::string FlagNodeMetadata::infoText()
{
return std::string("")+m_owner+"'s Home Flag";
}
/* /*
ChestNodeMetadata ChestNodeMetadata
*/ */

View File

@ -77,6 +77,25 @@ private:
std::string m_owner; std::string m_owner;
}; };
class FlagNodeMetadata : public NodeMetadata
{
public:
FlagNodeMetadata();
//~FlagNodeMetadata();
virtual u16 typeId() const;
static NodeMetadata* create(std::istream &is);
virtual NodeMetadata* clone();
virtual void serializeBody(std::ostream &os);
virtual std::string infoText();
virtual std::string getOwner(){ return m_owner; }
virtual void setOwner(std::string t){ m_owner = t; }
private:
std::string m_owner;
};
class ChestNodeMetadata : public NodeMetadata class ChestNodeMetadata : public NodeMetadata
{ {
public: public:

View File

@ -681,7 +681,7 @@ void drawLoadingScreen(video::IVideoDriver* driver, const char* msg)
video::ITexture *logotexture = driver->getTexture(getTexturePath("menulogo.png").c_str()); video::ITexture *logotexture = driver->getTexture(getTexturePath("menulogo.png").c_str());
if (logotexture) { if (logotexture) {
core::rect<s32> rect(x-100,y-90,x+100,y+110); core::rect<s32> rect(x-100,y-150,x+100,y+50);
driver->draw2DImage(logotexture, rect, driver->draw2DImage(logotexture, rect,
core::rect<s32>(core::position2d<s32>(0,0), core::rect<s32>(core::position2d<s32>(0,0),
core::dimension2di(logotexture->getSize())), core::dimension2di(logotexture->getSize())),
@ -695,7 +695,7 @@ void drawLoadingScreen(video::IVideoDriver* driver, const char* msg)
m = L"Loading"; m = L"Loading";
} }
core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(m.c_str()); core::dimension2d<u32> textsize = guienv->getSkin()->getFont()->getDimension(m.c_str());
core::rect<s32> rect(x-(textsize.Width/2), y+100, x+textsize.Width, y+100+textsize.Height); core::rect<s32> rect(x-(textsize.Width/2), y+50, x+textsize.Width, y+50+textsize.Height);
gui::IGUIStaticText *guitext = guienv->addStaticText(m.c_str(),rect); gui::IGUIStaticText *guitext = guienv->addStaticText(m.c_str(),rect);
guienv->drawAll(); guienv->drawAll();
guitext->remove(); guitext->remove();

View File

@ -277,6 +277,10 @@ void init_mapnode()
drawLoadingScreen(driver,"Loading Circuit MapNodes"); drawLoadingScreen(driver,"Loading Circuit MapNodes");
#endif #endif
content_mapnode_circuit(repeat); content_mapnode_circuit(repeat);
#ifndef SERVER
drawLoadingScreen(driver,"Loading Plant MapNodes");
#endif
content_mapnode_plants(repeat);
#ifndef SERVER #ifndef SERVER
drawLoadingScreen(driver,"Loading Farming MapNodes"); drawLoadingScreen(driver,"Loading Farming MapNodes");
#endif #endif
@ -294,6 +298,7 @@ void init_mapnode()
#endif #endif
content_mapnode_stair(repeat); content_mapnode_stair(repeat);
content_mapnode_slab(repeat); content_mapnode_slab(repeat);
content_mapnode_special(repeat);
} }
/* /*

View File

@ -302,8 +302,12 @@ struct ContentFeatures
// for pistons // for pistons
ContentPressureType pressure_type; ContentPressureType pressure_type;
// how much does this hurt?
u32 damage_per_second; u32 damage_per_second;
// can be used to set the users respawn position
bool home_node;
// NOTE: Move relevant properties to here from elsewhere // NOTE: Move relevant properties to here from elsewhere
void reset() void reset()
@ -370,6 +374,7 @@ struct ContentFeatures
hardness = 1.0; hardness = 1.0;
pressure_type = CST_MOVABLE; pressure_type = CST_MOVABLE;
damage_per_second = 0; damage_per_second = 0;
home_node = false;
} }
ContentFeatures() ContentFeatures()

View File

@ -43,7 +43,9 @@ Player::Player():
m_pitch(0), m_pitch(0),
m_yaw(0), m_yaw(0),
m_speed(0,0,0), m_speed(0,0,0),
m_position(0,0,0) m_position(0,0,0),
m_home(0,0,0),
m_hashome(false)
{ {
updateName("<not set>"); updateName("<not set>");
resetInventory(); resetInventory();
@ -116,6 +118,8 @@ void Player::serialize(std::ostream &os)
args.setV3F("position", m_position); args.setV3F("position", m_position);
args.setBool("craftresult_is_preview", craftresult_is_preview); args.setBool("craftresult_is_preview", craftresult_is_preview);
args.setS32("hp", hp); args.setS32("hp", hp);
if (m_hashome)
args.setV3F("home",m_home);
args.writeLines(os); args.writeLines(os);
@ -165,6 +169,10 @@ void Player::deSerialize(std::istream &is)
}catch(SettingNotFoundException &e){ }catch(SettingNotFoundException &e){
hp = 20; hp = 20;
} }
try{
m_home = args.getV3F("home");
m_hashome = true;
}catch(SettingNotFoundException &e){}
/*try{ /*try{
std::string sprivs = args.get("privs"); std::string sprivs = args.get("privs");
if(sprivs == "all") if(sprivs == "all")
@ -183,6 +191,20 @@ void Player::deSerialize(std::istream &is)
inventory.deSerialize(is); inventory.deSerialize(is);
} }
bool Player::getHome(v3f &h)
{
if (!m_hashome)
return false;
h = m_home;
return true;
}
void Player::setHome(v3f h)
{
m_home = h;
m_hashome = true;
}
/* /*
RemotePlayer RemotePlayer
*/ */

View File

@ -175,6 +175,10 @@ public:
u16 peer_id; u16 peer_id;
bool getHome(v3f &h);
void setHome(v3f h);
void unsetHome() {m_hashome = false;}
protected: protected:
char m_name[PLAYERNAME_SIZE]; char m_name[PLAYERNAME_SIZE];
u16 m_selected_item; u16 m_selected_item;
@ -182,6 +186,8 @@ protected:
f32 m_yaw; f32 m_yaw;
v3f m_speed; v3f m_speed;
v3f m_position; v3f m_position;
v3f m_home;
bool m_hashome;
public: public:

View File

@ -2902,6 +2902,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|| meta->typeId() == CONTENT_LOCKABLE_SIGN_WALL || meta->typeId() == CONTENT_LOCKABLE_SIGN_WALL
|| meta->typeId() == CONTENT_LOCKABLE_SIGN_UD || meta->typeId() == CONTENT_LOCKABLE_SIGN_UD
|| meta->typeId() == CONTENT_LOCKABLE_FURNACE || meta->typeId() == CONTENT_LOCKABLE_FURNACE
|| meta->typeId() == CONTENT_FLAG
|| meta->typeId() == CONTENT_FLAG_BLUE
|| meta->typeId() == CONTENT_FLAG_GREEN
|| meta->typeId() == CONTENT_FLAG_ORANGE
|| meta->typeId() == CONTENT_FLAG_PURPLE
|| meta->typeId() == CONTENT_FLAG_RED
|| meta->typeId() == CONTENT_FLAG_YELLOW
|| meta->typeId() == CONTENT_FLAG_BLACK
) )
&& meta->getOwner() != player->getName() && meta->getOwner() != player->getName()
) { ) {
@ -2949,7 +2957,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
} }
bool is_farm_swap = false; bool is_farm_swap = false;
// This is pretty much the entirety of farming // This was pretty much the entirety of farming
if ( if (
( (
material == CONTENT_MUD material == CONTENT_MUD
@ -3042,6 +3050,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
} }
sendRemoveNode(p_under, 0, &far_players, 30); sendRemoveNode(p_under, 0, &far_players, 30);
}else{ }else{
if (content_features(n).home_node)
player->unsetHome();
if (n.getContent() == CONTENT_FLOWER_POT) { if (n.getContent() == CONTENT_FLOWER_POT) {
MapNode a = m_env.getMap().getNodeNoEx(p_under+v3s16(0,1,0)); MapNode a = m_env.getMap().getNodeNoEx(p_under+v3s16(0,1,0));
if ( if (
@ -3769,6 +3779,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
} }
} }
if (content_features(n).home_node) {
v3f player_home = intToFloat(p_under,BS);
player_home.Y += 0.6*BS;
player->setHome(player_home);
std::string msg = std::string("Your home is now set to ")+itos(p_under.X)+","+itos(p_under.Y+1)+","+itos(p_under.Z);
SendChatMessage(player->peer_id,narrow_to_wide(msg).c_str());
}
/* /*
Send to all close-by players Send to all close-by players
*/ */
@ -5310,7 +5328,9 @@ void Server::HandlePlayerHP(Player *player, s16 damage)
void Server::RespawnPlayer(Player *player) void Server::RespawnPlayer(Player *player)
{ {
v3f pos = findSpawnPos(m_env.getServerMap()); v3f pos;
if (!player->getHome(pos))
pos = findSpawnPos(m_env.getServerMap());
player->setPosition(pos); player->setPosition(pos);
player->hp = 20; player->hp = 20;
SendMovePlayer(player); SendMovePlayer(player);