Introduce tag system for further usage
This commit is contained in:
parent
636c0cda64
commit
3419fcb660
@ -14,15 +14,17 @@
|
|||||||
-- You should have received a copy of the GNU General Public License
|
-- You should have received a copy of the GNU General Public License
|
||||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
industrialtest.api={}
|
industrialtest.api={
|
||||||
industrialtest.api.maceratorRecipes={}
|
maceratorRecipes={},
|
||||||
industrialtest.api.compressorRecipes={}
|
compressorRecipes={},
|
||||||
industrialtest.api.extractorRecipes={}
|
extractorRecipes={},
|
||||||
industrialtest.api.cableFormerRecipes={}
|
cableFormerRecipes={},
|
||||||
industrialtest.api.geothermalGeneratorFuels={}
|
geothermalGeneratorFuels={},
|
||||||
industrialtest.api.waterMillFuels={}
|
waterMillFuels={},
|
||||||
industrialtest.api.rotaryMaceratorModifiers={}
|
rotaryMaceratorModifiers={},
|
||||||
industrialtest.api.storageCells={}
|
storageCells={},
|
||||||
|
tags={}
|
||||||
|
}
|
||||||
|
|
||||||
industrialtest.api.lvPowerFlow=600
|
industrialtest.api.lvPowerFlow=600
|
||||||
industrialtest.api.mvPowerFlow=2400
|
industrialtest.api.mvPowerFlow=2400
|
||||||
|
@ -16,6 +16,13 @@
|
|||||||
|
|
||||||
local S=minetest.get_translator("industrialtest")
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
|
||||||
|
function industrialtest.api.addTag(name,tag)
|
||||||
|
if not industrialtest.api.tags[tag] then
|
||||||
|
industrialtest.api.tags[tag]={}
|
||||||
|
end
|
||||||
|
table.insert(industrialtest.api.tags[tag],name)
|
||||||
|
end
|
||||||
|
|
||||||
-- \brief Registers dust of certain resource
|
-- \brief Registers dust of certain resource
|
||||||
-- \param name Technical name of resource
|
-- \param name Technical name of resource
|
||||||
-- \param displayName Display name of resource
|
-- \param displayName Display name of resource
|
||||||
|
@ -344,7 +344,7 @@ addPipeworksCompatibility("industrialtest:induction_furnace",{
|
|||||||
},"dst")
|
},"dst")
|
||||||
|
|
||||||
-- Simple electric item processors
|
-- Simple electric item processors
|
||||||
for _,name in ipairs(industrialtest.internal.simpleElectricItemProcessors) do
|
for _,name in ipairs(industrialtest.api.tags.simpleElectricItemProcessor) do
|
||||||
addPipeworksCompatibility(name,{
|
addPipeworksCompatibility(name,{
|
||||||
{
|
{
|
||||||
y=1,
|
y=1,
|
||||||
|
@ -17,8 +17,6 @@
|
|||||||
local machine={}
|
local machine={}
|
||||||
local simpleElectricItemProcessor={}
|
local simpleElectricItemProcessor={}
|
||||||
|
|
||||||
industrialtest.internal.simpleElectricItemProcessors={}
|
|
||||||
|
|
||||||
industrialtest.internal.mclAfterDigNode=function(pos,oldmeta,lists)
|
industrialtest.internal.mclAfterDigNode=function(pos,oldmeta,lists)
|
||||||
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_furnaces/init.lua#L538
|
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_furnaces/init.lua#L538
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
@ -783,5 +781,5 @@ function industrialtest.internal.registerSimpleElectricItemProcessor(config)
|
|||||||
return simpleElectricItemProcessor.activeOnTimer(pos,elapsed,meta,inv,config)
|
return simpleElectricItemProcessor.activeOnTimer(pos,elapsed,meta,inv,config)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
table.insert(industrialtest.internal.simpleElectricItemProcessors,"industrialtest:"..config.name)
|
industrialtest.api.addTag("industrialtest:"..config.name,"simpleElectricItemProcessor")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user