craft guide pt3 and creative chest

This commit is contained in:
darkrose 2014-03-03 20:08:44 +10:00
parent d8a44e1cee
commit 17982b1ccf
12 changed files with 703 additions and 337 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

View File

@ -99,6 +99,7 @@ set(common_SRCS
content_craftitem.cpp content_craftitem.cpp
content_toolitem.cpp content_toolitem.cpp
content_mapnode.cpp content_mapnode.cpp
content_list.cpp
auth.cpp auth.cpp
collision.cpp collision.cpp
nodemetadata.cpp nodemetadata.cpp

View File

@ -628,6 +628,7 @@ void giveCreative(Player *player)
// CONTENT_IGNORE-terminated list // CONTENT_IGNORE-terminated list
content_t material_items[] = { content_t material_items[] = {
CONTENT_CREATIVE_CHEST,
CONTENT_TORCH, CONTENT_TORCH,
CONTENT_ROUGHSTONE, CONTENT_ROUGHSTONE,
CONTENT_MUD, CONTENT_MUD,

View File

@ -20,6 +20,7 @@
#include "content_craftitem.h" #include "content_craftitem.h"
#include "content_mapnode.h" #include "content_mapnode.h"
#include "content_craft.h" #include "content_craft.h"
#include "content_list.h"
#include <map> #include <map>
std::map<content_t,struct CraftItemFeatures> g_content_craftitem_features; std::map<content_t,struct CraftItemFeatures> g_content_craftitem_features;
@ -58,6 +59,8 @@ void content_craftitem_init()
f->name = "paper"; f->name = "paper";
f->description = "Paper"; f->description = "Paper";
crafting::setRow1Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER); crafting::setRow1Recipe(CONTENT_PAPYRUS,CONTENT_CRAFTITEM_PAPER);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CHARCOAL; i = CONTENT_CRAFTITEM_CHARCOAL;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -66,6 +69,7 @@ void content_craftitem_init()
f->name = "lump_of_charcoal"; f->name = "lump_of_charcoal";
f->description = "Charcoal Lump"; f->description = "Charcoal Lump";
f->fuel_time = 40; f->fuel_time = 40;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_COAL; i = CONTENT_CRAFTITEM_COAL;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -74,6 +78,7 @@ void content_craftitem_init()
f->name = "lump_of_coal"; f->name = "lump_of_coal";
f->description = "Coal Lump"; f->description = "Coal Lump";
f->fuel_time = 40; f->fuel_time = 40;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_IRON; i = CONTENT_CRAFTITEM_IRON;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -82,6 +87,7 @@ void content_craftitem_init()
f->name = "lump_of_iron"; f->name = "lump_of_iron";
f->description = "Iron Lump"; f->description = "Iron Lump";
f->cook_result = "CraftItem steel_ingot 1"; f->cook_result = "CraftItem steel_ingot 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CLAY; i = CONTENT_CRAFTITEM_CLAY;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -90,6 +96,7 @@ void content_craftitem_init()
f->name = "lump_of_clay"; f->name = "lump_of_clay";
f->description = "Clay Lump"; f->description = "Clay Lump";
f->cook_result = "CraftItem clay_brick 1"; f->cook_result = "CraftItem clay_brick 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_TIN; i = CONTENT_CRAFTITEM_TIN;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -98,6 +105,7 @@ void content_craftitem_init()
f->name = "lump_of_tin"; f->name = "lump_of_tin";
f->description = "Tin Lump"; f->description = "Tin Lump";
f->cook_result = "CraftItem tin_ingot 1"; f->cook_result = "CraftItem tin_ingot 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_COPPER; i = CONTENT_CRAFTITEM_COPPER;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -106,6 +114,7 @@ void content_craftitem_init()
f->name = "lump_of_copper"; f->name = "lump_of_copper";
f->description = "Copper Lump"; f->description = "Copper Lump";
f->cook_result = "CraftItem copper_ingot 1"; f->cook_result = "CraftItem copper_ingot 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_SILVER; i = CONTENT_CRAFTITEM_SILVER;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -114,6 +123,7 @@ void content_craftitem_init()
f->name = "lump_of_silver"; f->name = "lump_of_silver";
f->description = "Silver Lump"; f->description = "Silver Lump";
f->cook_result = "CraftItem silver_ingot 1"; f->cook_result = "CraftItem silver_ingot 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_GOLD; i = CONTENT_CRAFTITEM_GOLD;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -122,6 +132,7 @@ void content_craftitem_init()
f->name = "lump_of_gold"; f->name = "lump_of_gold";
f->description = "Gold Lump"; f->description = "Gold Lump";
f->cook_result = "CraftItem gold_ingot 1"; f->cook_result = "CraftItem gold_ingot 1";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_QUARTZ; i = CONTENT_CRAFTITEM_QUARTZ;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -129,6 +140,7 @@ void content_craftitem_init()
f->texture = "lump_of_quartz.png"; f->texture = "lump_of_quartz.png";
f->name = "lump_of_quartz"; f->name = "lump_of_quartz";
f->description = "Quartz Crystal"; f->description = "Quartz Crystal";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_TIN_INGOT; i = CONTENT_CRAFTITEM_TIN_INGOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -136,6 +148,7 @@ void content_craftitem_init()
f->texture = "tin_ingot.png"; f->texture = "tin_ingot.png";
f->name = "tin_ingot"; f->name = "tin_ingot";
f->description = "Tin Ingot"; f->description = "Tin Ingot";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_COPPER_INGOT; i = CONTENT_CRAFTITEM_COPPER_INGOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -143,6 +156,7 @@ void content_craftitem_init()
f->texture = "copper_ingot.png"; f->texture = "copper_ingot.png";
f->name = "copper_ingot"; f->name = "copper_ingot";
f->description = "Copper Ingot"; f->description = "Copper Ingot";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_SILVER_INGOT; i = CONTENT_CRAFTITEM_SILVER_INGOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -150,6 +164,7 @@ void content_craftitem_init()
f->texture = "silver_ingot.png"; f->texture = "silver_ingot.png";
f->name = "silver_ingot"; f->name = "silver_ingot";
f->description = "Silver Ingot"; f->description = "Silver Ingot";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_GOLD_INGOT; i = CONTENT_CRAFTITEM_GOLD_INGOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -157,6 +172,7 @@ void content_craftitem_init()
f->texture = "gold_ingot.png"; f->texture = "gold_ingot.png";
f->name = "gold_ingot"; f->name = "gold_ingot";
f->description = "Gold Ingot"; f->description = "Gold Ingot";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_FLINT; i = CONTENT_CRAFTITEM_FLINT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -164,6 +180,7 @@ void content_craftitem_init()
f->texture = "lump_of_flint.png"; f->texture = "lump_of_flint.png";
f->name = "lump_of_flint"; f->name = "lump_of_flint";
f->description = "Flint"; f->description = "Flint";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_STEEL_INGOT; i = CONTENT_CRAFTITEM_STEEL_INGOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -171,6 +188,7 @@ void content_craftitem_init()
f->texture = "steel_ingot.png"; f->texture = "steel_ingot.png";
f->name = "steel_ingot"; f->name = "steel_ingot";
f->description = "Steel Ingot"; f->description = "Steel Ingot";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CLAY_BRICK; i = CONTENT_CRAFTITEM_CLAY_BRICK;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -178,6 +196,7 @@ void content_craftitem_init()
f->texture = "clay_brick.png"; f->texture = "clay_brick.png";
f->name = "clay_brick"; f->name = "clay_brick";
f->description = "Brick"; f->description = "Brick";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_RAT; i = CONTENT_CRAFTITEM_RAT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -187,6 +206,7 @@ void content_craftitem_init()
f->description = "Rat"; f->description = "Rat";
f->cook_result = "CraftItem cooked_rat 1"; f->cook_result = "CraftItem cooked_rat 1";
f->drop_count = 1; f->drop_count = 1;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_COOKED_RAT; i = CONTENT_CRAFTITEM_COOKED_RAT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -196,6 +216,7 @@ void content_craftitem_init()
f->description = "Cooked Rat"; f->description = "Cooked Rat";
f->cook_result = "CraftItem scorched_stuff 1"; f->cook_result = "CraftItem scorched_stuff 1";
f->edible = 6; f->edible = 6;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_SCORCHED_STUFF; i = CONTENT_CRAFTITEM_SCORCHED_STUFF;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -203,6 +224,7 @@ void content_craftitem_init()
f->texture = "scorched_stuff.png"; f->texture = "scorched_stuff.png";
f->name = "scorched_stuff"; f->name = "scorched_stuff";
f->description = "Scorched Stuff"; f->description = "Scorched Stuff";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_FIREFLY; i = CONTENT_CRAFTITEM_FIREFLY;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -211,6 +233,7 @@ void content_craftitem_init()
f->name = "firefly"; f->name = "firefly";
f->description = "Firefly"; f->description = "Firefly";
f->drop_count = 1; f->drop_count = 1;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_APPLE; i = CONTENT_CRAFTITEM_APPLE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -219,6 +242,7 @@ void content_craftitem_init()
f->name = "apple"; f->name = "apple";
f->description = "Apple"; f->description = "Apple";
f->edible = 4; f->edible = 4;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_APPLE_IRON; i = CONTENT_CRAFTITEM_APPLE_IRON;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -235,6 +259,8 @@ void content_craftitem_init()
}; };
crafting::setRecipe(recipe,CONTENT_CRAFTITEM_APPLE_IRON,1); crafting::setRecipe(recipe,CONTENT_CRAFTITEM_APPLE_IRON,1);
} }
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_DYE_BLUE; i = CONTENT_CRAFTITEM_DYE_BLUE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -243,6 +269,8 @@ void content_craftitem_init()
f->name = "dye_blue"; f->name = "dye_blue";
f->description = "Blue Dye"; f->description = "Blue Dye";
crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE); crafting::set1To2Recipe(CONTENT_FLOWER_TULIP,CONTENT_CRAFTITEM_DYE_BLUE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_DYE_GREEN; i = CONTENT_CRAFTITEM_DYE_GREEN;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -251,6 +279,8 @@ void content_craftitem_init()
f->name = "dye_green"; f->name = "dye_green";
f->description = "Green Dye"; f->description = "Green Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_GREEN); 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; i = CONTENT_CRAFTITEM_DYE_ORANGE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -259,6 +289,8 @@ void content_craftitem_init()
f->name = "dye_orange"; f->name = "dye_orange";
f->description = "Orange Dye"; f->description = "Orange Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_CRAFTITEM_DYE_ORANGE); 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; i = CONTENT_CRAFTITEM_DYE_PURPLE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -267,6 +299,8 @@ void content_craftitem_init()
f->name = "dye_purple"; f->name = "dye_purple";
f->description = "Purple Dye"; f->description = "Purple Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_CRAFTITEM_DYE_RED,CONTENT_CRAFTITEM_DYE_PURPLE); 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; i = CONTENT_CRAFTITEM_DYE_RED;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -275,6 +309,8 @@ void content_craftitem_init()
f->name = "dye_red"; f->name = "dye_red";
f->description = "Red Dye"; f->description = "Red Dye";
crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED); crafting::set1To2Recipe(CONTENT_FLOWER_ROSE,CONTENT_CRAFTITEM_DYE_RED);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_DYE_YELLOW; i = CONTENT_CRAFTITEM_DYE_YELLOW;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -284,6 +320,8 @@ void content_craftitem_init()
f->description = "Yellow Dye"; f->description = "Yellow Dye";
crafting::set1To2Recipe(CONTENT_CACTUS_BLOSSOM,CONTENT_CRAFTITEM_DYE_YELLOW); crafting::set1To2Recipe(CONTENT_CACTUS_BLOSSOM,CONTENT_CRAFTITEM_DYE_YELLOW);
crafting::set1To2Recipe(CONTENT_FLOWER_DAFFODIL,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; i = CONTENT_CRAFTITEM_DYE_WHITE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -293,6 +331,8 @@ void content_craftitem_init()
f->description = "White Dye"; f->description = "White Dye";
crafting::set1To1Recipe(CONTENT_CRAFTITEM_APPLE_BLOSSOM,CONTENT_CRAFTITEM_DYE_WHITE); 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); 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; i = CONTENT_CRAFTITEM_DYE_BLACK;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -301,6 +341,8 @@ void content_craftitem_init()
f->name = "dye_black"; f->name = "dye_black";
f->description = "Black Dye"; f->description = "Black Dye";
crafting::set2Any2Recipe(CONTENT_CRAFTITEM_DYE_WHITE,CONTENT_CRAFTITEM_COAL,CONTENT_CRAFTITEM_DYE_BLACK); 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; i = CONTENT_CRAFTITEM_QUARTZ_DUST;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -309,6 +351,8 @@ void content_craftitem_init()
f->name = "quartz_dust"; f->name = "quartz_dust";
f->description = "Quartz Dust"; f->description = "Quartz Dust";
crafting::set1To1Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST); crafting::set1To1Recipe(CONTENT_CRAFTITEM_QUARTZ,CONTENT_CRAFTITEM_QUARTZ_DUST);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_SALTPETER; i = CONTENT_CRAFTITEM_SALTPETER;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -316,6 +360,7 @@ void content_craftitem_init()
f->texture = "saltpeter.png"; f->texture = "saltpeter.png";
f->name = "saltpeter"; f->name = "saltpeter";
f->description = "Saltpeter"; f->description = "Saltpeter";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_GUNPOWDER; i = CONTENT_CRAFTITEM_GUNPOWDER;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -324,6 +369,8 @@ void content_craftitem_init()
f->name = "gunpowder"; f->name = "gunpowder";
f->description = "Gun Powder"; f->description = "Gun Powder";
crafting::set1Any3Recipe(CONTENT_CRAFTITEM_CHARCOAL,CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_SALTPETER,CONTENT_CRAFTITEM_GUNPOWDER); 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; i = CONTENT_CRAFTITEM_SNOW_BALL;
f = &g_content_craftitem_features[i]; 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_APPLE_LEAVES,CONTENT_CRAFTITEM_STICK);
crafting::set1To2Recipe(CONTENT_JUNGLELEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_JUNGLELEAVES,CONTENT_CRAFTITEM_STICK);
crafting::set1To2Recipe(CONTENT_CONIFER_LEAVES,CONTENT_CRAFTITEM_STICK); crafting::set1To2Recipe(CONTENT_CONIFER_LEAVES,CONTENT_CRAFTITEM_STICK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_PINE_PLANK; i = CONTENT_CRAFTITEM_PINE_PLANK;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -355,6 +404,8 @@ void content_craftitem_init()
f->description = "Pine Plank"; f->description = "Pine Plank";
f->fuel_time = 30/16; f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK); crafting::set1To4Recipe(CONTENT_WOOD_PINE,CONTENT_CRAFTITEM_PINE_PLANK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_WOOD_PLANK; i = CONTENT_CRAFTITEM_WOOD_PLANK;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -364,6 +415,8 @@ void content_craftitem_init()
f->description = "Wood Plank"; f->description = "Wood Plank";
f->fuel_time = 30/16; f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK); crafting::set1To4Recipe(CONTENT_WOOD,CONTENT_CRAFTITEM_WOOD_PLANK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_JUNGLE_PLANK; i = CONTENT_CRAFTITEM_JUNGLE_PLANK;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -373,6 +426,8 @@ void content_craftitem_init()
f->description = "Jungle Wood Plank"; f->description = "Jungle Wood Plank";
f->fuel_time = 30/16; f->fuel_time = 30/16;
crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK); crafting::set1To4Recipe(CONTENT_JUNGLEWOOD,CONTENT_CRAFTITEM_JUNGLE_PLANK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_TNT; i = CONTENT_CRAFTITEM_TNT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -388,6 +443,8 @@ void content_craftitem_init()
}; };
crafting::setRecipe(recipe,CONTENT_CRAFTITEM_TNT,1); crafting::setRecipe(recipe,CONTENT_CRAFTITEM_TNT,1);
} }
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_ASH; i = CONTENT_CRAFTITEM_ASH;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -395,6 +452,7 @@ void content_craftitem_init()
f->texture = "lump_of_ash.png"; f->texture = "lump_of_ash.png";
f->name = "lump_of_ash"; f->name = "lump_of_ash";
f->description = "Ash"; f->description = "Ash";
lists::add("creative",i);
i = CONTENT_CRAFTITEM_APPLE_BLOSSOM; i = CONTENT_CRAFTITEM_APPLE_BLOSSOM;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -404,6 +462,7 @@ void content_craftitem_init()
f->description = "Apple Blossoms"; f->description = "Apple Blossoms";
f->edible = 1; f->edible = 1;
f->fuel_time = 30/16; f->fuel_time = 30/16;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CACTUS_FRUIT; i = CONTENT_CRAFTITEM_CACTUS_FRUIT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -412,6 +471,7 @@ void content_craftitem_init()
f->name = "cactus_fruit"; f->name = "cactus_fruit";
f->description = "Cactus Berry"; f->description = "Cactus Berry";
f->edible = 3; f->edible = 3;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_ROTTEN_FRUIT; i = CONTENT_CRAFTITEM_ROTTEN_FRUIT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -420,6 +480,7 @@ void content_craftitem_init()
f->name = "rotten_fruit"; f->name = "rotten_fruit";
f->description = "Rotten Fruit"; f->description = "Rotten Fruit";
f->edible = -1; f->edible = -1;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_MUSH; i = CONTENT_CRAFTITEM_MUSH;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -428,6 +489,7 @@ void content_craftitem_init()
f->name = "mushed_food"; f->name = "mushed_food";
f->description = "Mushed Food"; f->description = "Mushed Food";
f->edible = -1; f->edible = -1;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_PUMPKINSLICE; i = CONTENT_CRAFTITEM_PUMPKINSLICE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -437,6 +499,8 @@ void content_craftitem_init()
f->description = "Sliced Pumpkin"; f->description = "Sliced Pumpkin";
f->edible = 2; f->edible = 2;
crafting::set1To2Recipe(CONTENT_FARM_PUMPKIN,CONTENT_CRAFTITEM_PUMPKINSLICE); crafting::set1To2Recipe(CONTENT_FARM_PUMPKIN,CONTENT_CRAFTITEM_PUMPKINSLICE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW; i = CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -447,6 +511,7 @@ void content_craftitem_init()
f->cook_result = std::string("CraftItem pumpkin_pie 1"); f->cook_result = std::string("CraftItem pumpkin_pie 1");
f->edible = 3; f->edible = 3;
crafting::set1over1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW); crafting::set1over1Recipe(CONTENT_CRAFTITEM_PUMPKINSLICE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_PUMPKIN_PIE_RAW);
lists::add("craftguide",i);
i = CONTENT_CRAFTITEM_PUMPKIN_PIE; i = CONTENT_CRAFTITEM_PUMPKIN_PIE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -455,6 +520,7 @@ void content_craftitem_init()
f->name = "pumpkin_pie"; f->name = "pumpkin_pie";
f->description = "Pumpkin Pie"; f->description = "Pumpkin Pie";
f->edible = 6; f->edible = 6;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_APPLE_PIE_RAW; i = CONTENT_CRAFTITEM_APPLE_PIE_RAW;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -465,6 +531,7 @@ void content_craftitem_init()
f->cook_result = std::string("CraftItem apple_pie 1"); f->cook_result = std::string("CraftItem apple_pie 1");
f->edible = 3; f->edible = 3;
crafting::set1over1Recipe(CONTENT_CRAFTITEM_APPLE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_APPLE_PIE_RAW); crafting::set1over1Recipe(CONTENT_CRAFTITEM_APPLE,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_APPLE_PIE_RAW);
lists::add("craftguide",i);
i = CONTENT_CRAFTITEM_APPLE_PIE; i = CONTENT_CRAFTITEM_APPLE_PIE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -473,6 +540,7 @@ void content_craftitem_init()
f->name = "apple_pie"; f->name = "apple_pie";
f->description = "Apple Pie"; f->description = "Apple Pie";
f->edible = 6; f->edible = 6;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_MELONSLICE; i = CONTENT_CRAFTITEM_MELONSLICE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -482,6 +550,8 @@ void content_craftitem_init()
f->description = "Sliced Melon"; f->description = "Sliced Melon";
f->edible = 4; f->edible = 4;
crafting::set1To2Recipe(CONTENT_FARM_MELON,CONTENT_CRAFTITEM_MELONSLICE); crafting::set1To2Recipe(CONTENT_FARM_MELON,CONTENT_CRAFTITEM_MELONSLICE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_WHEAT; i = CONTENT_CRAFTITEM_WHEAT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -490,6 +560,7 @@ void content_craftitem_init()
f->name = "harvested_wheat"; f->name = "harvested_wheat";
f->description = "Wheat"; f->description = "Wheat";
f->edible = 1; f->edible = 1;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_FLOUR; i = CONTENT_CRAFTITEM_FLOUR;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -499,6 +570,8 @@ void content_craftitem_init()
f->description = "Flour"; f->description = "Flour";
f->edible = 1; f->edible = 1;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_FLOUR); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_WHEAT,CONTENT_CRAFTITEM_FLOUR);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_DOUGH; i = CONTENT_CRAFTITEM_DOUGH;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -509,6 +582,8 @@ void content_craftitem_init()
f->cook_result = std::string("CraftItem bread 1"); f->cook_result = std::string("CraftItem bread 1");
f->edible = 2; f->edible = 2;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_DOUGH); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_FLOUR,CONTENT_CRAFTITEM_DOUGH);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_BREAD; i = CONTENT_CRAFTITEM_BREAD;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -517,6 +592,7 @@ void content_craftitem_init()
f->name = "bread"; f->name = "bread";
f->description = "Bread"; f->description = "Bread";
f->edible = 5; f->edible = 5;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_POTATO; i = CONTENT_CRAFTITEM_POTATO;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -526,6 +602,7 @@ void content_craftitem_init()
f->description = "Potato"; f->description = "Potato";
f->cook_result = std::string("CraftItem roast_potato 1"); f->cook_result = std::string("CraftItem roast_potato 1");
f->edible = 3; f->edible = 3;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_STARCH; i = CONTENT_CRAFTITEM_STARCH;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -534,6 +611,8 @@ void content_craftitem_init()
f->name = "potato_starch"; f->name = "potato_starch";
f->description = "Potato Starch"; f->description = "Potato Starch";
crafting::set1To2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_STARCH); crafting::set1To2Recipe(CONTENT_CRAFTITEM_POTATO,CONTENT_CRAFTITEM_STARCH);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_CRAFTITEM_ROASTPOTATO; i = CONTENT_CRAFTITEM_ROASTPOTATO;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -542,6 +621,7 @@ void content_craftitem_init()
f->name = "roast_potato"; f->name = "roast_potato";
f->description = "Roast Potato"; f->description = "Roast Potato";
f->edible = 6; f->edible = 6;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CARROT; i = CONTENT_CRAFTITEM_CARROT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -550,6 +630,7 @@ void content_craftitem_init()
f->name = "harvested_carrot"; f->name = "harvested_carrot";
f->description = "Carrot"; f->description = "Carrot";
f->edible = 4; f->edible = 4;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_CARROT_CAKE_RAW; i = CONTENT_CRAFTITEM_CARROT_CAKE_RAW;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -560,6 +641,7 @@ void content_craftitem_init()
f->cook_result = std::string("CraftItem carrot_cake 1"); f->cook_result = std::string("CraftItem carrot_cake 1");
f->edible = 3; f->edible = 3;
crafting::set1over1Recipe(CONTENT_CRAFTITEM_CARROT,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_CARROT_CAKE_RAW); crafting::set1over1Recipe(CONTENT_CRAFTITEM_CARROT,CONTENT_CRAFTITEM_DOUGH,CONTENT_CRAFTITEM_CARROT_CAKE_RAW);
lists::add("craftguide",i);
i = CONTENT_CRAFTITEM_CARROT_CAKE; i = CONTENT_CRAFTITEM_CARROT_CAKE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -568,6 +650,7 @@ void content_craftitem_init()
f->name = "carrot_cake"; f->name = "carrot_cake";
f->description = "Carrot Cake"; f->description = "Carrot Cake";
f->edible = 6; f->edible = 6;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_BEETROOT; i = CONTENT_CRAFTITEM_BEETROOT;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -576,6 +659,7 @@ void content_craftitem_init()
f->name = "harvested_beetroot"; f->name = "harvested_beetroot";
f->description = "Beetroot"; f->description = "Beetroot";
f->edible = 3; f->edible = 3;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_GRAPE; i = CONTENT_CRAFTITEM_GRAPE;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -584,6 +668,7 @@ void content_craftitem_init()
f->name = "harvested_grape"; f->name = "harvested_grape";
f->description = "Bunch of Grapes"; f->description = "Bunch of Grapes";
f->edible = 4; f->edible = 4;
lists::add("creative",i);
i = CONTENT_CRAFTITEM_STRING; i = CONTENT_CRAFTITEM_STRING;
f = &g_content_craftitem_features[i]; f = &g_content_craftitem_features[i];
@ -591,4 +676,5 @@ void content_craftitem_init()
f->texture = "string.png"; f->texture = "string.png";
f->name = "string"; f->name = "string";
f->description = "String"; f->description = "String";
lists::add("creative",i);
} }

