Permalink
Browse files

Stairs: Remove combine slabs code

  • Loading branch information...
TumeniNodes authored and Ezhh committed Oct 11, 2018
1 parent f583d90 commit b042106fdc3bc56beb6c263e790c31a6f13f1ead
Showing with 0 additions and 30 deletions.
  1. +0 −30 mods/stairs/init.lua
@@ -143,10 +143,6 @@ function stairs.register_stair(subname, recipeitem, groups, images, description,
end


-- Slab facedir to placement 6d matching table
local slab_trans_dir = {[0] = 8, 0, 2, 1, 3, 4}


-- Register slab
-- Node will be called stairs:slab_<subname>

@@ -198,32 +194,6 @@ function stairs.register_slab(subname, recipeitem, groups, images, description,

local p2 = under.param2

-- combine two slabs if possible
if slab_trans_dir[math.floor(p2 / 4)] == dir
and wield_item == under.name then

if not recipeitem then
return itemstack
end
if minetest.is_protected(pointed_thing.under, player_name) and not
minetest.check_player_privs(player_name, "protection_bypass") then
minetest.record_protection_violation(pointed_thing.under,
player_name)
return
end
-- If paramtype2 of cubic version is not 'facedir' set its
-- param2 to 0 to avoid bugs such as liquid in connected
-- framed glass.
if minetest.registered_nodes[recipeitem].paramtype2 ~= "facedir" then
p2 = 0
end
minetest.set_node(pointed_thing.under, {name = recipeitem, param2 = p2})
if not creative_enabled then
itemstack:take_item()
end
return itemstack
end

-- Placing a slab on an upside down slab should make it right-side up.
if p2 >= 20 and dir == 8 then
p2 = p2 - 20

0 comments on commit b042106

Please sign in to comment.