forked from oerkki/voxelands
make trees grow slowly
This commit is contained in:
parent
e0b8de5ad9
commit
5cd47e89af
|
@ -416,6 +416,7 @@ void content_craftitem_init()
|
|||
f->description = "Pine Plank";
|
||||
f->fuel_time = 30/16;
|
||||
crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK);
|
||||
crafting::set1To2Recipe(CONTENT_YOUNG_CONIFER_TREE,CONTENT_CRAFTITEM_PINE_PLANK);
|
||||
lists::add("craftguide",i);
|
||||
lists::add("creative",i);
|
||||
|
||||
|
@ -427,6 +428,8 @@ void content_craftitem_init()
|
|||
f->description = "Wood Plank";
|
||||
f->fuel_time = 30/16;
|
||||
crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK);
|
||||
crafting::set1To2Recipe(CONTENT_YOUNG_TREE,CONTENT_CRAFTITEM_WOOD_PLANK);
|
||||
crafting::set1To2Recipe(CONTENT_YOUNG_APPLE_TREE,CONTENT_CRAFTITEM_WOOD_PLANK);
|
||||
lists::add("craftguide",i);
|
||||
lists::add("creative",i);
|
||||
|
||||
|
@ -438,6 +441,7 @@ void content_craftitem_init()
|
|||
f->description = "Jungle Wood Plank";
|
||||
f->fuel_time = 30/16;
|
||||
crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK);
|
||||
crafting::set1To2Recipe(CONTENT_YOUNG_JUNGLETREE,CONTENT_CRAFTITEM_JUNGLE_PLANK);
|
||||
lists::add("craftguide",i);
|
||||
lists::add("creative",i);
|
||||
|
||||
|
|
|
@ -765,6 +765,82 @@ void content_mapnode_init(bool repeat)
|
|||
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");
|
||||
|
|
|
@ -200,6 +200,7 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
|
|||
#define CONTENT_COTTON_YELLOW 0x895
|
||||
#define CONTENT_COTTON_BLACK 0x896
|
||||
// old walls
|
||||
// deprecated, just here for backwards compat
|
||||
#define CONTENT_ROUGHSTONE_WALL_LEGACY 0x89A
|
||||
#define CONTENT_MOSSYCOBBLE_WALL_LEGACY 0x89B
|
||||
#define CONTENT_SANDSTONE_WALL_LEGACY 0x89C
|
||||
|
@ -269,7 +270,12 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
|
|||
#define CONTENT_COOK_BOOK_OPEN 0x8DB
|
||||
#define CONTENT_DECRAFT_BOOK_OPEN 0x8DC
|
||||
#define CONTENT_DIARY_BOOK_OPEN 0x8DD
|
||||
// FREE 8D3-8FF
|
||||
// FREE 8D3-8DF
|
||||
#define CONTENT_YOUNG_TREE 0x8F0
|
||||
#define CONTENT_YOUNG_JUNGLETREE 0x8F1
|
||||
#define CONTENT_YOUNG_APPLE_TREE 0x8F2
|
||||
#define CONTENT_YOUNG_CONIFER_TREE 0x8F3
|
||||
// FREE 8F4-8FF
|
||||
// glass pane
|
||||
#define CONTENT_GLASS_PANE 0x900
|
||||
#define CONTENT_GLASS_PANE_BLUE 0x901
|
||||
|
|
|
@ -1463,3 +1463,10 @@ void content_nodebox_wall(ContentFeatures *f)
|
|||
));
|
||||
}
|
||||
|
||||
void content_nodebox_youngtree(ContentFeatures *f)
|
||||
{
|
||||
f->setNodeBox(core::aabbox3d<f32>(
|
||||
-0.125*BS,-0.5*BS,-0.125*BS,0.125*BS,0.5*BS,0.125*BS
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -61,5 +61,6 @@ void content_nodebox_fence_inv(ContentFeatures *f);
|
|||
void content_nodebox_fence(ContentFeatures *f);
|
||||
void content_nodebox_wall_inv(ContentFeatures *f);
|
||||
void content_nodebox_wall(ContentFeatures *f);
|
||||
void content_nodebox_youngtree(ContentFeatures *f);
|
||||
|
||||
#endif
|
||||
|
|
1145
src/environment.cpp
1145
src/environment.cpp
File diff suppressed because it is too large
Load Diff
|
@ -228,6 +228,31 @@ public:
|
|||
void clearAllObjects();
|
||||
virtual bool propogateEnergy(u8 level, v3s16 powersrc, v3s16 signalsrc, v3s16 pos);
|
||||
|
||||
// search for c within radius of pos
|
||||
bool searchNear(v3s16 pos, v3s16 radius_min, v3s16 radius_max, std::vector<content_t> c, v3s16 *found);
|
||||
bool searchNear(v3s16 pos, v3s16 radius, std::vector<content_t> c, v3s16 *found)
|
||||
{
|
||||
return searchNear(pos,radius,radius,c,found);
|
||||
}
|
||||
bool searchNear(v3s16 pos, v3s16 radius, content_t c, v3s16 *found)
|
||||
{
|
||||
std::vector<content_t> search;
|
||||
search.push_back(c);
|
||||
return searchNear(pos,radius,radius,search,found);
|
||||
}
|
||||
// search for not c within radius of pos
|
||||
bool searchNearInv(v3s16 pos, v3s16 radius_min, v3s16 radius_max, std::vector<content_t> c, v3s16 *found);
|
||||
bool searchNearInv(v3s16 pos, v3s16 radius, std::vector<content_t> c, v3s16 *found)
|
||||
{
|
||||
return searchNearInv(pos,radius,radius,c,found);
|
||||
}
|
||||
bool searchNearInv(v3s16 pos, v3s16 radius, content_t c, v3s16 *found)
|
||||
{
|
||||
std::vector<content_t> search;
|
||||
search.push_back(c);
|
||||
return searchNearInv(pos,radius,radius,search,found);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue