Fix random node definition stuff
authorPerttu Ahola <celeron55@gmail.com>
Fri, 25 Nov 2011 20:06:50 +0000 (22:06 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 29 Nov 2011 17:13:52 +0000 (19:13 +0200)
data/builtin.lua
data/mods/default/init.lua
src/scriptapi.cpp

index ead1ed3a6a143671ece638edaf8175bdda147d76..4a7678a2111e182c9ee6b12a751bfda7d5ec630c 100644 (file)
@@ -84,7 +84,7 @@ minetest.register_node("air", {
        walkable = false,
        pointable = false,
        diggable = false,
-       buildable_to = false,
+       buildable_to = true,
        air_equivalent = true,
 })
 
index 3e451b649680750bebcea1c5c077aeb2b806a098..d311c4f60ca7b0b52c3dcfaf15f11de681de9627 100644 (file)
@@ -628,9 +628,9 @@ function inventorycube(img1, img2, img3)
        img2 = img2 or img1
        img3 = img3 or img1
        return "[inventorycube"
-                       .. "{" .. img1:gsub("^", "&")
-                       .. "{" .. img2:gsub("^", "&")
-                       .. "{" .. img3:gsub("^", "&")
+                       .. "{" .. img1:gsub("%^", "&")
+                       .. "{" .. img2:gsub("%^", "&")
+                       .. "{" .. img3:gsub("%^", "&")
 end
 
 -- Legacy nodes
@@ -642,6 +642,7 @@ minetest.register_node("stone", {
        is_ground_content = true,
        often_contains_mineral = true, -- Texture atlas hint
        material = digprop_stonelike(1.0),
+       dug_item = 'NodeItem "cobble" 1',
 })
 
 minetest.register_node("dirt_with_grass", {
@@ -649,6 +650,7 @@ minetest.register_node("dirt_with_grass", {
        inventory_image = inventorycube("mud.png^grass_side.png"),
        is_ground_content = true,
        material = digprop_dirtlike(1.0),
+       dug_item = 'NodeItem "dirt" 1',
 })
 
 minetest.register_node("dirt_with_grass_footsteps", {
index a5454bea519886699207f0a2fc3aab7ada72a304..a6ac4a0f7ea8ca43c03371932d03432ad73402a8 100644 (file)
@@ -497,6 +497,9 @@ static int l_register_node(lua_State *L)
 
        // Default to getting the corresponding NodeItem when dug
        f.dug_item = std::string("NodeItem \"")+name+"\" 1";
+       
+       // Default to unknown_block.png as all textures
+       f.setAllTextures("unknown_block.png");
 
        /*
                Read definiton from Lua