From 5f063ce97c462710a003c255b52c76a5ed74acc2 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Sun, 29 May 2011 19:08:59 +0200 Subject: + .gitignore --- .gitignore | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..64ebbef66 --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +map/* +CMakeFiles/* +src/CMakeFiles/* +src/Makefile +src/cmake_config.h +src/cmake_install.cmake +src/jthread/CMakeFiles/* +src/jthread/Makefile +src/jthread/cmake_config.h +src/jthread/cmake_install.cmake +minetest.conf +bin/ +CMakeCache.txt +CPackConfig.cmake +CPackSourceConfig.cmake +Makefile +cmake_install.cmake +src/jthread/libjthread.a +debug.txt -- cgit v1.2.3 From 289e31ed981371fa05bd02488e38e2d0f0f5effe Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Mon, 30 May 2011 14:42:08 +0200 Subject: + cactii --- data/cactus_side.png | Bin 0 -> 279 bytes data/cactus_top.png | Bin 0 -> 236 bytes src/map.cpp | 34 +++++++++++++++++++++++++++------- src/mapnode.cpp | 10 ++++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 1 + src/tile.cpp | 2 ++ 8 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 data/cactus_side.png create mode 100644 data/cactus_top.png diff --git a/data/cactus_side.png b/data/cactus_side.png new file mode 100644 index 000000000..fc479fde6 Binary files /dev/null and b/data/cactus_side.png differ diff --git a/data/cactus_top.png b/data/cactus_top.png new file mode 100644 index 000000000..f9e68df51 Binary files /dev/null and b/data/cactus_top.png differ diff --git a/src/map.cpp b/src/map.cpp index a49de3c46..c48599d47 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2045,6 +2045,20 @@ void make_tree(VoxelManipulator &vmanip, v3s16 p0) } } +void make_cactus(VoxelManipulator &vmanip, v3s16 p0) +{ + MapNode cactusnode(CONTENT_CACTUS); + + s16 trunk_h = 3; + v3s16 p1 = p0; + for(s16 ii=0; ii y_nodes_max - 6) continue; v3s16 p(x,y,z); - /* - Trees grow only on mud and grass - */ { u32 i = data->vmanip.m_area.index(v3s16(p)); MapNode *n = &data->vmanip.m_data[i]; - if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS) + if(n->d != CONTENT_MUD && n->d != CONTENT_GRASS && n->d != CONTENT_SAND) continue; + // Trees grow only on mud and grass + if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) + { + p.Y++; + make_tree(data->vmanip, p); + } + // Cactii grow only on sand + if(n->d == CONTENT_SAND) + { + p.Y++; + make_cactus(data->vmanip, p); + } } - p.Y++; - // Make a tree - make_tree(data->vmanip, p); } } /*u32 tree_max = relative_area / 60; diff --git a/src/mapnode.cpp b/src/mapnode.cpp index c006b8222..8ceeecfba 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -215,6 +215,16 @@ void init_mapnode() } f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_CACTUS; + f = &g_content_features[i]; + f->setAllTextures("cactus_side.png"); + f->setTexture(0, "cactus_top.png"); + f->setTexture(1, "cactus_top.png"); + f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_GLASS; f = &g_content_features[i]; f->light_propagates = true; diff --git a/src/mapnode.h b/src/mapnode.h index ad256585f..c4dcbfbe5 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -102,6 +102,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_GLASS 20 #define CONTENT_FENCE 21 #define CONTENT_SANDSTONE 22 +#define CONTENT_CACTUS 23 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 60c1894bf..a1d419562 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -73,6 +73,7 @@ void initializeMaterialProperties() setWoodLikeDiggingProperties(CONTENT_TREE, 1.0); setWoodLikeDiggingProperties(CONTENT_LEAVES, 0.15); + setWoodLikeDiggingProperties(CONTENT_CACTUS, 0.75); setWoodLikeDiggingProperties(CONTENT_GLASS, 0.15); setWoodLikeDiggingProperties(CONTENT_FENCE, 0.75); setWoodLikeDiggingProperties(CONTENT_WOOD, 0.75); diff --git a/src/server.cpp b/src/server.cpp index c7b64f413..994e62eaf 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4078,6 +4078,7 @@ void setCreativeInventory(Player *player) CONTENT_SANDSTONE, CONTENT_TREE, CONTENT_LEAVES, + CONTENT_CACTUS, CONTENT_GLASS, CONTENT_FENCE, CONTENT_MESE, diff --git a/src/tile.cpp b/src/tile.cpp index 8b0c3f2ea..2a2d2a70c 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -513,6 +513,8 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("tree_top.png"); sourcelist.push_back("water.png"); sourcelist.push_back("leaves.png"); + sourcelist.push_back("cactus_side.png"); + sourcelist.push_back("cactus_top.png"); sourcelist.push_back("glass.png"); sourcelist.push_back("mud.png^grass_side.png"); sourcelist.push_back("cobble.png"); -- cgit v1.2.3 From b461213ddbdb838f76f22ece59d1c64d1485b8ee Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 02:56:23 +0200 Subject: * improved fence dimensions (cuboid side lengths now multiples of 2, textures should fit better) --- src/mapblock.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mapblock.cpp b/src/mapblock.cpp index c448ef236..d98bfaf1e 100644 --- a/src/mapblock.cpp +++ b/src/mapblock.cpp @@ -1563,8 +1563,8 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) u8 l = decode_light(undiminish_light(n.getLightBlend(data->m_daynight_ratio))); video::SColor c(255,l,l,l); - const f32 post_rad=(f32)BS/10; - const f32 bar_rad=(f32)BS/20; + const f32 post_rad=(f32)BS/(32.0/4.0); + const f32 bar_rad=(f32)BS/(32.0/2.0); const f32 bar_len=(f32)(BS/2)-post_rad; // The post - always present @@ -1581,12 +1581,12 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.X += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_len,bar_rad,bar_rad); @@ -1600,11 +1600,11 @@ scene::SMesh* makeMapBlockMesh(MeshMakeData *data) { pos = intToFloat(p+blockpos_nodes, BS); pos.Z += BS/2; - pos.Y += BS/4; + pos.Y += 3*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); - pos.Y -= BS/2; + pos.Y -= 6*bar_rad; makeCuboid(material_wood, &collector, &pa_wood, c, pos, bar_rad,bar_rad,bar_len); -- cgit v1.2.3 From 6ca51de990f7b58001e1da93d949023cee697173 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 02:56:41 +0200 Subject: + fence inventory icon --- data/fence.png | Bin 0 -> 539 bytes src/mapnode.cpp | 1 + 2 files changed, 1 insertion(+) create mode 100644 data/fence.png diff --git a/data/fence.png b/data/fence.png new file mode 100644 index 000000000..0b99f0eb5 Binary files /dev/null and b/data/fence.png differ diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 8ceeecfba..cfb1a493f 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -236,6 +236,7 @@ void init_mapnode() i = CONTENT_FENCE; f = &g_content_features[i]; + f->setInventoryTexture("fence.png"); f->light_propagates = true; f->param_type = CPT_LIGHT; f->is_ground_content = true; -- cgit v1.2.3 From 8d580ddf29ef4c42ddbe36f48cf7fd5f06ad400b Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 20:52:20 +0200 Subject: * menulogo now shows minetest delta --- data/menulogo.png | Bin 498 -> 653 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/data/menulogo.png b/data/menulogo.png index 76595c48d..cb6983e5c 100644 Binary files a/data/menulogo.png and b/data/menulogo.png differ -- cgit v1.2.3 From d7b768dc4b94786474c35a6ae7ea2000d7e11626 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Tue, 31 May 2011 22:04:09 +0200 Subject: + brick --- data/brick.png | Bin 0 -> 604 bytes src/mapnode.cpp | 8 ++++++++ src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 1 + src/tile.cpp | 1 + 6 files changed, 12 insertions(+) create mode 100644 data/brick.png diff --git a/data/brick.png b/data/brick.png new file mode 100644 index 000000000..32d77f347 Binary files /dev/null and b/data/brick.png differ diff --git a/src/mapnode.cpp b/src/mapnode.cpp index cfb1a493f..72cd762c6 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -189,6 +189,14 @@ void init_mapnode() f->is_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1"; + i = CONTENT_BRICK; + f = &g_content_features[i]; + f->setAllTextures("brick.png"); + f->setInventoryTextureCube("brick.png", "brick.png", "brick.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + i = CONTENT_TREE; f = &g_content_features[i]; f->setAllTextures("tree.png"); diff --git a/src/mapnode.h b/src/mapnode.h index c4dcbfbe5..5022031de 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -103,6 +103,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_FENCE 21 #define CONTENT_SANDSTONE 22 #define CONTENT_CACTUS 23 +#define CONTENT_BRICK 24 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index a1d419562..0c744af9f 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -60,6 +60,7 @@ void initializeMaterialProperties() setStoneLikeDiggingProperties(CONTENT_STONE, 1.0); setStoneLikeDiggingProperties(CONTENT_SANDSTONE, 1.0); + setStoneLikeDiggingProperties(CONTENT_BRICK, 3.0); setStoneLikeDiggingProperties(CONTENT_MESE, 0.5); setStoneLikeDiggingProperties(CONTENT_COALSTONE, 1.5); setStoneLikeDiggingProperties(CONTENT_FURNACE, 3.0); diff --git a/src/server.cpp b/src/server.cpp index 994e62eaf..dfc05f7d3 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4076,6 +4076,7 @@ void setCreativeInventory(Player *player) CONTENT_STONE, CONTENT_SAND, CONTENT_SANDSTONE, + CONTENT_BRICK, CONTENT_TREE, CONTENT_LEAVES, CONTENT_CACTUS, diff --git a/src/tile.cpp b/src/tile.cpp index 2a2d2a70c..361de704c 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -507,6 +507,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("mud.png"); sourcelist.push_back("sand.png"); sourcelist.push_back("sandstone.png"); + sourcelist.push_back("brick.png"); sourcelist.push_back("grass.png"); sourcelist.push_back("grass_footsteps.png"); sourcelist.push_back("tree.png"); -- cgit v1.2.3 From ba1460a5822d38dc6617717fa5fec9b033bb0a29 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 04:57:46 +0200 Subject: + clay and associated items --- data/clay.png | Bin 0 -> 613 bytes data/clay_brick.png | Bin 0 -> 249 bytes data/lump_of_clay.png | Bin 0 -> 210 bytes src/inventory.cpp | 8 +++++++- src/map.cpp | 12 +++++++++++- src/mapnode.cpp | 10 +++++++++- src/mapnode.h | 1 + src/materials.cpp | 1 + src/server.cpp | 31 +++++++++++++++++++++++++++++++ src/tile.cpp | 1 + 10 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 data/clay.png create mode 100644 data/clay_brick.png create mode 100644 data/lump_of_clay.png diff --git a/data/clay.png b/data/clay.png new file mode 100644 index 000000000..3557429d8 Binary files /dev/null and b/data/clay.png differ diff --git a/data/clay_brick.png b/data/clay_brick.png new file mode 100644 index 000000000..e36648e48 Binary files /dev/null and b/data/clay_brick.png differ diff --git a/data/lump_of_clay.png b/data/lump_of_clay.png new file mode 100644 index 000000000..be0bab9d7 Binary files /dev/null and b/data/lump_of_clay.png differ diff --git a/src/inventory.cpp b/src/inventory.cpp index 47a8d4de9..3f83c7419 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -160,8 +160,12 @@ video::ITexture * CraftItem::getImage() name = "lump_of_coal.png"; else if(m_subname == "lump_of_iron") name = "lump_of_iron.png"; + else if(m_subname == "lump_of_clay") + name = "lump_of_clay.png"; else if(m_subname == "steel_ingot") name = "steel_ingot.png"; + else if(m_subname == "clay_brick") + name = "clay_brick.png"; else if(m_subname == "rat") name = "rat.png"; else @@ -199,7 +203,7 @@ u16 CraftItem::getDropCount() bool CraftItem::isCookable() { - if(m_subname == "lump_of_iron") + if(m_subname == "lump_of_iron" || m_subname == "lump_of_clay") { return true; } @@ -212,6 +216,8 @@ InventoryItem *CraftItem::createCookResult() { return new CraftItem("steel_ingot", 1); } + else if(m_subname == "lump_of_clay") + return new CraftItem("clay_brick", 1); return NULL; } diff --git a/src/map.cpp b/src/map.cpp index c48599d47..bf9f38c87 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3141,6 +3141,13 @@ void makeChunk(ChunkMakeData *data) if(have_sand == false) continue; + // Determine whether to have clay in the sand here + double claynoise = noise2d_perlin( + 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, + data->seed+4321, 8, 0.95); + + bool have_clay = have_sand && (claynoise > 0.95); + // Find ground level s16 surface_y = find_ground_level_clever(data->vmanip, p2d); @@ -3157,7 +3164,10 @@ void makeChunk(ChunkMakeData *data) MapNode *n = &data->vmanip.m_data[i]; if(n->d == CONTENT_MUD || n->d == CONTENT_GRASS) { - n->d = CONTENT_SAND; + if(have_clay && (surface_y == WATER_LEVEL)) + n->d = CONTENT_CLAY; + else + n->d = CONTENT_SAND; } else { diff --git a/src/mapnode.cpp b/src/mapnode.cpp index 72cd762c6..cef9bbf03 100644 --- a/src/mapnode.cpp +++ b/src/mapnode.cpp @@ -189,13 +189,21 @@ void init_mapnode() f->is_ground_content = true; f->dug_item = std::string("MaterialItem ")+itos(CONTENT_SAND)+" 1"; + i = CONTENT_CLAY; + f = &g_content_features[i]; + f->setAllTextures("clay.png"); + f->setInventoryTextureCube("clay.png", "clay.png", "clay.png"); + f->param_type = CPT_MINERAL; + f->is_ground_content = true; + f->dug_item = std::string("CraftItem lump_of_clay 4"); + i = CONTENT_BRICK; f = &g_content_features[i]; f->setAllTextures("brick.png"); f->setInventoryTextureCube("brick.png", "brick.png", "brick.png"); f->param_type = CPT_MINERAL; f->is_ground_content = true; - f->dug_item = std::string("MaterialItem ")+itos(i)+" 1"; + f->dug_item = std::string("CraftItem clay_brick 4"); i = CONTENT_TREE; f = &g_content_features[i]; diff --git a/src/mapnode.h b/src/mapnode.h index 5022031de..e8cc0ab51 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -104,6 +104,7 @@ void init_content_inventory_texture_paths(); #define CONTENT_SANDSTONE 22 #define CONTENT_CACTUS 23 #define CONTENT_BRICK 24 +#define CONTENT_CLAY 25 /* Content feature list diff --git a/src/materials.cpp b/src/materials.cpp index 0c744af9f..8c23056f2 100644 --- a/src/materials.cpp +++ b/src/materials.cpp @@ -71,6 +71,7 @@ void initializeMaterialProperties() setDirtLikeDiggingProperties(CONTENT_GRASS, 1.0); setDirtLikeDiggingProperties(CONTENT_GRASS_FOOTSTEPS, 1.0); setDirtLikeDiggingProperties(CONTENT_SAND, 1.0); + setDirtLikeDiggingProperties(CONTENT_CLAY, 1.0); setWoodLikeDiggingProperties(CONTENT_TREE, 1.0); setWoodLikeDiggingProperties(CONTENT_LEAVES, 0.15); diff --git a/src/server.cpp b/src/server.cpp index dfc05f7d3..17850c5fa 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -3987,6 +3987,36 @@ void Server::UpdateCrafting(u16 peer_id) found = true; } } + + // Clay + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_CLAY, 1)); + found = true; + } + } + + // Brick + if(!found) + { + ItemSpec specs[9]; + specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick"); + specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick"); + if(checkItemCombination(items, specs)) + { + rlist->addItem(new MaterialItem(CONTENT_BRICK, 1)); + found = true; + } + } } } // if creative_mode == false @@ -4076,6 +4106,7 @@ void setCreativeInventory(Player *player) CONTENT_STONE, CONTENT_SAND, CONTENT_SANDSTONE, + CONTENT_CLAY, CONTENT_BRICK, CONTENT_TREE, CONTENT_LEAVES, diff --git a/src/tile.cpp b/src/tile.cpp index 361de704c..71e0c9638 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -507,6 +507,7 @@ void TextureSource::buildMainAtlas() sourcelist.push_back("mud.png"); sourcelist.push_back("sand.png"); sourcelist.push_back("sandstone.png"); + sourcelist.push_back("clay.png"); sourcelist.push_back("brick.png"); sourcelist.push_back("grass.png"); sourcelist.push_back("grass_footsteps.png"); -- cgit v1.2.3 From 5f52a622b6a2602742ea472c1163eba2acf17fb6 Mon Sep 17 00:00:00 2001 From: Nils Dagsson Moskopp Date: Wed, 1 Jun 2011 08:09:28 +0200 Subject: * clay is rarer now --- src/map.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map.cpp b/src/map.cpp index bf9f38c87..ac5bd7d14 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -3144,9 +3144,9 @@ void makeChunk(ChunkMakeData *data) // Determine whether to have clay in the sand here double claynoise = noise2d_perlin( 0.5+(float)p2d.X/500, 0.5+(float)p2d.Y/500, - data->seed+4321, 8, 0.95); + data->seed+4321, 6, 0.95); - bool have_clay = have_sand && (claynoise > 0.95); + bool have_clay = have_sand && (claynoise > 1.25); // Find ground level s16 surface_y = find_ground_level_clever(data->vmanip, p2d); -- cgit v1.2.3