Create the basics of the node

Signed-off-by: Gergely POLONKAI <gergely@polonkai.eu>
This commit is contained in:
2025-11-23 16:52:10 +01:00
parent 893ed52741
commit 3bc33616a2
3 changed files with 68 additions and 0 deletions

60
init.lua Normal file
View File

@@ -0,0 +1,60 @@
local S = minetest.get_translator(minetest.get_current_modname())
local node_defaults = {
description = S("Mesecons Clock"),
drawtype = "nodebox",
use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "opaque" or nil,
walkable = true,
selection_box = {
type = "fixed",
fixed = { -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, -8/16, 8/16, -7/16, 8/16 },
{ -6/16, -7/16, -6/16, 6/16, -6/16, 6/16 },
},
},
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
is_ground_content = false,
sounds = mesecon.node_sound.stone,
on_blast = mesecon.on_blastnode,
drop = "mesecons_clock:clock_off",
}
local off_state = {
inventory_image = "jeija_gate_off.png^meseclock.png",
wield_image = "jeija_gate_off.png^meseclock.png",
tiles = {
"jeija_microcontroller_bottom.png^meseclock_output_off.png^jeija_gate_off.png^meseclock.png",
"jeija_microcontroller_bottom.png^meseclock_output_off.png",
"jeija_gate_side.png^jeija_gate_side_output_off.png",
"jeija_gate_side.png^jeija_gate_side_output_off.png",
"jeija_gate_side.png^jeija_gate_side_output_off.png",
"jeija_gate_side.png^jeija_gate_side_output_off.png",
},
groups = { bendy = 2, snappy = 1, dig_immediate = 2 },
mesecons = {
receptor = { state = mesecon.state.off },
},
}
local on_state = {
inventory_image = "jeija_gate_on.png^meseclock.png",
wield_image = "jeija_gate_on.png^meseclock.png",
tiles = {
"jeija_microcontroller_bottom.png^meseclock_output_on.png^jeija_gate_on.png^meseclock.png",
"jeija_microcontroller_bottom.png^meseclock_output_on.png",
"jeija_gate_side.png^jeija_gate_side_output_on.png",
"jeija_gate_side.png^jeija_gate_side_output_on.png",
"jeija_gate_side.png^jeija_gate_side_output_on.png",
"jeija_gate_side.png^jeija_gate_side_output_on.png",
},
groups = { bendy = 2, snappy = 1, dig_immediate = 2, not_in_creative_inventory = 1 },
mesecons = {
receptor = { state = mesecon.state.on },
},
}
mesecon.register_node("mesecons_clock:clock", node_defaults, off_state, on_state)