From 17982b1ccf70621ec9392b7e97c37c915966edf1 Mon Sep 17 00:00:00 2001 From: darkrose Date: Mon, 3 Mar 2014 20:08:44 +1000 Subject: [PATCH] craft guide pt3 and creative chest --- data/textures/chest_creative.png | Bin 0 -> 741 bytes src/CMakeLists.txt | 1 + src/content_craft.cpp | 1 + src/content_craftitem.cpp | 86 ++++++++ src/content_list.cpp | 42 ++++ src/content_list.h | 271 ++---------------------- src/content_mapnode.cpp | 352 +++++++++++++++++++++++++++++++ src/content_mapnode.h | 3 +- src/content_nodemeta.cpp | 215 ++++++++++++------- src/content_nodemeta.h | 24 ++- src/content_toolitem.cpp | 43 ++++ src/guiFormSpecMenu.cpp | 2 + 12 files changed, 703 insertions(+), 337 deletions(-) create mode 100644 data/textures/chest_creative.png create mode 100644 src/content_list.cpp diff --git a/data/textures/chest_creative.png b/data/textures/chest_creative.png new file mode 100644 index 0000000000000000000000000000000000000000..b3c96a46d086c1eefdc3456ecca32d4332432567 GIT binary patch literal 741 zcmVPx#32;bRa{vGf6951U69E94oEQKA00(qQO+^RZ0|N;+D)pF9tN;K4cS%G+R5;5u zlRK^)We|nGdUW^ncq}8X5y%J&VG*$p5^{&UY@85~z!H$i5eX*XLWV#rfgP{`gdai- zGH`**c&1^3fZ&GEEqU!fw-$QYish!BrSaU@9nUUnP+cA`<|g zN^sUIoeHf7h*0Ya&ZY8PZ@3D5t30`!*maJnq5>DEz#CJxt#RYVvvd+Qj8bQo}s97IT}xX|C6Yo!%{fRg{!@TB#jHMpaLnvT#}6$ZbGsuyME1RL=Xj^ zDqI|bAAbA|6>t-ll0+t^Mnqz^FfB8iX2eujYN7&DNpvc3IV8s^IgH8Q$KdId-23D^ z4r6kh;oXnF<^R3Ej=^C}E{9}Xz@OhaSGUQ_H?NbW&}l(qVZYyV`@>HG*zfne{#s9Z zOQ<96Jbrw^AO8kEN76S=B#0!La2$if_a7j2MpS9LmZ2J*K_-|e0K3l6jR}XbU?Qk0 zH4;~$G2!l4zjEixUnl|BdZ+but_p&1nkyO!eWQp%t+5&iy#2)k?!WmWU*EmSJNJJk zGMP(7R4|mO)HPrtD^ufZI8>o^0NAvvqHo@R6%p9BPDXN?3#LNb3R)xRTjw+u8aGN! z#%aBGDQms`*-uO*In4nA2y7Z-oD&yYBipwQb!OWdL~wrZ72f*%0RZRk-NIC0g+O45 zSpTCeiEWe`!8`|21C4-$^E)rGZIok$8cEbd9cqQvjHxX6rV{`jKDr<>XiO0i4r5~8 zkTto|DdRE&GiSSre@=BJ%)p-xm9iK~QX?r*>0Fo!s3vVA3{xe65^$P=r6!rlmEQRe XOIK*T(>0?<00000NkvXXu0mjfU92@s literal 0 HcmV?d00001 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 654ab1a..9ebb62e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -99,6 +99,7 @@ set(common_SRCS content_craftitem.cpp content_toolitem.cpp content_mapnode.cpp + content_list.cpp auth.cpp collision.cpp nodemetadata.cpp diff --git a/src/content_craft.cpp b/src/content_craft.cpp index b338b3f..e49bc34 100644 --- a/src/content_craft.cpp +++ b/src/content_craft.cpp @@ -628,6 +628,7 @@ void giveCreative(Player *player) // CONTENT_IGNORE-terminated list content_t material_items[] = { + CONTENT_CREATIVE_CHEST, CONTENT_TORCH, CONTENT_ROUGHSTONE, CONTENT_MUD, diff --git a/src/content_craftitem.cpp b/src/content_craftitem.cpp index 3b8936b..0cd9370 100644 --- a/src/content_craftitem.cpp +++ b/src/content_craftitem.cpp @@ -20,6 +20,7 @@ #include "content_craftitem.h" #include "content_mapnode.h" #include "content_craft.h" +#include "content_list.h" #include std::map g_content_craftitem_features; @@ -58,6 +59,8 @@ void content_craftitem_init() f->name = "paper"; f->description = "Paper"; crafting::setRow1Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_CHARCOAL; f = &g_content_craftitem_features[i]; @@ -66,6 +69,7 @@ void content_craftitem_init() f->name = "lump_of_charcoal"; f->description = "Charcoal Lump"; f->fuel_time = 40; + lists::add("creative",i); i = CONTENT_CRAFTITEM_COAL; f = &g_content_craftitem_features[i]; @@ -74,6 +78,7 @@ void content_craftitem_init() f->name = "lump_of_coal"; f->description = "Coal Lump"; f->fuel_time = 40; + lists::add("creative",i); i = CONTENT_CRAFTITEM_IRON; f = &g_content_craftitem_features[i]; @@ -82,6 +87,7 @@ void content_craftitem_init() f->name = "lump_of_iron"; f->description = "Iron Lump"; f->cook_result = "CraftItem steel_ingot 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_CLAY; f = &g_content_craftitem_features[i]; @@ -90,6 +96,7 @@ void content_craftitem_init() f->name = "lump_of_clay"; f->description = "Clay Lump"; f->cook_result = "CraftItem clay_brick 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_TIN; f = &g_content_craftitem_features[i]; @@ -98,6 +105,7 @@ void content_craftitem_init() f->name = "lump_of_tin"; f->description = "Tin Lump"; f->cook_result = "CraftItem tin_ingot 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_COPPER; f = &g_content_craftitem_features[i]; @@ -106,6 +114,7 @@ void content_craftitem_init() f->name = "lump_of_copper"; f->description = "Copper Lump"; f->cook_result = "CraftItem copper_ingot 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_SILVER; f = &g_content_craftitem_features[i]; @@ -114,6 +123,7 @@ void content_craftitem_init() f->name = "lump_of_silver"; f->description = "Silver Lump"; f->cook_result = "CraftItem silver_ingot 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_GOLD; f = &g_content_craftitem_features[i]; @@ -122,6 +132,7 @@ void content_craftitem_init() f->name = "lump_of_gold"; f->description = "Gold Lump"; f->cook_result = "CraftItem gold_ingot 1"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_QUARTZ; f = &g_content_craftitem_features[i]; @@ -129,6 +140,7 @@ void content_craftitem_init() f->texture = "lump_of_quartz.png"; f->name = "lump_of_quartz"; f->description = "Quartz Crystal"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_TIN_INGOT; f = &g_content_craftitem_features[i]; @@ -136,6 +148,7 @@ void content_craftitem_init() f->texture = "tin_ingot.png"; f->name = "tin_ingot"; f->description = "Tin Ingot"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_COPPER_INGOT; f = &g_content_craftitem_features[i]; @@ -143,6 +156,7 @@ void content_craftitem_init() f->texture = "copper_ingot.png"; f->name = "copper_ingot"; f->description = "Copper Ingot"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_SILVER_INGOT; f = &g_content_craftitem_features[i]; @@ -150,6 +164,7 @@ void content_craftitem_init() f->texture = "silver_ingot.png"; f->name = "silver_ingot"; f->description = "Silver Ingot"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_GOLD_INGOT; f = &g_content_craftitem_features[i]; @@ -157,6 +172,7 @@ void content_craftitem_init() f->texture = "gold_ingot.png"; f->name = "gold_ingot"; f->description = "Gold Ingot"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_FLINT; f = &g_content_craftitem_features[i]; @@ -164,6 +180,7 @@ void content_craftitem_init() f->texture = "lump_of_flint.png"; f->name = "lump_of_flint"; f->description = "Flint"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_STEEL_INGOT; f = &g_content_craftitem_features[i]; @@ -171,6 +188,7 @@ void content_craftitem_init() f->texture = "steel_ingot.png"; f->name = "steel_ingot"; f->description = "Steel Ingot"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_CLAY_BRICK; f = &g_content_craftitem_features[i]; @@ -178,6 +196,7 @@ void content_craftitem_init() f->texture = "clay_brick.png"; f->name = "clay_brick"; f->description = "Brick"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_RAT; f = &g_content_craftitem_features[i]; @@ -187,6 +206,7 @@ void content_craftitem_init() f->description = "Rat"; f->cook_result = "CraftItem cooked_rat 1"; f->drop_count = 1; + lists::add("creative",i); i = CONTENT_CRAFTITEM_COOKED_RAT; f = &g_content_craftitem_features[i]; @@ -196,6 +216,7 @@ void content_craftitem_init() f->description = "Cooked Rat"; f->cook_result = "CraftItem scorched_stuff 1"; f->edible = 6; + lists::add("creative",i); i = CONTENT_CRAFTITEM_SCORCHED_STUFF; f = &g_content_craftitem_features[i]; @@ -203,6 +224,7 @@ void content_craftitem_init() f->texture = "scorched_stuff.png"; f->name = "scorched_stuff"; f->description = "Scorched Stuff"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_FIREFLY; f = &g_content_craftitem_features[i]; @@ -211,6 +233,7 @@ void content_craftitem_init() f->name = "firefly"; f->description = "Firefly"; f->drop_count = 1; + lists::add("creative",i); i = CONTENT_CRAFTITEM_APPLE; f = &g_content_craftitem_features[i]; @@ -219,6 +242,7 @@ void content_craftitem_init() f->name = "apple"; f->description = "Apple"; f->edible = 4; + lists::add("creative",i); i = CONTENT_CRAFTITEM_APPLE_IRON; f = &g_content_craftitem_features[i]; @@ -235,6 +259,8 @@ void content_craftitem_init() }; crafting::setRecipe(recipe,CONTENT_CRAFTITEM_APPLE_IRON,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_BLUE; f = &g_content_craftitem_features[i]; @@ -243,6 +269,8 @@ void content_craftitem_init() f->name = "dye_blue"; f->description = "Blue Dye"; crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_GREEN; f = &g_content_craftitem_features[i]; @@ -251,6 +279,8 @@ void content_craftitem_init() f->name = "dye_green"; f->description = "Green Dye"; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_ORANGE; f = &g_content_craftitem_features[i]; @@ -259,6 +289,8 @@ void content_craftitem_init() f->name = "dye_orange"; f->description = "Orange Dye"; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_PURPLE; f = &g_content_craftitem_features[i]; @@ -267,6 +299,8 @@ void content_craftitem_init() f->name = "dye_purple"; f->description = "Purple Dye"; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_RED; f = &g_content_craftitem_features[i]; @@ -275,6 +309,8 @@ void content_craftitem_init() f->name = "dye_red"; f->description = "Red Dye"; crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_YELLOW; f = &g_content_craftitem_features[i]; @@ -284,6 +320,8 @@ void content_craftitem_init() f->description = "Yellow Dye"; crafting::set1To2Recipe(CONTENT_CACTUS_BLOSSOM,CONTENT_CRAFTITEM_DYE_YELLOW); crafting::set1To2Recipe(CONTENT_FLOWER_DAFFODIL,CONTENT_CRAFTITEM_DYE_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_WHITE; f = &g_content_craftitem_features[i]; @@ -293,6 +331,8 @@ void content_craftitem_init() f->description = "White Dye"; crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE); crafting::set2Any3Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_WHITE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DYE_BLACK; f = &g_content_craftitem_features[i]; @@ -301,6 +341,8 @@ void content_craftitem_init() f->name = "dye_black"; f->description = "Black Dye"; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_DYE_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_QUARTZ_DUST; f = &g_content_craftitem_features[i]; @@ -309,6 +351,8 @@ void content_craftitem_init() f->name = "quartz_dust"; f->description = "Quartz Dust"; crafting::set1To1Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_SALTPETER; f = &g_content_craftitem_features[i]; @@ -316,6 +360,7 @@ void content_craftitem_init() f->texture = "saltpeter.png"; f->name = "saltpeter"; f->description = "Saltpeter"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_GUNPOWDER; f = &g_content_craftitem_features[i]; @@ -324,6 +369,8 @@ void content_craftitem_init() f->name = "gunpowder"; f->description = "Gun Powder"; crafting::set1Any3Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_SALTPETER,CONTENT_CRAFTITEM_GUNPOWDER); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_SNOW_BALL; f = &g_content_craftitem_features[i]; @@ -346,6 +393,8 @@ void content_craftitem_init() crafting::set1To2Recipe(CONTENT_APPLE_LEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_JUNGLELEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_CONIFER_LEAVES,CONTENT_CRAFTITEM_STICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_PINE_PLANK; f = &g_content_craftitem_features[i]; @@ -355,6 +404,8 @@ void content_craftitem_init() f->description = "Pine Plank"; f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_WOOD_PLANK; f = &g_content_craftitem_features[i]; @@ -364,6 +415,8 @@ void content_craftitem_init() f->description = "Wood Plank"; f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_JUNGLE_PLANK; f = &g_content_craftitem_features[i]; @@ -373,6 +426,8 @@ void content_craftitem_init() f->description = "Jungle Wood Plank"; f->fuel_time = 30/16; crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_TNT; f = &g_content_craftitem_features[i]; @@ -388,6 +443,8 @@ void content_craftitem_init() }; crafting::setRecipe(recipe,CONTENT_CRAFTITEM_TNT,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_ASH; f = &g_content_craftitem_features[i]; @@ -395,6 +452,7 @@ void content_craftitem_init() f->texture = "lump_of_ash.png"; f->name = "lump_of_ash"; f->description = "Ash"; + lists::add("creative",i); i = CONTENT_CRAFTITEM_APPLE_BLOSSOM; f = &g_content_craftitem_features[i]; @@ -404,6 +462,7 @@ void content_craftitem_init() f->description = "Apple Blossoms"; f->edible = 1; f->fuel_time = 30/16; + lists::add("creative",i); i = CONTENT_CRAFTITEM_CACTUS_FRUIT; f = &g_content_craftitem_features[i]; @@ -412,6 +471,7 @@ void content_craftitem_init() f->name = "cactus_fruit"; f->description = "Cactus Berry"; f->edible = 3; + lists::add("creative",i); i = CONTENT_CRAFTITEM_ROTTEN_FRUIT; f = &g_content_craftitem_features[i]; @@ -420,6 +480,7 @@ void content_craftitem_init() f->name = "rotten_fruit"; f->description = "Rotten Fruit"; f->edible = -1; + lists::add("creative",i); i = CONTENT_CRAFTITEM_MUSH; f = &g_content_craftitem_features[i]; @@ -428,6 +489,7 @@ void content_craftitem_init() f->name = "mushed_food"; f->description = "Mushed Food"; f->edible = -1; + lists::add("creative",i); i = CONTENT_CRAFTITEM_PUMPKINSLICE; f = &g_content_craftitem_features[i]; @@ -437,6 +499,8 @@ void content_craftitem_init() f->description = "Sliced Pumpkin"; f->edible = 2; crafting::set1To2Recipe(CONTENT_FARM_PUMPKIN,CONTENT_CRAFTITEM_PUMPKINSLICE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW; f = &g_content_craftitem_features[i]; @@ -447,6 +511,7 @@ void content_craftitem_init() f->cook_result = std::string("CraftItem pumpkin_pie 1"); f->edible = 3; crafting::set1over1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW); + lists::add("craftguide",i); i = CONTENT_CRAFTITEM_PUMPKIN_PIE; f = &g_content_craftitem_features[i]; @@ -455,6 +520,7 @@ void content_craftitem_init() f->name = "pumpkin_pie"; f->description = "Pumpkin Pie"; f->edible = 6; + lists::add("creative",i); i = CONTENT_CRAFTITEM_APPLE_PIE_RAW; f = &g_content_craftitem_features[i]; @@ -465,6 +531,7 @@ void content_craftitem_init() f->cook_result = std::string("CraftItem apple_pie 1"); f->edible = 3; crafting::set1over1Recipe(CONTENT_CRAFTITEM_APPLE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_APPLE_PIE_RAW); + lists::add("craftguide",i); i = CONTENT_CRAFTITEM_APPLE_PIE; f = &g_content_craftitem_features[i]; @@ -473,6 +540,7 @@ void content_craftitem_init() f->name = "apple_pie"; f->description = "Apple Pie"; f->edible = 6; + lists::add("creative",i); i = CONTENT_CRAFTITEM_MELONSLICE; f = &g_content_craftitem_features[i]; @@ -482,6 +550,8 @@ void content_craftitem_init() f->description = "Sliced Melon"; f->edible = 4; crafting::set1To2Recipe(CONTENT_FARM_MELON,CONTENT_CRAFTITEM_MELONSLICE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_WHEAT; f = &g_content_craftitem_features[i]; @@ -490,6 +560,7 @@ void content_craftitem_init() f->name = "harvested_wheat"; f->description = "Wheat"; f->edible = 1; + lists::add("creative",i); i = CONTENT_CRAFTITEM_FLOUR; f = &g_content_craftitem_features[i]; @@ -499,6 +570,8 @@ void content_craftitem_init() f->description = "Flour"; f->edible = 1; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_FLOUR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_DOUGH; f = &g_content_craftitem_features[i]; @@ -509,6 +582,8 @@ void content_craftitem_init() f->cook_result = std::string("CraftItem bread 1"); f->edible = 2; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_DOUGH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_BREAD; f = &g_content_craftitem_features[i]; @@ -517,6 +592,7 @@ void content_craftitem_init() f->name = "bread"; f->description = "Bread"; f->edible = 5; + lists::add("creative",i); i = CONTENT_CRAFTITEM_POTATO; f = &g_content_craftitem_features[i]; @@ -526,6 +602,7 @@ void content_craftitem_init() f->description = "Potato"; f->cook_result = std::string("CraftItem roast_potato 1"); f->edible = 3; + lists::add("creative",i); i = CONTENT_CRAFTITEM_STARCH; f = &g_content_craftitem_features[i]; @@ -534,6 +611,8 @@ void content_craftitem_init() f->name = "potato_starch"; f->description = "Potato Starch"; crafting::set1To2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_STARCH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFTITEM_ROASTPOTATO; f = &g_content_craftitem_features[i]; @@ -542,6 +621,7 @@ void content_craftitem_init() f->name = "roast_potato"; f->description = "Roast Potato"; f->edible = 6; + lists::add("creative",i); i = CONTENT_CRAFTITEM_CARROT; f = &g_content_craftitem_features[i]; @@ -550,6 +630,7 @@ void content_craftitem_init() f->name = "harvested_carrot"; f->description = "Carrot"; f->edible = 4; + lists::add("creative",i); i = CONTENT_CRAFTITEM_CARROT_CAKE_RAW; f = &g_content_craftitem_features[i]; @@ -560,6 +641,7 @@ void content_craftitem_init() f->cook_result = std::string("CraftItem carrot_cake 1"); f->edible = 3; crafting::set1over1Recipe(CONTENT_CRAFTITEM_CARROT,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_CARROT_CAKE_RAW); + lists::add("craftguide",i); i = CONTENT_CRAFTITEM_CARROT_CAKE; f = &g_content_craftitem_features[i]; @@ -568,6 +650,7 @@ void content_craftitem_init() f->name = "carrot_cake"; f->description = "Carrot Cake"; f->edible = 6; + lists::add("creative",i); i = CONTENT_CRAFTITEM_BEETROOT; f = &g_content_craftitem_features[i]; @@ -576,6 +659,7 @@ void content_craftitem_init() f->name = "harvested_beetroot"; f->description = "Beetroot"; f->edible = 3; + lists::add("creative",i); i = CONTENT_CRAFTITEM_GRAPE; f = &g_content_craftitem_features[i]; @@ -584,6 +668,7 @@ void content_craftitem_init() f->name = "harvested_grape"; f->description = "Bunch of Grapes"; f->edible = 4; + lists::add("creative",i); i = CONTENT_CRAFTITEM_STRING; f = &g_content_craftitem_features[i]; @@ -591,4 +676,5 @@ void content_craftitem_init() f->texture = "string.png"; f->name = "string"; f->description = "String"; + lists::add("creative",i); } diff --git a/src/content_list.cpp b/src/content_list.cpp new file mode 100644 index 0000000..52d778f --- /dev/null +++ b/src/content_list.cpp @@ -0,0 +1,42 @@ +/************************************************************************ +* content_list.cpp +* minetest-classic - 3d voxel world sandbox game +* Copyright (C) Lisa Milne 2014 +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* See the GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see +************************************************************************/ + +#include "mapnode.h" +#include "content_mapnode.h" +#include "content_list.h" +#include +#include +#include + +namespace lists { + +std::map< std::string , std::vector > c_lists; + +void add(std::string name, content_t c) +{ + if (std::find(c_lists[name].begin(),c_lists[name].end(),c) == c_lists[name].end()) + c_lists[name].push_back(c); +} + +std::vector &get(std::string name) +{ + return c_lists[name]; +} + +}; diff --git a/src/content_list.h b/src/content_list.h index c92bc21..1aa4213 100644 --- a/src/content_list.h +++ b/src/content_list.h @@ -1,258 +1,13 @@ -CONTENT_CRAFTITEM_PAPER, -CONTENT_BOOK, -CONTENT_CRAFTITEM_CHARCOAL, -CONTENT_CRAFTITEM_COAL, -CONTENT_CRAFTITEM_IRON, -CONTENT_CRAFTITEM_CLAY, -CONTENT_CRAFTITEM_TIN, -CONTENT_CRAFTITEM_COPPER, -CONTENT_CRAFTITEM_SILVER, -CONTENT_CRAFTITEM_GOLD, -CONTENT_CRAFTITEM_QUARTZ, -CONTENT_CRAFTITEM_TIN_INGOT, -CONTENT_CRAFTITEM_COPPER_INGOT, -CONTENT_CRAFTITEM_SILVER_INGOT, -CONTENT_CRAFTITEM_GOLD_INGOT, -CONTENT_CRAFTITEM_FLINT, -CONTENT_CRAFTITEM_STEEL_INGOT, -CONTENT_CRAFTITEM_CLAY_BRICK, -CONTENT_CRAFTITEM_RAT, -CONTENT_CRAFTITEM_COOKED_RAT, -CONTENT_CRAFTITEM_SCORCHED_STUFF, -CONTENT_CRAFTITEM_FIREFLY, -CONTENT_CRAFTITEM_APPLE, -CONTENT_CRAFTITEM_APPLE_IRON, -CONTENT_CRAFTITEM_DYE_BLUE, -CONTENT_CRAFTITEM_DYE_GREEN, -CONTENT_CRAFTITEM_DYE_ORANGE, -CONTENT_CRAFTITEM_DYE_PURPLE, -CONTENT_CRAFTITEM_DYE_RED, -CONTENT_CRAFTITEM_DYE_YELLOW, -CONTENT_CRAFTITEM_DYE_WHITE, -CONTENT_CRAFTITEM_DYE_BLACK, -CONTENT_CRAFTITEM_QUARTZ_DUST, -CONTENT_CRAFTITEM_SALTPETER, -CONTENT_CRAFTITEM_GUNPOWDER, -CONTENT_CRAFTITEM_SNOW_BALL, -CONTENT_CRAFTITEM_STICK, -CONTENT_CRAFTITEM_PINE_PLANK, -CONTENT_CRAFTITEM_WOOD_PLANK, -CONTENT_CRAFTITEM_JUNGLE_PLANK, -CONTENT_CRAFTITEM_TNT, -CONTENT_STONE, -CONTENT_ICE, -CONTENT_COAL, -CONTENT_CHARCOAL, -CONTENT_STONEBRICK, -CONTENT_STONEBLOCK, -CONTENT_ROUGHSTONEBRICK, -CONTENT_ROUGHSTONEBLOCK, -CONTENT_GRASS, -CONTENT_FARM_DIRT, -CONTENT_SAND, -CONTENT_GRAVEL, -CONTENT_SANDSTONE, -CONTENT_SANDSTONE_BRICK, -CONTENT_SANDSTONE_BLOCK, -CONTENT_CLAY, -CONTENT_CLAY_BLUE, -CONTENT_CLAY_GREEN, -CONTENT_CLAY_ORANGE, -CONTENT_CLAY_PURPLE, -CONTENT_CLAY_RED, -CONTENT_CLAY_YELLOW, -CONTENT_CLAY_BLACK, -CONTENT_BRICK, -CONTENT_TERRACOTTA, -CONTENT_TERRACOTTA_BRICK, -CONTENT_TERRACOTTA_BLOCK, -CONTENT_TERRACOTTA_TILE, -CONTENT_TREE, -CONTENT_APPLE_TREE, -CONTENT_JUNGLETREE, -CONTENT_CONIFER_TREE, -CONTENT_JUNGLEGRASS, -CONTENT_LEAVES, -CONTENT_APPLE_LEAVES, -CONTENT_JUNGLELEAVES, -CONTENT_CONIFER_LEAVES, -CONTENT_TRIMMED_LEAVES, -CONTENT_TRIMMED_APPLE_LEAVES, -CONTENT_TRIMMED_JUNGLE_LEAVES, -CONTENT_TRIMMED_CONIFER_LEAVES, -CONTENT_CACTUS, -CONTENT_PAPYRUS, -CONTENT_BOOKSHELF, -CONTENT_GLASS, -CONTENT_GLASS_BLUE, -CONTENT_GLASS_GREEN, -CONTENT_GLASS_ORANGE, -CONTENT_GLASS_PURPLE, -CONTENT_GLASS_RED, -CONTENT_GLASS_YELLOW, -CONTENT_GLASS_BLACK, -CONTENT_GLASS_PANE, -CONTENT_GLASS_PANE_BLUE, -CONTENT_GLASS_PANE_GREEN, -CONTENT_GLASS_PANE_ORANGE, -CONTENT_GLASS_PANE_PURPLE, -CONTENT_GLASS_PANE_RED, -CONTENT_GLASS_PANE_YELLOW, -CONTENT_GLASS_PANE_BLACK, -CONTENT_GLASS_SLAB, -CONTENT_GLASS_BLUE_SLAB, -CONTENT_GLASS_GREEN_SLAB, -CONTENT_GLASS_ORANGE_SLAB, -CONTENT_GLASS_PURPLE_SLAB, -CONTENT_GLASS_RED_SLAB, -CONTENT_GLASS_YELLOW_SLAB, -CONTENT_GLASS_BLACK_SLAB, -CONTENT_GLASSLIGHT, -CONTENT_FENCE, -CONTENT_RAIL, -CONTENT_LADDER, -CONTENT_BORDERSTONE, -CONTENT_WOOD, -CONTENT_JUNGLEWOOD, -CONTENT_WOOD_PINE, -CONTENT_MESE, -CONTENT_MESE_DIGGING, -CONTENT_SPONGE, -CONTENT_SPONGE_FULL, -CONTENT_HAY, -CONTENT_SNOW_BLOCK, -CONTENT_SNOWMAN, -CONTENT_CRAFT_GUIDE, -CONTENT_COTTON, -CONTENT_COTTON_BLUE, -CONTENT_COTTON_GREEN, -CONTENT_COTTON_ORANGE, -CONTENT_COTTON_PURPLE, -CONTENT_COTTON_RED, -CONTENT_COTTON_YELLOW, -CONTENT_COTTON_BLACK, -CONTENT_CARPET, -CONTENT_CARPET_BLUE, -CONTENT_CARPET_GREEN, -CONTENT_CARPET_ORANGE, -CONTENT_CARPET_PURPLE, -CONTENT_CARPET_RED, -CONTENT_CARPET_YELLOW, -CONTENT_CARPET_BLACK, -CONTENT_AIR, -CONTENT_WATER, -CONTENT_WATERSOURCE, -CONTENT_LAVA, -CONTENT_LAVASOURCE, -CONTENT_FIRE, -CONTENT_FIRE_SHORTTERM, -CONTENT_TORCH, -CONTENT_SIGN_WALL, -CONTENT_SIGN, -CONTENT_LOCKABLE_SIGN, -CONTENT_CHEST, -CONTENT_LOCKABLE_CHEST, -CONTENT_LOCKABLE_FURNACE, -CONTENT_FURNACE, -CONTENT_INCINERATOR, -CONTENT_ROUGHSTONE, -CONTENT_COBBLE, -CONTENT_MOSSYCOBBLE, -CONTENT_STEEL, -CONTENT_COPPER, -CONTENT_GOLD, -CONTENT_SILVER, -CONTENT_TIN, -CONTENT_QUARTZ, -CONTENT_NC, -CONTENT_SAPLING, -CONTENT_APPLE_SAPLING, -CONTENT_JUNGLESAPLING, -CONTENT_CONIFER_SAPLING, -CONTENT_APPLE, -CONTENT_ROUGHSTONE_STAIR, -CONTENT_COBBLE_STAIR, -CONTENT_MOSSYCOBBLE_STAIR, -CONTENT_STONE_STAIR, -CONTENT_WOOD_STAIR, -CONTENT_JUNGLE_STAIR, -CONTENT_BRICK_STAIR, -CONTENT_SANDSTONE_STAIR, -CONTENT_ROUGHSTONE_SLAB, -CONTENT_MOSSYCOBBLE_SLAB, -CONTENT_STONE_SLAB, -CONTENT_WOOD_SLAB, -CONTENT_JUNGLE_SLAB, -CONTENT_BRICK_SLAB, -CONTENT_SANDSTONE_SLAB, -CONTENT_COBBLE_SLAB, -CONTENT_WOOD_DOOR_LT, -CONTENT_STEEL_DOOR_LT, -CONTENT_GLASS_DOOR_LT, -CONTENT_WOOD_W_DOOR_LT, -CONTENT_STEEL_W_DOOR_LT, -CONTENT_WOOD_DOOR_RT, -CONTENT_GLASS_DOOR_RT, -CONTENT_STEEL_DOOR_RT, -CONTENT_WOOD_W_DOOR_RT, -CONTENT_STEEL_W_DOOR_RT, -CONTENT_WOOD_HATCH, -CONTENT_STEEL_HATCH, -CONTENT_WOOD_W_HATCH, -CONTENT_STEEL_W_HATCH, -CONTENT_WOOD_GATE, -CONTENT_STEEL_GATE, -CONTENT_WILDGRASS_SHORT, -CONTENT_WILDGRASS_LONG, -CONTENT_DEADGRASS, -CONTENT_FLOWER_STEM, -CONTENT_FLOWER_ROSE, -CONTENT_FLOWER_DAFFODIL, -CONTENT_FLOWER_TULIP, -CONTENT_FLOWER_POT_RAW, -CONTENT_FLOWER_POT, -CONTENT_COBBLE_WALL, -CONTENT_ROUGHSTONE_WALL, -CONTENT_MOSSYCOBBLE_WALL, -CONTENT_STONE_WALL, -CONTENT_SANDSTONE_WALL, -CONTENT_TNT, -CONTENT_ROOFTILE_TERRACOTTA, -CONTENT_ROOFTILE_WOOD, -CONTENT_ROOFTILE_ASPHALT, -CONTENT_ROOFTILE_STONE, -CONTENT_FLASH, -CONTENT_STEAM, -CONTENT_CHAIR, -CONTENT_TABLE, -CONTENT_BED_HEAD, -CONTENT_BED_BLUE_HEAD, -CONTENT_BED_GREEN_HEAD, -CONTENT_BED_ORANGE_HEAD, -CONTENT_BED_PURPLE_HEAD, -CONTENT_BED_RED_HEAD, -CONTENT_BED_YELLOW_HEAD, -CONTENT_BED_BLACK_HEAD, -CONTENT_TOOLITEM_WPICK, -CONTENT_TOOLITEM_STPICK, -CONTENT_TOOLITEM_STEELPICK, -CONTENT_TOOLITEM_MESEPICK, -CONTENT_TOOLITEM_WSHOVEL, -CONTENT_TOOLITEM_STSHOVEL, -CONTENT_TOOLITEM_STEELSHOVEL, -CONTENT_TOOLITEM_WAXE, -CONTENT_TOOLITEM_STAXE, -CONTENT_TOOLITEM_STEELAXE, -CONTENT_TOOLITEM_WSWORD, -CONTENT_TOOLITEM_STSWORD, -CONTENT_TOOLITEM_STEELSWORD, -CONTENT_TOOLITEM_STEELSHEARS, -CONTENT_TOOLITEM_WBUCKET, -CONTENT_TOOLITEM_TINBUCKET, -CONTENT_TOOLITEM_WBUCKET_WATER, -CONTENT_TOOLITEM_TINBUCKET_WATER, -CONTENT_TOOLITEM_STEELBUCKET, -CONTENT_TOOLITEM_STEELBUCKET_WATER, -CONTENT_TOOLITEM_STEELBUCKET_LAVA, -CONTENT_TOOLITEM_FIRESTARTER, -CONTENT_TOOLITEM_CROWBAR, +#ifndef _CONTENT_LIST_H +#define _CONTENT_LIST_H + +#include + +namespace lists { + +void add(std::string name, content_t c); +std::vector &get(std::string name); + +}; + +#endif diff --git a/src/content_mapnode.cpp b/src/content_mapnode.cpp index ea29939..75da0e1 100644 --- a/src/content_mapnode.cpp +++ b/src/content_mapnode.cpp @@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "content_craftitem.h" #include "content_toolitem.h" #include "content_craft.h" +#include "content_list.h" #ifndef SERVER #include "tile.h" #endif @@ -1082,6 +1083,7 @@ void content_mapnode_init() f->hardness = 1.0; if(invisible_stone) f->solidness = 0; // For debugging, hides regular stone + lists::add("creative",i); i = CONTENT_ICE; f = &content_features(i); @@ -1096,6 +1098,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_COAL; f = &content_features(i); @@ -1111,6 +1114,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_COAL,CONTENT_COAL); crafting::setUncraftHardBlockRecipe(CONTENT_COAL,CONTENT_CRAFTITEM_COAL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CHARCOAL; f = &content_features(i); @@ -1126,6 +1131,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CHARCOAL); crafting::setUncraftHardBlockRecipe(CONTENT_CHARCOAL,CONTENT_CRAFTITEM_CHARCOAL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STONEBRICK; f = &content_features(i); @@ -1138,6 +1145,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_STONE,CONTENT_STONEBRICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STONEBLOCK; f = &content_features(i); @@ -1150,6 +1159,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_STONE,CONTENT_STONEBLOCK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROUGHSTONEBRICK; f = &content_features(i); @@ -1162,6 +1173,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONEBRICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROUGHSTONEBLOCK; f = &content_features(i); @@ -1174,6 +1187,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONEBLOCK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GRASS; f = &content_features(i); @@ -1235,6 +1250,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_DIRT; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_ASH; f = &content_features(i); @@ -1247,6 +1263,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 0.5; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_ASH,CONTENT_ASH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SAND; f = &content_features(i); @@ -1259,6 +1277,7 @@ void content_mapnode_init() f->cook_result = std::string("MaterialItem2 ")+itos(CONTENT_GLASS)+" 1"; f->type = CMT_DIRT; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_GRAVEL; f = &content_features(i); @@ -1272,6 +1291,7 @@ void content_mapnode_init() f->extra_dug_item_rarity = 10; f->type = CMT_DIRT; f->hardness = 1.75; + lists::add("creative",i); i = CONTENT_SANDSTONE; f = &content_features(i); @@ -1284,6 +1304,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_SAND,CONTENT_SANDSTONE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SANDSTONE_BRICK; f = &content_features(i); @@ -1296,6 +1318,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_BRICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SANDSTONE_BLOCK; f = &content_features(i); @@ -1308,6 +1332,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_BLOCK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY; f = &content_features(i); @@ -1321,6 +1347,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_CLAY); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_BLUE; f = &content_features(i); @@ -1335,6 +1363,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CLAY,CONTENT_CLAY_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_GREEN; f = &content_features(i); @@ -1349,6 +1379,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CLAY,CONTENT_CLAY_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_ORANGE; f = &content_features(i); @@ -1363,6 +1395,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CLAY,CONTENT_CLAY_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_PURPLE; f = &content_features(i); @@ -1377,6 +1411,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CLAY,CONTENT_CLAY_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_RED; f = &content_features(i); @@ -1391,6 +1427,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CLAY,CONTENT_CLAY_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_YELLOW; f = &content_features(i); @@ -1405,6 +1443,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CLAY,CONTENT_CLAY_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CLAY_BLACK; f = &content_features(i); @@ -1419,6 +1459,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CLAY,CONTENT_CLAY_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BRICK; f = &content_features(i); @@ -1431,6 +1473,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_CLAY_BRICK,CONTENT_BRICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TERRACOTTA; f = &content_features(i); @@ -1442,6 +1486,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_TERRACOTTA_BRICK; f = &content_features(i); @@ -1454,6 +1499,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBrickRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_BRICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TERRACOTTA_BLOCK; f = &content_features(i); @@ -1466,6 +1513,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setBlockRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_BLOCK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TERRACOTTA_TILE; f = &content_features(i); @@ -1483,6 +1532,8 @@ void content_mapnode_init() content_mapnode_nodebox_carpet(f); f->setInventoryTextureNodeBox(i,"terracotta_tile.png", "terracotta_tile.png", "terracotta_tile.png"); crafting::setTileRecipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA_TILE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TREE; f = &content_features(i); @@ -1499,6 +1550,7 @@ void content_mapnode_init() f->fuel_time = 30; f->type = CMT_WOOD; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_APPLE_TREE; f = &content_features(i); @@ -1515,6 +1567,7 @@ void content_mapnode_init() f->fuel_time = 30; f->type = CMT_WOOD; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_JUNGLETREE; f = &content_features(i); @@ -1530,6 +1583,7 @@ void content_mapnode_init() f->fuel_time = 30; f->type = CMT_WOOD; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_CONIFER_TREE; f = &content_features(i); @@ -1562,6 +1616,7 @@ void content_mapnode_init() f->setInventoryTextureNodeBox(i,"conifer_tree_top.png", "conifer_tree.png", "conifer_tree.png"); f->type = CMT_WOOD; f->hardness = 0.8; + lists::add("creative",i); i = CONTENT_JUNGLEGRASS; f = &content_features(i); @@ -1581,6 +1636,7 @@ void content_mapnode_init() f->fuel_time = 30/32; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_LEAVES; f = &content_features(i); @@ -1713,6 +1769,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_TRIMMED_APPLE_LEAVES; f = &content_features(i); @@ -1737,6 +1794,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_TRIMMED_JUNGLE_LEAVES; f = &content_features(i); @@ -1761,6 +1819,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_TRIMMED_CONIFER_LEAVES; f = &content_features(i); @@ -1785,6 +1844,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_APPLE_BLOSSOM; f = &content_features(i); @@ -1834,6 +1894,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_CACTUS_BLOSSOM; f = &content_features(i); @@ -1852,6 +1913,7 @@ void content_mapnode_init() f->fuel_time = 30/32; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_CACTUS_FLOWER; f = &content_features(i); @@ -1870,6 +1932,7 @@ void content_mapnode_init() f->fuel_time = 30/32; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_CACTUS_FRUIT; f = &content_features(i); @@ -1888,6 +1951,7 @@ void content_mapnode_init() f->fuel_time = 30/32; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_CACTUS; f = &content_features(i); @@ -1948,6 +2012,7 @@ void content_mapnode_init() f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png"); f->type = CMT_WOOD; f->hardness = 0.75; + lists::add("creative",i); i = CONTENT_PAPYRUS; f = &content_features(i); @@ -1966,6 +2031,7 @@ void content_mapnode_init() f->fuel_time = 30/32; f->type = CMT_WOOD; f->hardness = 0.25; + lists::add("creative",i); i = CONTENT_BOOKSHELF; f = &content_features(i); @@ -1996,6 +2062,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_BOOKSHELF,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS; f = &content_features(i); @@ -2015,6 +2083,7 @@ void content_mapnode_init() f->setInventoryTextureCube("glass.png", "glass.png", "glass.png"); f->type = CMT_WOOD; f->hardness = 0.15; + lists::add("creative",i); i = CONTENT_GLASS_BLUE; f = &content_features(i); @@ -2035,6 +2104,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS,CONTENT_GLASS_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_GREEN; f = &content_features(i); @@ -2055,6 +2126,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS,CONTENT_GLASS_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_ORANGE; f = &content_features(i); @@ -2075,6 +2148,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS,CONTENT_GLASS_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PURPLE; f = &content_features(i); @@ -2095,6 +2170,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS,CONTENT_GLASS_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_RED; f = &content_features(i); @@ -2115,6 +2192,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS,CONTENT_GLASS_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_YELLOW; f = &content_features(i); @@ -2135,6 +2214,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS,CONTENT_GLASS_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_BLACK; f = &content_features(i); @@ -2155,6 +2236,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS,CONTENT_GLASS_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE; f = &content_features(i); @@ -2185,6 +2268,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS,CONTENT_GLASS_PANE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_BLUE; f = &content_features(i); @@ -2216,6 +2301,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_BLUE,CONTENT_GLASS_PANE_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_GREEN; f = &content_features(i); @@ -2247,6 +2334,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_GREEN,CONTENT_GLASS_PANE_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_ORANGE; f = &content_features(i); @@ -2278,6 +2367,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_ORANGE,CONTENT_GLASS_PANE_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_PURPLE; f = &content_features(i); @@ -2309,6 +2400,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_PURPLE,CONTENT_GLASS_PANE_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_RED; f = &content_features(i); @@ -2340,6 +2433,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_RED,CONTENT_GLASS_PANE_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_YELLOW; f = &content_features(i); @@ -2371,6 +2466,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_YELLOW,CONTENT_GLASS_PANE_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PANE_BLACK; f = &content_features(i); @@ -2402,6 +2499,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setCol3Recipe(CONTENT_GLASS_BLACK,CONTENT_GLASS_PANE_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS_PANE,CONTENT_GLASS_PANE_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASSLIGHT; f = &content_features(i); @@ -2423,6 +2522,8 @@ void content_mapnode_init() f->hardness = 0.15; f->light_source = LIGHT_MAX-1; crafting::setSurroundRecipe(CONTENT_GLASS,CONTENT_TORCH,CONTENT_GLASSLIGHT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_FENCE; f = &content_features(i); @@ -2444,6 +2545,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::setWallRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_FENCE); crafting::setWallRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_FENCE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_RAIL; f = &content_features(i); @@ -2486,6 +2589,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 0.75; crafting::set1over4Recipe(CONTENT_TERRACOTTA,CONTENT_TERRACOTTA,CONTENT_ROOFTILE_TERRACOTTA); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROOFTILE_WOOD; f = &content_features(i); @@ -2499,6 +2604,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::set1over4Recipe(CONTENT_WOOD,CONTENT_WOOD,CONTENT_ROOFTILE_WOOD); crafting::set1over4Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLEWOOD,CONTENT_ROOFTILE_WOOD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROOFTILE_ASPHALT; f = &content_features(i); @@ -2518,6 +2625,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_ROOFTILE_ASPHALT,4); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROOFTILE_STONE; f = &content_features(i); @@ -2530,6 +2639,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 0.75; crafting::set1over4Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE,CONTENT_ROOFTILE_STONE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_LADDER; f = &content_features(i); @@ -2573,6 +2684,8 @@ void content_mapnode_init() r[8] = CONTENT_CRAFTITEM_JUNGLE_PLANK; crafting::setRecipe(r,CONTENT_LADDER,4); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BORDERSTONE; f = &content_features(i); @@ -2595,6 +2708,7 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_BORDERSTONE,1); } + lists::add("craftguide",i); i = CONTENT_WOOD; f = &content_features(i); @@ -2610,6 +2724,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::set1To4Recipe(CONTENT_TREE,CONTENT_WOOD); crafting::set1To4Recipe(CONTENT_APPLE_TREE,CONTENT_WOOD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_JUNGLEWOOD; f = &content_features(i); @@ -2624,6 +2740,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.75; crafting::set1To4Recipe(CONTENT_JUNGLETREE,CONTENT_JUNGLEWOOD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_PINE; f = &content_features(i); @@ -2638,6 +2756,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.5; crafting::set1To4Recipe(CONTENT_CONIFER_TREE,CONTENT_WOOD_PINE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TRELLIS; f = &content_features(i); @@ -2657,6 +2777,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::set5Recipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_TRELLIS); crafting::set5Recipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TRELLIS); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_MESE; f = &content_features(i); @@ -2669,6 +2791,7 @@ void content_mapnode_init() f->cook_result = std::string("CraftItem saltpeter 1"); f->type = CMT_STONE; f->hardness = 0.5; + lists::add("creative",i); i = CONTENT_MESE_DIGGING; f = &content_features(i); @@ -2695,6 +2818,7 @@ void content_mapnode_init() f->fuel_time = 1; f->type = CMT_DIRT; f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_SPONGE_FULL; f = &content_features(i); @@ -2720,6 +2844,8 @@ void content_mapnode_init() f->type = CMT_PLANT; f->hardness = 0.6; crafting::setHardBlockRecipe(CONTENT_DEADGRASS,CONTENT_HAY); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_FERTILIZER; f = &content_features(i); @@ -2738,6 +2864,8 @@ void content_mapnode_init() f->hardness = 0.4; crafting::set2Any2Recipe(CONTENT_CRAFTITEM_ROTTEN_FRUIT,CONTENT_CRAFTITEM_ASH,CONTENT_FERTILIZER); crafting::set2Any2Recipe(CONTENT_CRAFTITEM_MUSH,CONTENT_CRAFTITEM_ASH,CONTENT_FERTILIZER); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SEEDS_WHEAT; f = &content_features(i); @@ -2753,6 +2881,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.4; + lists::add("creative",i); i = CONTENT_SEEDS_MELON; f = &content_features(i); @@ -2769,6 +2898,7 @@ void content_mapnode_init() f->type = CMT_PLANT; f->hardness = 0.4; crafting::set1To1Recipe(CONTENT_CRAFTITEM_MELONSLICE,CONTENT_SEEDS_MELON); + lists::add("creative",i); i = CONTENT_SEEDS_PUMPKIN; f = &content_features(i); @@ -2785,6 +2915,7 @@ void content_mapnode_init() f->type = CMT_PLANT; f->hardness = 0.4; crafting::set1To1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_SEEDS_PUMPKIN); + lists::add("creative",i); i = CONTENT_SEEDS_POTATO; f = &content_features(i); @@ -2800,6 +2931,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.4; + lists::add("creative",i); i = CONTENT_SEEDS_CARROT; f = &content_features(i); @@ -2815,6 +2947,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.4; + lists::add("creative",i); i = CONTENT_SEEDS_BEETROOT; f = &content_features(i); @@ -2830,6 +2963,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.4; + lists::add("creative",i); i = CONTENT_SEEDS_GRAPE; f = &content_features(i); @@ -2846,6 +2980,7 @@ void content_mapnode_init() f->type = CMT_PLANT; f->hardness = 0.4; crafting::set1To2Recipe(CONTENT_CRAFTITEM_GRAPE,CONTENT_SEEDS_GRAPE); + lists::add("creative",i); i = CONTENT_SEEDS_COTTON; f = &content_features(i); @@ -2861,6 +2996,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_PLANT; f->hardness = 0.4; + lists::add("creative",i); i = CONTENT_FARM_WHEAT_1; f = &content_features(i); @@ -3567,6 +3703,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 0.3; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_SNOW_BALL,CONTENT_SNOW_BLOCK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SNOWMAN; f = &content_features(i); @@ -3626,6 +3764,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_SNOWMAN,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SNOW; f = &content_features(i); @@ -3644,6 +3784,7 @@ void content_mapnode_init() f->setInventoryTextureNodeBox(i,"snow.png", "snow.png", "snow.png"); f->type = CMT_DIRT; f->hardness = 0.3; + lists::add("creative",i); i = CONTENT_BOOK; f = &content_features(i); @@ -3668,6 +3809,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setCol1Recipe(CONTENT_CRAFTITEM_PAPER,i); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CRAFT_GUIDE; f = &content_features(i); @@ -3700,6 +3843,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_CRAFT_GUIDE,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON; f = &content_features(i); @@ -3729,6 +3874,8 @@ void content_mapnode_init() crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_COTTON_YELLOW,CONTENT_COTTON); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_STARCH,CONTENT_COTTON_BLACK,CONTENT_COTTON); crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_STRING,CONTENT_COTTON); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_BLUE; f = &content_features(i); @@ -3743,6 +3890,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_COTTON,CONTENT_COTTON_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_GREEN; f = &content_features(i); @@ -3757,6 +3906,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_COTTON,CONTENT_COTTON_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_ORANGE; f = &content_features(i); @@ -3771,6 +3922,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_COTTON,CONTENT_COTTON_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_PURPLE; f = &content_features(i); @@ -3785,6 +3938,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_COTTON,CONTENT_COTTON_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_RED; f = &content_features(i); @@ -3799,6 +3954,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_COTTON,CONTENT_COTTON_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_YELLOW; f = &content_features(i); @@ -3813,6 +3970,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_COTTON,CONTENT_COTTON_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COTTON_BLACK; f = &content_features(i); @@ -3827,6 +3986,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_COTTON,CONTENT_COTTON_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET; f = &content_features(i); @@ -3846,6 +4007,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON,CONTENT_CARPET); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_BLUE; f = &content_features(i); @@ -3866,6 +4029,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_BLUE,CONTENT_CARPET_BLUE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CARPET,CONTENT_CARPET_BLUE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_GREEN; f = &content_features(i); @@ -3886,6 +4051,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_GREEN,CONTENT_CARPET_GREEN); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_CARPET,CONTENT_CARPET_GREEN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_ORANGE; f = &content_features(i); @@ -3906,6 +4073,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_ORANGE,CONTENT_CARPET_ORANGE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_CARPET,CONTENT_CARPET_ORANGE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_PURPLE; f = &content_features(i); @@ -3926,6 +4095,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_PURPLE,CONTENT_CARPET_PURPLE); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_CARPET,CONTENT_CARPET_PURPLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_RED; f = &content_features(i); @@ -3946,6 +4117,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_RED,CONTENT_CARPET_RED); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CARPET,CONTENT_CARPET_RED); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_YELLOW; f = &content_features(i); @@ -3966,6 +4139,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_YELLOW,CONTENT_CARPET_YELLOW); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CARPET,CONTENT_CARPET_YELLOW); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_CARPET_BLACK; f = &content_features(i); @@ -3986,6 +4161,8 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setTileRecipe(CONTENT_COTTON_BLACK,CONTENT_CARPET_BLACK); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_CARPET,CONTENT_CARPET_BLACK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_AIR; f = &content_features(i); @@ -4208,6 +4385,8 @@ void content_mapnode_init() f->hardness = 0.0; crafting::set1over4Recipe(CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); crafting::set1over4Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_STICK,CONTENT_TORCH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SIGN_WALL; f = &content_features(i); @@ -4269,6 +4448,8 @@ void content_mapnode_init() crafting::setSignRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_SIGN); crafting::setSignRecipe(CONTENT_CRAFTITEM_PINE_PLANK,CONTENT_SIGN); crafting::setSignRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_SIGN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SIGN_UD; f = &content_features(i); @@ -4365,6 +4546,8 @@ void content_mapnode_init() )); f->setInventoryTextureNodeBox(i,"sign.png", "sign_lock.png", "sign.png"); crafting::set1Any2Recipe(CONTENT_SIGN,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_SIGN); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_LOCKABLE_SIGN_UD; f = &content_features(i); @@ -4421,6 +4604,26 @@ void content_mapnode_init() f->hardness = 1.0; crafting::setRoundRecipe(CONTENT_WOOD,CONTENT_CHEST); crafting::setRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CHEST); + lists::add("craftguide",i); + lists::add("creative",i); + + i = CONTENT_CREATIVE_CHEST; + f = &content_features(i); + f->description = std::string("Creative Chest"); + f->param_type = CPT_FACEDIR_SIMPLE; + f->draw_type = CDT_CUBELIKE; + f->setAllTextures("chest_side.png"); + f->setTexture(0, "chest_top.png"); + f->setTexture(1, "chest_top.png"); + f->setTexture(5, "chest_creative.png"); // Z- + f->setInventoryTexture("chest_top.png"); + f->setInventoryTextureCube("chest_top.png", "chest_creative.png", "chest_side.png"); + f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; + if(f->initial_metadata == NULL) + f->initial_metadata = new CreativeChestNodeMetadata(); + f->type = CMT_WOOD; + f->hardness = 1.0; + lists::add("creative",i); i = CONTENT_LOCKABLE_CHEST; f = &content_features(i); @@ -4447,6 +4650,8 @@ void content_mapnode_init() crafting::setFilledRoundRecipe(CONTENT_WOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); crafting::setFilledRoundRecipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); crafting::set1Any2Recipe(CONTENT_CHEST,CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_LOCKABLE_CHEST); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_FURNACE; f = &content_features(i); @@ -4464,6 +4669,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 3.0; crafting::setRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_FURNACE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_LOCKABLE_FURNACE; f = &content_features(i); @@ -4482,6 +4689,8 @@ void content_mapnode_init() f->hardness = 3.0; crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); crafting::set1Any2Recipe(CONTENT_FURNACE,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_LOCKABLE_FURNACE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_INCINERATOR; f = &content_features(i); @@ -4499,6 +4708,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.4; crafting::setFilledRoundRecipe(CONTENT_ROUGHSTONE,CONTENT_MESE,CONTENT_INCINERATOR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROUGHSTONE; f = &content_features(i); @@ -4513,6 +4724,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setBlockRecipe(CONTENT_COBBLE,CONTENT_ROUGHSTONE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COBBLE; f = &content_features(i); @@ -4526,6 +4739,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::set5Recipe(CONTENT_ROUGHSTONE,CONTENT_COBBLE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_MOSSYCOBBLE; f = &content_features(i); @@ -4538,6 +4753,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 0.8; + lists::add("creative",i); i = CONTENT_STEEL; f = &content_features(i); @@ -4552,6 +4768,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL); crafting::setUncraftHardBlockRecipe(CONTENT_STEEL,CONTENT_CRAFTITEM_STEEL_INGOT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COPPER; f = &content_features(i); @@ -4566,6 +4784,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_COPPER_INGOT,CONTENT_COPPER); crafting::setUncraftHardBlockRecipe(CONTENT_COPPER,CONTENT_CRAFTITEM_COPPER_INGOT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GOLD; f = &content_features(i); @@ -4580,6 +4800,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_GOLD_INGOT,CONTENT_GOLD); crafting::setUncraftHardBlockRecipe(CONTENT_GOLD,CONTENT_CRAFTITEM_GOLD_INGOT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SILVER; f = &content_features(i); @@ -4594,6 +4816,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_SILVER_INGOT,CONTENT_SILVER); crafting::setUncraftHardBlockRecipe(CONTENT_SILVER,CONTENT_CRAFTITEM_SILVER_INGOT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TIN; f = &content_features(i); @@ -4608,6 +4832,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TIN); crafting::setUncraftHardBlockRecipe(CONTENT_TIN,CONTENT_CRAFTITEM_TIN_INGOT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_QUARTZ; f = &content_features(i); @@ -4622,6 +4848,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_QUARTZ); crafting::setUncraftHardBlockRecipe(CONTENT_QUARTZ,CONTENT_CRAFTITEM_QUARTZ); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_NC; f = &content_features(i); @@ -4635,6 +4863,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 3.0; + lists::add("creative",i); i = CONTENT_NC_RB; f = &content_features(i); @@ -4645,6 +4874,7 @@ void content_mapnode_init() f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1"; f->type = CMT_STONE; f->hardness = 3.0; + lists::add("creative",i); i = CONTENT_SAPLING; f = &content_features(i); @@ -4663,6 +4893,7 @@ void content_mapnode_init() f->fuel_time = 1; f->type = CMT_WOOD; f->hardness = 0.0; + lists::add("creative",i); i = CONTENT_APPLE_SAPLING; f = &content_features(i); @@ -4681,6 +4912,7 @@ void content_mapnode_init() f->fuel_time = 1; f->type = CMT_WOOD; f->hardness = 0.0; + lists::add("creative",i); i = CONTENT_JUNGLESAPLING; f = &content_features(i); @@ -4699,6 +4931,7 @@ void content_mapnode_init() f->fuel_time = 1; f->type = CMT_WOOD; f->hardness = 0.0; + lists::add("creative",i); i = CONTENT_CONIFER_SAPLING; f = &content_features(i); @@ -4717,6 +4950,7 @@ void content_mapnode_init() f->fuel_time = 1; f->type = CMT_WOOD; f->hardness = 0.0; + lists::add("creative",i); i = CONTENT_APPLE; f = &content_features(i); @@ -4736,6 +4970,7 @@ void content_mapnode_init() f->dug_item = std::string("CraftItem apple 1"); f->type = CMT_WOOD; f->hardness = 0.0; + lists::add("creative",i); // slabs i = CONTENT_ROUGHSTONE_SLAB; @@ -4753,6 +4988,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setRow3Recipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COBBLE_SLAB; f = &content_features(i); @@ -4769,6 +5006,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setRow3Recipe(CONTENT_COBBLE,CONTENT_COBBLE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_MOSSYCOBBLE_SLAB; f = &content_features(i); @@ -4785,6 +5024,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.8; crafting::setRow3Recipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STONE_SLAB; f = &content_features(i); @@ -4800,6 +5041,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setRow3Recipe(CONTENT_STONE,CONTENT_STONE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_SLAB; f = &content_features(i); @@ -4817,6 +5060,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.75; crafting::setRow3Recipe(CONTENT_WOOD,CONTENT_WOOD_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_JUNGLE_SLAB; f = &content_features(i); @@ -4834,6 +5079,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 1.0; crafting::setRow3Recipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BRICK_SLAB; f = &content_features(i); @@ -4849,6 +5096,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setRow3Recipe(CONTENT_BRICK,CONTENT_BRICK_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SANDSTONE_SLAB; f = &content_features(i); @@ -4864,6 +5113,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setRow3Recipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_SLAB; f = &content_features(i); @@ -4885,6 +5136,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_BLUE_SLAB; f = &content_features(i); @@ -4907,6 +5160,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLUE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS_BLUE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_GREEN_SLAB; f = &content_features(i); @@ -4929,6 +5184,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_GREEN_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS_GREEN_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_ORANGE_SLAB; f = &content_features(i); @@ -4951,6 +5208,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_ORANGE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS_ORANGE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_PURPLE_SLAB; f = &content_features(i); @@ -4973,6 +5232,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_PURPLE_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS_PURPLE_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_RED_SLAB; f = &content_features(i); @@ -4995,6 +5256,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_RED_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS_RED_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_YELLOW_SLAB; f = &content_features(i); @@ -5017,6 +5280,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_YELLOW_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS_YELLOW_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_BLACK_SLAB; f = &content_features(i); @@ -5039,6 +5304,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLACK_SLAB); crafting::set1Any2Recipe(CONTENT_GLASS_SLAB,CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS_BLACK_SLAB); + lists::add("craftguide",i); + lists::add("creative",i); // upside down slabs i = CONTENT_ROUGHSTONE_SLAB_UD; @@ -5328,6 +5595,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setStairRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_COBBLE_STAIR; f = &content_features(i); @@ -5343,6 +5612,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setStairRecipe(CONTENT_COBBLE,CONTENT_COBBLE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_MOSSYCOBBLE_STAIR; f = &content_features(i); @@ -5358,6 +5629,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.8; crafting::setStairRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STONE_STAIR; f = &content_features(i); @@ -5374,6 +5647,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setStairRecipe(CONTENT_STONE,CONTENT_STONE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_STAIR; f = &content_features(i); @@ -5391,6 +5666,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.75; crafting::setStairRecipe(CONTENT_WOOD,CONTENT_WOOD_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_JUNGLE_STAIR; f = &content_features(i); @@ -5408,6 +5685,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 1.0; crafting::setStairRecipe(CONTENT_JUNGLEWOOD,CONTENT_JUNGLE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BRICK_STAIR; f = &content_features(i); @@ -5423,6 +5702,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setStairRecipe(CONTENT_BRICK,CONTENT_BRICK_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SANDSTONE_STAIR; f = &content_features(i); @@ -5438,6 +5719,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setStairRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_STAIR); + lists::add("craftguide",i); + lists::add("creative",i); // upside down stairs i = CONTENT_ROUGHSTONE_STAIR_UD; @@ -5593,6 +5876,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::set1over1Recipe(CONTENT_WOOD_HATCH,CONTENT_WOOD_HATCH,CONTENT_WOOD_DOOR_LT); crafting::set1To1Recipe(CONTENT_WOOD_DOOR_RT,CONTENT_WOOD_DOOR_LT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_DOOR_LB; f = &content_features(i); @@ -5638,6 +5923,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::set1over1Recipe(CONTENT_STEEL_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_DOOR_LT); crafting::set1To1Recipe(CONTENT_STEEL_DOOR_RT,CONTENT_STEEL_DOOR_LT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_DOOR_LB; f = &content_features(i); @@ -5683,6 +5970,8 @@ void content_mapnode_init() f->hardness = 0.15; crafting::set1over1Recipe(CONTENT_GLASS_PANE,CONTENT_GLASS_PANE,CONTENT_GLASS_DOOR_LT); crafting::set1To1Recipe(CONTENT_GLASS_DOOR_RT,CONTENT_GLASS_DOOR_LT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_W_DOOR_LB; f = &content_features(i); @@ -5731,6 +6020,8 @@ void content_mapnode_init() crafting::set1over1Recipe(CONTENT_WOOD_W_HATCH,CONTENT_WOOD_HATCH,CONTENT_WOOD_W_DOOR_LT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_WOOD_DOOR_LT,CONTENT_WOOD_W_DOOR_LT); crafting::set1To1Recipe(CONTENT_WOOD_W_DOOR_RT,CONTENT_WOOD_W_DOOR_LT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_W_DOOR_LB; f = &content_features(i); @@ -5779,6 +6070,8 @@ void content_mapnode_init() crafting::set1over1Recipe(CONTENT_STEEL_W_HATCH,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_DOOR_LT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_DOOR_LT,CONTENT_STEEL_W_DOOR_LT); crafting::set1To1Recipe(CONTENT_STEEL_W_DOOR_RT,CONTENT_STEEL_W_DOOR_LT); + lists::add("craftguide",i); + lists::add("creative",i); // right doors i = CONTENT_WOOD_DOOR_RB; @@ -5824,6 +6117,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.75; crafting::set1To1Recipe(CONTENT_WOOD_DOOR_LT,CONTENT_WOOD_DOOR_RT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_GLASS_DOOR_RB; f = &content_features(i); @@ -5870,6 +6165,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.15; crafting::set1To1Recipe(CONTENT_GLASS_DOOR_LT,CONTENT_GLASS_DOOR_RT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_DOOR_RB; f = &content_features(i); @@ -5914,6 +6211,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 5.0; crafting::set1To1Recipe(CONTENT_GLASS_DOOR_LT,CONTENT_GLASS_DOOR_RT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_W_DOOR_RB; f = &content_features(i); @@ -5961,6 +6260,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::set1To1Recipe(CONTENT_WOOD_W_DOOR_LT,CONTENT_WOOD_W_DOOR_RT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_WOOD_DOOR_RT,CONTENT_WOOD_W_DOOR_RT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_W_DOOR_RB; f = &content_features(i); @@ -6008,6 +6309,8 @@ void content_mapnode_init() f->hardness = 5.0; crafting::set1To1Recipe(CONTENT_STEEL_W_DOOR_LT,CONTENT_STEEL_W_DOOR_RT); crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_DOOR_RT,CONTENT_STEEL_W_DOOR_RT); + lists::add("craftguide",i); + lists::add("creative",i); // open doors i = CONTENT_WOOD_DOOR_LB_OPEN; @@ -6461,6 +6764,8 @@ void content_mapnode_init() f->hardness = 0.75; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_WOOD_HATCH); crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_WOOD_HATCH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_HATCH; f = &content_features(i); @@ -6480,6 +6785,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 5.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL_HATCH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_WOOD_W_HATCH; f = &content_features(i); @@ -6502,6 +6809,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.75; crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_WOOD_HATCH,CONTENT_WOOD_W_HATCH); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_W_HATCH; f = &content_features(i); @@ -6524,6 +6833,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 5.0; crafting::set1over1Recipe(CONTENT_GLASS,CONTENT_STEEL_HATCH,CONTENT_STEEL_W_HATCH); + lists::add("craftguide",i); + lists::add("creative",i); // gates i = CONTENT_WOOD_GATE; @@ -6551,6 +6862,8 @@ void content_mapnode_init() crafting::setGateRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_JUNGLEWOOD,CONTENT_WOOD_GATE); crafting::setGateRecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_JUNGLEWOOD,CONTENT_WOOD_GATE); crafting::setGateRecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_WOOD,CONTENT_WOOD_GATE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STEEL_GATE; f = &content_features(i); @@ -6574,6 +6887,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 5.0; crafting::setGateRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_STEEL,CONTENT_STEEL_GATE); + lists::add("craftguide",i); + lists::add("creative",i); // open hatches i = CONTENT_WOOD_HATCH_OPEN; @@ -6814,6 +7129,7 @@ void content_mapnode_init() f->buildable_to = true; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_FLOWER_DAFFODIL; f = &content_features(i); @@ -6834,6 +7150,7 @@ void content_mapnode_init() f->buildable_to = true; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_FLOWER_TULIP; f = &content_features(i); @@ -6854,6 +7171,7 @@ void content_mapnode_init() f->buildable_to = true; f->type = CMT_WOOD; f->hardness = 0.10; + lists::add("creative",i); i = CONTENT_FLOWER_POT_RAW; f = &content_features(i); @@ -6912,6 +7230,7 @@ void content_mapnode_init() )); f->setInventoryTextureNodeBox(i,"flower_pot_raw_top.png","flower_pot_raw.png","flower_pot_raw.png"); crafting::setVRecipe(CONTENT_CRAFTITEM_CLAY,CONTENT_FLOWER_POT_RAW); + lists::add("craftguide",i); i = CONTENT_FLOWER_POT; f = &content_features(i); @@ -6968,6 +7287,7 @@ void content_mapnode_init() 0.3*BS )); f->setInventoryTextureNodeBox(i,"flower_pot_top.png","flower_pot.png","flower_pot.png"); + lists::add("creative",i); // walls i = CONTENT_COBBLE_WALL; @@ -6985,6 +7305,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setWallRecipe(CONTENT_COBBLE,CONTENT_COBBLE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_ROUGHSTONE_WALL; f = &content_features(i); @@ -7002,6 +7324,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.9; crafting::setWallRecipe(CONTENT_ROUGHSTONE,CONTENT_ROUGHSTONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_MOSSYCOBBLE_WALL; f = &content_features(i); @@ -7019,6 +7343,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 0.8; crafting::setWallRecipe(CONTENT_MOSSYCOBBLE,CONTENT_MOSSYCOBBLE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_STONE_WALL; f = &content_features(i); @@ -7036,6 +7362,8 @@ void content_mapnode_init() f->type = CMT_STONE; f->hardness = 1.0; crafting::setWallRecipe(CONTENT_STONE,CONTENT_STONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_SANDSTONE_WALL; f = &content_features(i); @@ -7053,6 +7381,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setWallRecipe(CONTENT_SANDSTONE,CONTENT_SANDSTONE_WALL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TNT; f = &content_features(i); @@ -7069,6 +7399,8 @@ void content_mapnode_init() f->type = CMT_DIRT; f->hardness = 1.0; crafting::setSoftBlockRecipe(CONTENT_CRAFTITEM_TNT,CONTENT_TNT); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_FLASH; f = &content_features(i); @@ -7151,6 +7483,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_CHAIR,2); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TABLE; f = &content_features(i); @@ -7205,6 +7539,8 @@ void content_mapnode_init() }; crafting::setRecipe(r,CONTENT_TABLE,1); } + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_HEAD; f = &content_features(i); @@ -7231,6 +7567,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON,CONTENT_BED_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_FOOT; f = &content_features(i); @@ -7282,6 +7620,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_BLUE,CONTENT_BED_BLUE_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_BLUE_FOOT; f = &content_features(i); @@ -7333,6 +7673,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_GREEN,CONTENT_BED_GREEN_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_GREEN_FOOT; f = &content_features(i); @@ -7384,6 +7726,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_ORANGE,CONTENT_BED_ORANGE_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_ORANGE_FOOT; f = &content_features(i); @@ -7435,6 +7779,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_PURPLE,CONTENT_BED_PURPLE_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_PURPLE_FOOT; f = &content_features(i); @@ -7486,6 +7832,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_RED,CONTENT_BED_RED_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_RED_FOOT; f = &content_features(i); @@ -7537,6 +7885,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_YELLOW,CONTENT_BED_YELLOW_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_YELLOW_FOOT; f = &content_features(i); @@ -7588,6 +7938,8 @@ void content_mapnode_init() f->type = CMT_WOOD; f->hardness = 0.25; crafting::setBedRecipe(CONTENT_COTTON_BLACK,CONTENT_BED_BLACK_HEAD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_BED_BLACK_FOOT; f = &content_features(i); diff --git a/src/content_mapnode.h b/src/content_mapnode.h index f89c602..5e1dec1 100644 --- a/src/content_mapnode.h +++ b/src/content_mapnode.h @@ -59,7 +59,8 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version); #define CONTENT_LOCKABLE_SIGN_WALL 22 #define CONTENT_LOCKABLE_SIGN 23 #define CONTENT_LOCKABLE_SIGN_UD 24 -// FREE 25-29 +#define CONTENT_CREATIVE_CHEST 25 +// FREE 26-29 #define CONTENT_RAIL 30 #define CONTENT_LADDER 31 #define CONTENT_LAVA 32 diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index f8cea0c..0282262 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "inventory.h" #include "content_mapnode.h" #include "content_craft.h" +#include "content_list.h" #include "log.h" #include "player.h" @@ -236,6 +237,119 @@ std::string LockingChestNodeMetadata::getDrawSpecString() "list[current_player;main;0,5;8,4;]"; } +/* + ChestNodeMetadata +*/ + +// Prototype +CreativeChestNodeMetadata proto_CreativeChestNodeMetadata; + +CreativeChestNodeMetadata::CreativeChestNodeMetadata() +{ + NodeMetadata::registerType(typeId(), create); + + m_page = 0; + + m_inventory = new Inventory(); + m_inventory->addList("0", 8*4); +} +CreativeChestNodeMetadata::~CreativeChestNodeMetadata() +{ + delete m_inventory; +} +u16 CreativeChestNodeMetadata::typeId() const +{ + return CONTENT_CREATIVE_CHEST; +} +NodeMetadata* CreativeChestNodeMetadata::create(std::istream &is) +{ + CreativeChestNodeMetadata *d = new CreativeChestNodeMetadata(); + d->m_inventory->deSerialize(is); + is>>d->m_page; + return d; +} +NodeMetadata* CreativeChestNodeMetadata::clone() +{ + CreativeChestNodeMetadata *d = new CreativeChestNodeMetadata(); + *d->m_inventory = *m_inventory; + InventoryList *l = d->m_inventory->getList("0"); + InventoryItem *t; + l->clearItems(); + std::vector &list = lists::get("creative"); + for (u16 i=0; iaddItem(t); + } + return d; +} +void CreativeChestNodeMetadata::serializeBody(std::ostream &os) +{ + m_inventory->serialize(os); + os< fields, Player *player) +{ + if (fields["prev"] == "" && fields["next"] == "") + return false; + if (fields["prev"] != "") + m_page--; + if (fields["next"] != "") + m_page++; + if (m_page < 0) + m_page = 0; + std::vector &list = lists::get("creative"); + if (m_page > (list.size()/32)) + m_page = list.size()/32; + InventoryList *l = m_inventory->getList("0"); + InventoryItem *t; + l->clearItems(); + u16 start = m_page*32; + u16 end = start+32; + if (end > list.size()) + end = list.size(); + for (u16 i=start; iaddItem(t); + } + return true; +} +std::string CreativeChestNodeMetadata::getDrawSpecString() +{ + std::vector &list = lists::get("creative"); + std::string spec("size[8,10]"); + spec += "list[current_name;0;0,0.5;8,4;]"; + spec += "button[0.25,5;2.5,0.75;prev;<< Previous Page]"; + spec += "label[3.5,5;Page "; + spec += itos(m_page+1); + spec +=" of "; + spec += itos((list.size()/32)+1); + spec += "]"; + spec += "button[6,5;2.5,0.75;next;Next Page >>]"; + spec += "list[current_player;main;0,6;8,4;]"; + + return spec; +} + /* BorderStoneNodeMetadata */ @@ -904,20 +1018,9 @@ std::string IncineratorNodeMetadata::getDrawSpecString() "list[current_player;main;0,3;8,4;]"; } - - - - - - - /* CraftGuideNodeMetadata */ -static content_t g_contents[] = { -#include "content_list.h" - CONTENT_IGNORE -}; // Prototype CraftGuideNodeMetadata proto_CraftGuideNodeMetadata; @@ -927,7 +1030,6 @@ CraftGuideNodeMetadata::CraftGuideNodeMetadata() NodeMetadata::registerType(typeId(), create); m_page = 0; - m_count = 0; m_inventory = new Inventory(); m_inventory->addList("list", 300); @@ -950,21 +1052,20 @@ NodeMetadata* CraftGuideNodeMetadata::clone() InventoryItem *t; content_t *r; l->clearItems(); - int ti = 0; - for (int i=0; g_contents[i] != CONTENT_IGNORE && ti < 40; i++) { - if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { - t = new CraftItem(g_contents[i],1); - }else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { - t = new ToolItem(g_contents[i],1); + std::vector &list = lists::get("craftguide"); + for (u16 i=0; iaddItem(t); } return d; @@ -1029,51 +1130,31 @@ bool CraftGuideNodeMetadata::receiveFields(std::string formname, std::map &list = lists::get("craftguide"); + if (m_page > (list.size()/40)) + m_page = list.size()/40; InventoryList *l = m_inventory->getList("list"); InventoryItem *t; content_t *r; - if (m_count == 0) { - for (int i=0; g_contents[i] != CONTENT_IGNORE; i++) { - if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { - t = new CraftItem(g_contents[i],1); - }else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { - t = new ToolItem(g_contents[i],1); - }else{ - t = new MaterialItem(g_contents[i],1); - } - r = crafting::getRecipe(t); - delete t; - if (!r) - continue; - m_count++; - } - } - if (m_page > (m_count/40)) - m_page = m_count/40; - ti = 0; - int ap = 0; l->clearItems(); - for (int i=0; g_contents[i] != CONTENT_IGNORE; i++) { - if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { - t = new CraftItem(g_contents[i],1); - }else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { - t = new ToolItem(g_contents[i],1); + u16 start = m_page*40; + u16 end = start+40; + if (end > list.size()) + end = list.size(); + for (int i=start; i 40) { - ti = 0; - ap++; - } - if (ap == m_page) - l->addItem(t); + l->addItem(t); } return true; } @@ -1081,28 +1162,10 @@ std::string CraftGuideNodeMetadata::getDrawSpecString() { InventoryList *l = m_inventory->getList("result"); InventoryItem *q = l->getItem(0); - InventoryItem *t; - content_t *r; int tr = 0; - m_count = 0; - for (int i=0; g_contents[i] != CONTENT_IGNORE; i++) { - if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { - t = new CraftItem(g_contents[i],1); - }else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { - t = new ToolItem(g_contents[i],1); - }else{ - t = new MaterialItem(g_contents[i],1); - } - r = crafting::getRecipe(t); - if (!r) { - delete t; - continue; - } - if (q && q->getContent() == g_contents[i]) - tr = crafting::getResultCount(t); - delete t; - m_count++; - } + std::vector &list = lists::get("craftguide"); + if (q && q->getContent() != CONTENT_IGNORE) + tr = crafting::getResultCount(q); std::string spec("size[8,9]"); spec += "label[0.5,0.75;Add item here to see recipe]"; @@ -1120,7 +1183,7 @@ std::string CraftGuideNodeMetadata::getDrawSpecString() spec += "label[3.5,3.5;Page "; spec += itos(m_page+1); spec +=" of "; - spec += itos((m_count/40)+1); + spec += itos((list.size()/40)+1); spec += "]"; spec += "button[6,3.5;2.5,0.75;next;Next Page >>]"; spec += "list[current_name;list;0,4;8,5;]"; diff --git a/src/content_nodemeta.h b/src/content_nodemeta.h index d07021f..286d01d 100644 --- a/src/content_nodemeta.h +++ b/src/content_nodemeta.h @@ -121,6 +121,27 @@ private: std::string m_owner; }; +class CreativeChestNodeMetadata : public NodeMetadata +{ +public: + CreativeChestNodeMetadata(); + ~CreativeChestNodeMetadata(); + + virtual u16 typeId() const; + static NodeMetadata* create(std::istream &is); + virtual NodeMetadata* clone(); + virtual void serializeBody(std::ostream &os); + virtual std::string infoText(); + virtual Inventory* getInventory() {return m_inventory;} + virtual bool nodeRemovalDisabled(); + virtual bool receiveFields(std::string formname, std::map fields, Player *player); + virtual std::string getDrawSpecString(); + +private: + u16 m_page; + Inventory *m_inventory; +}; + class BorderStoneNodeMetadata : public NodeMetadata { public: @@ -294,8 +315,7 @@ public: private: Inventory *m_inventory; - int m_page; - int m_count; + u16 m_page; }; #endif diff --git a/src/content_toolitem.cpp b/src/content_toolitem.cpp index 0517f65..6c120fc 100644 --- a/src/content_toolitem.cpp +++ b/src/content_toolitem.cpp @@ -20,6 +20,7 @@ #include "content_toolitem.h" #include "content_craftitem.h" #include "content_craft.h" +#include "content_list.h" #include "content_mapnode.h" #include @@ -116,6 +117,8 @@ void content_toolitem_init() f->dig_time = 1.5; crafting::setPickRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WPICK); crafting::setPickRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WPICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STPICK; f = &g_content_toolitem_features[i]; @@ -127,6 +130,8 @@ void content_toolitem_init() f->hardness = 100.; f->dig_time = 0.75; crafting::setPickRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STPICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELPICK; f = &g_content_toolitem_features[i]; @@ -138,6 +143,8 @@ void content_toolitem_init() f->hardness = 333.; f->dig_time = 0.5; crafting::setPickRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELPICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_MESEPICK; f = &g_content_toolitem_features[i]; @@ -149,6 +156,8 @@ void content_toolitem_init() f->hardness = 1337.; f->dig_time = 0.; crafting::setPickRecipe(CONTENT_MESE,CONTENT_TOOLITEM_MESEPICK); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_WSHOVEL; f = &g_content_toolitem_features[i]; @@ -161,6 +170,8 @@ void content_toolitem_init() f->dig_time = 0.4; crafting::setShovelRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSHOVEL); crafting::setShovelRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSHOVEL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STSHOVEL; f = &g_content_toolitem_features[i]; @@ -172,6 +183,8 @@ void content_toolitem_init() f->hardness = 150.; f->dig_time = 0.2; crafting::setShovelRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSHOVEL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELSHOVEL; f = &g_content_toolitem_features[i]; @@ -183,6 +196,8 @@ void content_toolitem_init() f->hardness = 400.; f->dig_time = 0.15; crafting::setShovelRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHOVEL); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_WAXE; f = &g_content_toolitem_features[i]; @@ -195,6 +210,8 @@ void content_toolitem_init() f->dig_time = 1.5; crafting::setAxeRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WAXE); crafting::setAxeRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WAXE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STAXE; f = &g_content_toolitem_features[i]; @@ -206,6 +223,8 @@ void content_toolitem_init() f->hardness = 100.; f->dig_time = 0.75; crafting::setAxeRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STAXE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELAXE; f = &g_content_toolitem_features[i]; @@ -217,6 +236,8 @@ void content_toolitem_init() f->hardness = 333.; f->dig_time = 0.5; crafting::setAxeRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELAXE); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_WSWORD; f = &g_content_toolitem_features[i]; @@ -229,6 +250,8 @@ void content_toolitem_init() f->dig_time = 1.5; crafting::setSwordRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSWORD); crafting::setSwordRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSWORD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STSWORD; f = &g_content_toolitem_features[i]; @@ -240,6 +263,8 @@ void content_toolitem_init() f->hardness = 50.; f->dig_time = 1.0; crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSWORD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELSWORD; f = &g_content_toolitem_features[i]; @@ -251,6 +276,8 @@ void content_toolitem_init() f->hardness = 80.; f->dig_time = 0.5; crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELSHEARS; f = &g_content_toolitem_features[i]; @@ -262,6 +289,8 @@ void content_toolitem_init() f->hardness = 333.; f->dig_time = 0.5; crafting::setShearsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHEARS); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_WBUCKET; f = &g_content_toolitem_features[i]; @@ -275,6 +304,8 @@ void content_toolitem_init() f->dig_time = 0.0; crafting::setURecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TOOLITEM_WBUCKET); crafting::setURecipe(CONTENT_CRAFTITEM_WOOD_PLANK,CONTENT_TOOLITEM_WBUCKET); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_TINBUCKET; f = &g_content_toolitem_features[i]; @@ -287,6 +318,8 @@ void content_toolitem_init() f->hardness = 50.; f->dig_time = 0.0; crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_WBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -295,6 +328,7 @@ void content_toolitem_init() f->name = "WBucket_water"; f->description = "Wooden Bucket of Water"; f->type = TT_SPECIAL; + lists::add("creative",i); i = CONTENT_TOOLITEM_TINBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -303,6 +337,7 @@ void content_toolitem_init() f->name = "TinBucket_water"; f->description = "Tin Bucket of Water"; f->type = TT_SPECIAL; + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELBUCKET; f = &g_content_toolitem_features[i]; @@ -315,6 +350,8 @@ void content_toolitem_init() f->hardness = 80.; f->dig_time = 0.0; crafting::setURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELBUCKET); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELBUCKET_WATER; f = &g_content_toolitem_features[i]; @@ -323,6 +360,7 @@ void content_toolitem_init() f->name = "SteelBucket_water"; f->description = "Steel Bucket of Water"; f->type = TT_SPECIAL; + lists::add("creative",i); i = CONTENT_TOOLITEM_STEELBUCKET_LAVA; f = &g_content_toolitem_features[i]; @@ -332,6 +370,7 @@ void content_toolitem_init() f->description = "Steel Bucket of Lava"; f->fuel_time = 80; f->type = TT_SPECIAL; + lists::add("creative",i); i = CONTENT_TOOLITEM_FIRESTARTER; f = &g_content_toolitem_features[i]; @@ -342,6 +381,8 @@ void content_toolitem_init() f->liquids_pointable = true; f->type = TT_SPECIAL; crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_FIRESTARTER); + lists::add("craftguide",i); + lists::add("creative",i); i = CONTENT_TOOLITEM_CROWBAR; f = &g_content_toolitem_features[i]; @@ -351,4 +392,6 @@ void content_toolitem_init() f->description = "Crowbar"; f->type = TT_SPECIAL; crafting::set1over1Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_CROWBAR); + lists::add("craftguide",i); + lists::add("creative",i); } diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index 19d02bc..82d25ec 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -800,6 +800,8 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event) quitMenu(); }else{ s.send = false; + // Restore focus to the full form + Environment->setFocus(this); } return true; }