better handling of unknown blocks on client
authorPerttu Ahola <celeron55@gmail.com>
Mon, 27 Jun 2011 04:30:02 +0000 (07:30 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Mon, 27 Jun 2011 04:30:02 +0000 (07:30 +0300)
data/unknown_block.png [new file with mode: 0644]
src/mapnode.cpp

diff --git a/data/unknown_block.png b/data/unknown_block.png
new file mode 100644 (file)
index 0000000..a27cb8c
Binary files /dev/null and b/data/unknown_block.png differ
index dae21e7ccc463f33b0af8d24914d977a684f89a7..7e26439877c497b20287446d8276cd2c33b5eff6 100644 (file)
@@ -138,6 +138,18 @@ void init_mapnode()
                        f->tiles[j].material_type = initial_material_type;
        }
 
+       /*
+               Initially set every block to be shown as an unknown block.
+               Don't touch CONTENT_IGNORE or CONTENT_AIR.
+       */
+       for(u16 i=0; i<=253; i++)
+       {
+               ContentFeatures *f = &g_content_features[i];
+               f->setAllTextures("unknown_block.png");
+               f->setInventoryTextureCube("unknown_block.png", "unknown_block.png", "unknown_block.png");
+               f->dug_item = std::string("MaterialItem ")+itos(i)+" 1";
+       }
+
        /*
                Initialize mapnode content
        */