mirror of
https://github.com/minetest-mods/moreblocks.git
synced 2025-07-01 23:50:40 +02:00
functional, except saw, legacy, other compatability
This commit is contained in:
@ -1,14 +1,28 @@
|
||||
-- register shapes (e.g. 1/16 slab, 1/8 slab, 1/4 slab, etc)
|
||||
--[[
|
||||
stairsplus.api.register_shape("micro_1", {
|
||||
name_format = "micro_%s_1",
|
||||
description = "@1 1/16 Microblock",
|
||||
shape_groups = {micro = 1},
|
||||
eighths = 1,
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
|
||||
},
|
||||
})
|
||||
]]
|
||||
local api = stairsplus.api
|
||||
|
||||
stairsplus.api.registered_shapes = {}
|
||||
stairsplus.api.shapes_by_group = {}
|
||||
api.registered_shapes = {}
|
||||
api.shapes_by_group = {}
|
||||
|
||||
function stairsplus.api.register_shape(name , def)
|
||||
stairsplus.api.registered_shapes[name] = def
|
||||
function api.register_shape(name, def)
|
||||
api.registered_shapes[name] = def
|
||||
|
||||
for group in pairs(def.shape_groups or {}) do
|
||||
local shapes = stairsplus.api.shapes_by_group[group] or {}
|
||||
local shapes = api.shapes_by_group[group] or {}
|
||||
table.insert(shapes, name)
|
||||
stairsplus.api.shapes_by_group[group] = shapes
|
||||
api.shapes_by_group[group] = shapes
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user