Merge branch 'master' of github.com:Jeija/minetest-mod-mesecons

This commit is contained in:
sfan5 2012-02-05 09:23:06 +01:00
commit 8690d8a07f
5 changed files with 50 additions and 52 deletions

View File

@ -7,9 +7,15 @@ minetest.register_alias("jeija:wireless_inverter", "jeija:wireless_inverter_on")
minetest.register_alias("jeija:wireless_receiver", "jeija:wireless_receiver_off") minetest.register_alias("jeija:wireless_receiver", "jeija:wireless_receiver_off")
minetest.register_alias("jeija:wireless_transmitter", "jeija:wireless_transmitter_off") minetest.register_alias("jeija:wireless_transmitter", "jeija:wireless_transmitter_off")
minetest.register_alias("jeija:switch", "jeija:mesecon_switch_off") minetest.register_alias("jeija:switch", "jeija:mesecon_switch_off")
minetest.register_alias("jeija:wall_button", "jeija:wall_button_off")
minetest.register_alias("jeija:piston", "jeija:piston_normal") minetest.register_alias("jeija:piston", "jeija:piston_normal")
minetest.register_alias("jeija:blinky_plant", "jeija:blinky_plant_off") minetest.register_alias("jeija:blinky_plant", "jeija:blinky_plant_off")
minetest.register_alias("jeija:mesecon_torch", "jeija:mesecon_torch_on") minetest.register_alias("jeija:mesecon_torch", "jeija:mesecon_torch_on")
minetest.register_alias("jeija:hydro_turbine", "jeija:hydro_turbine_off") minetest.register_alias("jeija:hydro_turbine", "jeija:hydro_turbine_off")
minetest.register_alias("jeija:pressure_plate_stone", "jeija:pressure_plate_stone_off") minetest.register_alias("jeija:pressure_plate_stone", "jeija:pressure_plate_stone_off")
minetest.register_alias("jeija:pressure_plate_wood", "jeija:pressure_plate_wood_off") minetest.register_alias("jeija:pressure_plate_wood", "jeija:pressure_plate_wood_off")
if ENABLE_TEMPEREST==1 then
minetest.register_alias("jeija:mesecon_socket", "jeija:mesecon_socket_off")
minetest.register_alias("jeija:mesecon_inverter", "jeija:mesecon_inverter_off")
end

View File

