Allow mechanisms to be linked, and allow storing links in schematics.
This commit is contained in:
parent
8f98a7fa2d
commit
82817a1cb4
10 changed files with 438 additions and 104 deletions
|
|
@ -45,6 +45,26 @@ function Promise(fn)
|
|||
}
|
||||
end
|
||||
|
||||
-- HACK: Lookup table for getting a rotation from a
|
||||
-- facedir (because Minetest doesn't have any way
|
||||
-- to get this)
|
||||
local facedir_rotations = {
|
||||
-- +Y
|
||||
[0] = vector.new(0,0,0),
|
||||
[1] = vector.new(0, math.pi *1.5, 0),
|
||||
[2] = vector.new(0, math.pi, 0),
|
||||
[3] = vector.new(0, math.pi *0.5, 0),
|
||||
|
||||
-- +Z
|
||||
[4] = vector.new(math.pi *1.5, 0, 0),
|
||||
[5] = vector.new(math.pi *1.5, math.pi *1.5, 0),
|
||||
[6] = vector.new(math.pi *1.5, math.pi, 0),
|
||||
[7] = vector.new(math.pi *1.5, math.pi *0.5, 0),
|
||||
}
|
||||
function artifact.facedir_to_rotation(facedir)
|
||||
return facedir_rotations[facedir] or minetest.facedir_to_dir(facedir):dir_to_rotation()
|
||||
end
|
||||
|
||||
|
||||
minetest.register_lbm{
|
||||
name = ":artifact:on_load",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue