aboutsummaryrefslogtreecommitdiff
path: root/assets/blender/ks/signal_ks_singlemesh_final.blend
Commit message (Expand)AuthorAge
* Shunt signals (not exactly Ks), along with fixes in other components that tho...orwell962018-12-08
* Complete Ks Main signalsorwell962018-10-26
a id='n37' href='#n37'>37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
-- p_mesecon_iface.lua
-- Mesecons interface by overriding the switch

if not mesecon then return end

minetest.override_item("mesecons_switch:mesecon_switch_off", {
	groups = {
		dig_immediate=2,
		save_in_nodedb=1,
	},
	on_rightclick = function (pos, node)
		advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2})
		mesecon.receptor_on(pos)
		minetest.sound_play("mesecons_switch", {pos=pos})
	end,
	on_updated_from_nodedb = function(pos, node)
		mesecon.receptor_off(pos)
	end,
	luaautomation = {
		getstate = "off",
		setstate = function(pos, node, newstate)
			if newstate=="on" then
				advtrains.ndb.swap_node(pos, {name="mesecons_switch:mesecon_switch_on", param2=node.param2})