42
src/content_list.cpp Normal file
View File

@ -0,0 +1,42 @@
/************************************************************************
* content_list.cpp
* minetest-classic - 3d voxel world sandbox game
* Copyright (C) Lisa Milne 2014 <lisa@ltmnet.com>
*
* 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 <http://www.gnu.org/licenses/>
************************************************************************/
#include "mapnode.h"
#include "content_mapnode.h"
#include "content_list.h"
#include <map>
#include <vector>
#include <algorithm>
namespace lists {
std::map< std::string , std::vector<content_t> > 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<content_t> &get(std::string name)
{
return c_lists[name];
}
};

View File

@ -1,258 +1,13 @@
CONTENT_CRAFTITEM_PAPER, #ifndef _CONTENT_LIST_H
CONTENT_BOOK, #define _CONTENT_LIST_H
CONTENT_CRAFTITEM_CHARCOAL,
CONTENT_CRAFTITEM_COAL, #include <vector>
CONTENT_CRAFTITEM_IRON,
CONTENT_CRAFTITEM_CLAY, namespace lists {
CONTENT_CRAFTITEM_TIN,
CONTENT_CRAFTITEM_COPPER, void add(std::string name, content_t c);
CONTENT_CRAFTITEM_SILVER, std::vector<content_t> &get(std::string name);
CONTENT_CRAFTITEM_GOLD,
CONTENT_CRAFTITEM_QUARTZ, };
CONTENT_CRAFTITEM_TIN_INGOT,
CONTENT_CRAFTITEM_COPPER_INGOT, #endif
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,

