diff --git a/data/textures/charcoal.png b/data/textures/charcoal.png new file mode 100644 index 0000000..b7e8254 Binary files /dev/null and b/data/textures/charcoal.png differ diff --git a/data/textures/coal.png b/data/textures/coal.png new file mode 100644 index 0000000..e866ccc Binary files /dev/null and b/data/textures/coal.png differ diff --git a/data/textures/copper_block.png b/data/textures/copper_block.png new file mode 100644 index 0000000..c8cdeea Binary files /dev/null and b/data/textures/copper_block.png differ diff --git a/data/textures/copper_ingot.png b/data/textures/copper_ingot.png new file mode 100644 index 0000000..0c8ba11 Binary files /dev/null and b/data/textures/copper_ingot.png differ diff --git a/data/textures/fire.png b/data/textures/fire.png new file mode 100644 index 0000000..a5c2afd Binary files /dev/null and b/data/textures/fire.png differ diff --git a/data/textures/gate_steel_inv.png b/data/textures/gate_steel_inv.png new file mode 100644 index 0000000..d56c76c Binary files /dev/null and b/data/textures/gate_steel_inv.png differ diff --git a/data/textures/gate_wood_inv.png b/data/textures/gate_wood_inv.png new file mode 100644 index 0000000..f27ce52 Binary files /dev/null and b/data/textures/gate_wood_inv.png differ diff --git a/data/textures/glass_black.png b/data/textures/glass_black.png new file mode 100644 index 0000000..84cdaec Binary files /dev/null and b/data/textures/glass_black.png differ diff --git a/data/textures/glass_blue.png b/data/textures/glass_blue.png new file mode 100644 index 0000000..f882d42 Binary files /dev/null and b/data/textures/glass_blue.png differ diff --git a/data/textures/glass_green.png b/data/textures/glass_green.png new file mode 100644 index 0000000..8f974a9 Binary files /dev/null and b/data/textures/glass_green.png differ diff --git a/data/textures/glass_orange.png b/data/textures/glass_orange.png new file mode 100644 index 0000000..1e8fcdb Binary files /dev/null and b/data/textures/glass_orange.png differ diff --git a/data/textures/glass_purple.png b/data/textures/glass_purple.png new file mode 100644 index 0000000..3f9e722 Binary files /dev/null and b/data/textures/glass_purple.png differ diff --git a/data/textures/glass_red.png b/data/textures/glass_red.png new file mode 100644 index 0000000..33fdf70 Binary files /dev/null and b/data/textures/glass_red.png differ diff --git a/data/textures/glass_yellow.png b/data/textures/glass_yellow.png new file mode 100644 index 0000000..1b7a192 Binary files /dev/null and b/data/textures/glass_yellow.png differ diff --git a/data/textures/gold_block.png b/data/textures/gold_block.png new file mode 100644 index 0000000..84dec28 Binary files /dev/null and b/data/textures/gold_block.png differ diff --git a/data/textures/gold_ingot.png b/data/textures/gold_ingot.png new file mode 100644 index 0000000..fa1de15 Binary files /dev/null and b/data/textures/gold_ingot.png differ diff --git a/data/textures/gunpowder.png b/data/textures/gunpowder.png new file mode 100644 index 0000000..612311c Binary files /dev/null and b/data/textures/gunpowder.png differ diff --git a/data/textures/lump_of_charcoal.png b/data/textures/lump_of_charcoal.png new file mode 100644 index 0000000..1a96c18 Binary files /dev/null and b/data/textures/lump_of_charcoal.png differ diff --git a/data/textures/lump_of_copper.png b/data/textures/lump_of_copper.png new file mode 100644 index 0000000..de03dcd Binary files /dev/null and b/data/textures/lump_of_copper.png differ diff --git a/data/textures/lump_of_flint.png b/data/textures/lump_of_flint.png new file mode 100644 index 0000000..9b4824c Binary files /dev/null and b/data/textures/lump_of_flint.png differ diff --git a/data/textures/lump_of_gold.png b/data/textures/lump_of_gold.png new file mode 100644 index 0000000..432ba8b Binary files /dev/null and b/data/textures/lump_of_gold.png differ diff --git a/data/textures/lump_of_quartz.png b/data/textures/lump_of_quartz.png new file mode 100644 index 0000000..ae2f4bb Binary files /dev/null and b/data/textures/lump_of_quartz.png differ diff --git a/data/textures/lump_of_silver.png b/data/textures/lump_of_silver.png new file mode 100644 index 0000000..5093d9f Binary files /dev/null and b/data/textures/lump_of_silver.png differ diff --git a/data/textures/lump_of_tin.png b/data/textures/lump_of_tin.png new file mode 100644 index 0000000..0d815aa Binary files /dev/null and b/data/textures/lump_of_tin.png differ diff --git a/data/textures/mineral_copper.png b/data/textures/mineral_copper.png new file mode 100644 index 0000000..43cdb11 Binary files /dev/null and b/data/textures/mineral_copper.png differ diff --git a/data/textures/mineral_gold.png b/data/textures/mineral_gold.png new file mode 100644 index 0000000..e110b43 Binary files /dev/null and b/data/textures/mineral_gold.png differ diff --git a/data/textures/mineral_quartz.png b/data/textures/mineral_quartz.png new file mode 100644 index 0000000..bf7630a Binary files /dev/null and b/data/textures/mineral_quartz.png differ diff --git a/data/textures/mineral_silver.png b/data/textures/mineral_silver.png new file mode 100644 index 0000000..a81e73f Binary files /dev/null and b/data/textures/mineral_silver.png differ diff --git a/data/textures/mineral_tin.png b/data/textures/mineral_tin.png new file mode 100644 index 0000000..591920c Binary files /dev/null and b/data/textures/mineral_tin.png differ diff --git a/data/textures/quartz_block.png b/data/textures/quartz_block.png new file mode 100644 index 0000000..dc9b2c5 Binary files /dev/null and b/data/textures/quartz_block.png differ diff --git a/data/textures/quartz_dust.png b/data/textures/quartz_dust.png new file mode 100644 index 0000000..f558a3f Binary files /dev/null and b/data/textures/quartz_dust.png differ diff --git a/data/textures/saltpeter.png b/data/textures/saltpeter.png new file mode 100644 index 0000000..947e3db Binary files /dev/null and b/data/textures/saltpeter.png differ diff --git a/data/textures/silver_block.png b/data/textures/silver_block.png new file mode 100644 index 0000000..e0ad5df Binary files /dev/null and b/data/textures/silver_block.png differ diff --git a/data/textures/silver_ingot.png b/data/textures/silver_ingot.png new file mode 100644 index 0000000..d07fdaa Binary files /dev/null and b/data/textures/silver_ingot.png differ diff --git a/data/textures/tin_block.png b/data/textures/tin_block.png new file mode 100644 index 0000000..e28c371 Binary files /dev/null and b/data/textures/tin_block.png differ diff --git a/data/textures/tin_ingot.png b/data/textures/tin_ingot.png new file mode 100644 index 0000000..b56279f Binary files /dev/null and b/data/textures/tin_ingot.png differ diff --git a/data/textures/tnt.png b/data/textures/tnt.png new file mode 100644 index 0000000..d9a2bc4 Binary files /dev/null and b/data/textures/tnt.png differ diff --git a/data/textures/tnt_bottom.png b/data/textures/tnt_bottom.png new file mode 100644 index 0000000..8ba2fca Binary files /dev/null and b/data/textures/tnt_bottom.png differ diff --git a/data/textures/tnt_top.png b/data/textures/tnt_top.png new file mode 100644 index 0000000..a84ffc9 Binary files /dev/null and b/data/textures/tnt_top.png differ diff --git a/data/textures/tool_fire_starter.png b/data/textures/tool_fire_starter.png new file mode 100644 index 0000000..6416634 Binary files /dev/null and b/data/textures/tool_fire_starter.png differ diff --git a/src/content_craft.cpp b/src/content_craft.cpp index a6266d4..ef1aa15 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_mapnode.h" #include "player.h" #include "mapnode.h" // For content_t +#include "settings.h" // for g_settings struct CraftDef { ItemSpec specs[9]; @@ -107,7 +108,7 @@ struct CraftDef { */ InventoryItem *craft_get_result(InventoryItem **items) { - static CraftDef defs[135]; + static CraftDef defs[174]; static int defs_init = 0; // only initialise (and hence allocate) these once @@ -431,6 +432,116 @@ InventoryItem *craft_get_result(InventoryItem **items) defs_init++; } + // copper block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "copper_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_COPPER, 1); + defs_init++; + } + + // Uncrafted Copper block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COPPER); + defs[defs_init].item = new CraftItem("copper_ingot", 9); + defs_init++; + } + + // gold block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "gold_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_GOLD, 1); + defs_init++; + } + + // Uncrafted gold block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_GOLD); + defs[defs_init].item = new CraftItem("gold_ingot", 9); + defs_init++; + } + + // silver block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "silver_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_SILVER, 1); + defs_init++; + } + + // Uncrafted silver block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_SILVER); + defs[defs_init].item = new CraftItem("silver_ingot", 9); + defs_init++; + } + + // tin block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].item = new MaterialItem(CONTENT_TIN, 1); + defs_init++; + } + + // Uncrafted tin block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_TIN); + defs[defs_init].item = new CraftItem("tin_ingot", 9); + defs_init++; + } + + // quartz block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].item = new MaterialItem(CONTENT_QUARTZ, 1); + defs_init++; + } + + // Uncrafted quartz block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_QUARTZ); + defs[defs_init].item = new CraftItem("lump_of_quartz", 9); + defs_init++; + } + // Sandstone { defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); @@ -1249,6 +1360,17 @@ InventoryItem *craft_get_result(InventoryItem **items) defs_init++; } + // Tin bucket + { + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "tin_ingot"); + defs[defs_init].item = new ToolItem("TinBucket", 0); + defs_init++; + } + // Cobble wall { defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE); @@ -1438,6 +1560,251 @@ InventoryItem *craft_get_result(InventoryItem **items) defs[defs_init].item = new MaterialItem(CONTENT_CLAY_BLACK, 1); defs_init++; } + + // blue glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_blue"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_BLUE, 1); + defs_init++; + } + + // green glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_green"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_GREEN, 1); + defs_init++; + } + + // orange glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_orange"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_ORANGE, 1); + defs_init++; + } + + // purple glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_purple"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_PURPLE, 1); + defs_init++; + } + + // red glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_red"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_RED, 1); + defs_init++; + } + + // yellow glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_yellow"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_YELLOW, 1); + defs_init++; + } + + // black glass + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_black"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_GLASS); + defs[defs_init].item = new MaterialItem(CONTENT_GLASS_BLACK, 1); + defs_init++; + } + + // Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET, 3); + defs_init++; + } + + // blue Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLUE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLUE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLUE, 3); + defs_init++; + } + + // blue Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_blue"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLUE, 1); + defs_init++; + } + + // green Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_GREEN); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_GREEN); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_GREEN, 3); + defs_init++; + } + + // green Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_green"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_GREEN, 1); + defs_init++; + } + + // orange Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_ORANGE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_ORANGE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_ORANGE, 3); + defs_init++; + } + + // orange Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_orange"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_ORANGE, 1); + defs_init++; + } + + // purple Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_PURPLE); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_PURPLE); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_PURPLE, 3); + defs_init++; + } + + // purple Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_purple"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_PURPLE, 1); + defs_init++; + } + + // red Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_RED); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_RED); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_RED, 3); + defs_init++; + } + + // red Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_red"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_RED, 1); + defs_init++; + } + + // yellow Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_YELLOW); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_YELLOW); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_YELLOW, 3); + defs_init++; + } + + // yellow Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_yellow"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_YELLOW, 1); + defs_init++; + } + + // black Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLACK); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COTTON_BLACK); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLACK, 3); + defs_init++; + } + + // black Carpet + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "dye_black"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_CARPET); + defs[defs_init].item = new MaterialItem(CONTENT_CARPET_BLACK, 1); + defs_init++; + } + + // Coal block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_coal"); + defs[defs_init].item = new MaterialItem(CONTENT_COAL, 1); + defs_init++; + } + + // Charoal block + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[1] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[5] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].item = new MaterialItem(CONTENT_CHARCOAL, 1); + defs_init++; + } + + // fire starter + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_flint"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot"); + defs[defs_init].item = new ToolItem("FireStarter", 0); + defs_init++; + } + + // quartz dust + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_quartz"); + defs[defs_init].item = new CraftItem("quartz_dust", 1); + defs_init++; + } + + // gun powder + { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_charcoal"); + defs[defs_init].specs[3] = ItemSpec(ITEM_CRAFT, "saltpeter"); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_flint"); + defs[defs_init].item = new CraftItem("gunpowder", 2); + defs_init++; + } + + // tnt + if (g_settings->getBool("enable_tnt")) { + defs[defs_init].specs[0] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[2] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[4] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[6] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND); + defs[defs_init].specs[8] = ItemSpec(ITEM_CRAFT, "gunpowder"); + defs[defs_init].item = new MaterialItem(CONTENT_TNT, 1); + defs_init++; + } } for (int i=0; isetNodeBox(core::aabbox3d( + -0.5*BS, + -0.5*BS, + -0.5*BS, + 0.5*BS, + -0.4*BS, + 0.5*BS + )); +} + /* A conversion table for backwards compatibility. Maps <=v19 content types to current ones. @@ -666,6 +678,30 @@ void content_mapnode_init() if(invisible_stone) f->solidness = 0; // For debugging, hides regular stone + i = CONTENT_COAL; + f = &content_features(i); + f->description = std::string("Coal Block"); + f->setAllTextures("coal.png"); + f->setInventoryTextureCube("coal.png", "coal.png", "coal.png"); + f->param_type = CPT_MINERAL; + 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"; + setStoneLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CHARCOAL; + f = &content_features(i); + f->description = std::string("Charcoal Block"); + f->setAllTextures("charcoal.png"); + f->setInventoryTextureCube("charcoal.png", "charcoal.png", "charcoal.png"); + f->param_type = CPT_MINERAL; + 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"; + setStoneLikeDiggingProperties(f->digging_properties, 1.0); + i = CONTENT_STONEBRICK; f = &content_features(i); f->description = std::string("Stone Brick"); @@ -741,6 +777,8 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->extra_dug_item = std::string("CraftItem lump_of_flint 1"); + f->extra_dug_item_rarity = 10; setDirtLikeDiggingProperties(f->digging_properties, 1.75); i = CONTENT_SANDSTONE; @@ -943,6 +981,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; 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"; setWoodLikeDiggingProperties(f->digging_properties, 1.0); @@ -956,6 +995,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; 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"; setWoodLikeDiggingProperties(f->digging_properties, 1.0); @@ -973,6 +1013,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_LEAVES; @@ -987,11 +1028,15 @@ void content_mapnode_init() 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->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"; @@ -1007,11 +1052,15 @@ void content_mapnode_init() 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->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setLeafLikeDiggingProperties(f->digging_properties, 0.15); @@ -1025,6 +1074,7 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; + 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"; setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -1041,6 +1091,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.25); i = CONTENT_BOOKSHELF; @@ -1053,10 +1104,12 @@ void content_mapnode_init() f->param_type = CPT_MINERAL; f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_GLASS; f = &content_features(i); + f->description = std::string("Glass"); f->light_propagates = true; f->sunlight_propagates = true; f->param_type = CPT_LIGHT; @@ -1066,9 +1119,138 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->visual_solidness = 1; f->setAllTextures("glass.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif f->setInventoryTextureCube("glass.png", "glass.png", "glass.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.15); + i = CONTENT_GLASS_BLUE; + f = &content_features(i); + f->description = std::string("Blue Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_blue.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_blue.png", "glass_blue.png", "glass_blue.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_GREEN; + f = &content_features(i); + f->description = std::string("Green Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_green.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_green.png", "glass_green.png", "glass_green.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_orange.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_orange.png", "glass_orange.png", "glass_orange.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_purple.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_purple.png", "glass_purple.png", "glass_purple.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_RED; + f = &content_features(i); + f->description = std::string("Red Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_red.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_red.png", "glass_red.png", "glass_red.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_yellow.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_yellow.png", "glass_yellow.png", "glass_yellow.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + + i = CONTENT_GLASS_BLACK; + f = &content_features(i); + f->description = std::string("Black Glass"); + f->light_propagates = true; + f->sunlight_propagates = true; + f->param_type = CPT_LIGHT; + f->draw_type = CDT_GLASSLIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->solidness = 0; // drawn separately, makes no faces + f->visual_solidness = 1; + f->setAllTextures("glass_black.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif + f->setInventoryTextureCube("glass_black.png", "glass_black.png", "glass_black.png"); + setWoodLikeDiggingProperties(f->digging_properties, 0.15); + i = CONTENT_GLASSLIGHT; f = &content_features(i); f->description = std::string("Glass Light"); @@ -1081,6 +1263,9 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->visual_solidness = 1; f->setAllTextures("glasslight.png"); +#ifndef SERVER + f->setAllTextureTypes(MATERIAL_ALPHA_BLEND); +#endif f->setInventoryTextureCube("glasslight.png", "glasslight.png", "glasslight.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.15); f->light_source = LIGHT_MAX-1; @@ -1098,6 +1283,7 @@ void content_mapnode_init() f->air_equivalent = true; // grass grows underneath f->setInventoryTexture("fence.png"); f->used_texturenames["fence.png"] = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_RAIL; @@ -1130,6 +1316,7 @@ void content_mapnode_init() f->air_equivalent = true; f->walkable = false; f->climbable = true; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.5); i = CONTENT_BORDERSTONE; @@ -1152,6 +1339,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLEWOOD; @@ -1162,6 +1350,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_MESE; @@ -1174,17 +1363,6 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setStoneLikeDiggingProperties(f->digging_properties, 0.5); - i = CONTENT_COTTON; - f = &content_features(i); - f->description = std::string("Cotton"); - f->setAllTextures("cotton.png"); - f->setInventoryTextureCube("cotton.png", "cotton.png", "cotton.png"); - f->param_type = CPT_MINERAL; - f->draw_type = CDT_CUBELIKE; - f->is_ground_content = true; - f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; - setDirtLikeDiggingProperties(f->digging_properties, 1.0); - i = CONTENT_SPONGE; f = &content_features(i); f->description = std::string("Sponge"); @@ -1194,6 +1372,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_SPONGE_FULL; @@ -1220,6 +1399,18 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setLeafLikeDiggingProperties(f->digging_properties, 0.6); + i = CONTENT_COTTON; + f = &content_features(i); + f->description = std::string("Cotton"); + f->setAllTextures("cotton.png"); + f->setInventoryTextureCube("cotton.png", "cotton.png", "cotton.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + i = CONTENT_COTTON_BLUE; f = &content_features(i); f->description = std::string("Blue Cotton"); @@ -1229,6 +1420,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_GREEN; @@ -1240,6 +1432,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_ORANGE; @@ -1251,6 +1444,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_PURPLE; @@ -1262,6 +1456,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_RED; @@ -1273,6 +1468,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_YELLOW; @@ -1284,6 +1480,7 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_COTTON_BLACK; @@ -1295,6 +1492,119 @@ void content_mapnode_init() f->draw_type = CDT_CUBELIKE; f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET; + f = &content_features(i); + f->description = std::string("Carpet"); + f->setAllTextures("cotton.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton.png", "cotton.png", "cotton.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_BLUE; + f = &content_features(i); + f->description = std::string("Blue Carpet"); + f->setAllTextures("cotton_blue.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_blue.png", "cotton_blue.png", "cotton_blue.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_GREEN; + f = &content_features(i); + f->description = std::string("Green Carpet"); + f->setAllTextures("cotton_green.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_green.png", "cotton_green.png", "cotton_green.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_ORANGE; + f = &content_features(i); + f->description = std::string("Orange Carpet"); + f->setAllTextures("cotton_orange.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_orange.png", "cotton_orange.png", "cotton_orange.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_PURPLE; + f = &content_features(i); + f->description = std::string("Purple Carpet"); + f->setAllTextures("cotton_purple.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_purple.png", "cotton_purple.png", "cotton_purple.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_RED; + f = &content_features(i); + f->description = std::string("Red Carpet"); + f->setAllTextures("cotton_red.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_red.png", "cotton_red.png", "cotton_red.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_YELLOW; + f = &content_features(i); + f->description = std::string("Yellow Carpet"); + f->setAllTextures("cotton_yellow.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_yellow.png", "cotton_yellow.png", "cotton_yellow.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + + i = CONTENT_CARPET_BLACK; + f = &content_features(i); + f->description = std::string("Black Carpet"); + f->setAllTextures("cotton_black.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_NODEBOX; + f->is_ground_content = true; + f->solidness = 0; // drawn separately, makes no faces + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + content_mapnode_nodebox_carpet(f); + f->setInventoryTextureNodeBox(i,"cotton_black.png", "cotton_black.png", "cotton_black.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setDirtLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_AIR; @@ -1428,6 +1738,7 @@ void content_mapnode_init() f->pointable = false; f->diggable = false; f->buildable_to = true; + f->flammable = 2; // can be set on fire f->liquid_type = LIQUID_FLOWING; f->liquid_alternative_flowing = CONTENT_LAVA; f->liquid_alternative_source = CONTENT_LAVASOURCE; @@ -1490,6 +1801,7 @@ void content_mapnode_init() f->pointable = false; //f->diggable = false; f->buildable_to = true; + f->flammable = 2; // can be set on fire f->liquid_type = LIQUID_SOURCE; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->liquid_alternative_flowing = CONTENT_LAVA; @@ -1517,6 +1829,44 @@ void content_mapnode_init() #endif setWaterLikeDiggingProperties(f->digging_properties, 0.5); + i = CONTENT_FIRE; + f = &content_features(i); + f->description = std::string("Fire"); + f->setAllTextures("fire.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->light_propagates = true; + f->light_source = LIGHT_MAX-1; + f->solidness = 0; // Drawn separately, makes no faces + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 4*2; +#ifndef SERVER + f->post_effect_color = video::SColor(192, 255, 64, 0); +#endif + + i = CONTENT_FIRE_SHORTTERM; + f = &content_features(i); + f->description = std::string("Fire"); + f->setAllTextures("fire.png"); + f->setAllTextureFlags(0); + f->param_type = CPT_LIGHT; + f->draw_type = CDT_PLANTLIKE; + f->light_propagates = true; + f->light_source = LIGHT_MAX-1; + f->solidness = 0; // Drawn separately, makes no faces + f->walkable = false; + f->pointable = false; + f->diggable = false; + f->buildable_to = true; + f->damage_per_second = 4*2; +#ifndef SERVER + f->post_effect_color = video::SColor(192, 255, 64, 0); +#endif + i = CONTENT_TORCH; f = &content_features(i); f->description = std::string("Torch"); @@ -1530,6 +1880,7 @@ void content_mapnode_init() f->walkable = false; f->wall_mounted = true; f->air_equivalent = true; + 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->light_source = LIGHT_MAX-1; f->digging_properties.set("", DiggingProperties(true, 0.0, 0)); @@ -1547,6 +1898,7 @@ void content_mapnode_init() f->walkable = false; f->wall_mounted = true; f->air_equivalent = true; + 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"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1562,6 +1914,7 @@ void content_mapnode_init() f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; 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->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN_WALL)+" 1"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1593,6 +1946,7 @@ void content_mapnode_init() f->param_type = CPT_FACEDIR_SIMPLE; f->draw_type = CDT_NODEBOX; 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->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SIGN_WALL)+" 1"; if(f->initial_metadata == NULL) f->initial_metadata = new SignNodeMetadata("Some sign"); @@ -1692,6 +2046,61 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; setStoneLikeDiggingProperties(f->digging_properties, 5.0); + i = CONTENT_COPPER; + f = &content_features(i); + f->description = std::string("Copper Block"); + f->setAllTextures("copper_block.png"); + f->setInventoryTextureCube("copper_block.png", "copper_block.png", "copper_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_GOLD; + f = &content_features(i); + f->description = std::string("Gold Block"); + f->setAllTextures("gold_block.png"); + f->setInventoryTextureCube("gold_block.png", "gold_block.png", "gold_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_SILVER; + f = &content_features(i); + f->description = std::string("Silver Block"); + f->setAllTextures("silver_block.png"); + f->setInventoryTextureCube("silver_block.png", "silver_block.png", "silver_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_TIN; + f = &content_features(i); + f->description = std::string("Tin Block"); + f->setAllTextures("tin_block.png"); + f->setInventoryTextureCube("tin_block.png", "tin_block.png", "tin_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + + i = CONTENT_QUARTZ; + f = &content_features(i); + f->description = std::string("Quartz Block"); + f->setAllTextures("quartz_block.png"); + f->setInventoryTextureCube("quartz_block.png", "quartz_block.png", "quartz_block.png"); + f->param_type = CPT_NONE; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + setStoneLikeDiggingProperties(f->digging_properties, 5.0); + i = CONTENT_NC; f = &content_features(i); f->description = std::string("Nyan Cat"); @@ -1726,6 +2135,7 @@ void content_mapnode_init() 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->digging_properties.set("", DiggingProperties(true, 0.0, 0)); i = CONTENT_APPLE; @@ -1733,6 +2143,7 @@ void content_mapnode_init() 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; @@ -1740,6 +2151,7 @@ void content_mapnode_init() 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->dug_item = std::string("CraftItem apple 1"); f->digging_properties.set("", DiggingProperties(true, 0.0, 0)); @@ -1797,6 +2209,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_WOOD; content_mapnode_nodebox_slab(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_SLAB; @@ -1811,6 +2224,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_JUNGLEWOOD; content_mapnode_nodebox_slab(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_SLAB; @@ -1891,6 +2305,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_WOOD; content_mapnode_nodebox_slabud(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_SLAB_UD; @@ -1904,6 +2319,7 @@ void content_mapnode_init() f->slab_cube_type = CONTENT_JUNGLEWOOD; content_mapnode_nodebox_slabud(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_SLAB_UD; @@ -1984,6 +2400,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; content_mapnode_nodebox_stair(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_STAIR; @@ -1997,6 +2414,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; content_mapnode_nodebox_stair(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_STAIR; @@ -2072,6 +2490,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_STAIR)+" 1"; content_mapnode_nodebox_stairud(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_JUNGLE_STAIR_UD; @@ -2084,6 +2503,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_JUNGLE_STAIR)+" 1"; content_mapnode_nodebox_stairud(f); f->setInventoryTextureNodeBox(i,"junglewood.png", "junglewood.png", "junglewood.png"); + f->flammable = 1; // can be replaced by fire if the node under it is set on fire setWoodLikeDiggingProperties(f->digging_properties, 1.0); i = CONTENT_BRICK_STAIR_UD; @@ -2125,6 +2545,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_LT; @@ -2141,6 +2562,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2195,6 +2617,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_LT; @@ -2211,6 +2634,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2266,6 +2690,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_RT; @@ -2282,6 +2707,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2336,6 +2762,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_door(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_RT; @@ -2352,6 +2779,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2405,6 +2833,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_LT_OPEN; @@ -2419,6 +2848,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2467,6 +2897,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_LT_OPEN; @@ -2481,6 +2912,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_LT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorwol(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2532,6 +2964,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_DOOR_RT_OPEN; @@ -2548,6 +2981,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); f->setInventoryTextureNodeBox(i,"wood.png", "wood.png", "wood.png"); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2603,6 +3037,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_dooror(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); i = CONTENT_WOOD_W_DOOR_RT_OPEN; @@ -2619,6 +3054,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_DOOR_RT)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_doorwor(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2672,6 +3108,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatch(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2704,6 +3141,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatchw(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2737,6 +3175,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_gate(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2772,6 +3211,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->climbable = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_HATCH)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatcho(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2808,6 +3248,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->climbable = true; f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WOOD_W_HATCH)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_hatchwo(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2843,6 +3284,7 @@ void content_mapnode_init() f->solidness = 0; // drawn separately, makes no faces f->is_ground_content = true; f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + f->flammable = 1; // can be replaced by fire if the node under it is set on fire content_mapnode_nodebox_gateo(f); setWoodLikeDiggingProperties(f->digging_properties, 0.75); @@ -2877,6 +3319,7 @@ void content_mapnode_init() 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->pointable = false; //f->buildable_to = true; setWoodLikeDiggingProperties(f->digging_properties, 0.10); @@ -2894,6 +3337,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_WILDGRASS_SHORT)+" 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_DEADGRASS; @@ -2908,6 +3352,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_STEM; @@ -2922,6 +3367,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_ROSE; @@ -2936,6 +3382,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_DAFFODIL; @@ -2950,6 +3397,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_TULIP; @@ -2964,6 +3412,7 @@ void content_mapnode_init() 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 setWoodLikeDiggingProperties(f->digging_properties, 0.10); i = CONTENT_FLOWER_POT_RAW; @@ -3129,6 +3578,21 @@ void content_mapnode_init() f->setInventoryTexture("sandstone_wall_inv.png"); setDirtLikeDiggingProperties(f->digging_properties, 1.0); + i = CONTENT_TNT; + f = &content_features(i); + f->description = std::string("TNT"); + f->setAllTextures("tnt.png"); + f->setTexture(0, "tnt_top.png"); + f->setTexture(1, "tnt_bottom.png"); + f->setInventoryTextureCube("tnt_top.png", "tnt.png", "tnt.png"); + f->param_type = CPT_MINERAL; + f->draw_type = CDT_CUBELIKE; + f->is_ground_content = true; + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new TNTNodeMetadata(); + setDirtLikeDiggingProperties(f->digging_properties, 1.0); + // NOTE: Remember to add frequently used stuff to the texture atlas in tile.cpp diff --git a/src/content_mapnode.h b/src/content_mapnode.h index 3a9f988..23effe3 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -233,6 +233,31 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_CLAY_RED 0x8AD #define CONTENT_CLAY_YELLOW 0x8AE #define CONTENT_CLAY_BLACK 0x8AF +#define CONTENT_GLASS_BLUE 0x8B0 +#define CONTENT_GLASS_GREEN 0x8B1 +#define CONTENT_GLASS_ORANGE 0x8B2 +#define CONTENT_GLASS_PURPLE 0x8B3 +#define CONTENT_GLASS_RED 0x8B4 +#define CONTENT_GLASS_YELLOW 0x8B5 +#define CONTENT_GLASS_BLACK 0x8B6 +#define CONTENT_CARPET 0x8B7 +#define CONTENT_CARPET_BLUE 0x8B8 +#define CONTENT_CARPET_GREEN 0x8B9 +#define CONTENT_CARPET_ORANGE 0x8BA +#define CONTENT_CARPET_PURPLE 0x8BB +#define CONTENT_CARPET_RED 0x8BC +#define CONTENT_CARPET_YELLOW 0x8BD +#define CONTENT_CARPET_BLACK 0x8BE +#define CONTENT_COAL 0x8BF +#define CONTENT_CHARCOAL 0x8C0 +#define CONTENT_TIN 0x8C1 +#define CONTENT_COPPER 0x8C2 +#define CONTENT_SILVER 0x8C3 +#define CONTENT_GOLD 0x8C4 +#define CONTENT_QUARTZ 0x8C5 +#define CONTENT_FIRE 0x8C6 +#define CONTENT_FIRE_SHORTTERM 0x8C7 +#define CONTENT_TNT 0x8C8 #endif diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index 6684eb6..cbd510b 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -550,6 +550,13 @@ bool FurnaceNodeMetadata::step(float dtime) fuel_list->decrementMaterials(1); changed = true; } + else if(ItemSpec(ITEM_CRAFT, "lump_of_charcoal").checkItem(fuel_item)) + { + m_fuel_totaltime = 40; + m_fuel_time = 0; + fuel_list->decrementMaterials(1); + changed = true; + } else if(ItemSpec(ITEM_CRAFT, "lump_of_coal").checkItem(fuel_item)) { m_fuel_totaltime = 40; @@ -577,4 +584,57 @@ std::string FurnaceNodeMetadata::getInventoryDrawSpecString() "list[current_player;main;0,5;8,4;]"; } +/* + LockedDoorNodeMetadata +*/ +// Prototype +TNTNodeMetadata proto_TNTNodeMetadata; + +TNTNodeMetadata::TNTNodeMetadata(): + m_armed(false), + m_time(0) +{ + NodeMetadata::registerType(typeId(), create); +} +TNTNodeMetadata::~TNTNodeMetadata() +{ +} +u16 TNTNodeMetadata::typeId() const +{ + return CONTENT_TNT; +} +NodeMetadata* TNTNodeMetadata::create(std::istream &is) +{ + TNTNodeMetadata *d = new TNTNodeMetadata(); + int temp; + is>>temp; + d->m_time = (float)temp/10; + is>>temp; + d->m_armed = (bool)temp; + return d; +} +NodeMetadata* TNTNodeMetadata::clone() +{ + TNTNodeMetadata *d = new TNTNodeMetadata(); + return d; +} +bool TNTNodeMetadata::step(float dtime) +{ + if (!m_armed) + return false; + m_time -= dtime; + return true; +} +void TNTNodeMetadata::serializeBody(std::ostream &os) +{ + os<setDefault("full_block_send_enable_min_time_from_building", "2.0"); settings->setDefault("enable_experimental", "false"); settings->setDefault("enable_lavabuckets", "false"); + settings->setDefault("enable_tnt", "false"); } diff --git a/src/environment.cpp b/src/environment.cpp index 1605a52..915138a 100644 --- a/src/environment.cpp +++ b/src/environment.cpp @@ -22,6 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "collision.h" #include "content_mapnode.h" +#include "content_nodemeta.h" #include "mapblock.h" #include "serverobject.h" #include "content_sao.h" @@ -29,6 +30,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "settings.h" #include "log.h" #include "profiler.h" +#include "server.h" #define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")" @@ -1101,8 +1103,8 @@ void ServerEnvironment::step(float dtime) */ if (n.getContent() == CONTENT_GRASS) { - int f = (1000-(p.Y*2))+10; - if (p.Y > -1 && myrand()%f == 0) { + int f = (10000-(p.Y*2))+10; + if (p.Y > 2 && myrand()%f == 0) { MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); if (n_top.getContent() == CONTENT_AIR && n_top.getLightBlend(getDayNightRatio()) >= 13) { v3f pp; @@ -1119,18 +1121,25 @@ void ServerEnvironment::step(float dtime) } if (n.getContent() == CONTENT_WILDGRASS_SHORT) { - if (p.Y > -1 && myrand()%200 == 0) { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); - if (n_btm.getContent() == CONTENT_GRASS && n_top.getLightBlend(getDayNightRatio()) >= 13) { - if (myrand()%5 == 0) { - n.setContent(CONTENT_FLOWER_STEM); - m_map->addNodeWithEvent(p, n); - }else{ - n.setContent(CONTENT_WILDGRASS_LONG); - m_map->addNodeWithEvent(p, n); + MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); + if (n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_MUD) { + if (p.Y > -1 && myrand()%200 == 0) { + MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); + if (n_btm.getContent() == CONTENT_GRASS) { + if (n_top.getLightBlend(getDayNightRatio()) >= 13) { + if (myrand()%5 == 0) { + n.setContent(CONTENT_FLOWER_STEM); + m_map->addNodeWithEvent(p, n); + }else{ + n.setContent(CONTENT_WILDGRASS_LONG); + m_map->addNodeWithEvent(p, n); + } + } } } + }else{ + n.setContent(CONTENT_DEADGRASS); + m_map->addNodeWithEvent(p, n); } } if (n.getContent() == CONTENT_WILDGRASS_LONG) @@ -1142,25 +1151,30 @@ void ServerEnvironment::step(float dtime) } if (n.getContent() == CONTENT_FLOWER_STEM) { - if (p.Y > -1 && myrand()%200 == 0) { - MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); - MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); - if ((n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_FLOWER_POT) && n_top.getLightBlend(getDayNightRatio()) >= 13) { - switch (myrand()%3) { - case 0: - n.setContent(CONTENT_FLOWER_ROSE); - m_map->addNodeWithEvent(p, n); - break; - case 1: - n.setContent(CONTENT_FLOWER_DAFFODIL); - m_map->addNodeWithEvent(p, n); - break; - case 2: - n.setContent(CONTENT_FLOWER_TULIP); - m_map->addNodeWithEvent(p, n); - break; + MapNode n_btm = m_map->getNodeNoEx(p+v3s16(0,-1,0)); + if (n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_MUD) { + if (p.Y > -1 && myrand()%200 == 0) { + MapNode n_top = m_map->getNodeNoEx(p+v3s16(0,1,0)); + if ((n_btm.getContent() == CONTENT_GRASS || n_btm.getContent() == CONTENT_FLOWER_POT) && n_top.getLightBlend(getDayNightRatio()) >= 13) { + switch (myrand()%3) { + case 0: + n.setContent(CONTENT_FLOWER_ROSE); + m_map->addNodeWithEvent(p, n); + break; + case 1: + n.setContent(CONTENT_FLOWER_DAFFODIL); + m_map->addNodeWithEvent(p, n); + break; + case 2: + n.setContent(CONTENT_FLOWER_TULIP); + m_map->addNodeWithEvent(p, n); + break; + } } } + }else{ + n.setContent(CONTENT_DEADGRASS); + m_map->addNodeWithEvent(p, n); } } if (n.getContent() == CONTENT_DEADGRASS) @@ -1184,6 +1198,103 @@ void ServerEnvironment::step(float dtime) m_map->addNodeWithEvent(p, n); } } + /* + fire that goes out + */ + if (n.getContent() == CONTENT_FIRE_SHORTTERM) { + if (myrand()%10 == 0) + m_map->removeNodeWithEvent(p); + } + /* + fire that spreads just a little + */ + if (n.getContent() == CONTENT_FIRE) { + if (myrand()%10) { + bool can_spread = true; + s16 bs_rad = g_settings->getS16("borderstone_radius"); + bs_rad += 2; + // if any node is border stone protected, don't spread + for(s16 x=-bs_rad; can_spread && x<=bs_rad; x++) + for(s16 y=-bs_rad; can_spread && y<=bs_rad; y++) + for(s16 z=-bs_rad; can_spread && z<=bs_rad; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_BORDERSTONE) + can_spread = false; + } + if (can_spread) { + for(s16 x=-1; x<=1; x++) + for(s16 y=0; y<=1; y++) + for(s16 z=-1; z<=1; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_FIRE || n_test.getContent() == CONTENT_FIRE_SHORTTERM) + continue; + if (content_features(n_test).flammable > 0) { + n_test.setContent(CONTENT_FIRE_SHORTTERM); + m_map->addNodeWithEvent(p+v3s16(x,y,z), n_test); + } + } + } + } + } + /* + boom + */ + if (n.getContent() == CONTENT_TNT) { + TNTNodeMetadata *meta = (TNTNodeMetadata*)m_map->getNodeMetadata(p); + if (meta && meta->getArmed() && meta->getTime() < 0.0) { + bool can_spread = true; + s16 bs_rad = g_settings->getS16("borderstone_radius"); + bs_rad += 3; + // if any node is border stone protected, don't destroy anything + for(s16 x=-bs_rad; can_spread && x<=bs_rad; x++) + for(s16 y=-bs_rad; can_spread && y<=bs_rad; y++) + for(s16 z=-bs_rad; can_spread && z<=bs_rad; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_BORDERSTONE) + can_spread = false; + } + if (can_spread) { + for(s16 x=-2; x<=2; x++) + for(s16 y=-2; y<=2; y++) + for(s16 z=-2; z<=2; z++) + { + MapNode n_test = m_map->getNodeNoEx(p+v3s16(x,y,z)); + if (n_test.getContent() == CONTENT_AIR) + continue; + if (n_test.getContent() == CONTENT_TNT) { + meta = (TNTNodeMetadata*)m_map->getNodeMetadata(p+v3s16(x,y,z)); + if (meta && !meta->getArmed()) + meta->setArmed(true); + continue; + } + if ( + (x == -2 && y == -2) + || (x == 2 && y == -2) + || (x == -2 && y == 2) + || (x == 2 && y == 2) + || (z == -2 && y == -2) + || (z == 2 && y == -2) + || (z == -2 && y == 2) + || (z == 2 && y == 2) + || (x == -2 && z == -2) + || (x == 2 && z == -2) + || (x == -2 && z == 2) + || (x == 2 && z == 2) + ) { + if (myrand()%3 == 0) + continue; + } + m_map->removeNodeWithEvent(p+v3s16(x,y,z)); + } + } + // but still blow up + m_map->removeNodeWithEvent(p); + // TODO: damage nearby players + } + } /* Rats spawn around regular trees */ diff --git a/src/guiDeathScreen.h b/src/guiDeathScreen.h index 786abc6..acfce2e 100644 --- a/src/guiDeathScreen.h +++ b/src/guiDeathScreen.h @@ -28,6 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc., class IRespawnInitiator { public: + virtual ~IRespawnInitiator() {} virtual void respawn() = 0; }; diff --git a/src/guiTextInputMenu.h b/src/guiTextInputMenu.h index 1d8c981..78ec945 100644 --- a/src/guiTextInputMenu.h +++ b/src/guiTextInputMenu.h @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., struct TextDest { + virtual ~TextDest() {} virtual void gotText(std::wstring text) = 0; }; diff --git a/src/inventory.h b/src/inventory.h index 2a5b7dd..c7cdd98 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -346,14 +346,20 @@ public: return "tool_shears.png"; }else if (m_toolname == "WBucket") { return "tool_woodbucket.png"; + }else if (m_toolname == "TinBucket") { + return "tool_tinbucket.png"; }else if (m_toolname == "WBucket_water") { return "tool_woodbucket_water.png"; + }else if (m_toolname == "TinBucket_water") { + return "tool_tinbucket_water.png"; }else if(m_toolname == "SteelBucket") { return "tool_steelbucket.png"; }else if(m_toolname == "SteelBucket_water") { return "tool_steelbucket_water.png"; }else if(m_toolname == "SteelBucket_lava") { return "tool_steelbucket_lava.png"; + }else if (m_toolname == "FireStarter") { + return "tool_fire_starter.png"; }else{ return "cotton.png"; } @@ -427,6 +433,8 @@ public: return "Steel Bucket of Water"; }else if(m_toolname == "SteelBucket_lava") { return "Steel Bucket of Lava"; + }else if (m_toolname == "FireStarter") { + return "Fire Starter"; } return ""; @@ -620,6 +628,7 @@ public: struct InventoryAction { + virtual ~InventoryAction() {} static InventoryAction * deSerialize(std::istream &is); virtual u16 getType() const = 0; diff --git a/src/mapgen.cpp b/src/mapgen.cpp index 1ec8c3e..a913d80 100644 --- a/src/mapgen.cpp +++ b/src/mapgen.cpp @@ -1821,22 +1821,21 @@ void make_block(BlockMakeData *data) MapNode new_content(CONTENT_IGNORE); u32 sparseness = 6; - if(noisebuf_ground_crumbleness.get(x,y+5,z) < -0.1) - { + if (noisebuf_ground_crumbleness.get(x,y+5,z) < -0.1) { new_content = MapNode(CONTENT_STONE, MINERAL_COAL); + }else if (noisebuf_ground_wetness.get(x,y+5,z) > 0.1) { + new_content = MapNode(CONTENT_STONE, MINERAL_IRON); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.4) { + new_content = MapNode(CONTENT_STONE, MINERAL_SILVER); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.3) { + new_content = MapNode(CONTENT_STONE, MINERAL_GOLD); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.2) { + new_content = MapNode(CONTENT_STONE, MINERAL_COPPER); + }else if (noisebuf_ground_crumbleness.get(x,y,z) > 0.1) { + new_content = MapNode(CONTENT_STONE, MINERAL_TIN); + }else if (noisebuf_ground_wetness.get(x,y+5,z) > 0.0) { + new_content = MapNode(CONTENT_STONE, MINERAL_QUARTZ); } - else - { - if(noisebuf_ground_wetness.get(x,y+5,z) > 0.0) - new_content = MapNode(CONTENT_STONE, MINERAL_IRON); - /*if(noisebuf_ground_wetness.get(x,y,z) > 0.0) - vmanip.m_data[i] = MapNode(CONTENT_MUD); - else - vmanip.m_data[i] = MapNode(CONTENT_SAND);*/ - } - /*else if(noisebuf_ground_crumbleness.get(x,y,z) > 0.1) - { - }*/ if(new_content.getContent() != CONTENT_IGNORE) { diff --git a/src/mapnode.h b/src/mapnode.h index bdcb32a..3a89f04 100644 --- a/src/mapnode.h +++ b/src/mapnode.h @@ -177,6 +177,8 @@ struct ContentFeatures bool climbable; // Player can build on these bool buildable_to; + // Whether fire can be started on top of it + u8 flammable; // Whether the node has no liquid, source liquid or flowing liquid enum LiquidType liquid_type; // If true, param2 is set to direction when placed. Used for torches. @@ -259,6 +261,7 @@ struct ContentFeatures diggable = true; climbable = false; buildable_to = false; + flammable = 0; liquid_type = LIQUID_NONE; wall_mounted = false; air_equivalent = false; @@ -314,6 +317,10 @@ struct ContentFeatures {} void setAllTextureFlags(u8 flags) {} + void setTextureType(u16 i, u8 type) + {} + void setAllTextureTypes(u8 type) + {} #else void setTexture(u16 i, std::string name, u8 alpha=255); @@ -335,6 +342,16 @@ struct ContentFeatures setTextureFlags(i, flags); } } + void setTextureType(u16 i, u8 type) + { + tiles[i].material_type = type; + } + void setAllTextureTypes(u8 type) + { + for (u16 i=0; i<6; i++) { + setTextureType(i, type); + } + } #endif #ifndef SERVER diff --git a/src/mineral.cpp b/src/mineral.cpp index afbff4e..4b178be 100644 --- a/src/mineral.cpp +++ b/src/mineral.cpp @@ -24,7 +24,12 @@ const char *mineral_filenames[MINERAL_COUNT] = { NULL, "mineral_coal.png", - "mineral_iron.png" + "mineral_iron.png", + "mineral_tin.png", + "mineral_copper.png", + "mineral_silver.png", + "mineral_gold.png", + "mineral_quartz.png" }; std::string mineral_textures[MINERAL_COUNT]; diff --git a/src/mineral.h b/src/mineral.h index 61776e6..7130178 100644 --- a/src/mineral.h +++ b/src/mineral.h @@ -35,17 +35,33 @@ void init_mineral(); #define MINERAL_NONE 0 #define MINERAL_COAL 1 #define MINERAL_IRON 2 +#define MINERAL_TIN 3 +#define MINERAL_COPPER 4 +#define MINERAL_SILVER 5 +#define MINERAL_GOLD 6 +#define MINERAL_QUARTZ 7 -#define MINERAL_COUNT 3 +#define MINERAL_COUNT 8 std::string mineral_block_texture(u8 mineral); inline CraftItem * getDiggedMineralItem(u8 mineral) { - if(mineral == MINERAL_COAL) + if (mineral == MINERAL_COAL) { return new CraftItem("lump_of_coal", 1); - else if(mineral == MINERAL_IRON) + }else if(mineral == MINERAL_IRON) { return new CraftItem("lump_of_iron", 1); + }else if(mineral == MINERAL_TIN) { + return new CraftItem("lump_of_tin", 1); + }else if(mineral == MINERAL_COPPER) { + return new CraftItem("lump_of_copper", 1); + }else if(mineral == MINERAL_SILVER) { + return new CraftItem("lump_of_silver", 1); + }else if(mineral == MINERAL_GOLD) { + return new CraftItem("lump_of_gold", 1); + }else if(mineral == MINERAL_QUARTZ) { + return new CraftItem("lump_of_quartz", 1); + } return NULL; } diff --git a/src/server.cpp b/src/server.cpp index e627a1f..654b516 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2456,6 +2456,49 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) continue; client->SetBlocksNotSent(modified_blocks); } + }else if (content_features(n).flammable > 1) { + const InventoryItem *wield = player->getWieldItem(); + if ( + wield && wield->getName() == std::string("ToolItem") + && ((ToolItem*)wield)->getToolName() == "FireStarter" + ) { + if (content_features(n).flammable == 2) { + MapNode a = m_env.getMap().getNodeNoEx(p_under+v3s16(0,1,0)); + if (a.getContent() == CONTENT_AIR || content_features(a).flammable > 0) { + a.setContent(CONTENT_FIRE); + core::list far_players; + sendAddNode(p_under+v3s16(0,1,0), a, 0, &far_players, 30); + core::map modified_blocks; + { + MapEditEventIgnorer ign(&m_ignore_map_edit_events); + + std::string p_name = std::string(player->getName()); + m_env.getMap().addNodeAndUpdate(p_under+v3s16(0,1,0), a, modified_blocks, p_name); + } + } + }else{ + n.setContent(CONTENT_FIRE_SHORTTERM); + core::list far_players; + sendAddNode(p_under, n, 0, &far_players, 30); + core::map modified_blocks; + { + 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); + } + } + } + }else if (n.getContent() == CONTENT_TNT) { + const InventoryItem *wield = player->getWieldItem(); + if ( + wield && wield->getName() == std::string("ToolItem") + && ((ToolItem*)wield)->getToolName() == "FireStarter" + ) { + TNTNodeMetadata *meta = (TNTNodeMetadata*)m_env.getMap().getNodeMetadata(p_under); + if (meta && !meta->getArmed()) + meta->setArmed(true); + } } /* NOTE: This can be used in the future to check if @@ -2700,6 +2743,14 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } } } + MapNode a = m_env.getMap().getNode(p_under+v3s16(0,1,0)); + if (a.getContent() == CONTENT_FIRE) { + sendRemoveNode(p_under+v3s16(0,1,0), 0, &far_players, 30); + { + MapEditEventIgnorer ign(&m_ignore_map_edit_events); + m_env.getMap().removeNodeAndUpdate(p_under+v3s16(0,1,0), modified_blocks); + } + } /* Send the removal to all close-by players. - If other player is close, send REMOVENODE @@ -2776,6 +2827,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) && ( wieldname == std::string("WBucket") || wieldname == std::string("SteelBucket") + || wieldname == std::string("TinBucket") ) ) { std::string dug_s = std::string("ToolItem ") + wieldname + "_water 1"; @@ -2793,6 +2845,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) && ( wieldname == std::string("WBucket") || wieldname == std::string("SteelBucket") + || wieldname == std::string("TinBucket") ) ) { MapNode n = m_env.getMap().getNode(p_under);