mirror of
https://github.com/theFox6/microexpansion.git
synced 2024-11-22 15:13:51 +01:00
fix lots of bugs
This commit is contained in:
parent
5b2a830a6e
commit
a47336ae3e
4
init.lua
4
init.lua
@ -24,6 +24,8 @@ end
|
|||||||
|
|
||||||
-- Load API
|
-- Load API
|
||||||
dofile(modpath.."/api.lua")
|
dofile(modpath.."/api.lua")
|
||||||
|
-- Machine Registration
|
||||||
|
dofile(modpath.."/register.lua")
|
||||||
|
|
||||||
-------------------
|
-------------------
|
||||||
----- MODULES -----
|
----- MODULES -----
|
||||||
@ -72,8 +74,6 @@ function microexpansion.require_module(name)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
microexpansion.require_module("power")
|
|
||||||
|
|
||||||
for name,enabled in pairs(settings) do
|
for name,enabled in pairs(settings) do
|
||||||
if enabled ~= false then
|
if enabled ~= false then
|
||||||
microexpansion.load_module(name)
|
microexpansion.load_module(name)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
shared = true
|
shared = true
|
||||||
network = true
|
network = true
|
||||||
power = true
|
power = false
|
||||||
storage = true
|
storage = true
|
||||||
ores = true
|
ores = true
|
||||||
|
@ -9,6 +9,5 @@ me.power = {}
|
|||||||
-- Load Resources
|
-- Load Resources
|
||||||
|
|
||||||
dofile(path.."/network.lua") -- Network Management
|
dofile(path.."/network.lua") -- Network Management
|
||||||
dofile(path.."/register.lua") -- Machine Registration
|
|
||||||
--dofile(path.."/ctrl.lua") -- Controller/wires
|
--dofile(path.."/ctrl.lua") -- Controller/wires
|
||||||
dofile(path.."/gen.lua") -- Generators
|
dofile(path.."/gen.lua") -- Generators
|
||||||
|
@ -17,6 +17,8 @@ local function load_drives()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
]]
|
]]
|
||||||
|
else
|
||||||
|
netdrives = {}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -167,12 +167,12 @@ microexpansion.register_node("term", {
|
|||||||
},
|
},
|
||||||
after_place_node = pipeworks_enabled and pipeworks.after_place,
|
after_place_node = pipeworks_enabled and pipeworks.after_place,
|
||||||
after_dig_node = pipeworks_enabled and pipeworks.after_dig,
|
after_dig_node = pipeworks_enabled and pipeworks.after_dig,
|
||||||
on_receive_fields = function(pos, _, fields, sender)
|
on_receive_fields = function(pos, _, fields, sender)
|
||||||
local net,cp = me.get_connected_network(pos)
|
local net,cp = me.get_connected_network(pos)
|
||||||
if net then
|
if net then
|
||||||
if cp then
|
if cp then
|
||||||
minetest.log("none","network and ctrl_pos")
|
minetest.log("info","network and ctrl_pos")
|
||||||
else
|
else
|
||||||
minetest.log("warning","network but no ctrl_pos")
|
minetest.log("warning","network but no ctrl_pos")
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
-- power/register.lua
|
-- register.lua
|
||||||
|
|
||||||
--[[ Machine Registration API ]]
|
--[[ Machine Registration API ]]
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ function me.register_machine(itemstring, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Trace Network
|
-- Trace Network
|
||||||
power.trace(pos)
|
--power.trace(pos)
|
||||||
|
|
||||||
-- Set demand
|
-- Set demand
|
||||||
if def.demand then
|
if def.demand then
|
||||||
@ -37,7 +37,9 @@ function me.register_machine(itemstring, def)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if type(def.machine) == "table" then
|
if type(def.machine) == "table" then
|
||||||
power.add_machine(pos, def.machine)
|
if power then
|
||||||
|
power.add_machine(pos, def.machine)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Set on_destruct
|
-- Set on_destruct
|
||||||
@ -55,7 +57,7 @@ function me.register_machine(itemstring, def)
|
|||||||
-- Remove item from network
|
-- Remove item from network
|
||||||
me.network_remove(pos)
|
me.network_remove(pos)
|
||||||
-- Retrace Network
|
-- Retrace Network
|
||||||
power.trace(pos)
|
--power.trace(pos)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Set connects_to
|
-- Set connects_to
|
Loading…
Reference in New Issue
Block a user