summaryrefslogtreecommitdiff
path: root/mesecons_random
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-12-11 19:49:55 +0100
committerJeija <norrepli@gmail.com>2012-12-11 19:49:55 +0100
commitde46729b971b5e59394834b8a01d4a7005318114 (patch)
tree5a2cf1f18b485ddefa8e255ac6d6a600ef2e2e12 /mesecons_random
parent31f3c99288355193dc68a6e83dfc63140fd02fa0 (diff)
parent5540fcbcb31eb32003fa0391113ed3b1dea25e47 (diff)
downloadmesecons-de46729b971b5e59394834b8a01d4a7005318114.tar
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.gz
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.bz2
mesecons-de46729b971b5e59394834b8a01d4a7005318114.tar.xz
mesecons-de46729b971b5e59394834b8a01d4a7005318114.zip
Merge branch 'mesecons_in_nodedef'
Conflicts: mesecons/internal.lua
Diffstat (limited to 'mesecons_random')
-rw-r--r--mesecons_random/init.lua44
1 files changed, 18 insertions, 26 deletions
diff --git a/mesecons_random/init.lua b/mesecons_random/init.lua
index 4011217..4fc2f6e 100644
--- a/mesecons_random/init.lua
+++ b/mesecons_random/init.lua
@@ -3,12 +3,16 @@
minetest.register_node("mesecons_random:removestone", {
tiles = {"jeija_removestone.png"},
inventory_image = minetest.inventorycube("jeija_removestone_inv.png"),
- groups = {cracky=3, mesecon=2},
+ groups = {cracky=3},
description="Removestone",
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ minetest.env:remove_node(pos)
+ mesecon:update_autoconnect(pos)
+ end
+ }}
})
-mesecon:register_effector(nil, "mesecons_random:removestone")
-
minetest.register_craft({
output = 'mesecons_random:removestone 4',
recipe = {
@@ -18,12 +22,6 @@ minetest.register_craft({
}
})
-mesecon:register_on_signal_on(function(pos, node)
- if node.name == "mesecons_random:removestone" then
- minetest.env:remove_node(pos)
- end
-end)
-
-- GHOSTSTONE
minetest.register_node("mesecons_random:ghoststone", {
@@ -31,8 +29,13 @@ minetest.register_node("mesecons_random:ghoststone", {
tiles = {"jeija_ghoststone.png"},
is_ground_content = true,
inventory_image = minetest.inventorycube("jeija_ghoststone_inv.png"),
- groups = {cracky=3, mesecon=2},
+ groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
+ mesecons = {effector = {
+ action_on = function (pos, node)
+ minetest.env:add_node(pos, {name="mesecons_random:ghoststone_active"})
+ end
+ }}
})
minetest.register_node("mesecons_random:ghoststone_active", {
@@ -41,10 +44,13 @@ minetest.register_node("mesecons_random:ghoststone_active", {
walkable = false,
diggable = false,
sunlight_propagates = true,
- groups = {mesecon=2},
+ mesecons = {effector = {
+ action_off = function (pos, node)
+ minetest.env:add_node(pos, {name="mesecons_random:ghoststone"})
+ end
+ }}
})
-mesecon:register_effector("mesecons_random:ghoststone_active", "mesecons_random:ghoststone")
minetest.register_craft({
output = 'mesecons_random:ghoststone 4',
@@ -54,17 +60,3 @@ minetest.register_craft({
{"default:steel_ingot", "default:cobble", "default:steel_ingot"},
}
})
-
-mesecon:register_on_signal_on(function(pos, node)
- if node.name == "mesecons_random:ghoststone" then
- minetest.env:add_node(pos, {name="mesecons_random:ghoststone_active"})
- nodeupdate(pos)
- end
-end)
-
-mesecon:register_on_signal_off(function(pos, node)
- if node.name == "mesecons_random:ghoststone_active" then
- minetest.env:add_node(pos, {name="mesecons_random:ghoststone"})
- nodeupdate(pos)
- end
-end) \ No newline at end of file