From fdfaa42f4f0b0052552692061c45ec6be7f06416 Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Thu, 4 Sep 2014 17:13:58 -0400 Subject: [PATCH] allow placement of cobweb on a flat vertical surface also. --- homedecor/cobweb.lua | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/homedecor/cobweb.lua b/homedecor/cobweb.lua index f4cb1c6..1f00bec 100644 --- a/homedecor/cobweb.lua +++ b/homedecor/cobweb.lua @@ -40,6 +40,27 @@ minetest.register_node("homedecor:cobweb_centered", { drop = "homedecor:cobweb_corner" }) +minetest.register_node("homedecor:cobweb_flat", { + description = "Cobweb", + drawtype = "nodebox", + tiles = { "homedecor_cobweb.png" }, + inventory_image = "homedecor_cobweb_inv.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 } + }, + node_box = { + type = "fixed", + fixed = { -0.5, -0.5, 0.495, 0.5, 0.5, 0.495 } + }, + groups = { snappy = 3, not_in_creative_inventory = 1 }, + drop = "homedecor:cobweb_corner" +}) + minetest.register_node("homedecor:cobweb_plantlike", { description = "Cobweb", drawtype = "plantlike", @@ -97,6 +118,21 @@ function homedecor.rotate_cobweb(pos) elseif iswall_zm and iswall_zp and not iswall_xm and not iswall_xp then minetest.set_node(pos, {name = "homedecor:cobweb_centered", param2 = 1}) + + -- ok, there aren't any simple two-wall corners or opposing walls. + -- Are there any standalone walls? + + elseif iswall_xm and not iswall_xp and not iswall_zm and not iswall_zp then + minetest.set_node(pos, {name = "homedecor:cobweb_flat", param2 = 3}) + + elseif iswall_xp and not iswall_xm and not iswall_zm and not iswall_zp then + minetest.set_node(pos, {name = "homedecor:cobweb_flat", param2 = 1}) + + elseif iswall_zm and not iswall_xm and not iswall_xp and not iswall_zp then + minetest.set_node(pos, {name = "homedecor:cobweb_flat", param2 = 2}) + + elseif iswall_zp and not iswall_xm and not iswall_xp and not iswall_zm then + minetest.set_node(pos, {name = "homedecor:cobweb_flat", param2 = 0}) -- if all else fails, place the plantlike version as a fallback.