From 3339c1d08bd7f8675d56342178daff4137444f4d Mon Sep 17 00:00:00 2001 From: cheapie Date: Sun, 15 Jan 2017 01:45:41 -0600 Subject: Shrink node and create entity on placement --- init.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/init.lua b/init.lua index 609e500..14c1c6b 100644 --- a/init.lua +++ b/init.lua @@ -45,6 +45,11 @@ minetest.register_node("rgblightstone:rgblightstone", { tiles = {"jeija_lightstone_darkgray_off.png^[colorize:#000000FF"}, groups = {cracky=2}, sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {{-0.45,-0.45,-0.45,0.45,0.45,0.45}} + }, paramtype = "light", description = "RGB Lightstone", on_construct = function(pos) @@ -52,6 +57,13 @@ minetest.register_node("rgblightstone:rgblightstone", { meta:set_string("formspec", "size[8,5;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;2,2;addrx;X Address;${addrx}]field[5,2;2,2;addry;Y Address;${addry}]button_exit[2.25,3;3,1;submit;Save]button_exit[2.25,4;3,1;autofill;Auto-Fill From Node Above]label[3,2;Leave address blank\nfor individual mode]") meta:set_string("infotext","Not configured! Right-click to set up manually, or punch to auto-fill from the node above.") meta:set_string("color","000000") + + --Create a new entity + local obj = minetest.add_entity(pos,"rgblightstone:entity") + + --Set to the black + local tex = "jeija_lightstone_darkgray_off.png^[colorize:#000000FF" + obj:set_properties({textures = {tex,tex,tex,tex,tex,tex}}) end, on_destruct = function(pos) local objs = minetest.get_objects_inside_radius(pos,0.5) -- cgit v1.2.3