Add lava to creative inventory (hmm, we're shortly running out of creative inventory...
[oweals/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         // Furnace
301         {
302                 ItemSpec specs[9];
303                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
304                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
305                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
306                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
307                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
308                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
309                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
310                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_COBBLE);
311                 if(checkItemCombination(items, specs))
312                 {
313                         return new MaterialItem(CONTENT_FURNACE, 1);
314                 }
315         }
316
317         // Steel block
318         {
319                 ItemSpec specs[9];
320                 specs[0] = ItemSpec(ITEM_CRAFT, "steel_ingot");
321                 specs[1] = ItemSpec(ITEM_CRAFT, "steel_ingot");
322                 specs[2] = ItemSpec(ITEM_CRAFT, "steel_ingot");
323                 specs[3] = ItemSpec(ITEM_CRAFT, "steel_ingot");
324                 specs[4] = ItemSpec(ITEM_CRAFT, "steel_ingot");
325                 specs[5] = ItemSpec(ITEM_CRAFT, "steel_ingot");
326                 specs[6] = ItemSpec(ITEM_CRAFT, "steel_ingot");
327                 specs[7] = ItemSpec(ITEM_CRAFT, "steel_ingot");
328                 specs[8] = ItemSpec(ITEM_CRAFT, "steel_ingot");
329                 if(checkItemCombination(items, specs))
330                 {
331                         return new MaterialItem(CONTENT_STEEL, 1);
332                 }
333         }
334
335         // Sandstone
336         {
337                 ItemSpec specs[9];
338                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
339                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
340                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
341                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_SAND);
342                 if(checkItemCombination(items, specs))
343                 {
344                         return new MaterialItem(CONTENT_SANDSTONE, 1);
345                 }
346         }
347
348         // Clay
349         {
350                 ItemSpec specs[9];
351                 specs[3] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
352                 specs[4] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
353                 specs[6] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
354                 specs[7] = ItemSpec(ITEM_CRAFT, "lump_of_clay");
355                 if(checkItemCombination(items, specs))
356                 {
357                         return new MaterialItem(CONTENT_CLAY, 1);
358                 }
359         }
360
361         // Brick
362         {
363                 ItemSpec specs[9];
364                 specs[3] = ItemSpec(ITEM_CRAFT, "clay_brick");
365                 specs[4] = ItemSpec(ITEM_CRAFT, "clay_brick");
366                 specs[6] = ItemSpec(ITEM_CRAFT, "clay_brick");
367                 specs[7] = ItemSpec(ITEM_CRAFT, "clay_brick");
368                 if(checkItemCombination(items, specs))
369                 {
370                         return new MaterialItem(CONTENT_BRICK, 1);
371                 }
372         }
373
374         // Paper
375         {
376                 ItemSpec specs[9];
377                 specs[3] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
378                 specs[4] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
379                 specs[5] = ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS);
380                 if(checkItemCombination(items, specs))
381                 {
382                         return new CraftItem("paper", 1);
383                 }
384         }
385
386         // Book
387         {
388                 ItemSpec specs[9];
389                 specs[1] = ItemSpec(ITEM_CRAFT, "paper");
390                 specs[4] = ItemSpec(ITEM_CRAFT, "paper");
391                 specs[7] = ItemSpec(ITEM_CRAFT, "paper");
392                 if(checkItemCombination(items, specs))
393                 {
394                         return new CraftItem("book", 1);
395                 }
396         }
397
398         // Book shelf
399         {
400                 ItemSpec specs[9];
401                 specs[0] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
402                 specs[1] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
403                 specs[2] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
404                 specs[3] = ItemSpec(ITEM_CRAFT, "book");
405                 specs[4] = ItemSpec(ITEM_CRAFT, "book");
406                 specs[5] = ItemSpec(ITEM_CRAFT, "book");
407                 specs[6] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
408                 specs[7] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
409                 specs[8] = ItemSpec(ITEM_MATERIAL, CONTENT_WOOD);
410                 if(checkItemCombination(items, specs))
411                 {
412                         return new MaterialItem(CONTENT_BOOKSHELF, 1);
413                 }
414         }
415
416         // Ladder
417         {
418                 ItemSpec specs[9];
419                 specs[0] = ItemSpec(ITEM_CRAFT, "Stick");
420                 specs[2] = ItemSpec(ITEM_CRAFT, "Stick");
421                 specs[3] = ItemSpec(ITEM_CRAFT, "Stick");
422                 specs[4] = ItemSpec(ITEM_CRAFT, "Stick");
423                 specs[5] = ItemSpec(ITEM_CRAFT, "Stick");
424                 specs[6] = ItemSpec(ITEM_CRAFT, "Stick");
425                 specs[8] = ItemSpec(ITEM_CRAFT, "Stick");
426                 if(checkItemCombination(items, specs))
427                 {
428                         return new MaterialItem(CONTENT_LADDER, 1);
429                 }
430         }
431
432         return NULL;
433 }
434
435 void craft_set_creative_inventory(Player *player)
436 {
437         player->resetInventory();
438         
439         // Give some good tools
440         {
441                 InventoryItem *item = new ToolItem("MesePick", 0);
442                 void* r = player->inventory.addItem("main", item);
443                 assert(r == NULL);
444         }
445         {
446                 InventoryItem *item = new ToolItem("SteelPick", 0);
447                 void* r = player->inventory.addItem("main", item);
448                 assert(r == NULL);
449         }
450         {
451                 InventoryItem *item = new ToolItem("SteelAxe", 0);
452                 void* r = player->inventory.addItem("main", item);
453                 assert(r == NULL);
454         }
455         {
456                 InventoryItem *item = new ToolItem("SteelShovel", 0);
457                 void* r = player->inventory.addItem("main", item);
458                 assert(r == NULL);
459         }
460
461         /*
462                 Give materials
463         */
464         
465         // CONTENT_IGNORE-terminated list
466         content_t material_items[] = {
467                 CONTENT_TORCH,
468                 CONTENT_COBBLE,
469                 CONTENT_MUD,
470                 CONTENT_STONE,
471                 CONTENT_SAND,
472                 CONTENT_SANDSTONE,
473                 CONTENT_CLAY,
474                 CONTENT_BRICK,
475                 CONTENT_TREE,
476                 CONTENT_LEAVES,
477                 CONTENT_CACTUS,
478                 CONTENT_PAPYRUS,
479                 CONTENT_BOOKSHELF,
480                 CONTENT_GLASS,
481                 CONTENT_FENCE,
482                 CONTENT_RAIL,
483                 CONTENT_MESE,
484                 CONTENT_WATERSOURCE,
485                 CONTENT_CLOUD,
486                 CONTENT_CHEST,
487                 CONTENT_FURNACE,
488                 CONTENT_SIGN_WALL,
489                 CONTENT_LAVASOURCE,
490                 CONTENT_IGNORE
491         };
492         
493         content_t *mip = material_items;
494         for(u16 i=0; i<PLAYER_INVENTORY_SIZE; i++)
495         {
496                 if(*mip == CONTENT_IGNORE)
497                         break;
498
499                 InventoryItem *item = new MaterialItem(*mip, 1);
500                 player->inventory.addItem("main", item);
501
502                 mip++;
503         }
504
505 #if 0
506         assert(USEFUL_CONTENT_COUNT <= PLAYER_INVENTORY_SIZE);
507         
508         // add torch first
509         InventoryItem *item = new MaterialItem(CONTENT_TORCH, 1);
510         player->inventory.addItem("main", item);
511         
512         // Then others
513         for(u16 i=0; i<USEFUL_CONTENT_COUNT; i++)
514         {
515                 // Skip some materials
516                 if(i == CONTENT_WATER || i == CONTENT_TORCH
517                         || i == CONTENT_COALSTONE)
518                         continue;
519
520                 InventoryItem *item = new MaterialItem(i, 1);
521                 player->inventory.addItem("main", item);
522         }
523 #endif
524
525         /*// Sign
526         {
527                 InventoryItem *item = new MapBlockObjectItem("Sign Example text");
528                 void* r = player->inventory.addItem("main", item);
529                 assert(r == NULL);
530         }*/
531 }
532
533 void craft_give_initial_stuff(Player *player)
534 {
535         {
536                 InventoryItem *item = new ToolItem("SteelPick", 0);
537                 void* r = player->inventory.addItem("main", item);
538                 assert(r == NULL);
539         }
540         {
541                 InventoryItem *item = new MaterialItem(CONTENT_TORCH, 99);
542                 void* r = player->inventory.addItem("main", item);
543                 assert(r == NULL);
544         }
545         {
546                 InventoryItem *item = new ToolItem("SteelAxe", 0);
547                 void* r = player->inventory.addItem("main", item);
548                 assert(r == NULL);
549         }
550         {
551                 InventoryItem *item = new ToolItem("SteelShovel", 0);
552                 void* r = player->inventory.addItem("main", item);
553                 assert(r == NULL);
554         }
555         {
556                 InventoryItem *item = new MaterialItem(CONTENT_COBBLE, 99);
557                 void* r = player->inventory.addItem("main", item);
558                 assert(r == NULL);
559         }
560         /*{
561                 InventoryItem *item = new MaterialItem(CONTENT_MESE, 6);
562                 void* r = player->inventory.addItem("main", item);
563                 assert(r == NULL);
564         }
565         {
566                 InventoryItem *item = new MaterialItem(CONTENT_COALSTONE, 6);
567                 void* r = player->inventory.addItem("main", item);
568                 assert(r == NULL);
569         }
570         {
571                 InventoryItem *item = new MaterialItem(CONTENT_WOOD, 6);
572                 void* r = player->inventory.addItem("main", item);
573                 assert(r == NULL);
574         }
575         {
576                 InventoryItem *item = new CraftItem("Stick", 4);
577                 void* r = player->inventory.addItem("main", item);
578                 assert(r == NULL);
579         }
580         {
581                 InventoryItem *item = new ToolItem("WPick", 32000);
582                 void* r = player->inventory.addItem("main", item);
583                 assert(r == NULL);
584         }
585         {
586                 InventoryItem *item = new ToolItem("STPick", 32000);
587                 void* r = player->inventory.addItem("main", item);
588                 assert(r == NULL);
589         }*/
590         /*// and some signs
591         for(u16 i=0; i<4; i++)
592         {
593                 InventoryItem *item = new MapBlockObjectItem("Sign Example text");
594                 bool r = player->inventory.addItem("main", item);
595                 assert(r == true);
596         }*/
597         /*// Give some other stuff
598         {
599                 InventoryItem *item = new MaterialItem(CONTENT_TREE, 999);
600                 bool r = player->inventory.addItem("main", item);
601                 assert(r == true);
602         }*/
603 }
604