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 NOTE: Not used anymore; TODO: Remove
33 InventoryItem *craft_get_result(InventoryItem **items, IGameDef *gamedef)
35 INodeDefManager *ndef = gamedef->ndef();
40 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_TREE"));
41 if(checkItemCombination(items, specs))
43 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_WOOD"), 4);
50 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
51 if(checkItemCombination(items, specs))
53 return new CraftItem(gamedef, "Stick", 4);
60 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
61 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
62 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
63 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
64 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
65 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
66 if(checkItemCombination(items, specs))
68 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_FENCE"), 2);
75 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
76 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
77 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
78 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
79 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
80 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
81 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
82 if(checkItemCombination(items, specs))
84 //return new MapBlockObjectItem(gamedef, "Sign");
85 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_SIGN_WALL"), 1);
92 specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_coal");
93 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
94 if(checkItemCombination(items, specs))
96 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 4);
103 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
104 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
105 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
106 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
107 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
108 if(checkItemCombination(items, specs))
110 return new ToolItem(gamedef, "WPick", 0);
117 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
118 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
119 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
120 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
121 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
122 if(checkItemCombination(items, specs))
124 return new ToolItem(gamedef, "STPick", 0);
131 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
132 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
133 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
134 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
135 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
136 if(checkItemCombination(items, specs))
138 return new ToolItem(gamedef, "SteelPick", 0);
145 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
146 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
147 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_MESE"));
148 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
149 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
150 if(checkItemCombination(items, specs))
152 return new ToolItem(gamedef, "MesePick", 0);
159 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
160 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
161 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
162 if(checkItemCombination(items, specs))
164 return new ToolItem(gamedef, "WShovel", 0);
171 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
172 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
173 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
174 if(checkItemCombination(items, specs))
176 return new ToolItem(gamedef, "STShovel", 0);
183 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
184 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
185 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
186 if(checkItemCombination(items, specs))
188 return new ToolItem(gamedef, "SteelShovel", 0);
195 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
196 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
197 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
198 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
199 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
200 if(checkItemCombination(items, specs))
202 return new ToolItem(gamedef, "WAxe", 0);
209 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
210 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
211 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
212 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
213 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
214 if(checkItemCombination(items, specs))
216 return new ToolItem(gamedef, "STAxe", 0);
223 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
224 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
225 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
226 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
227 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
228 if(checkItemCombination(items, specs))
230 return new ToolItem(gamedef, "SteelAxe", 0);
237 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
238 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
239 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
240 if(checkItemCombination(items, specs))
242 return new ToolItem(gamedef, "WSword", 0);
249 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
250 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
251 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
252 if(checkItemCombination(items, specs))
254 return new ToolItem(gamedef, "STSword", 0);
261 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
262 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
263 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
264 if(checkItemCombination(items, specs))
266 return new ToolItem(gamedef, "SteelSword", 0);
273 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
274 specs[1] = ItemSpec(ITEM_CRAFT, "Stick");
275 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
276 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
277 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
278 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
279 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
280 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
281 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
282 if(checkItemCombination(items, specs))
284 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_RAIL"), 15);
291 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
292 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
293 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
294 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
295 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
296 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
297 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
298 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
299 if(checkItemCombination(items, specs))
301 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_CHEST"), 1);
308 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
309 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
310 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
311 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
312 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
313 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
314 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
315 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
316 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
317 if(checkItemCombination(items, specs))
319 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_LOCKABLE_CHEST"), 1);
326 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
327 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
328 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
329 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
330 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
331 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
332 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
333 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_COBBLE"));
334 if(checkItemCombination(items, specs))
336 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_FURNACE"), 1);
343 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
344 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
345 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
346 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
347 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
348 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
349 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
350 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
351 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
352 if(checkItemCombination(items, specs))
354 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_STEEL"), 1);
361 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
362 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
363 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
364 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_SAND"));
365 if(checkItemCombination(items, specs))
367 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_SANDSTONE"), 1);
374 specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
375 specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
376 specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
377 specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
378 if(checkItemCombination(items, specs))
380 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_CLAY"), 1);
387 specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick");
388 specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick");
389 specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick");
390 specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick");
391 if(checkItemCombination(items, specs))
393 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_BRICK"), 1);
400 specs[3] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
401 specs[4] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
402 specs[5] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_PAPYRUS"));
403 if(checkItemCombination(items, specs))
405 return new CraftItem(gamedef, "paper", 1);
412 specs[1] = ItemSpec(ITEM_CRAFT, "paper");
413 specs[4] = ItemSpec(ITEM_CRAFT, "paper");
414 specs[7] = ItemSpec(ITEM_CRAFT, "paper");
415 if(checkItemCombination(items, specs))
417 return new CraftItem(gamedef, "book", 1);
424 specs[0] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
425 specs[1] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
426 specs[2] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
427 specs[3] = ItemSpec(ITEM_CRAFT, "book");
428 specs[4] = ItemSpec(ITEM_CRAFT, "book");
429 specs[5] = ItemSpec(ITEM_CRAFT, "book");
430 specs[6] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
431 specs[7] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
432 specs[8] = ItemSpec(ITEM_MATERIAL, LEGN(ndef, "CONTENT_WOOD"));
433 if(checkItemCombination(items, specs))
435 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_BOOKSHELF"), 1);
442 specs[0] = ItemSpec(ITEM_CRAFT, "Stick");
443 specs[2] = ItemSpec(ITEM_CRAFT, "Stick");
444 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
445 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
446 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
447 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
448 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
449 if(checkItemCombination(items, specs))
451 return new MaterialItem(gamedef, LEGN(ndef, "CONTENT_LADDER"), 1);
458 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
459 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
460 specs[4] = ItemSpec(ITEM_CRAFT, "apple");
461 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
462 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
463 if(checkItemCombination(items, specs))
465 return new CraftItem(gamedef, "apple_iron", 1);
472 void craft_set_creative_inventory(Player *player, IGameDef *gamedef)
474 INodeDefManager *ndef = gamedef->ndef();
476 player->resetInventory();
478 // Give some good tools
480 InventoryItem *item = new ToolItem(gamedef, "MesePick", 0);
481 void* r = player->inventory.addItem("main", item);
485 InventoryItem *item = new ToolItem(gamedef, "SteelPick", 0);
486 void* r = player->inventory.addItem("main", item);
490 InventoryItem *item = new ToolItem(gamedef, "SteelAxe", 0);
491 void* r = player->inventory.addItem("main", item);
495 InventoryItem *item = new ToolItem(gamedef, "SteelShovel", 0);
496 void* r = player->inventory.addItem("main", item);
504 // CONTENT_IGNORE-terminated list
505 content_t material_items[] = {
506 LEGN(ndef, "CONTENT_TORCH"),
507 LEGN(ndef, "CONTENT_COBBLE"),
508 LEGN(ndef, "CONTENT_MUD"),
509 LEGN(ndef, "CONTENT_STONE"),
510 LEGN(ndef, "CONTENT_SAND"),
511 LEGN(ndef, "CONTENT_SANDSTONE"),
512 LEGN(ndef, "CONTENT_CLAY"),
513 LEGN(ndef, "CONTENT_BRICK"),
514 LEGN(ndef, "CONTENT_TREE"),
515 LEGN(ndef, "CONTENT_LEAVES"),
516 LEGN(ndef, "CONTENT_CACTUS"),
517 LEGN(ndef, "CONTENT_PAPYRUS"),
518 LEGN(ndef, "CONTENT_BOOKSHELF"),
519 LEGN(ndef, "CONTENT_GLASS"),
520 LEGN(ndef, "CONTENT_FENCE"),
521 LEGN(ndef, "CONTENT_RAIL"),
522 LEGN(ndef, "CONTENT_MESE"),
523 LEGN(ndef, "CONTENT_WATERSOURCE"),
524 LEGN(ndef, "CONTENT_CLOUD"),
525 LEGN(ndef, "CONTENT_CHEST"),
526 LEGN(ndef, "CONTENT_FURNACE"),
527 LEGN(ndef, "CONTENT_SIGN_WALL"),
528 LEGN(ndef, "CONTENT_LAVASOURCE"),
532 content_t *mip = material_items;
533 for(u16 i=0; i<PLAYER_INVENTORY_SIZE; i++)
535 if(*mip == CONTENT_IGNORE)
538 InventoryItem *item = new MaterialItem(gamedef, *mip, 1);
539 player->inventory.addItem("main", item);
545 assert(USEFUL_LEGN(ndef, "CONTENT_COUNT") <= PLAYER_INVENTORY_SIZE);
548 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 1);
549 player->inventory.addItem("main", item);
552 for(u16 i=0; i<USEFUL_LEGN(ndef, "CONTENT_COUNT"); i++)
554 // Skip some materials
555 if(i == LEGN(ndef, "CONTENT_WATER") || i == LEGN(ndef, "CONTENT_TORCH")
556 || i == LEGN(ndef, "CONTENT_COALSTONE"))
559 InventoryItem *item = new MaterialItem(gamedef, i, 1);
560 player->inventory.addItem("main", item);
566 InventoryItem *item = new MapBlockObjectItem(gamedef, "Sign Example text");
567 void* r = player->inventory.addItem("main", item);
572 void craft_give_initial_stuff(Player *player, IGameDef *gamedef)
574 INodeDefManager *ndef = gamedef->ndef();
577 InventoryItem *item = new ToolItem(gamedef, "SteelPick", 0);
578 void* r = player->inventory.addItem("main", item);
582 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TORCH"), 99);
583 void* r = player->inventory.addItem("main", item);
587 InventoryItem *item = new ToolItem(gamedef, "SteelAxe", 0);
588 void* r = player->inventory.addItem("main", item);
592 InventoryItem *item = new ToolItem(gamedef, "SteelShovel", 0);
593 void* r = player->inventory.addItem("main", item);
597 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_COBBLE"), 99);
598 void* r = player->inventory.addItem("main", item);
602 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_MESE"), 6);
603 void* r = player->inventory.addItem("main", item);
607 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_COALSTONE"), 6);
608 void* r = player->inventory.addItem("main", item);
612 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_WOOD"), 6);
613 void* r = player->inventory.addItem("main", item);
617 InventoryItem *item = new CraftItem(gamedef, "Stick", 4);
618 void* r = player->inventory.addItem("main", item);
622 InventoryItem *item = new ToolItem(gamedef, "WPick", 32000);
623 void* r = player->inventory.addItem("main", item);
627 InventoryItem *item = new ToolItem(gamedef, "STPick", 32000);
628 void* r = player->inventory.addItem("main", item);
632 for(u16 i=0; i<4; i++)
634 InventoryItem *item = new MapBlockObjectItem(gamedef, "Sign Example text");
635 bool r = player->inventory.addItem("main", item);
638 /*// Give some other stuff
640 InventoryItem *item = new MaterialItem(gamedef, LEGN(ndef, "CONTENT_TREE"), 999);
641 bool r = player->inventory.addItem("main", item);