Cranks, shafts, and spruce trees.

This commit is contained in:
Signal 2026-05-09 16:01:10 -04:00
parent 4659a008ac
commit 9011835cf4
40 changed files with 1496 additions and 104 deletions

View file

@ -0,0 +1,92 @@
local lantern_box = {
type = "fixed",
fixed = {
{
-3/16, -0.5, -3/16,
3/16, -1/16, 3/16,
},
{
-2/16, -1/16, -2/16,
2/16, 1/16, 2/16
},
{
-1/16, 1/16, -1/16,
1/16, 3/16, 1/16
}
}
}
local hanging_lantern_box = {
type = "fixed",
fixed = {
{
-3/16, -7/16, -3/16,
3/16, 0, 3/16,
},
{
-2/16, 0, -2/16,
2/16, 2/16, 2/16
},
{
-1/16, 1/16, -1/16,
1/16, 0.5, 1/16
}
}
}
function rgt.register_lantern(type)
local function on_place(s, p, pt)
local out = ItemStack(s)
local target = minetest.registered_nodes[minetest.get_node(pt.under).name].buildable_to and pt.under or pt.above
local below = minetest.get_node(target:offset(0, -1, 0))
-- TODO: Check solidity, not just air-ness.
if below.name == "air" then
local above = minetest.get_node(target:offset(0, 1, 0))
if above.name == "air" then
return s
end
s:set_name("lantern_"..type.."_hanging")
else
s:set_name("lantern_"..type)
end
local stack = minetest.item_place_node(s, p, pt)
out:set_count(stack:get_count())
return out
end
rgt.register_node("lantern_"..type, {
drawtype = "mesh",
mesh = "rgt_lantern.gltf",
tiles = {"rgt_lantern_"..type..".png"},
paramtype = "light",
light_source = 11,
selection_box = lantern_box,
collision_box = lantern_box,
node_placement_prediction = "",
groups = {dig_immediate = 3},
on_place = on_place
})
rgt.register_node("lantern_"..type.."_hanging", {
drawtype = "mesh",
mesh = "rgt_lantern_hanging.gltf",
tiles = {"rgt_lantern_"..type..".png"},
paramtype = "light",
light_source = 11,
selection_box = hanging_lantern_box,
collision_box = hanging_lantern_box,
node_placement_prediction = "",
drop = "lantern_"..type,
groups = {dig_immediate = 3},
on_place = on_place
})
end
rgt.register_lantern("iron")
rgt.register_lantern("copper")

View file

@ -0,0 +1,2 @@
name = rgt_lights
depends = rgt_world

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 403 B