c3e507e218702ccf9449978bec09d76223651cb5
[oweals/minetest.git] / src / content_mapnode.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_mapnode.h"
21
22 #include "irrlichttypes.h"
23 #include "mapnode.h"
24 #include "content_nodemeta.h"
25 #include "nodedef.h"
26 #include "utility.h"
27
28 #define WATER_ALPHA 160
29
30 #define WATER_VISC 1
31 #define LAVA_VISC 7
32
33 void setConstantMaterialProperties(MaterialProperties &mprop, float time)
34 {
35         mprop.diggability = DIGGABLE_CONSTANT;
36         mprop.constant_time = time;
37 }
38
39 void setStoneLikeMaterialProperties(MaterialProperties &mprop, float toughness)
40 {
41         mprop.diggability = DIGGABLE_NORMAL;
42         mprop.weight = 5.0 * toughness;
43         mprop.crackiness = 1.0;
44         mprop.crumbliness = -0.1;
45         mprop.cuttability = -0.2;
46 }
47
48 void setDirtLikeMaterialProperties(MaterialProperties &mprop, float toughness)
49 {
50         mprop.diggability = DIGGABLE_NORMAL;
51         mprop.weight = toughness * 1.2;
52         mprop.crackiness = 0;
53         mprop.crumbliness = 1.2;
54         mprop.cuttability = -0.4;
55 }
56
57 void setGravelLikeMaterialProperties(MaterialProperties &mprop, float toughness)
58 {
59         mprop.diggability = DIGGABLE_NORMAL;
60         mprop.weight = toughness * 2.0;
61         mprop.crackiness = 0.2;
62         mprop.crumbliness = 1.5;
63         mprop.cuttability = -1.0;
64 }
65
66 void setWoodLikeMaterialProperties(MaterialProperties &mprop, float toughness)
67 {
68         mprop.diggability = DIGGABLE_NORMAL;
69         mprop.weight = toughness * 1.0;
70         mprop.crackiness = 0.75;
71         mprop.crumbliness = -1.0;
72         mprop.cuttability = 1.5;
73 }
74
75 void setLeavesLikeMaterialProperties(MaterialProperties &mprop, float toughness)
76 {
77         mprop.diggability = DIGGABLE_NORMAL;
78         mprop.weight = -0.5 * toughness;
79         mprop.crackiness = 0;
80         mprop.crumbliness = 0;
81         mprop.cuttability = 2.0;
82 }
83
84 void setGlassLikeMaterialProperties(MaterialProperties &mprop, float toughness)
85 {
86         mprop.diggability = DIGGABLE_NORMAL;
87         mprop.weight = 0.1 * toughness;
88         mprop.crackiness = 2.0;
89         mprop.crumbliness = -1.0;
90         mprop.cuttability = -1.0;
91 }
92
93 /*
94         A conversion table for backwards compatibility.
95         Maps <=v19 content types to current ones.
96         Should never be touched.
97 */
98 content_t trans_table_19[21][2] = {
99         {CONTENT_GRASS, 1},
100         {CONTENT_TREE, 4},
101         {CONTENT_LEAVES, 5},
102         {CONTENT_GRASS_FOOTSTEPS, 6},
103         {CONTENT_MESE, 7},
104         {CONTENT_MUD, 8},
105         {CONTENT_CLOUD, 10},
106         {CONTENT_COALSTONE, 11},
107         {CONTENT_WOOD, 12},
108         {CONTENT_SAND, 13},
109         {CONTENT_COBBLE, 18},
110         {CONTENT_STEEL, 19},
111         {CONTENT_GLASS, 20},
112         {CONTENT_MOSSYCOBBLE, 22},
113         {CONTENT_GRAVEL, 23},
114         {CONTENT_SANDSTONE, 24},
115         {CONTENT_CACTUS, 25},
116         {CONTENT_BRICK, 26},
117         {CONTENT_CLAY, 27},
118         {CONTENT_PAPYRUS, 28},
119         {CONTENT_BOOKSHELF, 29},
120 };
121
122 MapNode mapnode_translate_from_internal(MapNode n_from, u8 version)
123 {
124         MapNode result = n_from;
125         if(version <= 19)
126         {
127                 content_t c_from = n_from.getContent();
128                 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
129                 {
130                         if(trans_table_19[i][0] == c_from)
131                         {
132                                 result.setContent(trans_table_19[i][1]);
133                                 break;
134                         }
135                 }
136         }
137         return result;
138 }
139 MapNode mapnode_translate_to_internal(MapNode n_from, u8 version)
140 {
141         MapNode result = n_from;
142         if(version <= 19)
143         {
144                 content_t c_from = n_from.getContent();
145                 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
146                 {
147                         if(trans_table_19[i][1] == c_from)
148                         {
149                                 result.setContent(trans_table_19[i][0]);
150                                 break;
151                         }
152                 }
153         }
154         return result;
155 }
156
157 // See header for description
158 void content_mapnode_init(IWritableNodeDefManager *nodemgr)
159 {
160         content_t i;
161         ContentFeatures *f = NULL;
162
163         i = CONTENT_STONE;
164         f = nodemgr->getModifiable(i);
165         f->setAllTextures("stone.png");
166         f->setInventoryTextureCube("stone.png", "stone.png", "stone.png");
167         f->param_type = CPT_MINERAL;
168         f->is_ground_content = true;
169         f->often_contains_mineral = true;
170         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 1";
171         setStoneLikeMaterialProperties(f->material, 1.0);
172         
173         i = CONTENT_GRASS;
174         f = nodemgr->getModifiable(i);
175         f->setAllTextures("mud.png^grass_side.png");
176         f->setTexture(0, "grass.png");
177         f->setTexture(1, "mud.png");
178         f->param_type = CPT_MINERAL;
179         f->is_ground_content = true;
180         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
181         setDirtLikeMaterialProperties(f->material, 1.0);
182         
183         i = CONTENT_GRASS_FOOTSTEPS;
184         f = nodemgr->getModifiable(i);
185         f->setAllTextures("mud.png^grass_side.png");
186         f->setTexture(0, "grass_footsteps.png");
187         f->setTexture(1, "mud.png");
188         f->param_type = CPT_MINERAL;
189         f->is_ground_content = true;
190         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
191         setDirtLikeMaterialProperties(f->material, 1.0);
192         
193         i = CONTENT_MUD;
194         f = nodemgr->getModifiable(i);
195         f->setAllTextures("mud.png");
196         f->setInventoryTextureCube("mud.png", "mud.png", "mud.png");
197         f->param_type = CPT_MINERAL;
198         f->is_ground_content = true;
199         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
200         setDirtLikeMaterialProperties(f->material, 1.0);
201         
202         i = CONTENT_SAND;
203         f = nodemgr->getModifiable(i);
204         f->setAllTextures("sand.png");
205         f->setInventoryTextureCube("sand.png", "sand.png", "sand.png");
206         f->param_type = CPT_MINERAL;
207         f->is_ground_content = true;
208         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
209         f->cookresult_item = std::string("MaterialItem2 ")+itos(CONTENT_GLASS)+" 1";
210         setDirtLikeMaterialProperties(f->material, 1.0);
211         
212         i = CONTENT_GRAVEL;
213         f = nodemgr->getModifiable(i);
214         f->setAllTextures("gravel.png");
215         f->setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png");
216         f->param_type = CPT_MINERAL;
217         f->is_ground_content = true;
218         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
219         setGravelLikeMaterialProperties(f->material, 1.0);
220         
221         i = CONTENT_SANDSTONE;
222         f = nodemgr->getModifiable(i);
223         f->setAllTextures("sandstone.png");
224         f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
225         f->param_type = CPT_MINERAL;
226         f->is_ground_content = true;
227         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAND)+" 1";
228         setDirtLikeMaterialProperties(f->material, 1.0);
229
230         i = CONTENT_CLAY;
231         f = nodemgr->getModifiable(i);
232         f->setAllTextures("clay.png");
233         f->setInventoryTextureCube("clay.png", "clay.png", "clay.png");
234         f->param_type = CPT_MINERAL;
235         f->is_ground_content = true;
236         f->dug_item = std::string("CraftItem lump_of_clay 4");
237         setDirtLikeMaterialProperties(f->material, 1.0);
238
239         i = CONTENT_BRICK;
240         f = nodemgr->getModifiable(i);
241         f->setAllTextures("brick.png");
242         f->setInventoryTextureCube("brick.png", "brick.png", "brick.png");
243         f->param_type = CPT_MINERAL;
244         f->is_ground_content = true;
245         f->dug_item = std::string("CraftItem clay_brick 4");
246         setStoneLikeMaterialProperties(f->material, 1.0);
247
248         i = CONTENT_TREE;
249         f = nodemgr->getModifiable(i);
250         f->setAllTextures("tree.png");
251         f->setTexture(0, "tree_top.png");
252         f->setTexture(1, "tree_top.png");
253         f->param_type = CPT_MINERAL;
254         f->is_ground_content = true;
255         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
256         f->cookresult_item = "CraftItem lump_of_coal 1";
257         f->furnace_burntime = 30;
258         setWoodLikeMaterialProperties(f->material, 1.0);
259         
260         i = CONTENT_JUNGLETREE;
261         f = nodemgr->getModifiable(i);
262         f->setAllTextures("jungletree.png");
263         f->setTexture(0, "jungletree_top.png");
264         f->setTexture(1, "jungletree_top.png");
265         f->param_type = CPT_MINERAL;
266         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
267         f->furnace_burntime = 30;
268         setWoodLikeMaterialProperties(f->material, 1.0);
269         
270         i = CONTENT_JUNGLEGRASS;
271         f = nodemgr->getModifiable(i);
272         f->drawtype = NDT_PLANTLIKE;
273         f->visual_scale = 1.3;
274         f->setAllTextures("junglegrass.png");
275         f->setInventoryTexture("junglegrass.png");
276         f->light_propagates = true;
277         f->param_type = CPT_LIGHT;
278         f->air_equivalent = false; // grass grows underneath
279         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
280         f->walkable = false;
281         setLeavesLikeMaterialProperties(f->material, 1.0);
282         f->furnace_burntime = 2;
283
284         i = CONTENT_LEAVES;
285         f = nodemgr->getModifiable(i);
286         f->drawtype = NDT_ALLFACES_OPTIONAL;
287         f->setAllTextures("leaves.png");
288         //f->setAllTextures("[noalpha:leaves.png");
289         f->light_propagates = true;
290         f->param_type = CPT_LIGHT;
291         f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1";
292         f->extra_dug_item_rarity = 20;
293         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
294         setLeavesLikeMaterialProperties(f->material, 1.0);
295         f->furnace_burntime = 1.0;
296
297         i = CONTENT_CACTUS;
298         f = nodemgr->getModifiable(i);
299         f->setAllTextures("cactus_side.png");
300         f->setTexture(0, "cactus_top.png");
301         f->setTexture(1, "cactus_top.png");
302         f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png");
303         f->param_type = CPT_MINERAL;
304         f->is_ground_content = true;
305         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
306         setWoodLikeMaterialProperties(f->material, 0.75);
307         f->furnace_burntime = 15;
308
309         i = CONTENT_PAPYRUS;
310         f = nodemgr->getModifiable(i);
311         f->drawtype = NDT_PLANTLIKE;
312         f->setAllTextures("papyrus.png");
313         f->setInventoryTexture("papyrus.png");
314         f->light_propagates = true;
315         f->param_type = CPT_LIGHT;
316         f->is_ground_content = true;
317         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
318         f->walkable = false;
319         setLeavesLikeMaterialProperties(f->material, 0.5);
320         f->furnace_burntime = 1;
321
322         i = CONTENT_BOOKSHELF;
323         f = nodemgr->getModifiable(i);
324         f->setAllTextures("bookshelf.png");
325         f->setTexture(0, "wood.png");
326         f->setTexture(1, "wood.png");
327         // FIXME: setInventoryTextureCube() only cares for the first texture
328         f->setInventoryTextureCube("bookshelf.png", "bookshelf.png", "bookshelf.png");
329         //f->setInventoryTextureCube("wood.png", "bookshelf.png", "bookshelf.png");
330         f->param_type = CPT_MINERAL;
331         f->is_ground_content = true;
332         setWoodLikeMaterialProperties(f->material, 0.75);
333         f->furnace_burntime = 30;
334
335         i = CONTENT_GLASS;
336         f = nodemgr->getModifiable(i);
337         f->drawtype = NDT_GLASSLIKE;
338         f->setAllTextures("glass.png");
339         f->light_propagates = true;
340         f->sunlight_propagates = true;
341         f->param_type = CPT_LIGHT;
342         f->is_ground_content = true;
343         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
344         f->setInventoryTextureCube("glass.png", "glass.png", "glass.png");
345         setGlassLikeMaterialProperties(f->material, 1.0);
346
347         i = CONTENT_FENCE;
348         f = nodemgr->getModifiable(i);
349         f->drawtype = NDT_FENCELIKE;
350         f->setInventoryTexture("fence.png");
351         f->setTexture(0, "wood.png");
352         f->light_propagates = true;
353         f->param_type = CPT_LIGHT;
354         f->is_ground_content = true;
355         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
356         f->air_equivalent = true; // grass grows underneath
357         f->selection_box.type = NODEBOX_FIXED;
358         f->selection_box.fixed = core::aabbox3d<f32>(
359                         -BS/7, -BS/2, -BS/7, BS/7, BS/2, BS/7);
360         f->furnace_burntime = 30/2;
361         setWoodLikeMaterialProperties(f->material, 0.75);
362
363         i = CONTENT_RAIL;
364         f = nodemgr->getModifiable(i);
365         f->drawtype = NDT_RAILLIKE;
366         f->setInventoryTexture("rail.png");
367         f->setTexture(0, "rail.png");
368         f->setTexture(1, "rail_curved.png");
369         f->setTexture(2, "rail_t_junction.png");
370         f->setTexture(3, "rail_crossing.png");
371         f->light_propagates = true;
372         f->param_type = CPT_LIGHT;
373         f->is_ground_content = true;
374         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
375         f->air_equivalent = true; // grass grows underneath
376         f->walkable = false;
377         f->selection_box.type = NODEBOX_FIXED;
378         f->furnace_burntime = 5;
379         setDirtLikeMaterialProperties(f->material, 0.75);
380
381         i = CONTENT_LADDER;
382         f = nodemgr->getModifiable(i);
383         f->drawtype = NDT_SIGNLIKE;
384         f->setAllTextures("ladder.png");
385         f->setInventoryTexture("ladder.png");
386         f->light_propagates = true;
387         f->param_type = CPT_LIGHT;
388         f->is_ground_content = true;
389         f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
390         f->wall_mounted = true;
391         f->air_equivalent = true;
392         f->walkable = false;
393         f->climbable = true;
394         f->selection_box.type = NODEBOX_WALLMOUNTED;
395         f->furnace_burntime = 5;
396         setWoodLikeMaterialProperties(f->material, 0.5);
397
398         // Deprecated
399         i = CONTENT_COALSTONE;
400         f = nodemgr->getModifiable(i);
401         f->setAllTextures("stone.png^mineral_coal.png");
402         f->is_ground_content = true;
403         setStoneLikeMaterialProperties(f->material, 1.5);
404         
405         i = CONTENT_WOOD;
406         f = nodemgr->getModifiable(i);
407         f->setAllTextures("wood.png");
408         f->setInventoryTextureCube("wood.png", "wood.png", "wood.png");
409         f->is_ground_content = true;
410         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
411         f->furnace_burntime = 30/4;
412         setWoodLikeMaterialProperties(f->material, 0.75);
413         
414         i = CONTENT_MESE;
415         f = nodemgr->getModifiable(i);
416         f->setAllTextures("mese.png");
417         f->setInventoryTextureCube("mese.png", "mese.png", "mese.png");
418         f->is_ground_content = true;
419         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
420         f->furnace_burntime = 30;
421         setStoneLikeMaterialProperties(f->material, 0.5);
422         
423         i = CONTENT_CLOUD;
424         f = nodemgr->getModifiable(i);
425         f->setAllTextures("cloud.png");
426         f->setInventoryTextureCube("cloud.png", "cloud.png", "cloud.png");
427         f->is_ground_content = true;
428         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
429         
430         i = CONTENT_AIR;
431         f = nodemgr->getModifiable(i);
432         f->param_type = CPT_LIGHT;
433         f->light_propagates = true;
434         f->sunlight_propagates = true;
435         f->walkable = false;
436         f->pointable = false;
437         f->diggable = false;
438         f->buildable_to = true;
439         f->air_equivalent = true;
440         
441         i = CONTENT_WATER;
442         f = nodemgr->getModifiable(i);
443         f->drawtype = NDT_FLOWINGLIQUID;
444         f->setAllTextures("water.png");
445         f->alpha = WATER_ALPHA;
446         f->setInventoryTextureCube("water.png", "water.png", "water.png");
447         f->param_type = CPT_LIGHT;
448         f->light_propagates = true;
449         f->walkable = false;
450         f->pointable = false;
451         f->diggable = false;
452         f->buildable_to = true;
453         f->liquid_type = LIQUID_FLOWING;
454         f->liquid_alternative_flowing = CONTENT_WATER;
455         f->liquid_alternative_source = CONTENT_WATERSOURCE;
456         f->liquid_viscosity = WATER_VISC;
457         f->post_effect_color = video::SColor(64, 100, 100, 200);
458         f->setSpecialMaterial(0, MaterialSpec("water.png", false));
459         f->setSpecialMaterial(1, MaterialSpec("water.png", true));
460
461         i = CONTENT_WATERSOURCE;
462         f = nodemgr->getModifiable(i);
463         f->drawtype = NDT_LIQUID;
464         f->setAllTextures("water.png");
465         f->alpha = WATER_ALPHA;
466         f->setInventoryTextureCube("water.png", "water.png", "water.png");
467         f->param_type = CPT_LIGHT;
468         f->light_propagates = true;
469         f->walkable = false;
470         f->pointable = false;
471         f->diggable = false;
472         f->buildable_to = true;
473         f->liquid_type = LIQUID_SOURCE;
474         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
475         f->liquid_alternative_flowing = CONTENT_WATER;
476         f->liquid_alternative_source = CONTENT_WATERSOURCE;
477         f->liquid_viscosity = WATER_VISC;
478         f->post_effect_color = video::SColor(64, 100, 100, 200);
479         // New-style water source material (mostly unused)
480         f->setSpecialMaterial(0, MaterialSpec("water.png", false));
481         
482         i = CONTENT_LAVA;
483         f = nodemgr->getModifiable(i);
484         f->drawtype = NDT_FLOWINGLIQUID;
485         f->setAllTextures("lava.png");
486         f->setInventoryTextureCube("lava.png", "lava.png", "lava.png");
487         f->param_type = CPT_LIGHT;
488         f->light_propagates = false;
489         f->light_source = LIGHT_MAX-1;
490         f->walkable = false;
491         f->pointable = false;
492         f->diggable = false;
493         f->buildable_to = true;
494         f->liquid_type = LIQUID_FLOWING;
495         f->liquid_alternative_flowing = CONTENT_LAVA;
496         f->liquid_alternative_source = CONTENT_LAVASOURCE;
497         f->liquid_viscosity = LAVA_VISC;
498         f->damage_per_second = 4*2;
499         f->post_effect_color = video::SColor(192, 255, 64, 0);
500         f->setSpecialMaterial(0, MaterialSpec("lava.png", false));
501         f->setSpecialMaterial(1, MaterialSpec("lava.png", true));
502         
503         i = CONTENT_LAVASOURCE;
504         f = nodemgr->getModifiable(i);
505         f->drawtype = NDT_LIQUID;
506         f->setAllTextures("lava.png");
507         f->setInventoryTextureCube("lava.png", "lava.png", "lava.png");
508         f->param_type = CPT_LIGHT;
509         f->light_propagates = false;
510         f->light_source = LIGHT_MAX-1;
511         f->walkable = false;
512         f->pointable = false;
513         f->diggable = false;
514         f->buildable_to = true;
515         f->liquid_type = LIQUID_SOURCE;
516         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
517         f->liquid_alternative_flowing = CONTENT_LAVA;
518         f->liquid_alternative_source = CONTENT_LAVASOURCE;
519         f->liquid_viscosity = LAVA_VISC;
520         f->damage_per_second = 4*2;
521         f->post_effect_color = video::SColor(192, 255, 64, 0);
522         // New-style lava source material (mostly unused)
523         f->setSpecialMaterial(0, MaterialSpec("lava.png", false));
524         f->furnace_burntime = 60;
525         
526         i = CONTENT_TORCH;
527         f = nodemgr->getModifiable(i);
528         f->drawtype = NDT_TORCHLIKE;
529         f->setTexture(0, "torch_on_floor.png");
530         f->setTexture(1, "torch_on_ceiling.png");
531         f->setTexture(2, "torch.png");
532         f->setInventoryTexture("torch_on_floor.png");
533         f->param_type = CPT_LIGHT;
534         f->light_propagates = true;
535         f->sunlight_propagates = true;
536         f->walkable = false;
537         f->wall_mounted = true;
538         f->air_equivalent = true;
539         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
540         f->light_source = LIGHT_MAX-1;
541         f->selection_box.type = NODEBOX_WALLMOUNTED;
542         f->selection_box.wall_top = core::aabbox3d<f32>(
543                         -BS/10, BS/2-BS/3.333*2, -BS/10, BS/10, BS/2, BS/10);
544         f->selection_box.wall_bottom = core::aabbox3d<f32>(
545                         -BS/10, -BS/2, -BS/10, BS/10, -BS/2+BS/3.333*2, BS/10);
546         f->selection_box.wall_side = core::aabbox3d<f32>(
547                         -BS/2, -BS/3.333, -BS/10, -BS/2+BS/3.333, BS/3.333, BS/10);
548         setConstantMaterialProperties(f->material, 0.0);
549         f->furnace_burntime = 4;
550         
551         i = CONTENT_SIGN_WALL;
552         f = nodemgr->getModifiable(i);
553         f->drawtype = NDT_SIGNLIKE;
554         f->setAllTextures("sign_wall.png");
555         f->setInventoryTexture("sign_wall.png");
556         f->param_type = CPT_LIGHT;
557         f->light_propagates = true;
558         f->sunlight_propagates = true;
559         f->walkable = false;
560         f->wall_mounted = true;
561         f->air_equivalent = true;
562         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
563         if(f->initial_metadata == NULL)
564                 f->initial_metadata = new SignNodeMetadata(NULL, "Some sign");
565         setConstantMaterialProperties(f->material, 0.5);
566         f->selection_box.type = NODEBOX_WALLMOUNTED;
567         f->furnace_burntime = 10;
568         
569         i = CONTENT_CHEST;
570         f = nodemgr->getModifiable(i);
571         f->param_type = CPT_FACEDIR_SIMPLE;
572         f->setAllTextures("chest_side.png");
573         f->setTexture(0, "chest_top.png");
574         f->setTexture(1, "chest_top.png");
575         f->setTexture(5, "chest_front.png"); // Z-
576         f->setInventoryTexture("chest_top.png");
577         //f->setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
578         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
579         if(f->initial_metadata == NULL)
580                 f->initial_metadata = new ChestNodeMetadata(NULL);
581         setWoodLikeMaterialProperties(f->material, 1.0);
582         f->furnace_burntime = 30;
583         
584         i = CONTENT_LOCKABLE_CHEST;
585         f = nodemgr->getModifiable(i);
586         f->param_type = CPT_FACEDIR_SIMPLE;
587         f->setAllTextures("chest_side.png");
588         f->setTexture(0, "chest_top.png");
589         f->setTexture(1, "chest_top.png");
590         f->setTexture(5, "chest_lock.png"); // Z-
591         f->setInventoryTexture("chest_lock.png");
592         //f->setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
593         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
594         if(f->initial_metadata == NULL)
595                 f->initial_metadata = new LockingChestNodeMetadata(NULL);
596         setWoodLikeMaterialProperties(f->material, 1.0);
597         f->furnace_burntime = 30;
598
599         i = CONTENT_FURNACE;
600         f = nodemgr->getModifiable(i);
601         f->param_type = CPT_FACEDIR_SIMPLE;
602         f->setAllTextures("furnace_side.png");
603         f->setTexture(5, "furnace_front.png"); // Z-
604         f->setInventoryTexture("furnace_front.png");
605         //f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
606         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 6";
607         if(f->initial_metadata == NULL)
608                 f->initial_metadata = new FurnaceNodeMetadata(NULL);
609         setStoneLikeMaterialProperties(f->material, 3.0);
610         
611         i = CONTENT_COBBLE;
612         f = nodemgr->getModifiable(i);
613         f->setAllTextures("cobble.png");
614         f->setInventoryTextureCube("cobble.png", "cobble.png", "cobble.png");
615         f->param_type = CPT_NONE;
616         f->is_ground_content = true;
617         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
618         f->cookresult_item = std::string("MaterialItem2 ")+itos(CONTENT_STONE)+" 1";
619         setStoneLikeMaterialProperties(f->material, 0.9);
620
621         i = CONTENT_MOSSYCOBBLE;
622         f = nodemgr->getModifiable(i);
623         f->setAllTextures("mossycobble.png");
624         f->setInventoryTextureCube("mossycobble.png", "mossycobble.png", "mossycobble.png");
625         f->param_type = CPT_NONE;
626         f->is_ground_content = true;
627         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
628         setStoneLikeMaterialProperties(f->material, 0.8);
629         
630         i = CONTENT_STEEL;
631         f = nodemgr->getModifiable(i);
632         f->setAllTextures("steel_block.png");
633         f->setInventoryTextureCube("steel_block.png", "steel_block.png",
634                         "steel_block.png");
635         f->param_type = CPT_NONE;
636         f->is_ground_content = true;
637         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
638         setStoneLikeMaterialProperties(f->material, 5.0);
639         
640         i = CONTENT_NC;
641         f = nodemgr->getModifiable(i);
642         f->param_type = CPT_FACEDIR_SIMPLE;
643         f->setAllTextures("nc_side.png");
644         f->setTexture(5, "nc_front.png"); // Z-
645         f->setTexture(4, "nc_back.png"); // Z+
646         f->setInventoryTexture("nc_front.png");
647         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
648         setStoneLikeMaterialProperties(f->material, 3.0);
649         f->furnace_burntime = 1;
650         
651         i = CONTENT_NC_RB;
652         f = nodemgr->getModifiable(i);
653         f->setAllTextures("nc_rb.png");
654         f->setInventoryTexture("nc_rb.png");
655         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
656         setStoneLikeMaterialProperties(f->material, 3.0);
657         f->furnace_burntime = 1;
658
659         i = CONTENT_SAPLING;
660         f = nodemgr->getModifiable(i);
661         f->drawtype = NDT_PLANTLIKE;
662         f->visual_scale = 1.0;
663         f->setAllTextures("sapling.png");
664         f->setInventoryTexture("sapling.png");
665         f->param_type = CPT_LIGHT;
666         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
667         f->light_propagates = true;
668         f->air_equivalent = false;
669         f->walkable = false;
670         setConstantMaterialProperties(f->material, 0.0);
671         f->furnace_burntime = 10;
672         
673         i = CONTENT_APPLE;
674         f = nodemgr->getModifiable(i);
675         f->drawtype = NDT_PLANTLIKE;
676         f->visual_scale = 1.0;
677         f->setAllTextures("apple.png");
678         f->setInventoryTexture("apple.png");
679         f->param_type = CPT_LIGHT;
680         f->light_propagates = true;
681         f->sunlight_propagates = true;
682         f->walkable = false;
683         f->air_equivalent = true;
684         f->dug_item = std::string("CraftItem apple 1");
685         setConstantMaterialProperties(f->material, 0.0);
686         f->furnace_burntime = 3;
687 }
688
689