Stairsplus and Mesecons Problem

Post Reply
User avatar
rubberduck
Member
Posts: 505
Joined: Thu Feb 27, 2014 19:19
IRC: rbduck
In-game: rubberduck
Location: error 404 - location not found
Contact:

Stairsplus and Mesecons Problem

by rubberduck » Post

i want to create some lightstones (like these known from mesecons), that can be used with stairsplus / circular saw

but i have the problem that mesecon is not working with these. is there a way to fix this??

Code: Select all

local lightstone_rules = {
	{x=0,  y=0,  z=-1},
	{x=1,  y=0,  z=0},
	{x=-1, y=0,  z=0},
	{x=0,  y=0,  z=1},
	{x=1,  y=1,  z=0},
	{x=1,  y=-1, z=0},
	{x=-1, y=1,  z=0},
	{x=-1, y=-1, z=0},
	{x=0,  y=1,  z=1},
	{x=0,  y=-1, z=1},
	{x=0,  y=1,  z=-1},
	{x=0,  y=-1, z=-1},
	{x=0,  y=-1, z=0},
}

function meseconductors:lightstone_add(name, base_item, texture_off, texture_on)
	minetest.register_node("meseconductors:lightstone_" .. name .. "_off", {
		tiles = {texture_off},
		groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
		description=name.." Lightstone",
		sounds = default.node_sound_stone_defaults(),
		mesecons = {effector = {
			rules = lightstone_rules,
			action_on = function (pos, node)
				minetest.swap_node(pos, {name = "meseconductors:lightstone_" .. name .. "_on", param2 = node.param2})
			end,
		}}
	})
	minetest.register_node("meseconductors:lightstone_" .. name .. "_on", {
	tiles = {texture_on},
	groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
	drop = "meseconductors:lightstone_" .. name .. "_off",
	light_source = LIGHT_MAX-1,
	sounds = default.node_sound_stone_defaults(),
	mesecons = {effector = {
		rules = lightstone_rules,
		action_off = function (pos, node)
			minetest.swap_node(pos, {name = "meseconductors:lightstone_" .. name .. "_off", param2 = node.param2})
		end,
	}}
	})

	minetest.register_craft({
		output = "meseconductors:lightstone_" .. name .. "_off",
		recipe = {
			{"",base_item,""},
			{base_item,"default:torch",base_item},
			{"default:torch","default:torch","default:torch"}
		}
	})
end


meseconductors:lightstone_add("red", "default:clay_brick", "jeija_lightstone_red_off.png", "jeija_lightstone_red_on.png")
meseconductors:lightstone_add("green", "default:cactus", "jeija_lightstone_green_off.png", "jeija_lightstone_green_on.png")

if minetest.get_modpath("moreblocks") then


    stairsplus:register_all(
		"meseconductors",
		"lightstone_red_off",
		"meseconductors:lightstone_red_off",
		{
			description = "Red Lightstone",
			tiles = {"jeija_lightstone_red_off.png"},
			groups = {cracky=2, mesecon_effector_off = 1, mesecon = 2},
			sounds = default.node_sound_stone_defaults(),

		}}

		}
	)

	    stairsplus:register_all(
		"meseconductors",
		"lightstone_red_on",
		"meseconductors:lightstone_red_on",
		{
			description = "Red Lightstone On",
			drop = "lightstone_red_off",
			tiles = {"jeija_lightstone_red_on.png"},
			groups = {cracky=2,not_in_creative_inventory=1, mesecon = 2},
			sounds = default.node_sound_stone_defaults(),
			light_source = LIGHT_MAX-1,

		}
	)

end
My game (not minetest): http://forum.freegamedev.net/viewtopic.php?f=22&t=6800

my mods: gold_and_gem, meseconductors

a penguin throws an apple through a window

sometimes i change my "forum location" via user control panel

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests