summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheapie <no-email-for-you@example.com>2017-01-15 01:45:41 -0600
committercheapie <no-email-for-you@example.com>2017-01-15 01:45:41 -0600
commit3339c1d08bd7f8675d56342178daff4137444f4d (patch)
treecb4f739cf79a597b47b65bee17b476c193afd5db
parent87c223b142bc72fdc037f1ca063a74caec8625e1 (diff)
downloadrgblightstone-3339c1d08bd7f8675d56342178daff4137444f4d.tar
rgblightstone-3339c1d08bd7f8675d56342178daff4137444f4d.tar.gz
rgblightstone-3339c1d08bd7f8675d56342178daff4137444f4d.tar.bz2
rgblightstone-3339c1d08bd7f8675d56342178daff4137444f4d.tar.xz
rgblightstone-3339c1d08bd7f8675d56342178daff4137444f4d.zip
Shrink node and create entity on placement
-rw-r--r--init.lua12
1 files changed, 12 insertions, 0 deletions
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)