diff --git a/data/textures/book.png b/data/textures/book.png deleted file mode 100755 index 3426afe..0000000 Binary files a/data/textures/book.png and /dev/null differ diff --git a/data/textures/book_binding.png b/data/textures/book_binding.png deleted file mode 100644 index ad8eda3..0000000 Binary files a/data/textures/book_binding.png and /dev/null differ diff --git a/data/textures/book_bottom.png b/data/textures/book_bottom.png deleted file mode 100644 index 3659262..0000000 Binary files a/data/textures/book_bottom.png and /dev/null differ diff --git a/data/textures/book_craft_cover.png b/data/textures/book_craft_cover.png new file mode 100644 index 0000000..eeb3a2a Binary files /dev/null and b/data/textures/book_craft_cover.png differ diff --git a/data/textures/book_back.png b/data/textures/book_craft_end.png similarity index 100% rename from data/textures/book_back.png rename to data/textures/book_craft_end.png diff --git a/data/textures/book_craft_side.png b/data/textures/book_craft_side.png new file mode 100644 index 0000000..6e2062e Binary files /dev/null and b/data/textures/book_craft_side.png differ diff --git a/data/textures/book_front.png b/data/textures/book_front.png deleted file mode 100644 index 4cf6006..0000000 Binary files a/data/textures/book_front.png and /dev/null differ diff --git a/data/textures/book_side.png b/data/textures/book_side.png deleted file mode 100644 index bdc8b31..0000000 Binary files a/data/textures/book_side.png and /dev/null differ diff --git a/data/textures/book_top.png b/data/textures/book_top.png deleted file mode 100644 index c90b2ae..0000000 Binary files a/data/textures/book_top.png and /dev/null differ diff --git a/data/textures/craft_guide.png b/data/textures/craft_guide.png deleted file mode 100644 index 0906c66..0000000 Binary files a/data/textures/craft_guide.png and /dev/null differ diff --git a/data/textures/craft_guide_bottom.png b/data/textures/guide_craft_bottom.png similarity index 100% rename from data/textures/craft_guide_bottom.png rename to data/textures/guide_craft_bottom.png diff --git a/data/textures/craft_guide_end.png b/data/textures/guide_craft_end.png similarity index 100% rename from data/textures/craft_guide_end.png rename to data/textures/guide_craft_end.png diff --git a/data/textures/craft_guide_side.png b/data/textures/guide_craft_side.png similarity index 100% rename from data/textures/craft_guide_side.png rename to data/textures/guide_craft_side.png diff --git a/data/textures/craft_guide_top.png b/data/textures/guide_craft_top.png similarity index 100% rename from data/textures/craft_guide_top.png rename to data/textures/guide_craft_top.png diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index 8082e11..880d41a 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -2788,6 +2788,7 @@ void content_mapnode_init() f->setInventoryTextureCube("mese.png", "mese.png", "mese.png"); f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; + f->onpunch_replace_node = CONTENT_MESE_DIGGING; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->cook_result = std::string("CraftItem saltpeter 1"); f->type = CMT_STONE; @@ -3790,63 +3791,264 @@ void content_mapnode_init() i = CONTENT_BOOK; f = &content_features(i); f->description = std::string("Book"); - f->setTexture(0, "book_top.png"); - f->setTexture(1, "book_bottom.png"); - f->setTexture(2, "book_side.png"); - f->setTexture(3, "book_binding.png"); - f->setTexture(4, "book_back.png"); - f->setTexture(5, "book_front.png"); + f->setTexture(0, "book_cover.png"); + f->setTexture(1, "book_cover.png^[transformFX"); + f->setTexture(2, "book_side.png^[transformFY"); + f->setTexture(3, "book_side.png"); + f->setTexture(4, "book_end.png"); + f->setTexture(5, "book_end.png^[transformFX"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->rotate_tile_with_nodebox = true; f->light_propagates = true; f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_BOOK_OPEN; f->flammable = 1; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->solidness = 0; content_mapnode_nodebox_book(f); - f->setInventoryTextureNodeBox(i, "book_top.png", "book_front.png", "book_side.png"); + f->setInventoryTextureNodeBox(i, "book_cover.png", "book_end.png^[transformFX", "book_side.png^[transformFY"); f->type = CMT_DIRT; f->hardness = 1.0; crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,i); lists::add("craftguide",i); lists::add("creative",i); - i = CONTENT_CRAFT_GUIDE; + i = CONTENT_COOK_BOOK; f = &content_features(i); - f->description = std::string("Craft Guide"); - f->setAllTextures("craft_guide_side.png"); - f->setTexture(0, "craft_guide_top.png"); - f->setTexture(1, "craft_guide_bottom.png"); - f->setTexture(4, "craft_guide_end.png"); - f->setTexture(5, "craft_guide_end.png"); + f->description = std::string("Cook Book"); + f->setTexture(0, "book_cook_cover.png"); + f->setTexture(1, "book_cook_cover.png^[transformFX"); + f->setTexture(2, "book_cook_side.png^[transformFY"); + f->setTexture(3, "book_cook_side.png"); + f->setTexture(4, "book_cook_end.png"); + f->setTexture(5, "book_cook_end.png^[transformFX"); f->param_type = CPT_LIGHT; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->rotate_tile_with_nodebox = true; f->light_propagates = true; f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_COOK_BOOK_OPEN; f->flammable = 1; - f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_BOOK)+" 1"; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->solidness = 0; - content_mapnode_nodebox_guide(f); - f->setInventoryTextureNodeBox(i, "craft_guide_top.png", "craft_guide_end.png", "craft_guide_side.png"); + content_mapnode_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_cook_cover.png", "book_cook_end.png^[transformFX", "book_cook_side.png^[transformFY"); f->type = CMT_DIRT; f->hardness = 1.0; - if (f->initial_metadata == NULL) - f->initial_metadata = new CraftGuideNodeMetadata(); + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_COAL,i); + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_CHARCOAL,i); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_DECRAFT_BOOK; + f = &content_features(i); + f->description = std::string("Decraft Book"); + f->setTexture(0, "book_decraft_cover.png"); + f->setTexture(1, "book_decraft_cover.png^[transformFX"); + f->setTexture(2, "book_decraft_side.png^[transformFY"); + f->setTexture(3, "book_decraft_side.png"); + f->setTexture(4, "book_decraft_end.png"); + f->setTexture(5, "book_decraft_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DECRAFT_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_decraft_cover.png", "book_decraft_end.png^[transformFX", "book_decraft_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_GUNPOWDER,i); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_DIARY_BOOK; + f = &content_features(i); + f->description = std::string("Diary"); + f->setTexture(0, "book_diary_cover.png"); + f->setTexture(1, "book_diary_cover.png^[transformFX"); + f->setTexture(2, "book_diary_side.png^[transformFY"); + f->setTexture(3, "book_diary_side.png"); + f->setTexture(4, "book_diary_end.png"); + f->setTexture(5, "book_diary_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DIARY_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_diary_cover.png", "book_diary_end.png^[transformFX", "book_diary_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_CRAFTITEM_STEEL_INGOT,i); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_CRAFT_BOOK; + f = &content_features(i); + f->description = std::string("Craft Book"); + f->setTexture(0, "book_craft_cover.png"); + f->setTexture(1, "book_craft_cover.png^[transformFX"); + f->setTexture(2, "book_craft_side.png^[transformFY"); + f->setTexture(3, "book_craft_side.png"); + f->setTexture(4, "book_craft_end.png"); + f->setTexture(5, "book_craft_end.png^[transformFX"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_CRAFT_BOOK_OPEN; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_book(f); + f->setInventoryTextureNodeBox(i, "book_craft_cover.png", "book_craft_end.png^[transformFX", "book_craft_side.png^[transformFY"); + f->type = CMT_DIRT; + f->hardness = 1.0; + crafting::set1Any2Recipe(CONTENT_BOOK,CONTENT_MESE,i); { content_t r[9] = { CONTENT_CRAFTITEM_STICK, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_IGNORE, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_CRAFTITEM_STICK, CONTENT_IGNORE, CONTENT_IGNORE }; - crafting::setRecipe(r,CONTENT_CRAFT_GUIDE,1); + crafting::setRecipe(r,CONTENT_CRAFT_BOOK,1); } lists::add("craftguide",i); lists::add("creative",i); + i = CONTENT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Guide"); + f->setAllTextures("guide_side.png"); + f->setTexture(0, "guide_top.png"); + f->setTexture(1, "guide_bottom.png"); + f->setTexture(4, "guide_end.png"); + f->setTexture(5, "guide_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_BOOK)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_top.png", "guide_end.png", "guide_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + + i = CONTENT_COOK_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Cooking Guide"); + f->setAllTextures("guide_cook_side.png"); + f->setTexture(0, "guide_cook_top.png"); + f->setTexture(1, "guide_cook_bottom.png"); + f->setTexture(4, "guide_cook_end.png"); + f->setTexture(5, "guide_cook_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_COOK_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COOK_BOOK)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_cook_top.png", "guide_cook_end.png", "guide_cook_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + + i = CONTENT_DECRAFT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Decrafting Guide"); + f->setAllTextures("guide_decraft_side.png"); + f->setTexture(0, "guide_decraft_top.png"); + f->setTexture(1, "guide_decraft_bottom.png"); + f->setTexture(4, "guide_decraft_end.png"); + f->setTexture(5, "guide_decraft_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DECRAFT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DECRAFT_BOOK)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_decraft_top.png", "guide_decraft_end.png", "guide_decraft_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + + i = CONTENT_DIARY_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Diary"); + f->setAllTextures("guide_diary_side.png"); + f->setTexture(0, "guide_diary_top.png"); + f->setTexture(1, "guide_diary_bottom.png"); + f->setTexture(4, "guide_diary_end.png"); + f->setTexture(5, "guide_diary_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_DIARY_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_DIARY_BOOK)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_diary_top.png", "guide_diary_end.png", "guide_diary_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + + i = CONTENT_CRAFT_BOOK_OPEN; + f = &content_features(i); + f->description = std::string("Craft Guide"); + f->setAllTextures("guide_craft_side.png"); + f->setTexture(0, "guide_craft_top.png"); + f->setTexture(1, "guide_craft_bottom.png"); + f->setTexture(4, "guide_craft_end.png"); + f->setTexture(5, "guide_craft_end.png"); + f->param_type = CPT_LIGHT; + f->param2_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_NODEBOX; + f->rotate_tile_with_nodebox = true; + f->light_propagates = true; + f->air_equivalent = true; + f->onpunch_replace_node = CONTENT_CRAFT_BOOK; + f->flammable = 1; + f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_BOOK)+" 1"; + f->solidness = 0; + content_mapnode_nodebox_guide(f); + f->setInventoryTextureNodeBox(i, "guide_craft_top.png", "guide_craft_end.png", "guide_craft_side.png"); + f->type = CMT_DIRT; + f->hardness = 1.0; + if (f->initial_metadata == NULL) + f->initial_metadata = new CraftGuideNodeMetadata(); + i = CONTENT_COTTON; f = &content_features(i); f->description = std::string("Cotton"); @@ -4398,6 +4600,8 @@ void content_mapnode_init() f->draw_type = CDT_SIGNLIKE; f->light_propagates = true; f->sunlight_propagates = true; + f->floormount_alternate_node = CONTENT_SIGN; + f->roofmount_alternate_node = CONTENT_SIGN_UD; f->solidness = 0; // drawn separately, makes no faces f->walkable = false; f->wall_mounted = true; @@ -4419,6 +4623,8 @@ void content_mapnode_init() f->param_type = CPT_LIGHT; f->light_propagates = true; f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_SIGN_WALL; + f->roofmount_alternate_node = CONTENT_SIGN_UD; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->solidness = 0; // drawn separately, makes no faces @@ -4461,6 +4667,8 @@ void content_mapnode_init() f->param_type = CPT_LIGHT; f->light_propagates = true; f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_SIGN_WALL; + f->floormount_alternate_node = CONTENT_SIGN; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->solidness = 0; // drawn separately, makes no faces @@ -4498,6 +4706,8 @@ void content_mapnode_init() f->draw_type = CDT_SIGNLIKE; f->light_propagates = true; f->sunlight_propagates = true; + f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; + f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; f->solidness = 0; // drawn separately, makes no faces f->walkable = false; f->wall_mounted = true; @@ -4519,6 +4729,8 @@ void content_mapnode_init() f->param_type = CPT_LIGHT; f->light_propagates = true; f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; + f->roofmount_alternate_node = CONTENT_LOCKABLE_SIGN_UD; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->solidness = 0; // drawn separately, makes no faces @@ -4559,6 +4771,8 @@ void content_mapnode_init() f->param_type = CPT_LIGHT; f->light_propagates = true; f->sunlight_propagates = true; + f->wallmount_alternate_node = CONTENT_LOCKABLE_SIGN_WALL; + f->floormount_alternate_node = CONTENT_LOCKABLE_SIGN; f->param2_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; f->solidness = 0; // drawn separately, makes no faces diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 5e1dec1..338709a 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -185,6 +185,16 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_ASH 0x8D0 #define CONTENT_GRASS_FOOTSTEPS 0x8D1 #define CONTENT_TRELLIS 0x8D2 +// books +#define CONTENT_BOOK 0x8D3 +#define CONTENT_COOK_BOOK 0x8D4 +#define CONTENT_DECRAFT_BOOK 0x8D5 +#define CONTENT_DIARY_BOOK 0x8D6 +// FREE 8D7-8D9 +#define CONTENT_BOOK_OPEN 0x8DA +#define CONTENT_COOK_BOOK_OPEN 0x8DB +#define CONTENT_DECRAFT_BOOK_OPEN 0x8DC +#define CONTENT_DIARY_BOOK_OPEN 0x8DD // FREE 8D3-8FF // glass pane #define CONTENT_GLASS_PANE 0x900 @@ -255,12 +265,13 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_FARM_TRELLIS_GRAPE_2 0x951 #define CONTENT_FARM_TRELLIS_GRAPE_3 0x952 #define CONTENT_FARM_TRELLIS_GRAPE 0x953 -// FREE 955-9FA +// FREE 954-9FA #define CONTENT_DEAD_VINE 0x9FB #define CONTENT_TRELLIS_DEAD_VINE 0x9FC #define CONTENT_FARM_PUMPKIN_JACK 0x9FD -#define CONTENT_BOOK 0x9FE -#define CONTENT_CRAFT_GUIDE 0x9FF +// books +#define CONTENT_CRAFT_BOOK 0x9FE +#define CONTENT_CRAFT_BOOK_OPEN 0x9FF // slabs #define CONTENT_ROUGHSTONE_SLAB 0xA00 diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 0282262..6c2ec4d 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -1042,7 +1042,7 @@ CraftGuideNodeMetadata::~CraftGuideNodeMetadata() } u16 CraftGuideNodeMetadata::typeId() const { - return CONTENT_CRAFT_GUIDE; + return CONTENT_CRAFT_BOOK_OPEN; } NodeMetadata* CraftGuideNodeMetadata::clone() { diff --git a/src/mapnode.h b/src/mapnode.h index 5783e09..2a7d0e4 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -226,6 +226,15 @@ struct ContentFeatures // when dug, this node will replace the dug node content_t ondig_replace_node; + // when punched, this node will replace the punched node + content_t onpunch_replace_node; + + // when placed against a wall, this node should be placed instead + content_t wallmount_alternate_node; + // when placed on the floor, this node should be placed instead + content_t floormount_alternate_node; + // when placed on the roof, this node should be placed instead + content_t roofmount_alternate_node; // the result of cooking this node std::string cook_result; @@ -305,6 +314,10 @@ struct ContentFeatures extra_dug_item = ""; extra_dug_item_rarity = 2; ondig_replace_node = CONTENT_IGNORE; + onpunch_replace_node = CONTENT_IGNORE; + wallmount_alternate_node = CONTENT_IGNORE; + floormount_alternate_node = CONTENT_IGNORE; + roofmount_alternate_node = CONTENT_IGNORE; cook_result = ""; fuel_time = 0.0; initial_metadata = NULL; diff --git a/src/server.cpp b/src/server.cpp index 3d29e96..c717f62 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2488,17 +2488,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) continue; client->SetBlocksNotSent(modified_blocks); } - }else if (n.getContent() == CONTENT_BOOK || n.getContent() == CONTENT_CRAFT_GUIDE) { - + }else if (content_features(n).onpunch_replace_node != CONTENT_IGNORE) { core::list far_players; core::map modified_blocks; - if (n.getContent() == CONTENT_CRAFT_GUIDE) { - m_env.getMap().removeNodeMetadata(p_under); - sendRemoveNode(p_under, 0, &far_players, 30); - n.setContent(CONTENT_BOOK); - }else{ - n.setContent(CONTENT_CRAFT_GUIDE); - } + m_env.getMap().removeNodeMetadata(p_under); + n.setContent(content_features(n).onpunch_replace_node); sendAddNode(p_under, n, 0, &far_players, 30); { MapEditEventIgnorer ign(&m_ignore_map_edit_events); @@ -2614,24 +2608,6 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } SendInventory(player->peer_id); } - }else if (n.getContent() == CONTENT_MESE) { - core::list far_players; - core::map modified_blocks; - n.setContent(CONTENT_MESE_DIGGING); - sendAddNode(p_under, n, 0, &far_players, 30); - { - MapEditEventIgnorer ign(&m_ignore_map_edit_events); - - std::string p_name = std::string(player->getName()); - m_env.getMap().addNodeAndUpdate(p_under, n, modified_blocks, p_name); - } - for(core::list::Iterator i = far_players.begin(); i != far_players.end(); i++) { - u16 peer_id = *i; - RemoteClient *client = getClient(peer_id); - if (client == NULL) - continue; - client->SetBlocksNotSent(modified_blocks); - } }else if (n.getContent() == CONTENT_INCINERATOR) { NodeMetadata *meta = m_env.getMap().getNodeMetadata(p_under); if (!meta) @@ -3513,21 +3489,18 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) n.setContent(content_features(n).slab_cube_type); p_over += p_dir; } - } - - // Signs? - if (n.getContent() == CONTENT_SIGN) { - if (p_dir.Y == 1) { - n.setContent(CONTENT_SIGN_UD); - }else if (p_dir.Y != -1) { - n.setContent(CONTENT_SIGN_WALL); - } - }else if (n.getContent() == CONTENT_LOCKABLE_SIGN) { - if (p_dir.Y == 1) { - n.setContent(CONTENT_LOCKABLE_SIGN_UD); - }else if (p_dir.Y != -1) { - n.setContent(CONTENT_LOCKABLE_SIGN_WALL); - } + // roof mount + }else if (p_dir.Y == 1) { + if (content_features(n).roofmount_alternate_node != CONTENT_IGNORE) + n.setContent(content_features(n).roofmount_alternate_node); + // floor mount + }else if (p_dir.Y == -1){ + if (content_features(n).floormount_alternate_node != CONTENT_IGNORE) + n.setContent(content_features(n).roofmount_alternate_node); + // wall mount + }else{ + if (content_features(n).wallmount_alternate_node != CONTENT_IGNORE) + n.setContent(content_features(n).roofmount_alternate_node); } // Calculate direction for wall mounted stuff