diff options
author | cheapie <no-email-for-you@example.com> | 2015-12-01 23:57:57 -0600 |
---|---|---|
committer | cheapie <no-email-for-you@example.com> | 2015-12-01 23:57:57 -0600 |
commit | 037ce5ff5d429f26c8d5695abeac727035359e35 (patch) | |
tree | c675deb9514ef9293fc91ec2dfb437f3af209571 | |
download | rgblightstone-037ce5ff5d429f26c8d5695abeac727035359e35.tar rgblightstone-037ce5ff5d429f26c8d5695abeac727035359e35.tar.gz rgblightstone-037ce5ff5d429f26c8d5695abeac727035359e35.tar.bz2 rgblightstone-037ce5ff5d429f26c8d5695abeac727035359e35.tar.xz rgblightstone-037ce5ff5d429f26c8d5695abeac727035359e35.zip |
Added content, so it, you know, does something...
19 files changed, 82 insertions, 0 deletions
@@ -0,0 +1,28 @@ +RGB Lightstones for Minetest + +License: +---Code: WTFPL +---Textures: WTFPL (made by VanessaE) + +Depends: mesecons_lightstone, digilines? + +Instructions (with digilines): + +* Grab one from the creative inventory, or craft one: + nothing green lightstone nothing + red lightstone luacontroller blue lightstone + nothing digiline nothing + +or, if you don't have luacontrollers: + + nothing green lightstone nothing + red lightstone mesecon blue lightstone + nothing mesecon nothing + +* Place the thing +* Right-click and set a channel +* Send a digilines message to it on that channel with the color you want (choices listed below) + +Instructions (without digilines): + +Grab the one you want from the creative inventory and place it. Survival mode is not yet supported without digilines. diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..20c99f1 --- /dev/null +++ b/depends.txt @@ -0,0 +1,2 @@ +mesecons_lightstone +digilines? diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..0e140d7 --- /dev/null +++ b/init.lua @@ -0,0 +1,52 @@ +rgblightstone = {} +rgblightstone.colors = {"off","black","blue","brown","cyan","darkblue","darkcyan","darkgray","darkgreen","darkmagenta","darkred","gray","green","magenta","red","white","yellow"} +function rgblightstone.add(name) + minetest.register_node("rgblightstone:lightstone_" .. name, { + tiles = name == "off" and {"jeija_lightstone_darkgray_off.png"} or {"rgblightstone_"..name..".png"}, + drop = "rgblightstone:lightstone_off", + groups = name == "off" and {cracky=2} or {cracky=2,not_in_creative_inventory=1}, + description="RGB Lightstone ("..name..")", + sounds = default.node_sound_stone_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) + if fields.channel then minetest.get_meta(pos):set_string("channel", fields.channel) end + end, + light_source = name~= "off" and default.LIGHT_MAX-2 or 0, + digiline = { + receptor = {}, + effector = { + action = function(pos, node, channel, msg) + local channel_set = minetest.get_meta(pos):get_string("channel") + if channel==channel_set then + for _,color in ipairs(rgblightstone.colors) do + if msg==color then minetest.swap_node(pos, {name = "rgblightstone:lightstone_"..color}) end + end + end + end + } + } + }) +end +for _,i in ipairs(rgblightstone.colors) do rgblightstone.add(i) end +if minetest.get_modpath("mesecons_luacontroller") and minetest.get_modpath("digilines") then + minetest.register_craft({ + output = "rgblightstone:lightstone_off", + recipe = { + {"","mesecons_lightstone:lightstone_green_off",""}, + {"mesecons_lightstone:lightstone_red_off","mesecons_luacontroller:luacontroller0000","mesecons_lightstone:lightstone_blue_off"}, + {"","digilines:wire_std_00000000",""} + } + }) +else + minetest.register_craft({ + output = "rgblightstone:lightstone_off", + recipe = { + {"","mesecons_lightstone:lightstone_green_off",""}, + {"mesecons_lightstone:lightstone_red_off","group:mesecon_conductor_craftable","mesecons_lightstone:lightstone_blue_off"}, + {"","group:mesecon_conductor_craftable",""} + } + }) +end diff --git a/textures/rgblightstone_black.png b/textures/rgblightstone_black.png Binary files differnew file mode 100644 index 0000000..f3e2010 --- /dev/null +++ b/textures/rgblightstone_black.png diff --git a/textures/rgblightstone_blue.png b/textures/rgblightstone_blue.png Binary files differnew file mode 100644 index 0000000..064f202 --- /dev/null +++ b/textures/rgblightstone_blue.png diff --git a/textures/rgblightstone_brown.png b/textures/rgblightstone_brown.png Binary files differnew file mode 100644 index 0000000..d030973 --- /dev/null +++ b/textures/rgblightstone_brown.png diff --git a/textures/rgblightstone_cyan.png b/textures/rgblightstone_cyan.png Binary files differnew file mode 100644 index 0000000..b359bca --- /dev/null +++ b/textures/rgblightstone_cyan.png diff --git a/textures/rgblightstone_darkblue.png b/textures/rgblightstone_darkblue.png Binary files differnew file mode 100644 index 0000000..b7a49b9 --- /dev/null +++ b/textures/rgblightstone_darkblue.png diff --git a/textures/rgblightstone_darkcyan.png b/textures/rgblightstone_darkcyan.png Binary files differnew file mode 100644 index 0000000..4f6fe92 --- /dev/null +++ b/textures/rgblightstone_darkcyan.png diff --git a/textures/rgblightstone_darkgray.png b/textures/rgblightstone_darkgray.png Binary files differnew file mode 100644 index 0000000..9a0b84f --- /dev/null +++ b/textures/rgblightstone_darkgray.png diff --git a/textures/rgblightstone_darkgreen.png b/textures/rgblightstone_darkgreen.png Binary files differnew file mode 100644 index 0000000..9e4b3fa --- /dev/null +++ b/textures/rgblightstone_darkgreen.png diff --git a/textures/rgblightstone_darkmagenta.png b/textures/rgblightstone_darkmagenta.png Binary files differnew file mode 100644 index 0000000..693a301 --- /dev/null +++ b/textures/rgblightstone_darkmagenta.png diff --git a/textures/rgblightstone_darkred.png b/textures/rgblightstone_darkred.png Binary files differnew file mode 100644 index 0000000..f3d051e --- /dev/null +++ b/textures/rgblightstone_darkred.png diff --git a/textures/rgblightstone_gray.png b/textures/rgblightstone_gray.png Binary files differnew file mode 100644 index 0000000..329e5cf --- /dev/null +++ b/textures/rgblightstone_gray.png diff --git a/textures/rgblightstone_green.png b/textures/rgblightstone_green.png Binary files differnew file mode 100644 index 0000000..85cdaae --- /dev/null +++ b/textures/rgblightstone_green.png diff --git a/textures/rgblightstone_magenta.png b/textures/rgblightstone_magenta.png Binary files differnew file mode 100644 index 0000000..3aa7238 --- /dev/null +++ b/textures/rgblightstone_magenta.png diff --git a/textures/rgblightstone_red.png b/textures/rgblightstone_red.png Binary files differnew file mode 100644 index 0000000..ba656da --- /dev/null +++ b/textures/rgblightstone_red.png diff --git a/textures/rgblightstone_white.png b/textures/rgblightstone_white.png Binary files differnew file mode 100644 index 0000000..095ca8f --- /dev/null +++ b/textures/rgblightstone_white.png diff --git a/textures/rgblightstone_yellow.png b/textures/rgblightstone_yellow.png Binary files differnew file mode 100644 index 0000000..c976bff --- /dev/null +++ b/textures/rgblightstone_yellow.png |