2022-02-14 07:49:05 +01:00
|
|
|
|
|
|
|
local S = power_generators.translator
|
|
|
|
|
2022-02-18 17:42:36 +01:00
|
|
|
-- node box {x=0, y=0, z=0}
|
|
|
|
local hor_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5,-0.5,-0.5,-0.375,0.5,-0.375},
|
|
|
|
{0.375,-0.5,-0.5,0.5,0.5,-0.375},
|
|
|
|
{-0.0625,-0.0625,-0.5,0.0625,0.0625,0.5},
|
|
|
|
{-0.375,-0.125,-0.4375,0.375,-0.0625,-0.375},
|
|
|
|
{-0.125,-0.0625,-0.4375,-0.0625,0.125,-0.375},
|
|
|
|
{0.0625,-0.0625,-0.4375,0.125,0.125,-0.375},
|
|
|
|
{-0.375,0.0625,-0.4375,-0.125,0.125,-0.375},
|
|
|
|
{-0.0625,0.0625,-0.4375,0.0625,0.125,-0.375},
|
|
|
|
{0.125,0.0625,-0.4375,0.375,0.125,-0.375},
|
|
|
|
{-0.4375,-0.125,-0.375,-0.375,0.125,-0.3125},
|
|
|
|
{0.375,-0.125,-0.375,0.4375,0.125,-0.3125},
|
|
|
|
{-0.4375,-0.125,-0.3125,-0.375,-0.0625,0.5},
|
|
|
|
{0.375,-0.125,-0.3125,0.4375,-0.0625,0.5},
|
|
|
|
{-0.4375,0.0625,-0.3125,-0.375,0.125,0.5},
|
|
|
|
{0.375,0.0625,-0.3125,0.4375,0.125,0.5},
|
|
|
|
{-0.4375,-0.0625,-0.125,-0.375,0.0625,-0.0625},
|
|
|
|
{0.375,-0.0625,-0.125,0.4375,0.0625,-0.0625},
|
|
|
|
{-0.4375,-0.0625,0.0625,-0.375,0.0625,0.125},
|
|
|
|
{0.375,-0.0625,0.0625,0.4375,0.0625,0.125},
|
|
|
|
{-0.4375,-0.0625,0.3125,-0.375,0.0625,0.5},
|
|
|
|
{0.375,-0.0625,0.3125,0.4375,0.0625,0.5},
|
|
|
|
{-0.5,-0.5,0.375,-0.375,-0.125,0.5},
|
|
|
|
{0.375,-0.5,0.375,0.5,-0.125,0.5},
|
|
|
|
{-0.5,-0.125,0.375,-0.4375,0.5,0.5},
|
|
|
|
{-0.375,-0.125,0.375,0.375,-0.0625,0.4375},
|
|
|
|
{0.4375,-0.125,0.375,0.5,0.5,0.5},
|
|
|
|
{-0.375,-0.0625,0.375,-0.3125,0.125,0.4375},
|
|
|
|
{-0.125,-0.0625,0.375,-0.0625,0.125,0.4375},
|
|
|
|
{0.0625,-0.0625,0.375,0.125,0.125,0.4375},
|
|
|
|
{0.3125,-0.0625,0.375,0.375,0.125,0.4375},
|
|
|
|
{-0.3125,0.0625,0.375,-0.125,0.125,0.4375},
|
|
|
|
{-0.0625,0.0625,0.375,0.0625,0.125,0.4375},
|
|
|
|
{0.125,0.0625,0.375,0.3125,0.125,0.4375},
|
|
|
|
{-0.4375,0.125,0.375,-0.375,0.5,0.5},
|
|
|
|
{0.375,0.125,0.375,0.4375,0.5,0.5},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
-- node box {x=0, y=0, z=0}
|
|
|
|
local ver_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.5,-0.5,-0.5,-0.375,0.5,-0.375},
|
|
|
|
{0.375,-0.5,-0.5,0.5,0.5,-0.375},
|
|
|
|
{-0.375,-0.125,-0.4375,0.375,-0.0625,-0.375},
|
|
|
|
{-0.125,-0.0625,-0.4375,-0.0625,0.125,-0.375},
|
|
|
|
{0.0625,-0.0625,-0.4375,0.125,0.125,-0.375},
|
|
|
|
{-0.375,0.0625,-0.4375,-0.125,0.125,-0.375},
|
|
|
|
{-0.0625,0.0625,-0.4375,0.0625,0.125,-0.375},
|
|
|
|
{0.125,0.0625,-0.4375,0.375,0.125,-0.375},
|
|
|
|
{-0.4375,-0.125,-0.375,-0.375,0.125,-0.3125},
|
|
|
|
{0.375,-0.125,-0.375,0.4375,0.125,-0.3125},
|
|
|
|
{-0.4375,-0.125,-0.3125,-0.375,-0.0625,0.5},
|
|
|
|
{0.375,-0.125,-0.3125,0.4375,-0.0625,0.5},
|
|
|
|
{-0.4375,0.0625,-0.3125,-0.375,0.125,0.5},
|
|
|
|
{0.375,0.0625,-0.3125,0.4375,0.125,0.5},
|
|
|
|
{-0.4375,-0.0625,-0.125,-0.375,0.0625,-0.0625},
|
|
|
|
{0.375,-0.0625,-0.125,0.4375,0.0625,-0.0625},
|
|
|
|
{-0.0625,-0.5,-0.0625,0.0625,0.5,0.0625},
|
|
|
|
{-0.4375,-0.0625,0.0625,-0.375,0.0625,0.125},
|
|
|
|
{0.375,-0.0625,0.0625,0.4375,0.0625,0.125},
|
|
|
|
{-0.4375,-0.0625,0.3125,-0.375,0.0625,0.5},
|
|
|
|
{0.375,-0.0625,0.3125,0.4375,0.0625,0.5},
|
|
|
|
{-0.5,-0.5,0.375,-0.375,-0.125,0.5},
|
|
|
|
{0.375,-0.5,0.375,0.5,-0.125,0.5},
|
|
|
|
{-0.5,-0.125,0.375,-0.4375,0.5,0.5},
|
|
|
|
{-0.375,-0.125,0.375,0.375,-0.0625,0.4375},
|
|
|
|
{0.4375,-0.125,0.375,0.5,0.5,0.5},
|
|
|
|
{-0.375,-0.0625,0.375,-0.3125,0.125,0.4375},
|
|
|
|
{-0.125,-0.0625,0.375,-0.0625,0.125,0.4375},
|
|
|
|
{0.0625,-0.0625,0.375,0.125,0.125,0.4375},
|
|
|
|
{0.3125,-0.0625,0.375,0.375,0.125,0.4375},
|
|
|
|
{-0.3125,0.0625,0.375,-0.125,0.125,0.4375},
|
|
|
|
{-0.0625,0.0625,0.375,0.0625,0.125,0.4375},
|
|
|
|
{0.125,0.0625,0.375,0.3125,0.125,0.4375},
|
|
|
|
{-0.4375,0.125,0.375,-0.375,0.5,0.5},
|
|
|
|
{0.375,0.125,0.375,0.4375,0.5,0.5},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-02-14 07:49:05 +01:00
|
|
|
minetest.register_node("power_generators:shaft_hor", {
|
|
|
|
description = S("Shaft"),
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "power_generators_shaft.obj",
|
|
|
|
tiles = {"power_generators_frame_steel.png", "power_generators_shaft_steel.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2022-02-18 17:42:36 +01:00
|
|
|
selection_box = hor_box,
|
|
|
|
collision_box = hor_box,
|
2022-02-14 07:49:05 +01:00
|
|
|
groups = {cracky = 1, shaft = 2},
|
|
|
|
_shaft_sides = {"front","back"},
|
2022-05-27 21:46:21 +02:00
|
|
|
_shaft_types = {front="steel",back="steel"},
|
2022-02-14 07:49:05 +01:00
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_float("I", 1)
|
2022-02-18 17:42:36 +01:00
|
|
|
meta:set_float("fric", 0.1)
|
2022-02-14 07:49:05 +01:00
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_node("power_generators:shaft_ver", {
|
|
|
|
description = S("Shaft"),
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "power_generators_shaft_ver.obj",
|
|
|
|
tiles = {"power_generators_frame_steel.png", "power_generators_shaft_steel.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
2022-02-18 17:42:36 +01:00
|
|
|
selection_box = ver_box,
|
|
|
|
collision_box = ver_box,
|
2022-02-14 07:49:05 +01:00
|
|
|
groups = {cracky = 1, shaft = 2},
|
|
|
|
_shaft_sides = {"bottom","top"},
|
2022-05-27 21:46:21 +02:00
|
|
|
_shaft_types = {bottom="steel",top="steel"},
|
2022-02-14 07:49:05 +01:00
|
|
|
|
|
|
|
on_construct = function(pos)
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_float("I", 2)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|