Cranks, shafts, and spruce trees.
This commit is contained in:
parent
4659a008ac
commit
9011835cf4
40 changed files with 1496 additions and 104 deletions
0
mods/rgt_things/modpack.conf
Normal file
0
mods/rgt_things/modpack.conf
Normal file
92
mods/rgt_things/rgt_lights/init.lua
Normal file
92
mods/rgt_things/rgt_lights/init.lua
Normal 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")
|
||||
2
mods/rgt_things/rgt_lights/mod.conf
Normal file
2
mods/rgt_things/rgt_lights/mod.conf
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
name = rgt_lights
|
||||
depends = rgt_world
|
||||
1
mods/rgt_things/rgt_lights/models/rgt_lantern.gltf
Normal file
1
mods/rgt_things/rgt_lights/models/rgt_lantern.gltf
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
BIN
mods/rgt_things/rgt_lights/textures/rgt_lantern_copper.png
Normal file
BIN
mods/rgt_things/rgt_lights/textures/rgt_lantern_copper.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 413 B |
BIN
mods/rgt_things/rgt_lights/textures/rgt_lantern_iron.png
Normal file
BIN
mods/rgt_things/rgt_lights/textures/rgt_lantern_iron.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 403 B |
Loading…
Add table
Add a link
Reference in a new issue