Verified Commit f0c06d9d authored by Dirk's avatar Dirk

support Moreblocks slopes for proper rotation

parent 2a4277bf
......@@ -6,6 +6,7 @@ local item_place_node = minetest.item_place_node
local stairs = {}
local slabs = {}
local slopes = {}
-- Correct stairs placement
......@@ -106,9 +107,11 @@ for name,definition in pairs(minetest.registered_nodes) do
local from_moreblocks = definition.mod_origin == 'moreblocks'
local stair = string.match(name, ':stair_') ~= nil
local slab = string.match(name, ':slab_') ~= nil
local slope = string.match(name, ':slope_') ~= nil
if stair and from_moreblocks then table.insert(stairs, name) end
if slab and from_moreblocks then table.insert(slabs, name) end
if slope and from_moreblocks then table.insert(slopes, name) end
end
......@@ -123,6 +126,17 @@ for _,name in pairs(stairs) do
end
-- Iterate over all slopes and override the broken on_place function.
for _,name in pairs(slopes) do
override_item(name, {
on_place = function (itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then return itemstack end
return properly_rotate(itemstack, placer, pointed_thing)
end
})
end
-- Iterate over all slabs and override the broken on_place function.
for _,name in pairs(slabs) do
override_item(name, {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment