diff options
author | Anthony Zhang <azhang9@gmail.com> | 2012-02-10 16:05:55 -0500 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2012-02-10 16:05:55 -0500 |
commit | fd81543d2bc75a417f84fd08b2cb9fcd66866581 (patch) | |
tree | 1c94175bfaab112638b0b814256348f0ccb63365 | |
parent | 1ac2bc910f11f8ae610bf32f8fc6bc73a5bf5917 (diff) | |
parent | f4fa9dec32d7debe1a8aa058f2b0a413193a43aa (diff) | |
download | mesecons-fd81543d2bc75a417f84fd08b2cb9fcd66866581.tar mesecons-fd81543d2bc75a417f84fd08b2cb9fcd66866581.tar.gz mesecons-fd81543d2bc75a417f84fd08b2cb9fcd66866581.tar.bz2 mesecons-fd81543d2bc75a417f84fd08b2cb9fcd66866581.tar.xz mesecons-fd81543d2bc75a417f84fd08b2cb9fcd66866581.zip |
Merge remote-tracking branch 'origin/master'
-rw-r--r-- | jeija/button.lua | 1 | ||||
-rw-r--r-- | jeija/init.lua | 2 | ||||
-rw-r--r-- | jeija/lever.lua | 86 | ||||
-rw-r--r-- | jeija/lightstone.lua | 6 | ||||
-rw-r--r-- | jeija/textures/jeija_wall_lever_off.png | bin | 0 -> 189 bytes | |||
-rw-r--r-- | jeija/textures/jeija_wall_lever_on.png | bin | 0 -> 173 bytes | |||
-rw-r--r-- | jeija/torches.lua | 3 |
7 files changed, 94 insertions, 4 deletions
diff --git a/jeija/button.lua b/jeija/button.lua index 102a591..13d2426 100644 --- a/jeija/button.lua +++ b/jeija/button.lua @@ -3,6 +3,7 @@ minetest.register_node("jeija:wall_button_off", { drawtype = "signlike", tile_images = {"jeija_wall_button_off.png"}, inventory_image = "jeija_wall_button_off.png", + wield_image = "jeija_wall_button_off.png", paramtype = "light", paramtype2 = "wallmounted", legacy_wallmounted = true, diff --git a/jeija/init.lua b/jeija/init.lua index e2d658f..1a5fce7 100644 --- a/jeija/init.lua +++ b/jeija/init.lua @@ -734,6 +734,7 @@ minetest.register_node("jeija:meselamp_off", { drawtype = "torchlike", tile_images = {"jeija_meselamp_on_ceiling_off.png", "jeija_meselamp_on_floor_off.png", "jeija_meselamp_off.png"}, inventory_image = "jeija_meselamp_on_floor_off.png", + wield_image = "jeija_meselamp_on_ceiling_off.png", paramtype = "light", sunlight_propagates = true, walkable = false, @@ -875,6 +876,7 @@ dofile(minetest.get_modpath("jeija").."/alias.lua") dofile(minetest.get_modpath("jeija").."/switch.lua") dofile(minetest.get_modpath("jeija").."/pistons.lua") dofile(minetest.get_modpath("jeija").."/lightstone.lua") +dofile(minetest.get_modpath("jeija").."/lever.lua") --TEMPEREST's STUFF if ENABLE_TEMPEREST==1 then dofile(minetest.get_modpath("jeija").."/temperest.lua") diff --git a/jeija/lever.lua b/jeija/lever.lua new file mode 100644 index 0000000..6f20fec --- /dev/null +++ b/jeija/lever.lua @@ -0,0 +1,86 @@ +-- WALL LEVER +minetest.register_node("jeija:wall_lever_off", { + drawtype = "signlike", + tile_images = {"jeija_wall_lever_off.png"}, + inventory_image = "jeija_wall_lever_off.png", + wield_image = "jeija_wall_lever_off.png", + paramtype = "light", + paramtype2 = "wallmounted", + legacy_wallmounted = true, + walkable = false, + selection_box = { + type = "wallmounted", + }, + material = minetest.digprop_constanttime(0.3), + description="Lever", +}) +minetest.register_node("jeija:wall_lever_on", { + drawtype = "signlike", + tile_images = {"jeija_wall_lever_on.png"}, + inventory_image = "jeija_wall_lever_on.png", + paramtype = "light", + paramtype2 = "wallmounted", + legacy_wallmounted = true, + walkable = false, + selection_box = { + type = "wallmounted", + }, + material = minetest.digprop_constanttime(0.3), + drop = '"jeija:wall_lever_off" 1', + description="Lever", +}) + +minetest.register_on_dignode( + function(pos, oldnode, digger) + if oldnode.name == "jeija:wall_lever_on" then + mesecon:receptor_off(pos) + end + end +) +minetest.register_on_punchnode(function(pos, node, puncher) + if node.name == "jeija:wall_lever_off" then + minetest.env:add_node(pos, {name="jeija:wall_lever_on",param2=node.param2}) + local rules_string=nil + if node.param2 == 5 then + rules_string="button_z+" + end + if node.param2 == 3 then + rules_string="button_x+" + end + if node.param2 == 4 then + rules_string="button_z-" + end + if node.param2 == 2 then + rules_string="button_x-" + end + mesecon:receptor_on(pos, rules_string) + end + if node.name == "jeija:wall_lever_on" then + minetest.env:add_node(pos, {name="jeija:wall_lever_off",param2=node.param2}) + local rules_string=nil + if node.param2 == 5 then + rules_string="button_z+" + end + if node.param2 == 3 then + rules_string="button_x+" + end + if node.param2 == 4 then + rules_string="button_z-" + end + if node.param2 == 2 then + rules_string="button_x-" + end + mesecon:receptor_off(pos, rules_string) + end +end) + +minetest.register_craft({ + output = '"jeija:wall_lever_off" 2', + recipe = { + {'"jeija:mesecon_off"'}, + {'"default:stone"'}, + {'"default:stick"'}, + } +}) +mesecon:add_receptor_node("jeija:wall_lever") +mesecon:add_receptor_node_off("jeija:wall_lever_off") diff --git a/jeija/lightstone.lua b/jeija/lightstone.lua index 08e79dd..454eb4a 100644 --- a/jeija/lightstone.lua +++ b/jeija/lightstone.lua @@ -3,15 +3,15 @@ function mesecon:lightstone_add(name, base_item, texture_off, texture_on) tile_images = {texture_off}, inventory_image = minetest.inventorycube(texture_off), material = minetest.digprop_stonelike(0.5), - description=name.." Lightstone", + description=name.." Lightstone", }) minetest.register_node("jeija:lightstone_" .. name .. "_on", { tile_images = {texture_on}, inventory_image = minetest.inventorycube(texture_on), material = minetest.digprop_stonelike(0.5), - dug_item = "node jeija:lightstone_" .. name .. "_off 1", + drop = "jeija:lightstone_" .. name .. "_off 1", light_source = LIGHT_MAX-2, - description=name.." Lightstone", + description=name.." Lightstone", }) assert(loadstring('mesecon:register_on_signal_on(function(pos, node) \n \ if node.name == "jeija:lightstone_' .. name .. '_off" then \n \ diff --git a/jeija/textures/jeija_wall_lever_off.png b/jeija/textures/jeija_wall_lever_off.png Binary files differnew file mode 100644 index 0000000..ed2d460 --- /dev/null +++ b/jeija/textures/jeija_wall_lever_off.png diff --git a/jeija/textures/jeija_wall_lever_on.png b/jeija/textures/jeija_wall_lever_on.png Binary files differnew file mode 100644 index 0000000..617fd7f --- /dev/null +++ b/jeija/textures/jeija_wall_lever_on.png diff --git a/jeija/torches.lua b/jeija/torches.lua index 9aac92c..28e9985 100644 --- a/jeija/torches.lua +++ b/jeija/torches.lua @@ -12,7 +12,7 @@ minetest.register_node("jeija:mesecon_torch_off", { drawtype = "torchlike", tile_images = {"jeija_torches_off.png", "jeija_torches_off_ceiling.png", "jeija_torches_off_side.png"}, inventory_image = "jeija_torches_off.png", - sunlight_propagates = true, + paramtype = "light", walkable = false, paramtype2 = "wallmounted", legacy_wallmounted = true, @@ -25,6 +25,7 @@ minetest.register_node("jeija:mesecon_torch_on", { drawtype = "torchlike", tile_images = {"jeija_torches_on.png", "jeija_torches_on_ceiling.png", "jeija_torches_on_side.png"}, inventory_image = "jeija_torches_on.png", + wield_image = "jeija_torches_on.png", paramtype = "light", sunlight_propagates = true, walkable = false, |