]> git.lizzy.rs Git - dragonfireclient.git/blob - src/content_mapnode.cpp
Fix NDT_PLANTLIKE scaling to always keep the bottom at ground level
[dragonfireclient.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         setDirtLikeMaterialProperties(f->material, 1.0);
210         
211         i = CONTENT_GRAVEL;
212         f = nodemgr->getModifiable(i);
213         f->setAllTextures("gravel.png");
214         f->setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png");
215         f->param_type = CPT_MINERAL;
216         f->is_ground_content = true;
217         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
218         setGravelLikeMaterialProperties(f->material, 1.0);
219         
220         i = CONTENT_SANDSTONE;
221         f = nodemgr->getModifiable(i);
222         f->setAllTextures("sandstone.png");
223         f->setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
224         f->param_type = CPT_MINERAL;
225         f->is_ground_content = true;
226         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAND)+" 1";
227         setDirtLikeMaterialProperties(f->material, 1.0);
228
229         i = CONTENT_CLAY;
230         f = nodemgr->getModifiable(i);
231         f->setAllTextures("clay.png");
232         f->setInventoryTextureCube("clay.png", "clay.png", "clay.png");
233         f->param_type = CPT_MINERAL;
234         f->is_ground_content = true;
235         f->dug_item = std::string("CraftItem lump_of_clay 4");
236         setDirtLikeMaterialProperties(f->material, 1.0);
237
238         i = CONTENT_BRICK;
239         f = nodemgr->getModifiable(i);
240         f->setAllTextures("brick.png");
241         f->setInventoryTextureCube("brick.png", "brick.png", "brick.png");
242         f->param_type = CPT_MINERAL;
243         f->is_ground_content = true;
244         f->dug_item = std::string("CraftItem clay_brick 4");
245         setStoneLikeMaterialProperties(f->material, 1.0);
246
247         i = CONTENT_TREE;
248         f = nodemgr->getModifiable(i);
249         f->setAllTextures("tree.png");
250         f->setTexture(0, "tree_top.png");
251         f->setTexture(1, "tree_top.png");
252         f->param_type = CPT_MINERAL;
253         f->is_ground_content = true;
254         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
255         setWoodLikeMaterialProperties(f->material, 1.0);
256         
257         i = CONTENT_JUNGLETREE;
258         f = nodemgr->getModifiable(i);
259         f->setAllTextures("jungletree.png");
260         f->setTexture(0, "jungletree_top.png");
261         f->setTexture(1, "jungletree_top.png");
262         f->param_type = CPT_MINERAL;
263         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
264         setWoodLikeMaterialProperties(f->material, 1.0);
265         
266         i = CONTENT_JUNGLEGRASS;
267         f = nodemgr->getModifiable(i);
268         f->drawtype = NDT_PLANTLIKE;
269         f->visual_scale = 1.3;
270         f->setAllTextures("junglegrass.png");
271         f->setInventoryTexture("junglegrass.png");
272         f->light_propagates = true;
273         f->param_type = CPT_LIGHT;
274         f->air_equivalent = false; // grass grows underneath
275         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
276         f->walkable = false;
277         setLeavesLikeMaterialProperties(f->material, 1.0);
278
279         i = CONTENT_LEAVES;
280         f = nodemgr->getModifiable(i);
281         f->drawtype = NDT_ALLFACES_OPTIONAL;
282         f->setAllTextures("leaves.png");
283         //f->setAllTextures("[noalpha:leaves.png");
284         f->light_propagates = true;
285         f->param_type = CPT_LIGHT;
286         f->extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1";
287         f->extra_dug_item_rarity = 20;
288         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
289         setLeavesLikeMaterialProperties(f->material, 1.0);
290
291         i = CONTENT_CACTUS;
292         f = nodemgr->getModifiable(i);
293         f->setAllTextures("cactus_side.png");
294         f->setTexture(0, "cactus_top.png");
295         f->setTexture(1, "cactus_top.png");
296         f->setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png");
297         f->param_type = CPT_MINERAL;
298         f->is_ground_content = true;
299         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
300         setWoodLikeMaterialProperties(f->material, 0.75);
301
302         i = CONTENT_PAPYRUS;
303         f = nodemgr->getModifiable(i);
304         f->drawtype = NDT_PLANTLIKE;
305         f->setAllTextures("papyrus.png");
306         f->setInventoryTexture("papyrus.png");
307         f->light_propagates = true;
308         f->param_type = CPT_LIGHT;
309         f->is_ground_content = true;
310         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
311         f->walkable = false;
312         setLeavesLikeMaterialProperties(f->material, 0.5);
313
314         i = CONTENT_BOOKSHELF;
315         f = nodemgr->getModifiable(i);
316         f->setAllTextures("bookshelf.png");
317         f->setTexture(0, "wood.png");
318         f->setTexture(1, "wood.png");
319         // FIXME: setInventoryTextureCube() only cares for the first texture
320         f->setInventoryTextureCube("bookshelf.png", "bookshelf.png", "bookshelf.png");
321         //f->setInventoryTextureCube("wood.png", "bookshelf.png", "bookshelf.png");
322         f->param_type = CPT_MINERAL;
323         f->is_ground_content = true;
324         setWoodLikeMaterialProperties(f->material, 0.75);
325
326         i = CONTENT_GLASS;
327         f = nodemgr->getModifiable(i);
328         f->drawtype = NDT_GLASSLIKE;
329         f->setAllTextures("glass.png");
330         f->light_propagates = true;
331         f->sunlight_propagates = true;
332         f->param_type = CPT_LIGHT;
333         f->is_ground_content = true;
334         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
335         f->setInventoryTextureCube("glass.png", "glass.png", "glass.png");
336         setGlassLikeMaterialProperties(f->material, 1.0);
337
338         i = CONTENT_FENCE;
339         f = nodemgr->getModifiable(i);
340         f->drawtype = NDT_FENCELIKE;
341         f->setInventoryTexture("fence.png");
342         f->setTexture(0, "wood.png");
343         f->light_propagates = true;
344         f->param_type = CPT_LIGHT;
345         f->is_ground_content = true;
346         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
347         f->air_equivalent = true; // grass grows underneath
348         f->selection_box.type = NODEBOX_FIXED;
349         f->selection_box.fixed = core::aabbox3d<f32>(
350                         -BS/7, -BS/2, -BS/7, BS/7, BS/2, BS/7);
351         setWoodLikeMaterialProperties(f->material, 0.75);
352
353         i = CONTENT_RAIL;
354         f = nodemgr->getModifiable(i);
355         f->drawtype = NDT_RAILLIKE;
356         f->setInventoryTexture("rail.png");
357         f->setTexture(0, "rail.png");
358         f->setTexture(1, "rail_curved.png");
359         f->setTexture(2, "rail_t_junction.png");
360         f->setTexture(3, "rail_crossing.png");
361         f->light_propagates = true;
362         f->param_type = CPT_LIGHT;
363         f->is_ground_content = true;
364         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
365         f->air_equivalent = true; // grass grows underneath
366         f->walkable = false;
367         f->selection_box.type = NODEBOX_FIXED;
368         setDirtLikeMaterialProperties(f->material, 0.75);
369
370         i = CONTENT_LADDER;
371         f = nodemgr->getModifiable(i);
372         f->drawtype = NDT_SIGNLIKE;
373         f->setAllTextures("ladder.png");
374         f->setInventoryTexture("ladder.png");
375         f->light_propagates = true;
376         f->param_type = CPT_LIGHT;
377         f->is_ground_content = true;
378         f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
379         f->wall_mounted = true;
380         f->air_equivalent = true;
381         f->walkable = false;
382         f->climbable = true;
383         f->selection_box.type = NODEBOX_WALLMOUNTED;
384         setWoodLikeMaterialProperties(f->material, 0.5);
385
386         // Deprecated
387         i = CONTENT_COALSTONE;
388         f = nodemgr->getModifiable(i);
389         f->setAllTextures("stone.png^mineral_coal.png");
390         f->is_ground_content = true;
391         setStoneLikeMaterialProperties(f->material, 1.5);
392         
393         i = CONTENT_WOOD;
394         f = nodemgr->getModifiable(i);
395         f->setAllTextures("wood.png");
396         f->setInventoryTextureCube("wood.png", "wood.png", "wood.png");
397         f->is_ground_content = true;
398         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
399         setWoodLikeMaterialProperties(f->material, 0.75);
400         
401         i = CONTENT_MESE;
402         f = nodemgr->getModifiable(i);
403         f->setAllTextures("mese.png");
404         f->setInventoryTextureCube("mese.png", "mese.png", "mese.png");
405         f->is_ground_content = true;
406         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
407         setStoneLikeMaterialProperties(f->material, 0.5);
408         
409         i = CONTENT_CLOUD;
410         f = nodemgr->getModifiable(i);
411         f->setAllTextures("cloud.png");
412         f->setInventoryTextureCube("cloud.png", "cloud.png", "cloud.png");
413         f->is_ground_content = true;
414         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
415         
416         i = CONTENT_AIR;
417         f = nodemgr->getModifiable(i);
418         f->param_type = CPT_LIGHT;
419         f->light_propagates = true;
420         f->sunlight_propagates = true;
421         f->walkable = false;
422         f->pointable = false;
423         f->diggable = false;
424         f->buildable_to = true;
425         f->air_equivalent = true;
426         
427         i = CONTENT_WATER;
428         f = nodemgr->getModifiable(i);
429         f->drawtype = NDT_FLOWINGLIQUID;
430         f->setAllTextures("water.png", WATER_ALPHA);
431         f->setInventoryTextureCube("water.png", "water.png", "water.png");
432         f->param_type = CPT_LIGHT;
433         f->light_propagates = true;
434         f->walkable = false;
435         f->pointable = false;
436         f->diggable = false;
437         f->buildable_to = true;
438         f->liquid_type = LIQUID_FLOWING;
439         f->liquid_alternative_flowing = CONTENT_WATER;
440         f->liquid_alternative_source = CONTENT_WATERSOURCE;
441         f->liquid_viscosity = WATER_VISC;
442         f->post_effect_color = video::SColor(64, 100, 100, 200);
443         // Flowing water material
444         f->mspec_special[0].tname = "water.png";
445         f->mspec_special[0].backface_culling = false;
446         f->mspec_special[1].tname = "water.png";
447         f->mspec_special[1].backface_culling = true;
448
449         i = CONTENT_WATERSOURCE;
450         f = nodemgr->getModifiable(i);
451         f->drawtype = NDT_LIQUID;
452         f->setAllTextures("water.png", WATER_ALPHA);
453         //f->setInventoryTexture("water.png");
454         f->setInventoryTextureCube("water.png", "water.png", "water.png");
455         f->param_type = CPT_LIGHT;
456         f->light_propagates = true;
457         f->walkable = false;
458         f->pointable = false;
459         f->diggable = false;
460         f->buildable_to = true;
461         f->liquid_type = LIQUID_SOURCE;
462         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
463         f->liquid_alternative_flowing = CONTENT_WATER;
464         f->liquid_alternative_source = CONTENT_WATERSOURCE;
465         f->liquid_viscosity = WATER_VISC;
466         f->post_effect_color = video::SColor(64, 100, 100, 200);
467         // New-style water source material (mostly unused)
468         f->mspec_special[0].tname = "water.png";
469         f->mspec_special[0].backface_culling = false;
470         
471         i = CONTENT_LAVA;
472         f = nodemgr->getModifiable(i);
473         f->drawtype = NDT_FLOWINGLIQUID;
474         f->setAllTextures("lava.png");
475         f->setInventoryTextureCube("lava.png", "lava.png", "lava.png");
476         f->param_type = CPT_LIGHT;
477         f->light_propagates = false;
478         f->light_source = LIGHT_MAX-1;
479         f->walkable = false;
480         f->pointable = false;
481         f->diggable = false;
482         f->buildable_to = true;
483         f->liquid_type = LIQUID_FLOWING;
484         f->liquid_alternative_flowing = CONTENT_LAVA;
485         f->liquid_alternative_source = CONTENT_LAVASOURCE;
486         f->liquid_viscosity = LAVA_VISC;
487         f->damage_per_second = 4*2;
488         f->post_effect_color = video::SColor(192, 255, 64, 0);
489         // Flowing lava material
490         f->mspec_special[0].tname = "lava.png";
491         f->mspec_special[0].backface_culling = false;
492         f->mspec_special[1].tname = "lava.png";
493         f->mspec_special[1].backface_culling = true;
494         
495         i = CONTENT_LAVASOURCE;
496         f = nodemgr->getModifiable(i);
497         f->drawtype = NDT_LIQUID;
498         f->setAllTextures("lava.png");
499         f->setInventoryTextureCube("lava.png", "lava.png", "lava.png");
500         f->param_type = CPT_LIGHT;
501         f->light_propagates = false;
502         f->light_source = LIGHT_MAX-1;
503         f->walkable = false;
504         f->pointable = false;
505         f->diggable = false;
506         f->buildable_to = true;
507         f->liquid_type = LIQUID_SOURCE;
508         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
509         f->liquid_alternative_flowing = CONTENT_LAVA;
510         f->liquid_alternative_source = CONTENT_LAVASOURCE;
511         f->liquid_viscosity = LAVA_VISC;
512         f->damage_per_second = 4*2;
513         f->post_effect_color = video::SColor(192, 255, 64, 0);
514         // New-style lava source material (mostly unused)
515         f->mspec_special[0].tname = "lava.png";
516         f->mspec_special[0].backface_culling = false;
517         
518         i = CONTENT_TORCH;
519         f = nodemgr->getModifiable(i);
520         f->drawtype = NDT_TORCHLIKE;
521         f->setTexture(0, "torch_on_floor.png");
522         f->setTexture(1, "torch_on_ceiling.png");
523         f->setTexture(2, "torch.png");
524         f->setInventoryTexture("torch_on_floor.png");
525         f->param_type = CPT_LIGHT;
526         f->light_propagates = true;
527         f->sunlight_propagates = true;
528         f->walkable = false;
529         f->wall_mounted = true;
530         f->air_equivalent = true;
531         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
532         f->light_source = LIGHT_MAX-1;
533         f->selection_box.type = NODEBOX_WALLMOUNTED;
534         f->selection_box.wall_top = core::aabbox3d<f32>(
535                         -BS/10, BS/2-BS/3.333*2, -BS/10, BS/10, BS/2, BS/10);
536         f->selection_box.wall_bottom = core::aabbox3d<f32>(
537                         -BS/10, -BS/2, -BS/10, BS/10, -BS/2+BS/3.333*2, BS/10);
538         f->selection_box.wall_side = core::aabbox3d<f32>(
539                         -BS/2, -BS/3.333, -BS/10, -BS/2+BS/3.333, BS/3.333, BS/10);
540         setConstantMaterialProperties(f->material, 0.0);
541         
542         i = CONTENT_SIGN_WALL;
543         f = nodemgr->getModifiable(i);
544         f->drawtype = NDT_SIGNLIKE;
545         f->setAllTextures("sign_wall.png");
546         f->setInventoryTexture("sign_wall.png");
547         f->param_type = CPT_LIGHT;
548         f->light_propagates = true;
549         f->sunlight_propagates = true;
550         f->walkable = false;
551         f->wall_mounted = true;
552         f->air_equivalent = true;
553         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
554         if(f->initial_metadata == NULL)
555                 f->initial_metadata = new SignNodeMetadata(NULL, "Some sign");
556         setConstantMaterialProperties(f->material, 0.5);
557         f->selection_box.type = NODEBOX_WALLMOUNTED;
558         
559         i = CONTENT_CHEST;
560         f = nodemgr->getModifiable(i);
561         f->param_type = CPT_FACEDIR_SIMPLE;
562         f->setAllTextures("chest_side.png");
563         f->setTexture(0, "chest_top.png");
564         f->setTexture(1, "chest_top.png");
565         f->setTexture(5, "chest_front.png"); // Z-
566         f->setInventoryTexture("chest_top.png");
567         //f->setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
568         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
569         if(f->initial_metadata == NULL)
570                 f->initial_metadata = new ChestNodeMetadata(NULL);
571         setWoodLikeMaterialProperties(f->material, 1.0);
572         
573         i = CONTENT_LOCKABLE_CHEST;
574         f = nodemgr->getModifiable(i);
575         f->param_type = CPT_FACEDIR_SIMPLE;
576         f->setAllTextures("chest_side.png");
577         f->setTexture(0, "chest_top.png");
578         f->setTexture(1, "chest_top.png");
579         f->setTexture(5, "chest_lock.png"); // Z-
580         f->setInventoryTexture("chest_lock.png");
581         //f->setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
582         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
583         if(f->initial_metadata == NULL)
584                 f->initial_metadata = new LockingChestNodeMetadata(NULL);
585         setWoodLikeMaterialProperties(f->material, 1.0);
586
587         i = CONTENT_FURNACE;
588         f = nodemgr->getModifiable(i);
589         f->param_type = CPT_FACEDIR_SIMPLE;
590         f->setAllTextures("furnace_side.png");
591         f->setTexture(5, "furnace_front.png"); // Z-
592         f->setInventoryTexture("furnace_front.png");
593         //f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
594         f->dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 6";
595         if(f->initial_metadata == NULL)
596                 f->initial_metadata = new FurnaceNodeMetadata(NULL);
597         setStoneLikeMaterialProperties(f->material, 3.0);
598         
599         i = CONTENT_COBBLE;
600         f = nodemgr->getModifiable(i);
601         f->setAllTextures("cobble.png");
602         f->setInventoryTextureCube("cobble.png", "cobble.png", "cobble.png");
603         f->param_type = CPT_NONE;
604         f->is_ground_content = true;
605         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
606         setStoneLikeMaterialProperties(f->material, 0.9);
607
608         i = CONTENT_MOSSYCOBBLE;
609         f = nodemgr->getModifiable(i);
610         f->setAllTextures("mossycobble.png");
611         f->setInventoryTextureCube("mossycobble.png", "mossycobble.png", "mossycobble.png");
612         f->param_type = CPT_NONE;
613         f->is_ground_content = true;
614         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
615         setStoneLikeMaterialProperties(f->material, 0.8);
616         
617         i = CONTENT_STEEL;
618         f = nodemgr->getModifiable(i);
619         f->setAllTextures("steel_block.png");
620         f->setInventoryTextureCube("steel_block.png", "steel_block.png",
621                         "steel_block.png");
622         f->param_type = CPT_NONE;
623         f->is_ground_content = true;
624         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
625         setStoneLikeMaterialProperties(f->material, 5.0);
626         
627         i = CONTENT_NC;
628         f = nodemgr->getModifiable(i);
629         f->param_type = CPT_FACEDIR_SIMPLE;
630         f->setAllTextures("nc_side.png");
631         f->setTexture(5, "nc_front.png"); // Z-
632         f->setTexture(4, "nc_back.png"); // Z+
633         f->setInventoryTexture("nc_front.png");
634         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
635         setStoneLikeMaterialProperties(f->material, 3.0);
636         
637         i = CONTENT_NC_RB;
638         f = nodemgr->getModifiable(i);
639         f->setAllTextures("nc_rb.png");
640         f->setInventoryTexture("nc_rb.png");
641         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
642         setStoneLikeMaterialProperties(f->material, 3.0);
643
644         i = CONTENT_SAPLING;
645         f = nodemgr->getModifiable(i);
646         f->drawtype = NDT_PLANTLIKE;
647         f->visual_scale = 1.5;
648         f->setAllTextures("sapling.png");
649         f->setInventoryTexture("sapling.png");
650         f->param_type = CPT_LIGHT;
651         f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
652         f->light_propagates = true;
653         f->air_equivalent = false;
654         f->walkable = false;
655         setConstantMaterialProperties(f->material, 0.0);
656         
657         i = CONTENT_APPLE;
658         f = nodemgr->getModifiable(i);
659         f->drawtype = NDT_PLANTLIKE;
660         f->visual_scale = 1.0;
661         f->setAllTextures("apple.png");
662         f->setInventoryTexture("apple.png");
663         f->param_type = CPT_LIGHT;
664         f->light_propagates = true;
665         f->sunlight_propagates = true;
666         f->walkable = false;
667         f->air_equivalent = true;
668         f->dug_item = std::string("CraftItem apple 1");
669         setConstantMaterialProperties(f->material, 0.0);
670 }
671
672