Remove trailing tabs from empty lines in stairs

This commit is contained in:
ShadowNinja 2013-10-04 20:33:41 -04:00
parent 7b8ad5786c
commit 3c0fa5f8b0
1 changed files with 13 additions and 13 deletions

View File

@ -25,11 +25,11 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then
return itemstack return itemstack
end end
local p0 = pointed_thing.under local p0 = pointed_thing.under
local p1 = pointed_thing.above local p1 = pointed_thing.above
local param2 = 0 local param2 = 0
local placer_pos = placer:getpos() local placer_pos = placer:getpos()
if placer_pos then if placer_pos then
local dir = { local dir = {
@ -39,7 +39,7 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
} }
param2 = minetest.dir_to_facedir(dir) param2 = minetest.dir_to_facedir(dir)
end end
if p0.y-1 == p1.y then if p0.y-1 == p1.y then
param2 = param2 + 20 param2 = param2 + 20
if param2 == 21 then if param2 == 21 then
@ -48,11 +48,11 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
param2 = 21 param2 = 21
end end
end end
return minetest.item_place(itemstack, placer, pointed_thing, param2) return minetest.item_place(itemstack, placer, pointed_thing, param2)
end, end,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:stair_" .. subname.."upside_down", { minetest.register_node(":stairs:stair_" .. subname.."upside_down", {
replace_name = "stairs:stair_" .. subname, replace_name = "stairs:stair_" .. subname,
@ -108,10 +108,10 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
local n0 = minetest.get_node(p0) local n0 = minetest.get_node(p0)
local n1 = minetest.get_node(p1) local n1 = minetest.get_node(p1)
local param2 = 0 local param2 = 0
local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and
n0.param2 >= 20) n0.param2 >= 20)
if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then
slabpos = p0 slabpos = p0
slabnode = n0 slabnode = n0
@ -125,7 +125,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
-- Make a fake stack of a single item and try to place it -- Make a fake stack of a single item and try to place it
local fakestack = ItemStack(recipeitem) local fakestack = ItemStack(recipeitem)
fakestack:set_count(itemstack:get_count()) fakestack:set_count(itemstack:get_count())
pointed_thing.above = slabpos pointed_thing.above = slabpos
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer, pointed_thing)
@ -148,7 +148,7 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
-- Make a fake stack of a single item and try to place it -- Make a fake stack of a single item and try to place it
local fakestack = ItemStack(recipeitem) local fakestack = ItemStack(recipeitem)
fakestack:set_count(itemstack:get_count()) fakestack:set_count(itemstack:get_count())
pointed_thing.above = p0 pointed_thing.above = p0
local success local success
fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) fakestack, success = minetest.item_place(fakestack, placer, pointed_thing)
@ -161,20 +161,20 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,
end end
return itemstack return itemstack
end end
-- Place upside down slab -- Place upside down slab
param2 = 20 param2 = 20
end end
-- If pointing at the side of a upside down slab -- If pointing at the side of a upside down slab
if n0_is_upside_down and p0.y+1 ~= p1.y then if n0_is_upside_down and p0.y+1 ~= p1.y then
param2 = 20 param2 = 20
end end
return minetest.item_place(itemstack, placer, pointed_thing, param2) return minetest.item_place(itemstack, placer, pointed_thing, param2)
end, end,
}) })
-- for replace ABM -- for replace ABM
minetest.register_node(":stairs:slab_" .. subname.."upside_down", { minetest.register_node(":stairs:slab_" .. subname.."upside_down", {
replace_name = "stairs:slab_"..subname, replace_name = "stairs:slab_"..subname,