mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-25 01:40:18 +01:00
Fix most of the namespace pollutions reported in #311
This commit is contained in:
parent
7415036f5b
commit
c2e3d7c4e5
@ -47,7 +47,8 @@ elseif i == 2 then delaytime = 0.3
|
|||||||
elseif i == 3 then delaytime = 0.5
|
elseif i == 3 then delaytime = 0.5
|
||||||
elseif i == 4 then delaytime = 1.0 end
|
elseif i == 4 then delaytime = 1.0 end
|
||||||
|
|
||||||
boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
local boxes = {
|
||||||
|
{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
||||||
|
|
||||||
{ -2/16, -7/16, -4/16, 2/16, -26/64, -3/16 }, -- the jeweled "on" indicator
|
{ -2/16, -7/16, -4/16, 2/16, -26/64, -3/16 }, -- the jeweled "on" indicator
|
||||||
{ -3/16, -7/16, -3/16, 3/16, -26/64, -2/16 },
|
{ -3/16, -7/16, -3/16, 3/16, -26/64, -2/16 },
|
||||||
@ -57,7 +58,8 @@ boxes = {{ -6/16, -8/16, -6/16, 6/16, -7/16, 6/16 }, -- the main slab
|
|||||||
|
|
||||||
{ -6/16, -7/16, -6/16, -4/16, -27/64, -4/16 }, -- the timer indicator
|
{ -6/16, -7/16, -6/16, -4/16, -27/64, -4/16 }, -- the timer indicator
|
||||||
{ -8/16, -8/16, -1/16, -6/16, -7/16, 1/16 }, -- the two wire stubs
|
{ -8/16, -8/16, -1/16, -6/16, -7/16, 1/16 }, -- the two wire stubs
|
||||||
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }}
|
{ 6/16, -8/16, -1/16, 8/16, -7/16, 1/16 }
|
||||||
|
}
|
||||||
|
|
||||||
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), {
|
||||||
description = "Delayer",
|
description = "Delayer",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function crossover_get_rules(node)
|
local function crossover_get_rules(node)
|
||||||
return {
|
return {
|
||||||
{--first wire
|
{--first wire
|
||||||
{x=-1,y=0,z=0},
|
{x=-1,y=0,z=0},
|
||||||
|
@ -54,7 +54,7 @@ local function update_gate(pos, node, link, newstate)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function register_gate(name, inputnumber, assess, recipe)
|
local function register_gate(name, inputnumber, assess, recipe)
|
||||||
local get_inputrules = inputnumber == 2 and gate_get_input_rules_twoinputs or
|
local get_inputrules = inputnumber == 2 and gate_get_input_rules_twoinputs or
|
||||||
gate_get_input_rules_oneinput
|
gate_get_input_rules_oneinput
|
||||||
local description = "Mesecons Logic Gate: "..name
|
local description = "Mesecons Logic Gate: "..name
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
function insulated_wire_get_rules(node)
|
local function insulated_wire_get_rules(node)
|
||||||
local rules = {{x = 1, y = 0, z = 0},
|
local rules = {{x = 1, y = 0, z = 0},
|
||||||
{x =-1, y = 0, z = 0}}
|
{x =-1, y = 0, z = 0}}
|
||||||
if node.param2 == 1 or node.param2 == 3 then
|
if node.param2 == 1 or node.param2 == 3 then
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
-- A lamp is "is an electrical device used to create artificial light" (wikipedia)
|
-- A lamp is "is an electrical device used to create artificial light" (wikipedia)
|
||||||
-- guess what?
|
-- guess what?
|
||||||
|
|
||||||
mesecon_lamp_box = {
|
local mesecon_lamp_box = {
|
||||||
type = "wallmounted",
|
type = "wallmounted",
|
||||||
wall_top = {-0.3125,0.375,-0.3125,0.3125,0.5,0.3125},
|
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_bottom = {-0.3125,-0.5,-0.3125,0.3125,-0.375,0.3125},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
-- Get mesecon rules of pistons
|
-- Get mesecon rules of pistons
|
||||||
piston_rules =
|
local piston_rules = {
|
||||||
{{x=0, y=0, z=1}, --everything apart from z- (pusher side)
|
{x=0, y=0, z=1}, --everything apart from z- (pusher side)
|
||||||
{x=1, y=0, z=0},
|
{x=1, y=0, z=0},
|
||||||
{x=-1, y=0, z=0},
|
{x=-1, y=0, z=0},
|
||||||
{x=1, y=1, z=0},
|
{x=1, y=1, z=0},
|
||||||
@ -8,29 +8,32 @@ piston_rules =
|
|||||||
{x=-1, y=1, z=0},
|
{x=-1, y=1, z=0},
|
||||||
{x=-1, y=-1, z=0},
|
{x=-1, y=-1, z=0},
|
||||||
{x=0, y=1, z=1},
|
{x=0, y=1, z=1},
|
||||||
{x=0, y=-1, z=1}}
|
{x=0, y=-1, z=1}
|
||||||
|
}
|
||||||
|
|
||||||
local piston_up_rules =
|
local piston_up_rules = {
|
||||||
{{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
|
{x=0, y=0, z=-1}, --everything apart from y+ (pusher side)
|
||||||
{x=1, y=0, z=0},
|
{x=1, y=0, z=0},
|
||||||
{x=-1, y=0, z=0},
|
{x=-1, y=0, z=0},
|
||||||
{x=0, y=0, z=1},
|
{x=0, y=0, z=1},
|
||||||
{x=1, y=-1, z=0},
|
{x=1, y=-1, z=0},
|
||||||
{x=-1, y=-1, z=0},
|
{x=-1, y=-1, z=0},
|
||||||
{x=0, y=-1, z=1},
|
{x=0, y=-1, z=1},
|
||||||
{x=0, y=-1, z=-1}}
|
{x=0, y=-1, z=-1}
|
||||||
|
}
|
||||||
|
|
||||||
local piston_down_rules =
|
local piston_down_rules = {
|
||||||
{{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
|
{x=0, y=0, z=-1}, --everything apart from y- (pusher side)
|
||||||
{x=1, y=0, z=0},
|
{x=1, y=0, z=0},
|
||||||
{x=-1, y=0, z=0},
|
{x=-1, y=0, z=0},
|
||||||
{x=0, y=0, z=1},
|
{x=0, y=0, z=1},
|
||||||
{x=1, y=1, z=0},
|
{x=1, y=1, z=0},
|
||||||
{x=-1, y=1, z=0},
|
{x=-1, y=1, z=0},
|
||||||
{x=0, y=1, z=1},
|
{x=0, y=1, z=1},
|
||||||
{x=0, y=1, z=-1}}
|
{x=0, y=1, z=-1}
|
||||||
|
}
|
||||||
|
|
||||||
local piston_get_rules = function (node)
|
local function piston_get_rules(node)
|
||||||
local rules = piston_rules
|
local rules = piston_rules
|
||||||
for i = 1, node.param2 do
|
for i = 1, node.param2 do
|
||||||
rules = mesecon.rotate_rules_left(rules)
|
rules = mesecon.rotate_rules_left(rules)
|
||||||
@ -38,7 +41,7 @@ local piston_get_rules = function (node)
|
|||||||
return rules
|
return rules
|
||||||
end
|
end
|
||||||
|
|
||||||
piston_facedir_direction = function (node)
|
local function piston_facedir_direction(node)
|
||||||
local rules = {{x = 0, y = 0, z = -1}}
|
local rules = {{x = 0, y = 0, z = -1}}
|
||||||
for i = 1, node.param2 do
|
for i = 1, node.param2 do
|
||||||
rules = mesecon.rotate_rules_left(rules)
|
rules = mesecon.rotate_rules_left(rules)
|
||||||
@ -46,7 +49,7 @@ piston_facedir_direction = function (node)
|
|||||||
return rules[1]
|
return rules[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
piston_get_direction = function(dir, node)
|
local function piston_get_direction(dir, node)
|
||||||
if type(dir) == "function" then
|
if type(dir) == "function" then
|
||||||
return dir(node)
|
return dir(node)
|
||||||
else
|
else
|
||||||
|
@ -8,7 +8,7 @@ local pp_box_on = {
|
|||||||
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
|
fixed = { -7/16, -8/16, -7/16, 7/16, -7.5/16, 7/16 },
|
||||||
}
|
}
|
||||||
|
|
||||||
pp_on_timer = function (pos, elapsed)
|
local function pp_on_timer(pos, elapsed)
|
||||||
local node = minetest.get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local basename = minetest.registered_nodes[node.name].pressureplate_basename
|
local basename = minetest.registered_nodes[node.name].pressureplate_basename
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ nid_inc = function (nid)
|
|||||||
return i <= 8
|
return i <= 8
|
||||||
end
|
end
|
||||||
|
|
||||||
register_wires = function()
|
local function register_wires()
|
||||||
local nid = {}
|
local nid = {}
|
||||||
while true do
|
while true do
|
||||||
-- Create group specifiction and nodeid string (see note above for details)
|
-- Create group specifiction and nodeid string (see note above for details)
|
||||||
|
Loading…
Reference in New Issue
Block a user