add mithril block

This commit is contained in:
darkrose 2015-08-15 17:58:16 +10:00
parent b4691bbd06
commit 1955f8d4e4
4 changed files with 23 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

View File

@ -2280,6 +2280,24 @@ void content_mapnode_init(bool repeat)
lists::add("craftguide",i);
lists::add("creative",i);
i = CONTENT_MITHRIL_BLOCK;
f = &content_features(i);
f->description = wgettext("Mithril Block");
f->setAllTextures("mithril_block.png");
f->setInventoryTextureCube("mithril_block.png", "mithril_block.png", "mithril_block.png");
f->param_type = CPT_NONE;
f->draw_type = CDT_CUBELIKE;
f->is_ground_content = true;
f->dug_item = std::string("MaterialItem2 ")+itos(i)+" 1";
f->type = CMT_STONE;
f->hardness = 10.0;
f->destructive_mob_safe = true;
crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_MITHRIL_UNBOUND,CONTENT_MITHRIL_BLOCK);
crafting::setHardBlockRecipe(CONTENT_CRAFTITEM_MITHRIL,CONTENT_MITHRIL_BLOCK);
crafting::setUncraftHardBlockRecipe(CONTENT_MITHRIL_BLOCK,CONTENT_CRAFTITEM_MITHRIL_UNBOUND);
lists::add("craftguide",i);
lists::add("creative",i);
content_nodedef_knob(CONTENT_STONE_KNOB, CONTENT_STONE, CMT_STONE, "stone.png", wgettext("Stone Knob"));
content_nodedef_knob(CONTENT_ROUGHSTONE_KNOB, CONTENT_ROUGHSTONE, CMT_STONE, "roughstone.png", wgettext("Rough Stone Knob"));
content_nodedef_knob(CONTENT_SANDSTONE_KNOB, CONTENT_SANDSTONE, CMT_STONE, "sandstone.png", wgettext("Sandstone Knob"));

View File

@ -270,8 +270,7 @@ MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
#define CONTENT_FIRE_SHORTTERM 0x8C7
#define CONTENT_TNT 0x8C8
#define CONTENT_FLASH 0x8C9
// MESE is deprecated, but leave it here for the moment
#define CONTENT_MESE_DIGGING 0x8CA
#define CONTENT_MITHRIL_BLOCK 0x8CA
#define CONTENT_COBBLE 0x8CB
#define CONTENT_ROUGHSTONEBRICK 0x8CC
#define CONTENT_ROUGHSTONEBLOCK 0x8CD

View File

@ -1727,14 +1727,11 @@ void ServerEnvironment::step(float dtime)
// MESE is dead
case CONTENT_MESE:
case CONTENT_MESE_DIGGING:
{
v3f pp;
pp.X = p.X;
pp.Y = p.Y;
pp.Z = p.Z;
Player *nearest = getNearestConnectedPlayer(pp);
if (nearest == NULL || nearest->getPosition().getDistanceFrom(pp*BS) > 6.0*BS) {
if (p.Y > 0) {
n.setContent(CONTENT_MITHRIL_BLOCK);
m_map->addNodeWithEvent(p, n);
}else{
n.setContent(CONTENT_STONE);
n.param1 = MINERAL_MITHRIL;
m_map->addNodeWithEvent(p, n);