3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #include "content_mapnode.h"
22 #include "irrlichttypes.h"
24 #include "content_nodemeta.h"
28 #define WATER_ALPHA 160
33 void setConstantMaterialProperties(MaterialProperties &mprop, float time)
35 mprop.diggability = DIGGABLE_CONSTANT;
36 mprop.constant_time = time;
39 void setStoneLikeMaterialProperties(MaterialProperties &mprop, float toughness)
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;
48 void setDirtLikeMaterialProperties(MaterialProperties &mprop, float toughness)
50 mprop.diggability = DIGGABLE_NORMAL;
51 mprop.weight = toughness * 1.2;
53 mprop.crumbliness = 1.2;
54 mprop.cuttability = -0.4;
57 void setGravelLikeMaterialProperties(MaterialProperties &mprop, float toughness)
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;
66 void setWoodLikeMaterialProperties(MaterialProperties &mprop, float toughness)
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;
75 void setLeavesLikeMaterialProperties(MaterialProperties &mprop, float toughness)
77 mprop.diggability = DIGGABLE_NORMAL;
78 mprop.weight = -0.5 * toughness;
80 mprop.crumbliness = 0;
81 mprop.cuttability = 2.0;
84 void setGlassLikeMaterialProperties(MaterialProperties &mprop, float toughness)
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;
94 A conversion table for backwards compatibility.
95 Maps <=v19 content types to current ones.
96 Should never be touched.
98 content_t trans_table_19[21][2] = {
102 {CONTENT_GRASS_FOOTSTEPS, 6},
106 {CONTENT_COALSTONE, 11},
109 {CONTENT_COBBLE, 18},
112 {CONTENT_MOSSYCOBBLE, 22},
113 {CONTENT_GRAVEL, 23},
114 {CONTENT_SANDSTONE, 24},
115 {CONTENT_CACTUS, 25},
118 {CONTENT_PAPYRUS, 28},
119 {CONTENT_BOOKSHELF, 29},
122 MapNode mapnode_translate_from_internal(MapNode n_from, u8 version)
124 MapNode result = n_from;
127 content_t c_from = n_from.getContent();
128 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
130 if(trans_table_19[i][0] == c_from)
132 result.setContent(trans_table_19[i][1]);
139 MapNode mapnode_translate_to_internal(MapNode n_from, u8 version)
141 MapNode result = n_from;
144 content_t c_from = n_from.getContent();
145 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
147 if(trans_table_19[i][1] == c_from)
149 result.setContent(trans_table_19[i][0]);
157 // See header for description
158 void content_mapnode_init(IWritableNodeDefManager *nodemgr)
161 ContentFeatures *f = NULL;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
266 i = CONTENT_JUNGLEGRASS;
267 f = nodemgr->getModifiable(i);
268 f->drawtype = NDT_PLANTLIKE;
269 f->visual_scale = 1.6;
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";
277 setLeavesLikeMaterialProperties(f->material, 1.0);
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);
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);
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";
312 setLeavesLikeMaterialProperties(f->material, 0.5);
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);
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);
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);
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
367 f->selection_box.type = NODEBOX_FIXED;
368 setDirtLikeMaterialProperties(f->material, 0.75);
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;
383 f->selection_box.type = NODEBOX_WALLMOUNTED;
384 setWoodLikeMaterialProperties(f->material, 0.5);
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);
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);
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);
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";
417 f = nodemgr->getModifiable(i);
418 f->param_type = CPT_LIGHT;
419 f->light_propagates = true;
420 f->sunlight_propagates = true;
422 f->pointable = false;
424 f->buildable_to = true;
425 f->air_equivalent = true;
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;
435 f->pointable = 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;
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;
458 f->pointable = 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;
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;
480 f->pointable = 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;
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;
504 f->pointable = 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;
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;
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);
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;
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;
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);
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);
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);
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);
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);
618 f = nodemgr->getModifiable(i);
619 f->setAllTextures("steel_block.png");
620 f->setInventoryTextureCube("steel_block.png", "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);
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);
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);
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;
655 setConstantMaterialProperties(f->material, 0.0);
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;
667 f->air_equivalent = true;
668 f->dug_item = std::string("CraftItem apple 1");
669 setConstantMaterialProperties(f->material, 0.0);