From 037ce5ff5d429f26c8d5695abeac727035359e35 Mon Sep 17 00:00:00 2001 From: cheapie Date: Tue, 1 Dec 2015 23:57:57 -0600 Subject: Added content, so it, you know, does something... --- README | 28 ++++++++++++++++++ depends.txt | 2 ++ init.lua | 52 +++++++++++++++++++++++++++++++++ textures/rgblightstone_black.png | Bin 0 -> 101 bytes textures/rgblightstone_blue.png | Bin 0 -> 106 bytes textures/rgblightstone_brown.png | Bin 0 -> 108 bytes textures/rgblightstone_cyan.png | Bin 0 -> 105 bytes textures/rgblightstone_darkblue.png | Bin 0 -> 104 bytes textures/rgblightstone_darkcyan.png | Bin 0 -> 108 bytes textures/rgblightstone_darkgray.png | Bin 0 -> 106 bytes textures/rgblightstone_darkgreen.png | Bin 0 -> 108 bytes textures/rgblightstone_darkmagenta.png | Bin 0 -> 108 bytes textures/rgblightstone_darkred.png | Bin 0 -> 110 bytes textures/rgblightstone_gray.png | Bin 0 -> 107 bytes textures/rgblightstone_green.png | Bin 0 -> 107 bytes textures/rgblightstone_magenta.png | Bin 0 -> 106 bytes textures/rgblightstone_red.png | Bin 0 -> 107 bytes textures/rgblightstone_white.png | Bin 0 -> 98 bytes textures/rgblightstone_yellow.png | Bin 0 -> 104 bytes 19 files changed, 82 insertions(+) create mode 100644 README create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 textures/rgblightstone_black.png create mode 100644 textures/rgblightstone_blue.png create mode 100644 textures/rgblightstone_brown.png create mode 100644 textures/rgblightstone_cyan.png create mode 100644 textures/rgblightstone_darkblue.png create mode 100644 textures/rgblightstone_darkcyan.png create mode 100644 textures/rgblightstone_darkgray.png create mode 100644 textures/rgblightstone_darkgreen.png create mode 100644 textures/rgblightstone_darkmagenta.png create mode 100644 textures/rgblightstone_darkred.png create mode 100644 textures/rgblightstone_gray.png create mode 100644 textures/rgblightstone_green.png create mode 100644 textures/rgblightstone_magenta.png create mode 100644 textures/rgblightstone_red.png create mode 100644 textures/rgblightstone_white.png create mode 100644 textures/rgblightstone_yellow.png diff --git a/README b/README new file mode 100644 index 0000000..ba24564 --- /dev/null +++ b/README @@ -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 new file mode 100644 index 0000000..f3e2010 Binary files /dev/null and b/textures/rgblightstone_black.png differ diff --git a/textures/rgblightstone_blue.png b/textures/rgblightstone_blue.png new file mode 100644 index 0000000..064f202 Binary files /dev/null and b/textures/rgblightstone_blue.png differ diff --git a/textures/rgblightstone_brown.png b/textures/rgblightstone_brown.png new file mode 100644 index 0000000..d030973 Binary files /dev/null and b/textures/rgblightstone_brown.png differ diff --git a/textures/rgblightstone_cyan.png b/textures/rgblightstone_cyan.png new file mode 100644 index 0000000..b359bca Binary files /dev/null and b/textures/rgblightstone_cyan.png differ diff --git a/textures/rgblightstone_darkblue.png b/textures/rgblightstone_darkblue.png new file mode 100644 index 0000000..b7a49b9 Binary files /dev/null and b/textures/rgblightstone_darkblue.png differ diff --git a/textures/rgblightstone_darkcyan.png b/textures/rgblightstone_darkcyan.png new file mode 100644 index 0000000..4f6fe92 Binary files /dev/null and b/textures/rgblightstone_darkcyan.png differ diff --git a/textures/rgblightstone_darkgray.png b/textures/rgblightstone_darkgray.png new file mode 100644 index 0000000..9a0b84f Binary files /dev/null and b/textures/rgblightstone_darkgray.png differ diff --git a/textures/rgblightstone_darkgreen.png b/textures/rgblightstone_darkgreen.png new file mode 100644 index 0000000..9e4b3fa Binary files /dev/null and b/textures/rgblightstone_darkgreen.png differ diff --git a/textures/rgblightstone_darkmagenta.png b/textures/rgblightstone_darkmagenta.png new file mode 100644 index 0000000..693a301 Binary files /dev/null and b/textures/rgblightstone_darkmagenta.png differ diff --git a/textures/rgblightstone_darkred.png b/textures/rgblightstone_darkred.png new file mode 100644 index 0000000..f3d051e Binary files /dev/null and b/textures/rgblightstone_darkred.png differ diff --git a/textures/rgblightstone_gray.png b/textures/rgblightstone_gray.png new file mode 100644 index 0000000..329e5cf Binary files /dev/null and b/textures/rgblightstone_gray.png differ diff --git a/textures/rgblightstone_green.png b/textures/rgblightstone_green.png new file mode 100644 index 0000000..85cdaae Binary files /dev/null and b/textures/rgblightstone_green.png differ diff --git a/textures/rgblightstone_magenta.png b/textures/rgblightstone_magenta.png new file mode 100644 index 0000000..3aa7238 Binary files /dev/null and b/textures/rgblightstone_magenta.png differ diff --git a/textures/rgblightstone_red.png b/textures/rgblightstone_red.png new file mode 100644 index 0000000..ba656da Binary files /dev/null and b/textures/rgblightstone_red.png differ diff --git a/textures/rgblightstone_white.png b/textures/rgblightstone_white.png new file mode 100644 index 0000000..095ca8f Binary files /dev/null and b/textures/rgblightstone_white.png differ diff --git a/textures/rgblightstone_yellow.png b/textures/rgblightstone_yellow.png new file mode 100644 index 0000000..c976bff Binary files /dev/null and b/textures/rgblightstone_yellow.png differ -- cgit v1.2.3