diff options
| author | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-09-08 12:12:15 -0400 | 
|---|---|---|
| committer | Vanessa Dannenberg <vanessa.e.dannenberg@gmail.com> | 2018-09-08 12:12:15 -0400 | 
| commit | aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b (patch) | |
| tree | 379775ce76eb855a3ea65906727d828d1696cece /digistuff/init.lua | |
| parent | ba470a69750df16eac4278c30471d813c2581202 (diff) | |
| download | dreambuilder_modpack-aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b.tar dreambuilder_modpack-aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b.tar.gz dreambuilder_modpack-aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b.tar.bz2 dreambuilder_modpack-aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b.tar.xz dreambuilder_modpack-aaed0a2ea81a51f36a7eb35cb30c57ddf646fe1b.zip  | |
updated castles, coloredwood, digistuff, locks, mesecons,
pipeworks, steel, unified dyes, unified mesecons, and worldedit
Diffstat (limited to 'digistuff/init.lua')
| -rw-r--r-- | digistuff/init.lua | 126 | 
1 files changed, 119 insertions, 7 deletions
diff --git a/digistuff/init.lua b/digistuff/init.lua index 351fb6b..01aa586 100644 --- a/digistuff/init.lua +++ b/digistuff/init.lua @@ -360,7 +360,7 @@ minetest.register_node("digistuff:digimese", {  	light_source = 3,  	groups = {cracky = 3, level = 2},  	is_ground_content = false, -	sounds = default.node_sound_stone_defaults(), +	sounds = default and default.node_sound_stone_defaults(),  	digiline = { wire = { rules = {  	{x = 1, y = 0, z = 0},  	{x =-1, y = 0, z = 0}, @@ -417,7 +417,7 @@ minetest.register_node("digistuff:button", {  			minetest.chat_send_player(sender:get_player_name(),"Channel and message must both be set!")  		end  	end, -	sounds = default.node_sound_stone_defaults(), +	sounds = default and default.node_sound_stone_defaults(),  })  minetest.register_node("digistuff:button_off", { @@ -460,7 +460,7 @@ minetest.register_node("digistuff:button_off", {  		if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end  		minetest.after(0.5, digistuff.button_turnoff, pos)  	end, -	sounds = default.node_sound_stone_defaults(), +	sounds = default and default.node_sound_stone_defaults(),  })  minetest.register_node("digistuff:button_on", { @@ -477,7 +477,7 @@ minetest.register_node("digistuff:button_on", {  	paramtype2 = "facedir",  	legacy_wallmounted = true,  	walkable = false, -	light_source = default.LIGHT_MAX-7, +	light_source = 7,  	sunlight_propagates = true,  	selection_box = {  		type = "fixed", @@ -502,7 +502,7 @@ minetest.register_node("digistuff:button_on", {  		if minetest.get_modpath("mesecons") then minetest.sound_play("mesecons_button_push", {pos=pos}) end  	end,  	description = "Digilines Button (on state - you hacker you!)", -	sounds = default.node_sound_stone_defaults(), +	sounds = default and default.node_sound_stone_defaults(),  })  minetest.register_craft({ @@ -553,7 +553,7 @@ minetest.register_node("digistuff:detector", {  		if fields.msg then meta:set_string("msg",fields.msg) end  		if fields.radius then meta:set_string("radius",fields.radius) end  	end, -	sounds = default.node_sound_stone_defaults() +	sounds = default and default.node_sound_stone_defaults()  })  minetest.register_abm({ @@ -877,7 +877,7 @@ minetest.register_node("digistuff:camera", {  		if fields.distance and tonumber(fields.distance) then meta:set_int("distance",math.max(math.min(20,fields.distance),0)) end  		if fields.radius and tonumber(fields.radius) then meta:set_int("radius",math.max(math.min(10,fields.radius),1)) end  	end, -	sounds = default.node_sound_stone_defaults() +	sounds = default and default.node_sound_stone_defaults()  })  minetest.register_abm({ @@ -989,3 +989,115 @@ if minetest.get_modpath("mesecons_noteblock") then  		},  	})  end + +for i=0,14,1 do +	local mult = 255 - ((14-i)*16) +	minetest.register_node("digistuff:light_"..i, { +		drop = "digistuff:light_0", +		description = "Digilines Dimmable Light"..(i > 0 and " (on state - you hacker you!)" or ""), +		tiles = {"digistuff_light.png"}, +		paramtype = "light", +		drawtype = "nodebox", +		node_box = { +			type = "fixed", +			fixed = { +					{-0.25,0.4,-0.25,0.25,0.5,0.25}, +				} +		}, +		groups = i > 0 and {cracky = 1, not_in_creative_inventory = 1} or {cracky = 1}, +		is_ground_content = false, +		light_source = i, +		color = {r = mult,g = mult,b = mult}, +		sounds = default and default.node_sound_glass_defaults(), +		on_construct = function(pos) +			local meta = minetest.get_meta(pos) +			meta:set_string("formspec","field[channel;Channel;${channel}") +		end, +		on_receive_fields = function(pos, formname, fields, sender) +			local name = sender:get_player_name() +			if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then +				minetest.record_protection_violation(pos,name) +				return +			end +			local meta = minetest.get_meta(pos) +			if fields.channel then meta:set_string("channel",fields.channel) end +		end, +		digiline = { +			receptor = {}, +			wire = { +				rules = { +					{x = 1,y = 0,z = 0}, +					{x = -1,y = 0,z = 0}, +					{x = 0,y = 0,z = 1}, +					{x = 0,y = 0,z = -1}, +					{x = 0,y = 1,z = 0}, +					{x = 0,y = -1,z = 0}, +					{x = 0,y = 2,z = 0}, +				} +			}, +			effector = { +				action = function(pos,node,channel,msg) +						local meta = minetest.get_meta(pos) +						if meta:get_string("channel") ~= channel then return end +						local value = tonumber(msg) +						if (not value) or value > 14 or value < 0 then return end +						node.name = "digistuff:light_"..math.floor(value) +						minetest.swap_node(pos,node) +					end +			}, +		}, +	}) +end + +minetest.register_node("digistuff:junctionbox", { +	description = "Digilines Junction Box", +	tiles = {"digistuff_junctionbox.png"}, +	paramtype = "light", +	paramtype2 = "facedir", +	groups = {cracky = 3}, +	is_ground_content = false, +		paramtype = "light", +		drawtype = "nodebox", +		node_box = { +			type = "fixed", +			fixed = { +					{-0.1,-0.15,0.35,0.1,0.15,0.5}, +				} +		}, +	sounds = default and default.node_sound_stone_defaults(), +	digiline = { +		receptor = {}, +		wire = { +			rules = { +				{x = 1,y = 0,z = 0}, +				{x = -1,y = 0,z = 0}, +				{x = 0,y = 0,z = 1}, +				{x = 0,y = 0,z = -1}, +				{x = 0,y = 1,z = 0}, +				{x = 0,y = -1,z = 0}, +				{x = 0,y = -2,z = 0}, +				{x = 0,y = 2,z = 0}, +				{x = -2,y = 0,z = 0}, +				{x = 2,y = 0,z = 0}, +				{x = 0,y = 0,z = -2}, +				{x = 0,y = 0,z = 2}, +			} +		}, +	}, +}) + +minetest.register_craft({ +	output = "digistuff:light_0", +	recipe = { +		{"digilines:wire_std_00000000","mesecons_lamp:lamp_off",}, +	} +}) + +minetest.register_craft({ +	output = "digistuff:junctionbox", +	recipe = { +		{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",}, +		{"digilines:wire_std_00000000","digilines:wire_std_00000000","digilines:wire_std_00000000",}, +		{"homedecor:plastic_sheeting","digilines:wire_std_00000000","homedecor:plastic_sheeting",}, +	} +})  | 
