Add CMT_GLASS content material type and update glass nodes

This commit is contained in:
Joel Heaton 2014-11-18 18:28:31 +00:00
parent 78bee0486e
commit f74f31e832
6 changed files with 50 additions and 49 deletions

View File

@ -690,7 +690,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass.png", "glass.png", "glass.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
lists::add("creative",i);
@ -710,7 +710,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_blue.png", "glass_blue.png", "glass_blue.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLUE,CONTENT_GLASS,CONTENT_GLASS_BLUE);
lists::add("craftguide",i);
@ -732,7 +732,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_green.png", "glass_green.png", "glass_green.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_GREEN,CONTENT_GLASS,CONTENT_GLASS_GREEN);
lists::add("craftguide",i);
@ -754,7 +754,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_orange.png", "glass_orange.png", "glass_orange.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_ORANGE,CONTENT_GLASS,CONTENT_GLASS_ORANGE);
lists::add("craftguide",i);
@ -776,7 +776,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_purple.png", "glass_purple.png", "glass_purple.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_PURPLE,CONTENT_GLASS,CONTENT_GLASS_PURPLE);
lists::add("craftguide",i);
@ -798,7 +798,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_red.png", "glass_red.png", "glass_red.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_RED,CONTENT_GLASS,CONTENT_GLASS_RED);
lists::add("craftguide",i);
@ -820,7 +820,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_yellow.png", "glass_yellow.png", "glass_yellow.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_YELLOW,CONTENT_GLASS,CONTENT_GLASS_YELLOW);
lists::add("craftguide",i);
@ -842,7 +842,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glass_black.png", "glass_black.png", "glass_black.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
crafting::set1Any2Recipe(CONTENT_CRAFTITEM_DYE_BLACK,CONTENT_GLASS,CONTENT_GLASS_BLACK);
lists::add("craftguide",i);
@ -874,7 +874,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_side.png", "glass.png", "glass_pane_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -908,7 +908,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_blue_side.png", "glass_blue.png", "glass_pane_blue_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -943,7 +943,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_green_side.png", "glass_green.png", "glass_pane_green_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -978,7 +978,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_orange_side.png", "glass_orange.png", "glass_pane_orange_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -1013,7 +1013,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_purple_side.png", "glass_purple.png", "glass_pane_purple_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -1048,7 +1048,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_red_side.png", "glass_red.png", "glass_pane_red_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -1083,7 +1083,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_yellow_side.png", "glass_yellow.png", "glass_pane_yellow_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -1118,7 +1118,7 @@ void content_mapnode_init(bool repeat)
0.05*BS
));
f->setInventoryTextureNodeBox(i,"glass_pane_black_side.png", "glass_black.png", "glass_pane_black_side.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -1143,7 +1143,7 @@ void content_mapnode_init(bool repeat)
f->setAllTextureTypes(MATERIAL_ALPHA_BLEND);
#endif
f->setInventoryTextureCube("glasslight.png", "glasslight.png", "glasslight.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->light_source = LIGHT_MAX-1;
crafting::setSurroundRecipe(CONTENT_GLASS,CONTENT_CRAFTITEM_FIREFLY,CONTENT_GLASSLIGHT);

View File

@ -160,7 +160,7 @@ void content_mapnode_door(bool repeat)
f->dug_item = std::string("MaterialItem2 ")+itos(i+1)+" 1";
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
content_nodebox_door(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
@ -184,7 +184,7 @@ void content_mapnode_door(bool repeat)
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
content_nodebox_door(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
@ -381,7 +381,7 @@ void content_mapnode_door(bool repeat)
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30;
content_nodebox_door(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
@ -406,7 +406,7 @@ void content_mapnode_door(bool repeat)
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30;
content_nodebox_door(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
@ -893,7 +893,7 @@ void content_mapnode_door(bool repeat)
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30;
content_nodebox_dooror(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;
@ -918,7 +918,7 @@ void content_mapnode_door(bool repeat)
f->flammable = 1; // can be replaced by fire if the node under it is set on fire
f->fuel_time = 30;
content_nodebox_dooror(f);
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->pressure_type = CST_SOLID;
f->suffocation_per_second = 0;

View File

@ -202,7 +202,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass.png", "glass_slab.png", "glass_slab.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_SLAB);
@ -228,7 +228,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_blue.png", "glass_slab_blue.png", "glass_slab_blue.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLUE_SLAB);
@ -255,7 +255,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_green.png", "glass_slab_green.png", "glass_slab_green.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_GREEN_SLAB);
@ -282,7 +282,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_orange.png", "glass_slab_orange.png", "glass_slab_orange.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_ORANGE_SLAB);
@ -309,7 +309,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_purple.png", "glass_slab_purple.png", "glass_slab_purple.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_PURPLE_SLAB);
@ -336,7 +336,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_red.png", "glass_slab_red.png", "glass_slab_red.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_RED_SLAB);
@ -363,7 +363,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_yellow.png", "glass_slab_yellow.png", "glass_slab_yellow.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_YELLOW_SLAB);
@ -390,7 +390,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slab(f);
f->setInventoryTextureNodeBox(i,"glass_black.png", "glass_slab_black.png", "glass_slab_black.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
crafting::setRow3Recipe(CONTENT_GLASS,CONTENT_GLASS_BLACK_SLAB);
@ -538,7 +538,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass.png", "glass_slab.png", "glass_slab.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -561,7 +561,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_blue.png", "glass_slab_blue.png", "glass_slab_blue.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -584,7 +584,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_green.png", "glass_slab_green.png", "glass_slab_green.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -607,7 +607,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_orange.png", "glass_slab_orange.png", "glass_slab_orange.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -630,7 +630,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_purple.png", "glass_slab_purple.png", "glass_slab_purple.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -653,7 +653,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_red.png", "glass_slab_red.png", "glass_slab_red.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -676,7 +676,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_yellow.png", "glass_slab_yellow.png", "glass_slab_yellow.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
@ -699,7 +699,7 @@ void content_mapnode_slab(bool repeat)
#endif
content_nodebox_slabud(f);
f->setInventoryTextureNodeBox(i,"glass_black.png", "glass_slab_black.png", "glass_slab_black.png");
f->type = CMT_WOOD;
f->type = CMT_GLASS;
f->hardness = 0.15;
f->suffocation_per_second = 0;
}

View File

@ -185,7 +185,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -208,7 +208,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -232,7 +232,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -256,7 +256,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -280,7 +280,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -304,7 +304,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -328,7 +328,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;
@ -352,7 +352,7 @@ void content_mapnode_special(bool repeat)
f->draw_type = CDT_ROOFLIKE;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->solidness = 0; // drawn separately, makes no faces
f->type = CMT_DIRT;
f->type = CMT_GLASS;
f->hardness = 0.75;
f->pressure_type = CST_CRUSHABLE;
f->suffocation_per_second = 0;

View File

@ -67,7 +67,7 @@ DiggingProperties getDiggingProperties(content_t content, content_t tool)
case TT_AXE:
if (c_features.type == CMT_PLANT) {
time *= 2.;
}else if (c_features.type != CMT_WOOD) {
}else if (c_features.type != CMT_WOOD && c_features.type != CMT_GLASS) {
time *= 10.;
}
break;

View File

@ -152,7 +152,8 @@ enum ContentMaterialType {
CMT_STONE,
CMT_LIQUID,
CMT_PLANT,
CMT_DIRT
CMT_DIRT,
CMT_GLASS
};
/*