mirror of
https://gitea.your-land.de/whosit/compass_rose_node.git
synced 2025-06-15 22:48:01 +02:00
131 lines
4.3 KiB
Lua
131 lines
4.3 KiB
Lua
-- local function on_place(itemstack, placer, pointed_thing)
|
|
-- if not minetest.is_player(placer) then
|
|
-- return minetest.item_place(itemstack, placer, pointed_thing)
|
|
-- end
|
|
|
|
-- local look_dir = placer:get_look_dir()
|
|
|
|
-- if not vector.check(look_dir) then
|
|
-- return minetest.item_place(itemstack, placer, pointed_thing)
|
|
-- end
|
|
|
|
-- local facedir = minetest.dir_to_facedir(look_dir)
|
|
-- local aim_dir = pointed_thing.under - pointed_thing.above
|
|
|
|
-- local param2
|
|
-- if aim_dir.x == -1 then
|
|
-- param2 = 15
|
|
-- elseif aim_dir.x == 1 then
|
|
-- param2 = 17
|
|
-- elseif aim_dir.y == -1 then
|
|
-- param2 = facedir
|
|
-- elseif aim_dir.y == 1 then
|
|
-- param2 = 20 + ((2 - facedir) % 4)
|
|
-- elseif aim_dir.z == -1 then
|
|
-- param2 = 6
|
|
-- elseif aim_dir.z == 1 then
|
|
-- param2 = 8
|
|
-- end
|
|
|
|
-- return minetest.item_place(itemstack, placer, pointed_thing, param2)
|
|
-- end
|
|
|
|
-- function compass_rose_node.register_eye(name)
|
|
minetest.register_node(":compass_rose_node:" .. "block", {
|
|
description = "Compass rose block",
|
|
--drawtype = "nodebox",
|
|
--use_texture_alpha = "blend",
|
|
tiles = {
|
|
"compass_rose_node_block_side1.png",
|
|
"compass_rose_node_block_side2.png",
|
|
"compass_rose_node_block_side3.png",
|
|
"compass_rose_node_block_side0.png",
|
|
"compass_rose_node_block_side4.png",
|
|
"compass_rose_node_block_side5.png",
|
|
},
|
|
is_ground_content = false,
|
|
--inventory_image = "compass_rose_node_" .. name .. ".png",
|
|
--wield_image = "compass_rose_node_" .. name .. ".png",
|
|
paramtype = "light",
|
|
paramtype2 = "facedir",
|
|
--walkable = false,
|
|
--climbable = false,
|
|
--sunlight_propagates = true,
|
|
-- node_box = {
|
|
-- type = "fixed",
|
|
-- fixed = {-0.5, -0.4375, -0.5, 0.5, -0.4375, 0.5}
|
|
-- },
|
|
-- selection_box = {
|
|
-- type = "fixed",
|
|
-- fixed = {-0.5, -0.375, -0.5, 0.5, -0.5, 0.5}
|
|
-- },
|
|
groups = {choppy = 3, dig_immediate = 2},
|
|
--on_place = on_place
|
|
})
|
|
--end
|
|
|
|
for i=0,5 do
|
|
minetest.register_node(":compass_rose_node:decal_light_" .. tostring(i), {
|
|
description = "Compass rose block",
|
|
drawtype = "nodebox",
|
|
use_texture_alpha = "clip", -- "blend",
|
|
tiles = {
|
|
"compass_rose_decal_light_side" .. tostring(i) .. ".png",
|
|
},
|
|
is_ground_content = false,
|
|
--inventory_image = "compass_rose_node_" .. name .. ".png",
|
|
--wield_image = "compass_rose_node_" .. name .. ".png",
|
|
paramtype = "light",
|
|
paramtype2 = "facedir",
|
|
walkable = false,
|
|
climbable = false,
|
|
sunlight_propagates = true,
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {-0.5, -0.4375, -0.5, 0.5, -0.4375, 0.5}
|
|
},
|
|
selection_box = {
|
|
type = "fixed",
|
|
fixed = {-0.5, -0.375, -0.5, 0.5, -0.5, 0.5}
|
|
},
|
|
groups = {choppy = 3, dig_immediate = 2},
|
|
--on_place = on_place
|
|
})
|
|
end
|
|
|
|
minetest.register_node(":compass_rose_node:decal_light_large", {
|
|
description = "Compass rose block",
|
|
drawtype = "nodebox",
|
|
use_texture_alpha = "blend",
|
|
tiles = {
|
|
"compass_rose_decal_light_large.png",
|
|
},
|
|
-- overlay_tiles = {
|
|
-- {
|
|
-- name = "compass_rose_decal_light_large_letters.png",
|
|
-- color = "#F0F0F0",
|
|
-- }
|
|
-- },
|
|
visual_scale = 3.0,
|
|
is_ground_content = false,
|
|
--inventory_image = "compass_rose_node_" .. name .. ".png",
|
|
--wield_image = "compass_rose_node_" .. name .. ".png",
|
|
paramtype = "light",
|
|
--paramtype2 = "facedir",
|
|
paramtype2 = "colorfacedir",
|
|
palette = "compass_rose_decal_palette.png",
|
|
walkable = false,
|
|
climbable = false,
|
|
sunlight_propagates = true,
|
|
node_box = {
|
|
type = "fixed",
|
|
fixed = {-1.5/3, -0.49/3, -1.5/3, 1.5/3, -0.49/3, 1.5/3}
|
|
},
|
|
selection_box = {
|
|
type = "fixed",
|
|
fixed = {-1.5, -0.45, -1.5, 1.5, -0.5, 1.5}
|
|
},
|
|
groups = {choppy = 3, dig_immediate = 2},
|
|
--on_place = on_place
|
|
})
|