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"
27 #include "nameidmapping.h"
29 #define WATER_ALPHA 160
34 void setConstantMaterialProperties(MaterialProperties &mprop, float time)
36 mprop.diggability = DIGGABLE_CONSTANT;
37 mprop.constant_time = time;
40 void setStoneLikeMaterialProperties(MaterialProperties &mprop, float toughness)
42 mprop.diggability = DIGGABLE_NORMAL;
43 mprop.weight = 5.0 * toughness;
44 mprop.crackiness = 1.0;
45 mprop.crumbliness = -0.1;
46 mprop.cuttability = -0.2;
49 void setDirtLikeMaterialProperties(MaterialProperties &mprop, float toughness)
51 mprop.diggability = DIGGABLE_NORMAL;
52 mprop.weight = toughness * 1.2;
54 mprop.crumbliness = 1.2;
55 mprop.cuttability = -0.4;
58 void setGravelLikeMaterialProperties(MaterialProperties &mprop, float toughness)
60 mprop.diggability = DIGGABLE_NORMAL;
61 mprop.weight = toughness * 2.0;
62 mprop.crackiness = 0.2;
63 mprop.crumbliness = 1.5;
64 mprop.cuttability = -1.0;
67 void setWoodLikeMaterialProperties(MaterialProperties &mprop, float toughness)
69 mprop.diggability = DIGGABLE_NORMAL;
70 mprop.weight = toughness * 1.0;
71 mprop.crackiness = 0.75;
72 mprop.crumbliness = -1.0;
73 mprop.cuttability = 1.5;
76 void setLeavesLikeMaterialProperties(MaterialProperties &mprop, float toughness)
78 mprop.diggability = DIGGABLE_NORMAL;
79 mprop.weight = -0.5 * toughness;
81 mprop.crumbliness = 0;
82 mprop.cuttability = 2.0;
85 void setGlassLikeMaterialProperties(MaterialProperties &mprop, float toughness)
87 mprop.diggability = DIGGABLE_NORMAL;
88 mprop.weight = 0.1 * toughness;
89 mprop.crackiness = 2.0;
90 mprop.crumbliness = -1.0;
91 mprop.cuttability = -1.0;
95 A conversion table for backwards compatibility.
96 Maps <=v19 content types to current ones.
97 Should never be touched.
99 content_t trans_table_19[21][2] = {
103 {CONTENT_GRASS_FOOTSTEPS, 6},
107 {CONTENT_COALSTONE, 11},
110 {CONTENT_COBBLE, 18},
113 {CONTENT_MOSSYCOBBLE, 22},
114 {CONTENT_GRAVEL, 23},
115 {CONTENT_SANDSTONE, 24},
116 {CONTENT_CACTUS, 25},
119 {CONTENT_PAPYRUS, 28},
120 {CONTENT_BOOKSHELF, 29},
123 MapNode mapnode_translate_from_internal(MapNode n_from, u8 version)
125 MapNode result = n_from;
128 content_t c_from = n_from.getContent();
129 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
131 if(trans_table_19[i][0] == c_from)
133 result.setContent(trans_table_19[i][1]);
140 MapNode mapnode_translate_to_internal(MapNode n_from, u8 version)
142 MapNode result = n_from;
145 content_t c_from = n_from.getContent();
146 for(u32 i=0; i<sizeof(trans_table_19)/sizeof(trans_table_19[0]); i++)
148 if(trans_table_19[i][1] == c_from)
150 result.setContent(trans_table_19[i][0]);
158 void content_mapnode_get_name_id_mapping(NameIdMapping *nimap)
160 nimap->set(0, "stone");
161 nimap->set(2, "water_flowing");
162 nimap->set(3, "torch");
163 nimap->set(9, "water_source");
164 nimap->set(14, "sign_wall");
165 nimap->set(15, "chest");
166 nimap->set(16, "furnace");
167 nimap->set(17, "locked_chest");
168 nimap->set(21, "wooden_fence");
169 nimap->set(30, "rail");
170 nimap->set(31, "ladder");
171 nimap->set(32, "lava_flowing");
172 nimap->set(33, "lava_source");
173 nimap->set(0x800, "dirt_with_grass");
174 nimap->set(0x801, "tree");
175 nimap->set(0x802, "leaves");
176 nimap->set(0x803, "dirt_with_grass_footsteps");
177 nimap->set(0x804, "mese");
178 nimap->set(0x805, "dirt");
179 nimap->set(0x806, "cloud");
180 nimap->set(0x807, "coalstone");
181 nimap->set(0x808, "wood");
182 nimap->set(0x809, "sand");
183 nimap->set(0x80a, "cobble");
184 nimap->set(0x80b, "steel");
185 nimap->set(0x80c, "glass");
186 nimap->set(0x80d, "mossycobble");
187 nimap->set(0x80e, "gravel");
188 nimap->set(0x80f, "sandstone");
189 nimap->set(0x810, "cactus");
190 nimap->set(0x811, "brick");
191 nimap->set(0x812, "clay");
192 nimap->set(0x813, "papyrus");
193 nimap->set(0x814, "bookshelf");
194 nimap->set(0x815, "jungletree");
195 nimap->set(0x816, "junglegrass");
196 nimap->set(0x817, "nyancat");
197 nimap->set(0x818, "nyancat_rainbow");
198 nimap->set(0x819, "apple");
199 nimap->set(0x820, "sapling");
201 nimap->set(CONTENT_IGNORE, "ignore");
202 nimap->set(CONTENT_AIR, "air");
205 // See header for description
206 void content_mapnode_init(IWritableNodeDefManager *nodemgr)
212 f = ContentFeatures();
214 f.setAllTextures("stone.png");
215 f.setInventoryTextureCube("stone.png", "stone.png", "stone.png");
216 f.param_type = CPT_MINERAL;
217 f.is_ground_content = true;
218 f.often_contains_mineral = true;
219 f.dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 1";
220 setStoneLikeMaterialProperties(f.material, 1.0);
224 f = ContentFeatures();
225 f.name = "dirt_with_grass";
226 f.setAllTextures("mud.png^grass_side.png");
227 f.setTexture(0, "grass.png");
228 f.setTexture(1, "mud.png");
229 f.param_type = CPT_MINERAL;
230 f.is_ground_content = true;
231 f.dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
232 setDirtLikeMaterialProperties(f.material, 1.0);
235 i = CONTENT_GRASS_FOOTSTEPS;
236 f = ContentFeatures();
237 f.name = "dirt_with_grass_footsteps";
238 f.setAllTextures("mud.png^grass_side.png");
239 f.setTexture(0, "grass_footsteps.png");
240 f.setTexture(1, "mud.png");
241 f.param_type = CPT_MINERAL;
242 f.is_ground_content = true;
243 f.dug_item = std::string("MaterialItem2 ")+itos(CONTENT_MUD)+" 1";
244 setDirtLikeMaterialProperties(f.material, 1.0);
248 f = ContentFeatures();
250 f.setAllTextures("mud.png");
251 f.setInventoryTextureCube("mud.png", "mud.png", "mud.png");
252 f.param_type = CPT_MINERAL;
253 f.is_ground_content = true;
254 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
255 setDirtLikeMaterialProperties(f.material, 1.0);
259 f = ContentFeatures();
261 f.setAllTextures("sand.png");
262 f.setInventoryTextureCube("sand.png", "sand.png", "sand.png");
263 f.param_type = CPT_MINERAL;
264 f.is_ground_content = true;
265 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
266 f.cookresult_item = std::string("MaterialItem2 ")+itos(CONTENT_GLASS)+" 1";
267 setDirtLikeMaterialProperties(f.material, 1.0);
271 f = ContentFeatures();
273 f.setAllTextures("gravel.png");
274 f.setInventoryTextureCube("gravel.png", "gravel.png", "gravel.png");
275 f.param_type = CPT_MINERAL;
276 f.is_ground_content = true;
277 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
278 setGravelLikeMaterialProperties(f.material, 1.0);
281 i = CONTENT_SANDSTONE;
282 f = ContentFeatures();
283 f.name = "sandstone";
284 f.setAllTextures("sandstone.png");
285 f.setInventoryTextureCube("sandstone.png", "sandstone.png", "sandstone.png");
286 f.param_type = CPT_MINERAL;
287 f.is_ground_content = true;
288 f.dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAND)+" 1";
289 setDirtLikeMaterialProperties(f.material, 1.0);
293 f = ContentFeatures();
295 f.setAllTextures("clay.png");
296 f.setInventoryTextureCube("clay.png", "clay.png", "clay.png");
297 f.param_type = CPT_MINERAL;
298 f.is_ground_content = true;
299 f.dug_item = std::string("CraftItem lump_of_clay 4");
300 setDirtLikeMaterialProperties(f.material, 1.0);
304 f = ContentFeatures();
306 f.setAllTextures("brick.png");
307 f.setInventoryTextureCube("brick.png", "brick.png", "brick.png");
308 f.param_type = CPT_MINERAL;
309 f.is_ground_content = true;
310 f.dug_item = std::string("CraftItem clay_brick 4");
311 setStoneLikeMaterialProperties(f.material, 1.0);
315 f = ContentFeatures();
317 f.setAllTextures("tree.png");
318 f.setTexture(0, "tree_top.png");
319 f.setTexture(1, "tree_top.png");
320 f.param_type = CPT_MINERAL;
321 f.is_ground_content = true;
322 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
323 f.cookresult_item = "CraftItem lump_of_coal 1";
324 f.furnace_burntime = 30;
325 setWoodLikeMaterialProperties(f.material, 1.0);
328 i = CONTENT_JUNGLETREE;
329 f = ContentFeatures();
330 f.name = "jungletree";
331 f.setAllTextures("jungletree.png");
332 f.setTexture(0, "jungletree_top.png");
333 f.setTexture(1, "jungletree_top.png");
334 f.param_type = CPT_MINERAL;
335 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
336 f.furnace_burntime = 30;
337 setWoodLikeMaterialProperties(f.material, 1.0);
340 i = CONTENT_JUNGLEGRASS;
341 f = ContentFeatures();
342 f.name = "junglegrass";
343 f.drawtype = NDT_PLANTLIKE;
344 f.visual_scale = 1.3;
345 f.setAllTextures("junglegrass.png");
346 f.setInventoryTexture("junglegrass.png");
347 f.light_propagates = true;
348 f.param_type = CPT_LIGHT;
349 f.air_equivalent = false; // grass grows underneath
350 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
352 setLeavesLikeMaterialProperties(f.material, 1.0);
353 f.furnace_burntime = 2;
357 f = ContentFeatures();
359 f.drawtype = NDT_ALLFACES_OPTIONAL;
360 f.setAllTextures("leaves.png");
361 //f.setAllTextures("[noalpha:leaves.png");
362 f.light_propagates = true;
363 f.param_type = CPT_LIGHT;
364 f.extra_dug_item = std::string("MaterialItem2 ")+itos(CONTENT_SAPLING)+" 1";
365 f.extra_dug_item_rarity = 20;
366 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
367 setLeavesLikeMaterialProperties(f.material, 1.0);
368 f.furnace_burntime = 1.0;
372 f = ContentFeatures();
374 f.setAllTextures("cactus_side.png");
375 f.setTexture(0, "cactus_top.png");
376 f.setTexture(1, "cactus_top.png");
377 f.setInventoryTextureCube("cactus_top.png", "cactus_side.png", "cactus_side.png");
378 f.param_type = CPT_MINERAL;
379 f.is_ground_content = true;
380 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
381 setWoodLikeMaterialProperties(f.material, 0.75);
382 f.furnace_burntime = 15;
386 f = ContentFeatures();
388 f.drawtype = NDT_PLANTLIKE;
389 f.setAllTextures("papyrus.png");
390 f.setInventoryTexture("papyrus.png");
391 f.light_propagates = true;
392 f.param_type = CPT_LIGHT;
393 f.is_ground_content = true;
394 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
396 setLeavesLikeMaterialProperties(f.material, 0.5);
397 f.furnace_burntime = 1;
400 i = CONTENT_BOOKSHELF;
401 f = ContentFeatures();
402 f.name = "bookshelf";
403 f.setAllTextures("bookshelf.png");
404 f.setTexture(0, "wood.png");
405 f.setTexture(1, "wood.png");
406 // FIXME: setInventoryTextureCube() only cares for the first texture
407 f.setInventoryTextureCube("bookshelf.png", "bookshelf.png", "bookshelf.png");
408 //f.setInventoryTextureCube("wood.png", "bookshelf.png", "bookshelf.png");
409 f.param_type = CPT_MINERAL;
410 f.is_ground_content = true;
411 setWoodLikeMaterialProperties(f.material, 0.75);
412 f.furnace_burntime = 30;
416 f = ContentFeatures();
418 f.drawtype = NDT_GLASSLIKE;
419 f.setAllTextures("glass.png");
420 f.light_propagates = true;
421 f.sunlight_propagates = true;
422 f.param_type = CPT_LIGHT;
423 f.is_ground_content = true;
424 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
425 f.setInventoryTextureCube("glass.png", "glass.png", "glass.png");
426 setGlassLikeMaterialProperties(f.material, 1.0);
430 f = ContentFeatures();
431 f.name = "wooden_fence";
432 f.drawtype = NDT_FENCELIKE;
433 f.setInventoryTexture("fence.png");
434 f.setTexture(0, "wood.png");
435 f.light_propagates = true;
436 f.param_type = CPT_LIGHT;
437 f.is_ground_content = true;
438 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
439 f.air_equivalent = true; // grass grows underneath
440 f.selection_box.type = NODEBOX_FIXED;
441 f.selection_box.fixed = core::aabbox3d<f32>(
442 -BS/7, -BS/2, -BS/7, BS/7, BS/2, BS/7);
443 f.furnace_burntime = 30/2;
444 setWoodLikeMaterialProperties(f.material, 0.75);
448 f = ContentFeatures();
450 f.drawtype = NDT_RAILLIKE;
451 f.setInventoryTexture("rail.png");
452 f.setTexture(0, "rail.png");
453 f.setTexture(1, "rail_curved.png");
454 f.setTexture(2, "rail_t_junction.png");
455 f.setTexture(3, "rail_crossing.png");
456 f.light_propagates = true;
457 f.param_type = CPT_LIGHT;
458 f.is_ground_content = true;
459 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
460 f.air_equivalent = true; // grass grows underneath
462 f.selection_box.type = NODEBOX_FIXED;
463 f.furnace_burntime = 5;
464 setDirtLikeMaterialProperties(f.material, 0.75);
468 f = ContentFeatures();
470 f.drawtype = NDT_SIGNLIKE;
471 f.setAllTextures("ladder.png");
472 f.setInventoryTexture("ladder.png");
473 f.light_propagates = true;
474 f.param_type = CPT_LIGHT;
475 f.is_ground_content = true;
476 f.dug_item = std::string("MaterialItem ")+itos(i)+" 1";
477 f.wall_mounted = true;
478 f.air_equivalent = true;
481 f.selection_box.type = NODEBOX_WALLMOUNTED;
482 f.furnace_burntime = 5;
483 setWoodLikeMaterialProperties(f.material, 0.5);
487 i = CONTENT_COALSTONE;
488 f = ContentFeatures();
489 f.name = "coalstone";
490 f.setAllTextures("stone.png^mineral_coal.png");
491 f.is_ground_content = true;
492 setStoneLikeMaterialProperties(f.material, 1.5);
496 f = ContentFeatures();
498 f.setAllTextures("wood.png");
499 f.setInventoryTextureCube("wood.png", "wood.png", "wood.png");
500 f.is_ground_content = true;
501 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
502 f.furnace_burntime = 30/4;
503 setWoodLikeMaterialProperties(f.material, 0.75);
507 f = ContentFeatures();
509 f.setAllTextures("mese.png");
510 f.setInventoryTextureCube("mese.png", "mese.png", "mese.png");
511 f.is_ground_content = true;
512 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
513 f.furnace_burntime = 30;
514 setStoneLikeMaterialProperties(f.material, 0.5);
518 f = ContentFeatures();
520 f.setAllTextures("cloud.png");
521 f.setInventoryTextureCube("cloud.png", "cloud.png", "cloud.png");
522 f.is_ground_content = true;
523 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
527 f = ContentFeatures();
529 f.param_type = CPT_LIGHT;
530 f.light_propagates = true;
531 f.sunlight_propagates = true;
535 f.buildable_to = true;
536 f.air_equivalent = true;
540 f = ContentFeatures();
541 f.name = "water_flowing";
542 f.drawtype = NDT_FLOWINGLIQUID;
543 f.setAllTextures("water.png");
544 f.alpha = WATER_ALPHA;
545 f.setInventoryTextureCube("water.png", "water.png", "water.png");
546 f.param_type = CPT_LIGHT;
547 f.light_propagates = true;
551 f.buildable_to = true;
552 f.liquid_type = LIQUID_FLOWING;
553 f.liquid_alternative_flowing = CONTENT_WATER;
554 f.liquid_alternative_source = CONTENT_WATERSOURCE;
555 f.liquid_viscosity = WATER_VISC;
556 f.post_effect_color = video::SColor(64, 100, 100, 200);
557 f.setSpecialMaterial(0, MaterialSpec("water.png", false));
558 f.setSpecialMaterial(1, MaterialSpec("water.png", true));
561 i = CONTENT_WATERSOURCE;
562 f = ContentFeatures();
563 f.name = "water_source";
564 f.drawtype = NDT_LIQUID;
565 f.setAllTextures("water.png");
566 f.alpha = WATER_ALPHA;
567 f.setInventoryTextureCube("water.png", "water.png", "water.png");
568 f.param_type = CPT_LIGHT;
569 f.light_propagates = true;
573 f.buildable_to = true;
574 f.liquid_type = LIQUID_SOURCE;
575 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
576 f.liquid_alternative_flowing = CONTENT_WATER;
577 f.liquid_alternative_source = CONTENT_WATERSOURCE;
578 f.liquid_viscosity = WATER_VISC;
579 f.post_effect_color = video::SColor(64, 100, 100, 200);
580 // New-style water source material (mostly unused)
581 f.setSpecialMaterial(0, MaterialSpec("water.png", false));
585 f = ContentFeatures();
586 f.name = "lava_flowing";
587 f.drawtype = NDT_FLOWINGLIQUID;
588 f.setAllTextures("lava.png");
589 f.setInventoryTextureCube("lava.png", "lava.png", "lava.png");
590 f.param_type = CPT_LIGHT;
591 f.light_propagates = false;
592 f.light_source = LIGHT_MAX-1;
596 f.buildable_to = true;
597 f.liquid_type = LIQUID_FLOWING;
598 f.liquid_alternative_flowing = CONTENT_LAVA;
599 f.liquid_alternative_source = CONTENT_LAVASOURCE;
600 f.liquid_viscosity = LAVA_VISC;
601 f.damage_per_second = 4*2;
602 f.post_effect_color = video::SColor(192, 255, 64, 0);
603 f.setSpecialMaterial(0, MaterialSpec("lava.png", false));
604 f.setSpecialMaterial(1, MaterialSpec("lava.png", true));
607 i = CONTENT_LAVASOURCE;
608 f = ContentFeatures();
609 f.name = "lava_source";
610 f.drawtype = NDT_LIQUID;
611 f.setAllTextures("lava.png");
612 f.setInventoryTextureCube("lava.png", "lava.png", "lava.png");
613 f.param_type = CPT_LIGHT;
614 f.light_propagates = false;
615 f.light_source = LIGHT_MAX-1;
619 f.buildable_to = true;
620 f.liquid_type = LIQUID_SOURCE;
621 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
622 f.liquid_alternative_flowing = CONTENT_LAVA;
623 f.liquid_alternative_source = CONTENT_LAVASOURCE;
624 f.liquid_viscosity = LAVA_VISC;
625 f.damage_per_second = 4*2;
626 f.post_effect_color = video::SColor(192, 255, 64, 0);
627 // New-style lava source material (mostly unused)
628 f.setSpecialMaterial(0, MaterialSpec("lava.png", false));
629 f.furnace_burntime = 60;
633 f = ContentFeatures();
635 f.drawtype = NDT_TORCHLIKE;
636 f.setTexture(0, "torch_on_floor.png");
637 f.setTexture(1, "torch_on_ceiling.png");
638 f.setTexture(2, "torch.png");
639 f.setInventoryTexture("torch_on_floor.png");
640 f.param_type = CPT_LIGHT;
641 f.light_propagates = true;
642 f.sunlight_propagates = true;
644 f.wall_mounted = true;
645 f.air_equivalent = true;
646 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
647 f.light_source = LIGHT_MAX-1;
648 f.selection_box.type = NODEBOX_WALLMOUNTED;
649 f.selection_box.wall_top = core::aabbox3d<f32>(
650 -BS/10, BS/2-BS/3.333*2, -BS/10, BS/10, BS/2, BS/10);
651 f.selection_box.wall_bottom = core::aabbox3d<f32>(
652 -BS/10, -BS/2, -BS/10, BS/10, -BS/2+BS/3.333*2, BS/10);
653 f.selection_box.wall_side = core::aabbox3d<f32>(
654 -BS/2, -BS/3.333, -BS/10, -BS/2+BS/3.333, BS/3.333, BS/10);
655 setConstantMaterialProperties(f.material, 0.0);
656 f.furnace_burntime = 4;
659 i = CONTENT_SIGN_WALL;
660 f = ContentFeatures();
661 f.name = "sign_wall";
662 f.drawtype = NDT_SIGNLIKE;
663 f.setAllTextures("sign_wall.png");
664 f.setInventoryTexture("sign_wall.png");
665 f.param_type = CPT_LIGHT;
666 f.light_propagates = true;
667 f.sunlight_propagates = true;
669 f.wall_mounted = true;
670 f.air_equivalent = true;
671 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
672 if(f.initial_metadata == NULL)
673 f.initial_metadata = new SignNodeMetadata(NULL, "Some sign");
674 setConstantMaterialProperties(f.material, 0.5);
675 f.selection_box.type = NODEBOX_WALLMOUNTED;
676 f.furnace_burntime = 10;
680 f = ContentFeatures();
682 f.param_type = CPT_FACEDIR_SIMPLE;
683 f.setAllTextures("chest_side.png");
684 f.setTexture(0, "chest_top.png");
685 f.setTexture(1, "chest_top.png");
686 f.setTexture(5, "chest_front.png"); // Z-
687 f.setInventoryTexture("chest_top.png");
688 //f.setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
689 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
690 if(f.initial_metadata == NULL)
691 f.initial_metadata = new ChestNodeMetadata(NULL);
692 setWoodLikeMaterialProperties(f.material, 1.0);
693 f.furnace_burntime = 30;
696 i = CONTENT_LOCKABLE_CHEST;
697 f = ContentFeatures();
698 f.name = "locked_chest";
699 f.param_type = CPT_FACEDIR_SIMPLE;
700 f.setAllTextures("chest_side.png");
701 f.setTexture(0, "chest_top.png");
702 f.setTexture(1, "chest_top.png");
703 f.setTexture(5, "chest_lock.png"); // Z-
704 f.setInventoryTexture("chest_lock.png");
705 //f.setInventoryTextureCube("chest_top.png", "chest_side.png", "chest_side.png");
706 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
707 if(f.initial_metadata == NULL)
708 f.initial_metadata = new LockingChestNodeMetadata(NULL);
709 setWoodLikeMaterialProperties(f.material, 1.0);
710 f.furnace_burntime = 30;
714 f = ContentFeatures();
716 f.param_type = CPT_FACEDIR_SIMPLE;
717 f.setAllTextures("furnace_side.png");
718 f.setTexture(5, "furnace_front.png"); // Z-
719 f.setInventoryTexture("furnace_front.png");
720 //f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
721 f.dug_item = std::string("MaterialItem2 ")+itos(CONTENT_COBBLE)+" 6";
722 if(f.initial_metadata == NULL)
723 f.initial_metadata = new FurnaceNodeMetadata(NULL);
724 setStoneLikeMaterialProperties(f.material, 3.0);
728 f = ContentFeatures();
730 f.setAllTextures("cobble.png");
731 f.setInventoryTextureCube("cobble.png", "cobble.png", "cobble.png");
732 f.param_type = CPT_NONE;
733 f.is_ground_content = true;
734 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
735 f.cookresult_item = std::string("MaterialItem2 ")+itos(CONTENT_STONE)+" 1";
736 setStoneLikeMaterialProperties(f.material, 0.9);
739 i = CONTENT_MOSSYCOBBLE;
740 f = ContentFeatures();
741 f.name = "mossycobble";
742 f.setAllTextures("mossycobble.png");
743 f.setInventoryTextureCube("mossycobble.png", "mossycobble.png", "mossycobble.png");
744 f.param_type = CPT_NONE;
745 f.is_ground_content = true;
746 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
747 setStoneLikeMaterialProperties(f.material, 0.8);
751 f = ContentFeatures();
752 f.name = "steelblock";
753 f.setAllTextures("steel_block.png");
754 f.setInventoryTextureCube("steel_block.png", "steel_block.png",
756 f.param_type = CPT_NONE;
757 f.is_ground_content = true;
758 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
759 setStoneLikeMaterialProperties(f.material, 5.0);
763 f = ContentFeatures();
765 f.param_type = CPT_FACEDIR_SIMPLE;
766 f.setAllTextures("nc_side.png");
767 f.setTexture(5, "nc_front.png"); // Z-
768 f.setTexture(4, "nc_back.png"); // Z+
769 f.setInventoryTexture("nc_front.png");
770 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
771 setStoneLikeMaterialProperties(f.material, 3.0);
772 f.furnace_burntime = 1;
776 f = ContentFeatures();
777 f.name = "nyancat_rainbow";
778 f.setAllTextures("nc_rb.png");
779 f.setInventoryTexture("nc_rb.png");
780 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
781 setStoneLikeMaterialProperties(f.material, 3.0);
782 f.furnace_burntime = 1;
786 f = ContentFeatures();
788 f.drawtype = NDT_PLANTLIKE;
789 f.visual_scale = 1.0;
790 f.setAllTextures("sapling.png");
791 f.setInventoryTexture("sapling.png");
792 f.param_type = CPT_LIGHT;
793 f.dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
794 f.light_propagates = true;
795 f.air_equivalent = false;
797 setConstantMaterialProperties(f.material, 0.0);
798 f.furnace_burntime = 10;
802 f = ContentFeatures();
804 f.drawtype = NDT_PLANTLIKE;
805 f.visual_scale = 1.0;
806 f.setAllTextures("apple.png");
807 f.setInventoryTexture("apple.png");
808 f.param_type = CPT_LIGHT;
809 f.light_propagates = true;
810 f.sunlight_propagates = true;
812 f.air_equivalent = true;
813 f.dug_item = std::string("CraftItem apple 1");
814 setConstantMaterialProperties(f.material, 0.0);
815 f.furnace_burntime = 3;