@ -639,16 +639,30 @@ minetest.register_on_dignode(
end end
) )
-- Silicon
-- Solar Panel
minetest.register_craftitem("jeija:silicon", { minetest.register_craftitem("jeija:silicon", {
image = "jeija_silicon.png", image = "jeija_silicon.png",
on_place_on_ground = minetest.craftitem_place_item, on_place_on_ground = minetest.craftitem_place_item,
description="Silicon", description="Silicon",
}) })
-- IC
minetest.register_craftitem("jeija:ic", {
image = "jeija_ic.png",
on_place_on_ground = minetest.craftitem_place_item,
description="IC",
})
minetest.register_craft({
output = 'craft "jeija:ic" 2',
recipe = {
{'jeija:silicon', 'jeija:silicon', 'jeija:mesecon_off'},
{'jeija:silicon', 'jeija:silicon', 'jeija:mesecon_off'},
{'jeija:mesecon_off', 'jeija:mesecon_off', ''},
}
})
-- Solar Panel
minetest.register_node("jeija:solar_panel", { minetest.register_node("jeija:solar_panel", {
drawtype = "raillike", drawtype = "raillike",
tile_images = {"jeija_solar_panel.png"}, tile_images = {"jeija_solar_panel.png"},
@ -700,7 +714,7 @@ minetest.register_abm(
-- MESELAMPS -- MESELAMPS
minetest.register_node("jeija:meselamp_on", { minetest.register_node("jeija:meselamp_on", {
drawtype = "torchlike", drawtype = "torchlike",
tile_images = {"jeija_meselamp_on_floor_on.png", "jeija_meselamp_on_ceiling_on.png", "jeija_meselamp_on.png"}, tile_images = {"jeija_meselamp_on_ceiling_on.png", "jeija_meselamp_on_floor_on.png", "jeija_meselamp_on.png"},
inventory_image = "jeija_meselamp_on_floor_on.png", inventory_image = "jeija_meselamp_on_floor_on.png",
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
@ -709,8 +723,8 @@ minetest.register_node("jeija:meselamp_on", {
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
selection_box = { selection_box = {
type = "wallmounted", --type = "wallmounted",
type = "fixed", --type = "fixed",
fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1}, fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1},
}, },
material = minetest.digprop_constanttime(0.1), material = minetest.digprop_constanttime(0.1),
@ -720,7 +734,7 @@ minetest.register_node("jeija:meselamp_on", {
minetest.register_node("jeija:meselamp_off", { minetest.register_node("jeija:meselamp_off", {
drawtype = "torchlike", drawtype = "torchlike",
tile_images = {"jeija_meselamp_on_floor_off.png", "jeija_meselamp_on_ceiling_off.png", "jeija_meselamp_off.png"}, 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", inventory_image = "jeija_meselamp_on_floor_off.png",
wield_image = "jeija_meselamp_on_ceiling_off.png", wield_image = "jeija_meselamp_on_ceiling_off.png",
paramtype = "light", paramtype = "light",
@ -728,7 +742,7 @@ minetest.register_node("jeija:meselamp_off", {
walkable = false, walkable = false,
wall_mounted = false, wall_mounted = false,
selection_box = { selection_box = {
type = "fixed", --type = "fixed",
fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1}, fixed = {-0.38, -0.5, -0.1, 0.38, -0.2, 0.1},
}, },
material = minetest.digprop_constanttime(0.1), material = minetest.digprop_constanttime(0.1),
@ -863,9 +877,10 @@ dofile(minetest.get_modpath("jeija").."/wireless.lua")
dofile(minetest.get_modpath("jeija").."/alias.lua") dofile(minetest.get_modpath("jeija").."/alias.lua")
dofile(minetest.get_modpath("jeija").."/switch.lua") dofile(minetest.get_modpath("jeija").."/switch.lua")
dofile(minetest.get_modpath("jeija").."/pistons.lua") dofile(minetest.get_modpath("jeija").."/pistons.lua")
dofile(minetest.get_modpath("jeija").."/lightstone.lua")
--TEMPEREST's STUFF --TEMPEREST's STUFF
if ENABLE_TEMPEREST==1 then if ENABLE_TEMPEREST==1 then
dofile(minetest.get_modpath("jeija").."temperest.lua") dofile(minetest.get_modpath("jeija").."/temperest.lua")
end end
--INIT --INIT

View File

@ -254,16 +254,6 @@ minetest.register_entity("jeija:sticky_movestone_entity", {
end end
}) })
minetest.register_craft({
output = '"jeija:sticky_movestone" 2',
recipe = {
{'"default:stone"', '"default:stone"', '"default:stone"'},
{'"jeija:mesecon_off"', '"jeija:mesecon_off"', '"default:tree"'},
{'"default:stone"', '"default:stone"', '"default:stone"'},
}
})
mesecon:register_on_signal_on(function (pos, node) mesecon:register_on_signal_on(function (pos, node)
if node.name=="jeija:sticky_movestone" then if node.name=="jeija:sticky_movestone" then
local direction=jeija_get_movestone_direction({x=pos.x, y=pos.y, z=pos.z}) local direction=jeija_get_movestone_direction({x=pos.x, y=pos.y, z=pos.z})

View File

@ -1,6 +1,7 @@
--TEMPEREST-PLUG --TEMPEREST-PLUG
minetest.register_node("jeija:mesecon_plug", { minetest.register_node("jeija:mesecon_plug", {
description = "Plug",
drawtype = "raillike", drawtype = "raillike",
paramtype = "light", paramtype = "light",
is_ground_content = true, is_ground_content = true,
@ -16,7 +17,7 @@ minetest.register_node("jeija:mesecon_plug", {
mesecon:register_on_signal_on(function(pos, node) mesecon:register_on_signal_on(function(pos, node)
if node.name=="jeija:mesecon_plug" then if node.name=="jeija:mesecon_plug" then
local set_node_on = function(pos) local set_node_on = function(pos)
node = minetest.env:get_node(pos) local node = minetest.env:get_node(pos)
if node.name=="jeija:mesecon_socket_off" then if node.name=="jeija:mesecon_socket_off" then
minetest.env:add_node(pos, {name="jeija:mesecon_socket_on"}) minetest.env:add_node(pos, {name="jeija:mesecon_socket_on"})
nodeupdate(pos) nodeupdate(pos)
@ -28,16 +29,16 @@ mesecon:register_on_signal_on(function(pos, node)
end end
end end
lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away local lnode = minetest.env:get_node({x=pos.x-1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z}) end if lnode.name=="air" then set_node_on({x=pos.x-2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away local lnode = minetest.env:get_node({x=pos.x+1, y=pos.y, z=pos.z}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end if lnode.name=="air" then set_node_on({x=pos.x+2, y=pos.y, z=pos.z}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z-1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z-2}) end
lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away local lnode = minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z+1}) --a node between this node and the one two nodes away
if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z+2}) end if lnode.name=="air" then set_node_on({x=pos.x, y=pos.y, z=pos.z+2}) end
end end
end) end)
@ -113,6 +114,7 @@ minetest.register_craft({
--TEMPEREST-SOCKET --TEMPEREST-SOCKET
minetest.register_node("jeija:mesecon_socket_off", { minetest.register_node("jeija:mesecon_socket_off", {
description = "Socket",
drawtype = "raillike", drawtype = "raillike",
paramtype = "light", paramtype = "light",
is_ground_content = true, is_ground_content = true,
@ -136,7 +138,7 @@ minetest.register_node("jeija:mesecon_socket_on", {
selection_box = { selection_box = {
type = "fixed", type = "fixed",
}, },
dug_item='node "jeija:mesecon_socket_off" 1', drop='node "jeija:mesecon_socket_off" 1',
}) })
minetest.register_on_dignode( minetest.register_on_dignode(
@ -162,6 +164,7 @@ minetest.register_craft({
--TEMPEREST-INVERTER --TEMPEREST-INVERTER
minetest.register_node("jeija:mesecon_inverter_off", { minetest.register_node("jeija:mesecon_inverter_off", {
description = "Inverter",
drawtype = "raillike", drawtype = "raillike",
paramtype = "light", paramtype = "light",
is_ground_content = true, is_ground_content = true,
@ -185,7 +188,7 @@ minetest.register_node("jeija:mesecon_inverter_on", {
selection_box = { selection_box = {
type = "fixed", type = "fixed",
}, },
dug_item='node "jeija:mesecon_inverter_off" 1', drop='node "jeija:mesecon_inverter_off" 1',
}) })
minetest.register_on_dignode( minetest.register_on_dignode(

View File

@ -1,19 +1,3 @@
-- IC
minetest.register_craftitem("jeija:ic", {
image = "jeija_ic.png",
on_place_on_ground = minetest.craftitem_place_item,
description="IC",
})
minetest.register_craft({
output = 'craft "jeija:ic" 2',
recipe = {
{'craft "jeija:silicon"', 'craft "jeija:silicon"', 'node "jeija:mesecon_off"'},
{'craft "jeija:silicon"', 'craft "jeija:silicon"', 'node "jeija:mesecon_off"'},
{'node "jeija:mesecon_off"', 'node "jeija:mesecon_off"', ''},
}
})
--COMMON WIRELESS FUNCTIONS --COMMON WIRELESS FUNCTIONS
function mesecon:read_wlre_from_file() function mesecon:read_wlre_from_file()
@ -170,7 +154,7 @@ minetest.register_node("jeija:wireless_receiver_on", {
tile_images = {"jeija_wireless_receiver_tb_on.png", "jeija_wireless_receiver_tb_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png"}, tile_images = {"jeija_wireless_receiver_tb_on.png", "jeija_wireless_receiver_tb_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png", "jeija_wireless_receiver_on.png"},
inventory_image = minetest.inventorycube("jeija_wireless_receiver_on.png"), inventory_image = minetest.inventorycube("jeija_wireless_receiver_on.png"),
material = minetest.digprop_constanttime(0.8), material = minetest.digprop_constanttime(0.8),
dug_item = 'node "jeija:wireless_receiver_off" 1', drop = 'jeija:wireless_receiver_off',
description="Wireless Receiver", description="Wireless Receiver",
}) })
@ -231,7 +215,7 @@ minetest.register_node("jeija:wireless_inverter_off", {
tile_images = {"jeija_wireless_inverter_tb.png", "jeija_wireless_inverter_tb.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png"}, tile_images = {"jeija_wireless_inverter_tb.png", "jeija_wireless_inverter_tb.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png", "jeija_wireless_inverter_off.png"},
inventory_image = minetest.inventorycube("jeija_wireless_inverter_off.png"), inventory_image = minetest.inventorycube("jeija_wireless_inverter_off.png"),
material = minetest.digprop_constanttime(0.8), material = minetest.digprop_constanttime(0.8),
dug_item = 'node "jeija:wireless_inverter_on" 1', drop = 'jeija:wireless_inverter_on',
description="Wireless Inverter", description="Wireless Inverter",
}) })
@ -243,11 +227,11 @@ minetest.register_node("jeija:wireless_inverter_on", {
}) })
minetest.register_craft({ minetest.register_craft({
output = 'node "jeija:wireless_inverter_off" 2', output = '"jeija:wireless_inverter_off" 2',
recipe = { recipe = {
{'', 'craft "default:steel_ingot"', ''}, {'', 'default:steel_ingot', ''},
{'craft "jeija:ic"', 'node "jeija:mesecon_off"', 'craft "jeija:ic"'}, {'jeija:ic', 'jeija:mesecon_off', 'jeija:ic'},
{'', 'node "jeija:mesecon_off"', ''}, {'', 'jeija:mesecon_off', ''},
} }
}) })
@ -305,11 +289,11 @@ minetest.register_node("jeija:wireless_transmitter_off", {
}) })
minetest.register_craft({ minetest.register_craft({
output = 'node "jeija:wireless_transmitter_off" 2', output = '"jeija:wireless_transmitter_off" 2',
recipe = { recipe = {
{'craft "default:steel_ingot"', 'node "jeija:mesecon_off"', 'craft "default:steel_ingot"'}, {'default:steel_ingot', 'jeija:mesecon_off', 'default:steel_ingot'},
{'', 'node "jeija:mesecon_off"', ''}, {'', 'jeija:mesecon_off', ''},
{'', 'craft "jeija:ic"', ''}, {'', 'jeija:ic', ''},
} }
}) })