summaryrefslogtreecommitdiff
path: root/mesecons_lamp
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-26 22:54:28 +0100
committerJeija <norrepli@gmail.com>2012-12-26 22:54:28 +0100
commitd91e0b66cb7971ba54d071a0955f17d1a7b0162e (patch)
tree11294026f6db9a7c49a5ab93ed9cc6d63b8db1a4 /mesecons_lamp
parentc508bfaea62156684ea90b04e8963fb9e30dfaf2 (diff)
downloadmesecons-d91e0b66cb7971ba54d071a0955f17d1a7b0162e.tar
mesecons-d91e0b66cb7971ba54d071a0955f17d1a7b0162e.tar.gz
mesecons-d91e0b66cb7971ba54d071a0955f17d1a7b0162e.tar.bz2
mesecons-d91e0b66cb7971ba54d071a0955f17d1a7b0162e.tar.xz
mesecons-d91e0b66cb7971ba54d071a0955f17d1a7b0162e.zip
Re-write pistons from scratch, propably fixes a lot of bugs and doesn't cause too many new ones.
Diffstat (limited to 'mesecons_lamp')
-rw-r--r--mesecons_lamp/init.lua35
1 files changed, 11 insertions, 24 deletions
diff --git a/mesecons_lamp/init.lua b/mesecons_lamp/init.lua
index d20236b..175a22b 100644
--- a/mesecons_lamp/init.lua
+++ b/mesecons_lamp/init.lua
@@ -2,6 +2,13 @@
-- A lamp is "is an electrical device used to create artificial light" (wikipedia)
-- guess what?
+mesecon_lamp_box = {
+ type = "wallmounted",
+ wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
+ wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
+ wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
+}
+
minetest.register_node("mesecons_lamp:lamp_on", {
drawtype = "nodebox",
tiles = {"jeija_meselamp_on.png"},
@@ -11,18 +18,8 @@ minetest.register_node("mesecons_lamp:lamp_on", {
sunlight_propagates = true,
walkable = true,
light_source = LIGHT_MAX,
- node_box = {
- type = "wallmounted",
- wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
- wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
- wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
- },
- selection_box = {
- type = "wallmounted",
- wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
- wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
- wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
- },
+ node_box = mesecon_lamp_box,
+ selection_box = mesecon_lamp_box,
groups = {dig_immediate=3,not_in_creative_inventory=1, mesecon_effector_on = 1},
drop='"mesecons_lamp:lamp_off" 1',
mesecons = {effector = {
@@ -41,18 +38,8 @@ minetest.register_node("mesecons_lamp:lamp_off", {
paramtype2 = "wallmounted",
sunlight_propagates = true,
walkable = true,
- node_box = {
- type = "wallmounted",
- wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
- wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
- wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
- },
- selection_box = {
- type = "wallmounted",
- wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
- wall_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
- wall_side = {-0.375,-0.3125,-0.3125,-0.5,0.3125,0.3125},
- },
+ node_box = mesecon_lamp_box,
+ selection_box = mesecon_lamp_box,
groups = {dig_immediate=3, mesecon_receptor_off = 1, mesecon_effector_off = 1},
description="Meselamp",
mesecons = {effector = {