Verified Commit f78340a2 authored by Dirk's avatar Dirk

use string parsing to determine stairs

Unfortunately stair/slab groups are pretty inconsistent so using the
name (ID) of them works best. Raw string parsing is bad but it is
actually more reliable then using the group.
parent 168d2a01
......@@ -104,7 +104,7 @@ end
-- Determine all stairs and slabs and put them into the respective tables.
for name,definition in pairs(minetest.registered_nodes) do
local from_moreblocks = definition.mod_origin == 'moreblocks'
local stair = definition.groups.stair
local stair = string.match(name, ':stair_') ~= nil
local slab = string.match(name, ':slab_') ~= nil
if stair and from_moreblocks then table.insert(stairs, name) end
......@@ -114,6 +114,7 @@ end
-- Iterate over all stairs and override the broken on_place function.
for _,name in pairs(stairs) do
print(dump(name))
override_item(name, {
on_place = function (itemstack, placer, pointed_thing)
if pointed_thing.type ~= "node" then return itemstack end
......
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