]> git.lizzy.rs Git - minetest.git/blob - src/content_craft.cpp
Generic NodeMetadata text input
[minetest.git] / src / content_craft.cpp
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
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.
9
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.
14
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.
18 */
19
20 #include "content_craft.h"
21 #include "inventory.h"
22 #include "content_mapnode.h"
23 #include "player.h"
24 #include "mapnode.h" // For content_t
25
26 /*
27         items: actually *items[9]
28         return value: allocates a new item, or returns NULL.
29 */
30 InventoryItem *craft_get_result(InventoryItem **items)
31 {
32         // Wood
33         {
34                 ItemSpec specs[9];
35                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_TREE);
36                 if(checkItemCombination(items, specs))
37                 {
38                         return new MaterialItem(CONTENT_WOOD, 4);
39                 }
40         }
41
42         // Stick
43         {
44                 ItemSpec specs[9];
45                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
46                 if(checkItemCombination(items, specs))
47                 {
48                         return new CraftItem("Stick", 4);
49                 }
50         }
51
52         // Fence
53         {
54                 ItemSpec specs[9];
55                 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
56                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
57                 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
58                 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
59                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
60                 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
61                 if(checkItemCombination(items, specs))
62                 {
63                         return new MaterialItem(CONTENT_FENCE, 2);
64                 }
65         }
66
67         // Sign
68         {
69                 ItemSpec specs[9];
70                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
71                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
72                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
73                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
74                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
75                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
76                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
77                 if(checkItemCombination(items, specs))
78                 {
79                         //return new MapBlockObjectItem("Sign");
80                         return new MaterialItem(CONTENT_SIGN_WALL, 1);
81                 }
82         }
83
84         // Torch
85         {
86                 ItemSpec specs[9];
87                 specs[0] = ItemSpec(ITEM_CRAFT, "lump_of_coal");
88                 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
89                 if(checkItemCombination(items, specs))
90                 {
91                         return new MaterialItem(CONTENT_TORCH, 4);
92                 }
93         }
94
95         // Wooden pick
96         {
97                 ItemSpec specs[9];
98                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
99                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
100                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
101                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
102                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
103                 if(checkItemCombination(items, specs))
104                 {
105                         return new ToolItem("WPick", 0);
106                 }
107         }
108
109         // Stone pick
110         {
111                 ItemSpec specs[9];
112                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
113                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
114                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
115                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
116                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
117                 if(checkItemCombination(items, specs))
118                 {
119                         return new ToolItem("STPick", 0);
120                 }
121         }
122
123         // Steel pick
124         {
125                 ItemSpec specs[9];
126                 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
127                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
128                 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
129                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
130                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
131                 if(checkItemCombination(items, specs))
132                 {
133                         return new ToolItem("SteelPick", 0);
134                 }
135         }
136
137         // Mese pick
138         {
139                 ItemSpec specs[9];
140                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE);
141                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE);
142                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_MESE);
143                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
144                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
145                 if(checkItemCombination(items, specs))
146                 {
147                         return new ToolItem("MesePick", 0);
148                 }
149         }
150
151         // Wooden shovel
152         {
153                 ItemSpec specs[9];
154                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
155                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
156                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
157                 if(checkItemCombination(items, specs))
158                 {
159                         return new ToolItem("WShovel", 0);
160                 }
161         }
162
163         // Stone shovel
164         {
165                 ItemSpec specs[9];
166                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
167                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
168                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
169                 if(checkItemCombination(items, specs))
170                 {
171                         return new ToolItem("STShovel", 0);
172                 }
173         }
174
175         // Steel shovel
176         {
177                 ItemSpec specs[9];
178                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
179                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
180                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
181                 if(checkItemCombination(items, specs))
182                 {
183                         return new ToolItem("SteelShovel", 0);
184                 }
185         }
186
187         // Wooden axe
188         {
189                 ItemSpec specs[9];
190                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
191                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
192                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
193                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
194                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
195                 if(checkItemCombination(items, specs))
196                 {
197                         return new ToolItem("WAxe", 0);
198                 }
199         }
200
201         // Stone axe
202         {
203                 ItemSpec specs[9];
204                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
205                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
206                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
207                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
208                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
209                 if(checkItemCombination(items, specs))
210                 {
211                         return new ToolItem("STAxe", 0);
212                 }
213         }
214
215         // Steel axe
216         {
217                 ItemSpec specs[9];
218                 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
219                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
220                 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
221                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
222                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
223                 if(checkItemCombination(items, specs))
224                 {
225                         return new ToolItem("SteelAxe", 0);
226                 }
227         }
228
229         // Wooden sword
230         {
231                 ItemSpec specs[9];
232                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
233                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
234                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
235                 if(checkItemCombination(items, specs))
236                 {
237                         return new ToolItem("WSword", 0);
238                 }
239         }
240
241         // Stone sword
242         {
243                 ItemSpec specs[9];
244                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
245                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
246                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
247                 if(checkItemCombination(items, specs))
248                 {
249                         return new ToolItem("STSword", 0);
250                 }
251         }
252
253         // Steel sword
254         {
255                 ItemSpec specs[9];
256                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
257                 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
258                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
259                 if(checkItemCombination(items, specs))
260                 {
261                         return new ToolItem("SteelSword", 0);
262                 }
263         }
264
265         // Rail
266         {
267                 ItemSpec specs[9];
268                 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
269                 specs[1] = ItemSpec(ITEM_CRAFT, "Stick");
270                 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
271                 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
272                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
273                 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
274                 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
275                 specs[7] = ItemSpec(ITEM_CRAFT, "Stick");
276                 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
277                 if(checkItemCombination(items, specs))
278                 {
279                         return new MaterialItem(CONTENT_RAIL, 15);
280                 }
281         }
282
283         // Chest
284         {
285                 ItemSpec specs[9];
286                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
287                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
288                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
289                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
290                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
291                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
292                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
293                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
294                 if(checkItemCombination(items, specs))
295                 {
296                         return new MaterialItem(CONTENT_CHEST, 1);
297                 }
298         }
299
300         // Locking Chest
301         {
302                 ItemSpec specs[9];
303                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
304                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
305                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
306                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
307                 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
308                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
309                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
310                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
311                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
312                 if(checkItemCombination(items, specs))
313                 {
314                         return new MaterialItem(CONTENT_LOCKABLE_CHEST, 1);
315                 }
316         }
317
318         // Furnace
319         {
320                 ItemSpec specs[9];
321                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
322                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
323                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
324                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
325                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
326                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
327                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
328                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
329                 if(checkItemCombination(items, specs))
330                 {
331                         return new MaterialItem(CONTENT_FURNACE, 1);
332                 }
333         }
334
335         // Steel block
336         {
337                 ItemSpec specs[9];
338                 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
339                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
340                 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
341                 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
342                 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
343                 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
344                 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
345                 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
346                 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
347                 if(checkItemCombination(items, specs))
348                 {
349                         return new MaterialItem(CONTENT_STEEL, 1);
350                 }
351         }
352
353         // Sandstone
354         {
355                 ItemSpec specs[9];
356                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
357                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
358                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
359                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
360                 if(checkItemCombination(items, specs))
361                 {
362                         return new MaterialItem(CONTENT_SANDSTONE, 1);
363                 }
364         }
365
366         // Clay
367         {
368                 ItemSpec specs[9];
369                 specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
370                 specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
371                 specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
372                 specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
373                 if(checkItemCombination(items, specs))
374                 {
375                         return new MaterialItem(CONTENT_CLAY, 1);
376                 }
377         }
378
379         // Brick
380         {
381                 ItemSpec specs[9];
382                 specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick");
383                 specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick");
384                 specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick");
385                 specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick");
386                 if(checkItemCombination(items, specs))
387                 {
388                         return new MaterialItem(CONTENT_BRICK, 1);
389                 }
390         }
391
392         // Paper
393         {
394                 ItemSpec specs[9];
395                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
396                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
397                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
398                 if(checkItemCombination(items, specs))
399                 {
400                         return new CraftItem("paper", 1);
401                 }
402         }
403
404         // Book
405         {
406                 ItemSpec specs[9];
407                 specs[1] = ItemSpec(ITEM_CRAFT, "paper");
408                 specs[4] = ItemSpec(ITEM_CRAFT, "paper");
409                 specs[7] = ItemSpec(ITEM_CRAFT, "paper");
410                 if(checkItemCombination(items, specs))
411                 {
412                         return new CraftItem("book", 1);
413                 }
414         }
415
416         // Book shelf
417         {
418                 ItemSpec specs[9];
419                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
420                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
421                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
422                 specs[3] = ItemSpec(ITEM_CRAFT, "book");
423                 specs[4] = ItemSpec(ITEM_CRAFT, "book");
424                 specs[5] = ItemSpec(ITEM_CRAFT, "book");
425                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
426                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
427                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
428                 if(checkItemCombination(items, specs))
429                 {
430                         return new MaterialItem(CONTENT_BOOKSHELF, 1);
431                 }
432         }
433
434         // Ladder
435         {
436                 ItemSpec specs[9];
437                 specs[0] = ItemSpec(ITEM_CRAFT, "Stick");
438                 specs[2] = ItemSpec(ITEM_CRAFT, "Stick");
439                 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
440                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
441                 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
442                 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
443                 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
444                 if(checkItemCombination(items, specs))
445                 {
446                         return new MaterialItem(CONTENT_LADDER, 1);
447                 }
448         }
449         
450         // Iron Apple
451         {
452                 ItemSpec specs[9];
453                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
454                 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
455                 specs[4] = ItemSpec(ITEM_CRAFT, "apple");
456                 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
457                 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
458                 if(checkItemCombination(items, specs))
459                 {
460                         return new CraftItem("apple_iron", 1);
461                 }
462         }
463
464         return NULL;
465 }
466
467 void craft_set_creative_inventory(Player *player)
468 {
469         player->resetInventory();
470         
471         // Give some good tools
472         {
473                 InventoryItem *item = new ToolItem("MesePick", 0);
474                 void* r = player->inventory.addItem("main", item);
475                 assert(r == NULL);
476         }
477         {
478                 InventoryItem *item = new ToolItem("SteelPick", 0);
479                 void* r = player->inventory.addItem("main", item);
480                 assert(r == NULL);
481         }
482         {
483                 InventoryItem *item = new ToolItem("SteelAxe", 0);
484                 void* r = player->inventory.addItem("main", item);
485                 assert(r == NULL);
486         }
487         {
488                 InventoryItem *item = new ToolItem("SteelShovel", 0);
489                 void* r = player->inventory.addItem("main", item);
490                 assert(r == NULL);
491         }
492
493         /*
494                 Give materials
495         */
496         
497         // CONTENT_IGNORE-terminated list
498         content_t material_items[] = {
499                 CONTENT_TORCH,
500                 CONTENT_COBBLE,
501                 CONTENT_MUD,
502                 CONTENT_STONE,
503                 CONTENT_SAND,
504                 CONTENT_SANDSTONE,
505                 CONTENT_CLAY,
506                 CONTENT_BRICK,
507                 CONTENT_TREE,
508                 CONTENT_LEAVES,
509                 CONTENT_CACTUS,
510                 CONTENT_PAPYRUS,
511                 CONTENT_BOOKSHELF,
512                 CONTENT_GLASS,
513                 CONTENT_FENCE,
514                 CONTENT_RAIL,
515                 CONTENT_MESE,
516                 CONTENT_WATERSOURCE,
517                 CONTENT_CLOUD,
518                 CONTENT_CHEST,
519                 CONTENT_FURNACE,
520                 CONTENT_SIGN_WALL,
521                 CONTENT_LAVASOURCE,
522                 CONTENT_IGNORE
523         };
524         
525         content_t *mip = material_items;
526         for(u16 i=0; i<PLAYER_INVENTORY_SIZE; i++)
527         {
528                 if(*mip == CONTENT_IGNORE)
529                         break;
530
531                 InventoryItem *item = new MaterialItem(*mip, 1);
532                 player->inventory.addItem("main", item);
533
534                 mip++;
535         }
536
537 #if 0
538         assert(USEFUL_CONTENT_COUNT <= PLAYER_INVENTORY_SIZE);
539         
540         // add torch first
541         InventoryItem *item = new MaterialItem(CONTENT_TORCH, 1);
542         player->inventory.addItem("main", item);
543         
544         // Then others
545         for(u16 i=0; i<USEFUL_CONTENT_COUNT; i++)
546         {
547                 // Skip some materials
548                 if(i == CONTENT_WATER || i == CONTENT_TORCH
549                         || i == CONTENT_COALSTONE)
550                         continue;
551
552                 InventoryItem *item = new MaterialItem(i, 1);
553                 player->inventory.addItem("main", item);
554         }
555 #endif
556
557         /*// Sign
558         {
559                 InventoryItem *item = new MapBlockObjectItem("Sign Example text");
560                 void* r = player->inventory.addItem("main", item);
561                 assert(r == NULL);
562         }*/
563 }
564
565 void craft_give_initial_stuff(Player *player)
566 {
567         {
568                 InventoryItem *item = new ToolItem("SteelPick", 0);
569                 void* r = player->inventory.addItem("main", item);
570                 assert(r == NULL);
571         }
572         {
573                 InventoryItem *item = new MaterialItem(CONTENT_TORCH, 99);
574                 void* r = player->inventory.addItem("main", item);
575                 assert(r == NULL);
576         }
577         {
578                 InventoryItem *item = new ToolItem("SteelAxe", 0);
579                 void* r = player->inventory.addItem("main", item);
580                 assert(r == NULL);
581         }
582         {
583                 InventoryItem *item = new ToolItem("SteelShovel", 0);
584                 void* r = player->inventory.addItem("main", item);
585                 assert(r == NULL);
586         }
587         {
588                 InventoryItem *item = new MaterialItem(CONTENT_COBBLE, 99);
589                 void* r = player->inventory.addItem("main", item);
590                 assert(r == NULL);
591         }
592         /*{
593                 InventoryItem *item = new MaterialItem(CONTENT_MESE, 6);
594                 void* r = player->inventory.addItem("main", item);
595                 assert(r == NULL);
596         }
597         {
598                 InventoryItem *item = new MaterialItem(CONTENT_COALSTONE, 6);
599                 void* r = player->inventory.addItem("main", item);
600                 assert(r == NULL);
601         }
602         {
603                 InventoryItem *item = new MaterialItem(CONTENT_WOOD, 6);
604                 void* r = player->inventory.addItem("main", item);
605                 assert(r == NULL);
606         }
607         {
608                 InventoryItem *item = new CraftItem("Stick", 4);
609                 void* r = player->inventory.addItem("main", item);
610                 assert(r == NULL);
611         }
612         {
613                 InventoryItem *item = new ToolItem("WPick", 32000);
614                 void* r = player->inventory.addItem("main", item);
615                 assert(r == NULL);
616         }
617         {
618                 InventoryItem *item = new ToolItem("STPick", 32000);
619                 void* r = player->inventory.addItem("main", item);
620                 assert(r == NULL);
621         }*/
622         /*// and some signs
623         for(u16 i=0; i<4; i++)
624         {
625                 InventoryItem *item = new MapBlockObjectItem("Sign Example text");
626                 bool r = player->inventory.addItem("main", item);
627                 assert(r == true);
628         }*/
629         /*// Give some other stuff
630         {
631                 InventoryItem *item = new MaterialItem(CONTENT_TREE, 999);
632                 bool r = player->inventory.addItem("main", item);
633                 assert(r == true);
634         }*/
635 }
636