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