add trimmed apple blossom, add apple blossom craft item to make white dye

This commit is contained in:
darkrose 2013-12-31 20:49:35 +10:00
parent 2625efbb22
commit 41bebe1e6a
5 changed files with 41 additions and 1 deletions

View File

@ -298,6 +298,7 @@ void content_craftitem_init()
f->texture = "dye_white.png";
f->name = "dye_white";
f->gui_name = "White Dye";
crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE);
crafting::set2Any3Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE);
i = CONTENT_CRAFTITEM_DYE_BLACK;
@ -402,4 +403,13 @@ void content_craftitem_init()
f->name = "lump_of_ash";
f->gui_name = "Ash";
i = CONTENT_CRAFTITEM_APPLE_BLOSSOM;
f = &g_content_craftitem_features[i];
f->content = CONTENT_CRAFTITEM_APPLE_BLOSSOM;
f->texture = "apple_blossom.png";
f->name = "apple_blossom";
f->gui_name = "Apple Blossoms";
f->edible = 1;
f->fuel_time = 30/16;
}

View File

@ -79,5 +79,6 @@ CraftItemFeatures & content_craftitem_features(std::string subname);
#define CONTENT_CRAFTITEM_JUNGLE_PLANK (CONTENT_CRAFTITEM_MASK | 0x28)
#define CONTENT_CRAFTITEM_TNT (CONTENT_CRAFTITEM_MASK | 0x29)
#define CONTENT_CRAFTITEM_ASH (CONTENT_CRAFTITEM_MASK | 0x2A)
#define CONTENT_CRAFTITEM_APPLE_BLOSSOM (CONTENT_CRAFTITEM_MASK | 0x2B)
#endif

View File

@ -1657,9 +1657,33 @@ void content_mapnode_init()
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 = 5;
f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_APPLE_LEAVES)+" 1";
setLeafLikeDiggingProperties(f->digging_properties, 0.15);
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";
setLeafLikeDiggingProperties(f->digging_properties, 0.15);
i = CONTENT_CACTUS;
f = &content_features(i);
f->description = std::string("Cactus");

View File

@ -200,7 +200,8 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
#define CONTENT_TRIMMED_JUNGLE_LEAVES 0x916
#define CONTENT_TRIMMED_CONIFER_LEAVES 0x917
#define CONTENT_APPLE_BLOSSOM 0x918
// FREE 919-9FE
#define CONTENT_TRIMMED_APPLE_BLOSSOM 0x919
// FREE 91A-9FE
//bwahaha!
#define CONTENT_CRAFT_GUIDE 0x9FF

View File

@ -3102,6 +3102,10 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
std::string dug_s = std::string("MaterialItem2 ")+itos(CONTENT_TRIMMED_APPLE_LEAVES)+" 1";;
std::istringstream is(dug_s, std::ios::binary);
item = InventoryItem::deSerialize(is);
}else if (material == CONTENT_APPLE_BLOSSOM && tool->getContent() == CONTENT_TOOLITEM_STEELSHEARS) {
std::string dug_s = std::string("MaterialItem2 ")+itos(CONTENT_TRIMMED_APPLE_BLOSSOM)+" 1";;
std::istringstream is(dug_s, std::ios::binary);
item = InventoryItem::deSerialize(is);
}else if (material == CONTENT_CONIFER_LEAVES && tool->getContent() == CONTENT_TOOLITEM_STEELSHEARS) {
std::string dug_s = std::string("MaterialItem2 ")+itos(CONTENT_TRIMMED_CONIFER_LEAVES)+" 1";;
std::istringstream is(dug_s, std::ios::binary);