3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "content_craft.h"
21 #include "inventory.h"
22 #include "content_mapnode.h"
24 #include "mapnode.h" // For content_t
28 items: actually *items[9]
29 return value: allocates a new item, or returns NULL.
31 InventoryItem *craft_get_result(InventoryItem **items, IGameDef *gamedef)
33 INodeDefManager *ndef = gamedef->ndef();
38 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_TREE"));
39 if(checkItemCombination(items, specs))
41 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_WOOD"), 4);
48 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
49 if(checkItemCombination(items, specs))
51 return new CraftItem(gamedef, "Stick", 4);
58 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
59 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
60 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
61 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
62 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
63 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
64 if(checkItemCombination(items, specs))
66 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_FENCE"), 2);
73 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
74 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
75 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
76 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
77 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
78 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
79 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
80 if(checkItemCombination(items, specs))
82 //return new MapBlockObjectItem(gamedef, "Sign");
83 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_SIGN_WALL"), 1);
90 specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_coal");
91 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
92 if(checkItemCombination(items, specs))
94 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 4);
101 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
102 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
103 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
104 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
105 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
106 if(checkItemCombination(items, specs))
108 return new ToolItem(gamedef, "WPick", 0);
115 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
116 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
117 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
118 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
119 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
120 if(checkItemCombination(items, specs))
122 return new ToolItem(gamedef, "STPick", 0);
129 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
130 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
131 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
132 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
133 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
134 if(checkItemCombination(items, specs))
136 return new ToolItem(gamedef, "SteelPick", 0);
143 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
144 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
145 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
146 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
147 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
148 if(checkItemCombination(items, specs))
150 return new ToolItem(gamedef, "MesePick", 0);
157 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
158 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
159 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
160 if(checkItemCombination(items, specs))
162 return new ToolItem(gamedef, "WShovel", 0);
169 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
170 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
171 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
172 if(checkItemCombination(items, specs))
174 return new ToolItem(gamedef, "STShovel", 0);
181 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
182 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
183 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
184 if(checkItemCombination(items, specs))
186 return new ToolItem(gamedef, "SteelShovel", 0);
193 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
194 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
195 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
196 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
197 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
198 if(checkItemCombination(items, specs))
200 return new ToolItem(gamedef, "WAxe", 0);
207 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
208 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
209 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
210 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
211 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
212 if(checkItemCombination(items, specs))
214 return new ToolItem(gamedef, "STAxe", 0);
221 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
222 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
223 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
224 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
225 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
226 if(checkItemCombination(items, specs))
228 return new ToolItem(gamedef, "SteelAxe", 0);
235 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
236 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
237 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
238 if(checkItemCombination(items, specs))
240 return new ToolItem(gamedef, "WSword", 0);
247 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
248 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
249 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
250 if(checkItemCombination(items, specs))
252 return new ToolItem(gamedef, "STSword", 0);
259 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
260 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
261 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
262 if(checkItemCombination(items, specs))
264 return new ToolItem(gamedef, "SteelSword", 0);
271 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
272 specs[1] = ItemSpec(ITEM_CRAFT, "Stick");
273 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
274 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
275 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
276 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
277 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
278 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
279 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
280 if(checkItemCombination(items, specs))
282 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_RAIL"), 15);
289 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
290 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
291 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
292 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
293 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
294 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
295 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
296 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
297 if(checkItemCombination(items, specs))
299 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_CHEST"), 1);
306 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
307 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
308 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
309 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
310 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
311 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
312 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
313 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
314 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
315 if(checkItemCombination(items, specs))
317 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_LOCKABLE_CHEST"), 1);
324 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
325 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
326 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
327 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
328 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
329 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
330 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
331 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
332 if(checkItemCombination(items, specs))
334 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_FURNACE"), 1);
341 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
342 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
343 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
344 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
345 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
346 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
347 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
348 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
349 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
350 if(checkItemCombination(items, specs))
352 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_STEEL"), 1);
359 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
360 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
361 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
362 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
363 if(checkItemCombination(items, specs))
365 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_SANDSTONE"), 1);
372 specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
373 specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
374 specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
375 specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
376 if(checkItemCombination(items, specs))
378 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_CLAY"), 1);
385 specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick");
386 specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick");
387 specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick");
388 specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick");
389 if(checkItemCombination(items, specs))
391 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_BRICK"), 1);
398 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
399 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
400 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
401 if(checkItemCombination(items, specs))
403 return new CraftItem(gamedef, "paper", 1);
410 specs[1] = ItemSpec(ITEM_CRAFT, "paper");
411 specs[4] = ItemSpec(ITEM_CRAFT, "paper");
412 specs[7] = ItemSpec(ITEM_CRAFT, "paper");
413 if(checkItemCombination(items, specs))
415 return new CraftItem(gamedef, "book", 1);
422 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
423 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
424 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
425 specs[3] = ItemSpec(ITEM_CRAFT, "book");
426 specs[4] = ItemSpec(ITEM_CRAFT, "book");
427 specs[5] = ItemSpec(ITEM_CRAFT, "book");
428 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
429 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
430 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
431 if(checkItemCombination(items, specs))
433 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_BOOKSHELF"), 1);
440 specs[0] = ItemSpec(ITEM_CRAFT, "Stick");
441 specs[2] = ItemSpec(ITEM_CRAFT, "Stick");
442 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
443 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
444 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
445 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
446 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
447 if(checkItemCombination(items, specs))
449 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_LADDER"), 1);
456 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
457 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
458 specs[4] = ItemSpec(ITEM_CRAFT, "apple");
459 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
460 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
461 if(checkItemCombination(items, specs))
463 return new CraftItem(gamedef, "apple_iron", 1);
470 void craft_set_creative_inventory(Player *player, IGameDef *gamedef)
472 INodeDefManager *ndef = gamedef->ndef();
474 player->resetInventory();
476 // Give some good tools
478 InventoryItem *item = new ToolItem(gamedef, "MesePick", 0);
479 void* r = player->inventory.addItem("main", item);
483 InventoryItem *item = new ToolItem(gamedef, "SteelPick", 0);
484 void* r = player->inventory.addItem("main", item);
488 InventoryItem *item = new ToolItem(gamedef, "SteelAxe", 0);
489 void* r = player->inventory.addItem("main", item);
493 InventoryItem *item = new ToolItem(gamedef, "SteelShovel", 0);
494 void* r = player->inventory.addItem("main", item);
502 // CONTENT_IGNORE-terminated list
503 content_t material_items[] = {
504 LEGN(ndef, "CONTENT_TORCH"),
505 LEGN(ndef, "CONTENT_COBBLE"),
506 LEGN(ndef, "CONTENT_MUD"),
507 LEGN(ndef, "CONTENT_STONE"),
508 LEGN(ndef, "CONTENT_SAND"),
509 LEGN(ndef, "CONTENT_SANDSTONE"),
510 LEGN(ndef, "CONTENT_CLAY"),
511 LEGN(ndef, "CONTENT_BRICK"),
512 LEGN(ndef, "CONTENT_TREE"),
513 LEGN(ndef, "CONTENT_LEAVES"),
514 LEGN(ndef, "CONTENT_CACTUS"),
515 LEGN(ndef, "CONTENT_PAPYRUS"),
516 LEGN(ndef, "CONTENT_BOOKSHELF"),
517 LEGN(ndef, "CONTENT_GLASS"),
518 LEGN(ndef, "CONTENT_FENCE"),
519 LEGN(ndef, "CONTENT_RAIL"),
520 LEGN(ndef, "CONTENT_MESE"),
521 LEGN(ndef, "CONTENT_WATERSOURCE"),
522 LEGN(ndef, "CONTENT_CLOUD"),
523 LEGN(ndef, "CONTENT_CHEST"),
524 LEGN(ndef, "CONTENT_FURNACE"),
525 LEGN(ndef, "CONTENT_SIGN_WALL"),
526 LEGN(ndef, "CONTENT_LAVASOURCE"),
530 content_t *mip = material_items;
531 for(u16 i=0; i<PLAYER_INVENTORY_SIZE; i++)
533 if(*mip == CONTENT_IGNORE)
536 InventoryItem *item = new MaterialItem(gamedef, *mip, 1);
537 player->inventory.addItem("main", item);
543 assert(USEFUL_LEGN(ndef, "CONTENT_COUNT") <= PLAYER_INVENTORY_SIZE);
546 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 1);
547 player->inventory.addItem("main", item);
550 for(u16 i=0; i<USEFUL_LEGN(ndef, "CONTENT_COUNT"); i++)
552 // Skip some materials
553 if(i == LEGN(ndef, "CONTENT_WATER") || i == LEGN(ndef, "CONTENT_TORCH")
554 || i == LEGN(ndef, "CONTENT_COALSTONE"))
557 InventoryItem *item = new MaterialItem(gamedef, i, 1);
558 player->inventory.addItem("main", item);
564 InventoryItem *item = new MapBlockObjectItem(gamedef, "Sign Example text");
565 void* r = player->inventory.addItem("main", item);
570 void craft_give_initial_stuff(Player *player, IGameDef *gamedef)
572 INodeDefManager *ndef = gamedef->ndef();
575 InventoryItem *item = new ToolItem(gamedef, "SteelPick", 0);
576 void* r = player->inventory.addItem("main", item);
580 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 99);
581 void* r = player->inventory.addItem("main", item);
585 InventoryItem *item = new ToolItem(gamedef, "SteelAxe", 0);
586 void* r = player->inventory.addItem("main", item);
590 InventoryItem *item = new ToolItem(gamedef, "SteelShovel", 0);
591 void* r = player->inventory.addItem("main", item);
595 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_COBBLE"), 99);
596 void* r = player->inventory.addItem("main", item);
600 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_MESE"), 6);
601 void* r = player->inventory.addItem("main", item);
605 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_COALSTONE"), 6);
606 void* r = player->inventory.addItem("main", item);
610 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_WOOD"), 6);
611 void* r = player->inventory.addItem("main", item);
615 InventoryItem *item = new CraftItem(gamedef, "Stick", 4);
616 void* r = player->inventory.addItem("main", item);
620 InventoryItem *item = new ToolItem(gamedef, "WPick", 32000);
621 void* r = player->inventory.addItem("main", item);
625 InventoryItem *item = new ToolItem(gamedef, "STPick", 32000);
626 void* r = player->inventory.addItem("main", item);
630 for(u16 i=0; i<4; i++)
632 InventoryItem *item = new MapBlockObjectItem(gamedef, "Sign Example text");
633 bool r = player->inventory.addItem("main", item);
636 /*// Give some other stuff
638 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TREE"), 999);
639 bool r = player->inventory.addItem("main", item);