File diff suppressed because it is too large Load Diff

View File

@ -59,7 +59,8 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
#define CONTENT_LOCKABLE_SIGN_WALL 22 #define CONTENT_LOCKABLE_SIGN_WALL 22
#define CONTENT_LOCKABLE_SIGN 23 #define CONTENT_LOCKABLE_SIGN 23
#define CONTENT_LOCKABLE_SIGN_UD 24 #define CONTENT_LOCKABLE_SIGN_UD 24
// FREE 25-29 #define CONTENT_CREATIVE_CHEST 25
// FREE 26-29
#define CONTENT_RAIL 30 #define CONTENT_RAIL 30
#define CONTENT_LADDER 31 #define CONTENT_LADDER 31
#define CONTENT_LAVA 32 #define CONTENT_LAVA 32

View File

@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "inventory.h" #include "inventory.h"
#include "content_mapnode.h" #include "content_mapnode.h"
#include "content_craft.h" #include "content_craft.h"
#include "content_list.h"
#include "log.h" #include "log.h"
#include "player.h" #include "player.h"
@ -236,6 +237,119 @@ std::string LockingChestNodeMetadata::getDrawSpecString()
"list[current_player;main;0,5;8,4;]"; "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<content_t> &list = lists::get("creative");
for (u16 i=0; i<list.size() && i < 32; i++) {
if ((list[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) {
t = new CraftItem(list[i],1);
}else if ((list[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) {
t = new ToolItem(list[i],1);
}else{
t = new MaterialItem(list[i],1);
}
l->addItem(t);
}
return d;
}
void CreativeChestNodeMetadata::serializeBody(std::ostream &os)
{
m_inventory->serialize(os);
os<<itos(m_page) << " ";
}
std::string CreativeChestNodeMetadata::infoText()
{
return "Creative Chest";
}
bool CreativeChestNodeMetadata::nodeRemovalDisabled()
{
return false;
}
bool CreativeChestNodeMetadata::receiveFields(std::string formname, std::map<std::string, std::string> 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<content_t> &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; i<end; i++) {
if ((list[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) {
t = new CraftItem(list[i],1);
}else if ((list[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) {
t = new ToolItem(list[i],1);
}else{
t = new MaterialItem(list[i],1);
}
l->addItem(t);
}
return true;
}
std::string CreativeChestNodeMetadata::getDrawSpecString()
{
std::vector<content_t> &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 BorderStoneNodeMetadata
*/ */
@ -904,20 +1018,9 @@ std::string IncineratorNodeMetadata::getDrawSpecString()
"list[current_player;main;0,3;8,4;]"; "list[current_player;main;0,3;8,4;]";
} }
/* /*
CraftGuideNodeMetadata CraftGuideNodeMetadata
*/ */
static content_t g_contents[] = {
#include "content_list.h"
CONTENT_IGNORE
};
// Prototype // Prototype
CraftGuideNodeMetadata proto_CraftGuideNodeMetadata; CraftGuideNodeMetadata proto_CraftGuideNodeMetadata;
@ -927,7 +1030,6 @@ CraftGuideNodeMetadata::CraftGuideNodeMetadata()
NodeMetadata::registerType(typeId(), create); NodeMetadata::registerType(typeId(), create);
m_page = 0; m_page = 0;
m_count = 0;
m_inventory = new Inventory(); m_inventory = new Inventory();
m_inventory->addList("list", 300); m_inventory->addList("list", 300);
@ -950,21 +1052,20 @@ NodeMetadata* CraftGuideNodeMetadata::clone()
InventoryItem *t; InventoryItem *t;
content_t *r; content_t *r;
l->clearItems(); l->clearItems();
int ti = 0; std::vector<content_t> &list = lists::get("craftguide");
for (int i=0; g_contents[i] != CONTENT_IGNORE && ti < 40; i++) { for (u16 i=0; i<list.size() && i < 40; i++) {
if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { if ((list[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) {
t = new CraftItem(g_contents[i],1); t = new CraftItem(list[i],1);
}else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { }else if ((list[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) {
t = new ToolItem(g_contents[i],1); t = new ToolItem(list[i],1);
}else{ }else{
t = new MaterialItem(g_contents[i],1); t = new MaterialItem(list[i],1);
} }
r = crafting::getRecipe(t); r = crafting::getRecipe(t);
if (!r) { if (!r) {
delete t; delete t;
continue; continue;
} }
ti++;
l->addItem(t); l->addItem(t);
} }
return d; return d;
@ -1029,51 +1130,31 @@ bool CraftGuideNodeMetadata::receiveFields(std::string formname, std::map<std::s
m_page++; m_page++;
if (m_page < 0) if (m_page < 0)
m_page = 0; m_page = 0;
int ti = 0; std::vector<content_t> &list = lists::get("craftguide");
if (m_page > (list.size()/40))
m_page = list.size()/40;
InventoryList *l = m_inventory->getList("list"); InventoryList *l = m_inventory->getList("list");
InventoryItem *t; InventoryItem *t;
content_t *r; 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(); l->clearItems();
for (int i=0; g_contents[i] != CONTENT_IGNORE; i++) { u16 start = m_page*40;
if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { u16 end = start+40;
t = new CraftItem(g_contents[i],1); if (end > list.size())
}else if ((g_contents[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { end = list.size();
t = new ToolItem(g_contents[i],1); for (int i=start; i<end; i++) {
if ((list[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) {
t = new CraftItem(list[i],1);
}else if ((list[i]&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) {
t = new ToolItem(list[i],1);
}else{ }else{
t = new MaterialItem(g_contents[i],1); t = new MaterialItem(list[i],1);
} }
r = crafting::getRecipe(t); r = crafting::getRecipe(t);
if (!r) { if (!r) {
delete t; delete t;
continue; continue;
} }
ti++; l->addItem(t);
if (ti > 40) {
ti = 0;
ap++;
}
if (ap == m_page)
l->addItem(t);
} }
return true; return true;
} }
@ -1081,28 +1162,10 @@ std::string CraftGuideNodeMetadata::getDrawSpecString()
{ {
InventoryList *l = m_inventory->getList("result"); InventoryList *l = m_inventory->getList("result");
InventoryItem *q = l->getItem(0); InventoryItem *q = l->getItem(0);
InventoryItem *t;
content_t *r;
int tr = 0; int tr = 0;
m_count = 0; std::vector<content_t> &list = lists::get("craftguide");
for (int i=0; g_contents[i] != CONTENT_IGNORE; i++) { if (q && q->getContent() != CONTENT_IGNORE)
if ((g_contents[i]&CONTENT_CRAFTITEM_MASK) == CONTENT_CRAFTITEM_MASK) { tr = crafting::getResultCount(q);
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::string spec("size[8,9]"); std::string spec("size[8,9]");
spec += "label[0.5,0.75;Add item here to see recipe]"; 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 += "label[3.5,3.5;Page ";
spec += itos(m_page+1); spec += itos(m_page+1);
spec +=" of "; spec +=" of ";
spec += itos((m_count/40)+1); spec += itos((list.size()/40)+1);
spec += "]"; spec += "]";
spec += "button[6,3.5;2.5,0.75;next;Next Page >>]"; spec += "button[6,3.5;2.5,0.75;next;Next Page >>]";
spec += "list[current_name;list;0,4;8,5;]"; spec += "list[current_name;list;0,4;8,5;]";

View File

@ -121,6 +121,27 @@ private:
std::string m_owner; 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<std::string, std::string> fields, Player *player);
virtual std::string getDrawSpecString();
private:
u16 m_page;
Inventory *m_inventory;
};
class BorderStoneNodeMetadata : public NodeMetadata class BorderStoneNodeMetadata : public NodeMetadata
{ {
public: public:
@ -294,8 +315,7 @@ public:
private: private:
Inventory *m_inventory; Inventory *m_inventory;
int m_page; u16 m_page;
int m_count;
}; };
#endif #endif

View File

@ -20,6 +20,7 @@
#include "content_toolitem.h" #include "content_toolitem.h"
#include "content_craftitem.h" #include "content_craftitem.h"
#include "content_craft.h" #include "content_craft.h"
#include "content_list.h"
#include "content_mapnode.h" #include "content_mapnode.h"
#include <map> #include <map>
@ -116,6 +117,8 @@ void content_toolitem_init()
f->dig_time = 1.5; f->dig_time = 1.5;
crafting::setPickRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WPICK); crafting::setPickRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WPICK);
crafting::setPickRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WPICK); crafting::setPickRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WPICK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STPICK; i = CONTENT_TOOLITEM_STPICK;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -127,6 +130,8 @@ void content_toolitem_init()
f->hardness = 100.; f->hardness = 100.;
f->dig_time = 0.75; f->dig_time = 0.75;
crafting::setPickRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STPICK); crafting::setPickRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STPICK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELPICK; i = CONTENT_TOOLITEM_STEELPICK;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -138,6 +143,8 @@ void content_toolitem_init()
f->hardness = 333.; f->hardness = 333.;
f->dig_time = 0.5; f->dig_time = 0.5;
crafting::setPickRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELPICK); crafting::setPickRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELPICK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_MESEPICK; i = CONTENT_TOOLITEM_MESEPICK;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -149,6 +156,8 @@ void content_toolitem_init()
f->hardness = 1337.; f->hardness = 1337.;
f->dig_time = 0.; f->dig_time = 0.;
crafting::setPickRecipe(CONTENT_MESE,CONTENT_TOOLITEM_MESEPICK); crafting::setPickRecipe(CONTENT_MESE,CONTENT_TOOLITEM_MESEPICK);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_WSHOVEL; i = CONTENT_TOOLITEM_WSHOVEL;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -161,6 +170,8 @@ void content_toolitem_init()
f->dig_time = 0.4; f->dig_time = 0.4;
crafting::setShovelRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSHOVEL); crafting::setShovelRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSHOVEL);
crafting::setShovelRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSHOVEL); crafting::setShovelRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSHOVEL);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STSHOVEL; i = CONTENT_TOOLITEM_STSHOVEL;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -172,6 +183,8 @@ void content_toolitem_init()
f->hardness = 150.; f->hardness = 150.;
f->dig_time = 0.2; f->dig_time = 0.2;
crafting::setShovelRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSHOVEL); crafting::setShovelRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSHOVEL);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELSHOVEL; i = CONTENT_TOOLITEM_STEELSHOVEL;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -183,6 +196,8 @@ void content_toolitem_init()
f->hardness = 400.; f->hardness = 400.;
f->dig_time = 0.15; f->dig_time = 0.15;
crafting::setShovelRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHOVEL); crafting::setShovelRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHOVEL);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_WAXE; i = CONTENT_TOOLITEM_WAXE;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -195,6 +210,8 @@ void content_toolitem_init()
f->dig_time = 1.5; f->dig_time = 1.5;
crafting::setAxeRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WAXE); crafting::setAxeRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WAXE);
crafting::setAxeRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WAXE); crafting::setAxeRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WAXE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STAXE; i = CONTENT_TOOLITEM_STAXE;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -206,6 +223,8 @@ void content_toolitem_init()
f->hardness = 100.; f->hardness = 100.;
f->dig_time = 0.75; f->dig_time = 0.75;
crafting::setAxeRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STAXE); crafting::setAxeRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STAXE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELAXE; i = CONTENT_TOOLITEM_STEELAXE;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -217,6 +236,8 @@ void content_toolitem_init()
f->hardness = 333.; f->hardness = 333.;
f->dig_time = 0.5; f->dig_time = 0.5;
crafting::setAxeRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELAXE); crafting::setAxeRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELAXE);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_WSWORD; i = CONTENT_TOOLITEM_WSWORD;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -229,6 +250,8 @@ void content_toolitem_init()
f->dig_time = 1.5; f->dig_time = 1.5;
crafting::setSwordRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSWORD); crafting::setSwordRecipe(CONTENT_WOOD,CONTENT_TOOLITEM_WSWORD);
crafting::setSwordRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSWORD); crafting::setSwordRecipe(CONTENT_JUNGLEWOOD,CONTENT_TOOLITEM_WSWORD);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STSWORD; i = CONTENT_TOOLITEM_STSWORD;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -240,6 +263,8 @@ void content_toolitem_init()
f->hardness = 50.; f->hardness = 50.;
f->dig_time = 1.0; f->dig_time = 1.0;
crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSWORD); crafting::setSwordRecipe(CONTENT_ROUGHSTONE,CONTENT_TOOLITEM_STSWORD);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELSWORD; i = CONTENT_TOOLITEM_STEELSWORD;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -251,6 +276,8 @@ void content_toolitem_init()
f->hardness = 80.; f->hardness = 80.;
f->dig_time = 0.5; f->dig_time = 0.5;
crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD); crafting::setSwordRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSWORD);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELSHEARS; i = CONTENT_TOOLITEM_STEELSHEARS;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -262,6 +289,8 @@ void content_toolitem_init()
f->hardness = 333.; f->hardness = 333.;
f->dig_time = 0.5; f->dig_time = 0.5;
crafting::setShearsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHEARS); crafting::setShearsRecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELSHEARS);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_WBUCKET; i = CONTENT_TOOLITEM_WBUCKET;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -275,6 +304,8 @@ void content_toolitem_init()
f->dig_time = 0.0; f->dig_time = 0.0;
crafting::setURecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TOOLITEM_WBUCKET); crafting::setURecipe(CONTENT_CRAFTITEM_JUNGLE_PLANK,CONTENT_TOOLITEM_WBUCKET);
crafting::setURecipe(CONTENT_CRAFTITEM_WOOD_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; i = CONTENT_TOOLITEM_TINBUCKET;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -287,6 +318,8 @@ void content_toolitem_init()
f->hardness = 50.; f->hardness = 50.;
f->dig_time = 0.0; f->dig_time = 0.0;
crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET); crafting::setURecipe(CONTENT_CRAFTITEM_TIN_INGOT,CONTENT_TOOLITEM_TINBUCKET);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_WBUCKET_WATER; i = CONTENT_TOOLITEM_WBUCKET_WATER;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -295,6 +328,7 @@ void content_toolitem_init()
f->name = "WBucket_water"; f->name = "WBucket_water";
f->description = "Wooden Bucket of Water"; f->description = "Wooden Bucket of Water";
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
lists::add("creative",i);
i = CONTENT_TOOLITEM_TINBUCKET_WATER; i = CONTENT_TOOLITEM_TINBUCKET_WATER;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -303,6 +337,7 @@ void content_toolitem_init()
f->name = "TinBucket_water"; f->name = "TinBucket_water";
f->description = "Tin Bucket of Water"; f->description = "Tin Bucket of Water";
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELBUCKET; i = CONTENT_TOOLITEM_STEELBUCKET;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -315,6 +350,8 @@ void content_toolitem_init()
f->hardness = 80.; f->hardness = 80.;
f->dig_time = 0.0; f->dig_time = 0.0;
crafting::setURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELBUCKET); crafting::setURecipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_STEELBUCKET);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELBUCKET_WATER; i = CONTENT_TOOLITEM_STEELBUCKET_WATER;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -323,6 +360,7 @@ void content_toolitem_init()
f->name = "SteelBucket_water"; f->name = "SteelBucket_water";
f->description = "Steel Bucket of Water"; f->description = "Steel Bucket of Water";
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
lists::add("creative",i);
i = CONTENT_TOOLITEM_STEELBUCKET_LAVA; i = CONTENT_TOOLITEM_STEELBUCKET_LAVA;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -332,6 +370,7 @@ void content_toolitem_init()
f->description = "Steel Bucket of Lava"; f->description = "Steel Bucket of Lava";
f->fuel_time = 80; f->fuel_time = 80;
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
lists::add("creative",i);
i = CONTENT_TOOLITEM_FIRESTARTER; i = CONTENT_TOOLITEM_FIRESTARTER;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -342,6 +381,8 @@ void content_toolitem_init()
f->liquids_pointable = true; f->liquids_pointable = true;
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_FIRESTARTER); crafting::set1Any2Recipe(CONTENT_CRAFTITEM_FLINT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_FIRESTARTER);
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_TOOLITEM_CROWBAR; i = CONTENT_TOOLITEM_CROWBAR;
f = &g_content_toolitem_features[i]; f = &g_content_toolitem_features[i];
@ -351,4 +392,6 @@ void content_toolitem_init()
f->description = "Crowbar"; f->description = "Crowbar";
f->type = TT_SPECIAL; f->type = TT_SPECIAL;
crafting::set1over1Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_CROWBAR); crafting::set1over1Recipe(CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_CRAFTITEM_STEEL_INGOT,CONTENT_TOOLITEM_CROWBAR);
lists::add("craftguide",i);
lists::add("creative",i);
} }

View File

@ -800,6 +800,8 @@ bool GUIFormSpecMenu::OnEvent(const SEvent& event)
quitMenu(); quitMenu();
}else{ }else{
s.send = false; s.send = false;
// Restore focus to the full form
Environment->setFocus(this);
} }
return true; return true;
} }