forked from mrkubax10/industrialtest
More code clean up and missing craftings
This commit is contained in:
parent
fe0b6b97cd
commit
5fc2fb9440
@ -19,12 +19,11 @@ local S=minetest.get_translator("industrialtest")
|
|||||||
local mtgAvailable=minetest.get_modpath("default")
|
local mtgAvailable=minetest.get_modpath("default")
|
||||||
local mclAvailable=minetest.get_modpath("mcl_core")
|
local mclAvailable=minetest.get_modpath("mcl_core")
|
||||||
|
|
||||||
industrialtest={}
|
|
||||||
industrialtest.elementKeys={}
|
industrialtest.elementKeys={}
|
||||||
|
|
||||||
-- compatibilty that adds not existing elements
|
-- compatibilty that adds not existing elements
|
||||||
if mclAvailable then
|
if mclAvailable then
|
||||||
local function registerMineral(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness)
|
industrialtest.registerMineral=function(name,displayName,oreBlastResistance,oreHardness,rawBlockBlastResistance,rawBlockHardness,blockBlastResistance,blockHardness)
|
||||||
minetest.register_craftitem("industrialtest:raw_"..name,{
|
minetest.register_craftitem("industrialtest:raw_"..name,{
|
||||||
description=S("Raw "..displayName),
|
description=S("Raw "..displayName),
|
||||||
inventory_image="industrialtest_mcl_raw_"..name..".png"
|
inventory_image="industrialtest_mcl_raw_"..name..".png"
|
||||||
@ -83,9 +82,33 @@ if mclAvailable then
|
|||||||
{"industrialtest:"..name.."_ingot","industrialtest:"..name.."_ingot","industrialtest:"..name.."_ingot"}
|
{"industrialtest:"..name.."_ingot","industrialtest:"..name.."_ingot","industrialtest:"..name.."_ingot"}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shaped",
|
||||||
|
output="industrialtest:raw_"..name.."_block",
|
||||||
|
recipe={
|
||||||
|
{"industrialtest:raw_"..name,"industrialtest:raw_"..name,"industrialtest:raw_"..name},
|
||||||
|
{"industrialtest:raw_"..name,"industrialtest:raw_"..name,"industrialtest:raw_"..name},
|
||||||
|
{"industrialtest:raw_"..name,"industrialtest:raw_"..name,"industrialtest:raw_"..name}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shapeless",
|
||||||
|
output="industrialtest:"..name.."_ingot 9",
|
||||||
|
recipe={
|
||||||
|
"industrialtest:"..name.."_block"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_craft({
|
||||||
|
type="shapeless",
|
||||||
|
output="industrialtest:raw_"..name.." 9",
|
||||||
|
recipe={
|
||||||
|
"industrialtest:raw_"..name.."_block"
|
||||||
|
}
|
||||||
|
})
|
||||||
end
|
end
|
||||||
-- register required minerals that are not available in MCL
|
-- register required minerals that are not available in MCL
|
||||||
registerMineral("tin","Tin",3,3)
|
industrialtest.registerMineral("tin","Tin",3,3)
|
||||||
|
industrialtest.elementKeys.tinIngot="industrialtest:tin_ingot"
|
||||||
|
|
||||||
-- register ore generation
|
-- register ore generation
|
||||||
local stonelike={"mcl_core:stone","mcl_core:diorite","mcl_core:andesite","mcl_core:granite"}
|
local stonelike={"mcl_core:stone","mcl_core:diorite","mcl_core:andesite","mcl_core:granite"}
|
||||||
|
4
init.lua
4
init.lua
@ -17,5 +17,9 @@
|
|||||||
MODNAME="industrialtest"
|
MODNAME="industrialtest"
|
||||||
local modpath=minetest.get_modpath(MODNAME)
|
local modpath=minetest.get_modpath(MODNAME)
|
||||||
|
|
||||||
|
-- table with global functions, variables etc
|
||||||
|
industrialtest={}
|
||||||
|
|
||||||
-- load other lua files
|
-- load other lua files
|
||||||
dofile(modpath.."/compatibility.lua")
|
dofile(modpath.."/compatibility.lua")
|
||||||
|
dofile(modpath.."/minerals.lua")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user