2016-04-02 14:29:50 +02:00
-- BASIC_MACHINES: lightweight automation mod for minetest
-- minetest 0.4.14
-- (c) 2015-2016 rnd
2016-04-02 14:32:38 +02:00
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
2015-10-19 11:26:09 +02:00
basic_machines = { } ;
2015-10-29 17:11:01 +01:00
2016-04-02 09:55:28 +02:00
2018-06-16 14:58:45 +02:00
2015-09-29 12:20:14 +02:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /mark.lua " ) -- used for markings, borrowed and adapted from worldedit mod
2016-04-26 12:13:02 +02:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /mover.lua " ) -- mover, detector, keypad, distributor
2016-04-02 09:55:28 +02:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /technic_power.lua " ) -- technic power for mover
2016-12-04 23:37:57 +01:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /recycler.lua " ) -- recycle old used tools
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /grinder.lua " ) -- grind materials into dusts
2016-02-28 13:16:15 +01:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /autocrafter.lua " ) -- borrowed and adapted from pipeworks mod
2016-12-04 23:37:57 +01:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /constructor.lua " ) -- enable crafting of all machines
2016-05-12 12:23:42 +02:00
2016-12-04 23:37:57 +01:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /protect.lua " ) -- enable interaction with players, adds local on protect/chat event handling
2016-04-14 08:20:42 +02:00
2016-05-07 10:40:25 +02:00
-- OPTIONAL ADDITIONAL STUFF ( comment to disable )
2015-05-01 18:40:54 +02:00
2016-12-04 23:37:57 +01:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /ball.lua " ) -- interactive flying ball, can activate blocks or be used as a weapon
2016-05-07 10:40:25 +02:00
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /enviro.lua " ) -- enviro blocks that can change surrounding enviroment physics, uncomment spawn/join code to change global physics, disabled by default
minetest.after ( 0 , function ( )
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /mesecon_doors.lua " ) -- if you want open/close doors with signal, also steel doors are made impervious to dig through, removal by repeat punch
dofile ( minetest.get_modpath ( " basic_machines " ) .. " /mesecon_lights.lua " ) -- adds ability for other light blocks to toggle light
2015-05-01 18:40:54 +02:00
end )
2015-10-29 17:11:01 +01:00
2016-06-12 20:30:32 +02:00
-- MACHINE PRIVILEGE
minetest.register_privilege ( " machines " , {
description = " Player is expert basic_machine user: his machines work while not present on server, can spawn more than 2 balls at once " ,
} )
2016-03-07 12:29:40 +01:00
-- machines fuel related recipes
2016-03-25 00:16:03 +01:00
-- CHARCOAL
2015-10-29 17:11:01 +01:00
minetest.register_craftitem ( " basic_machines:charcoal " , {
description = " Wood charcoal " ,
2017-12-25 18:34:25 +01:00
inventory_image = " charcoal.png " ,
2015-10-29 17:11:01 +01:00
} )
2016-03-25 00:16:03 +01:00
2015-10-29 17:11:01 +01:00
minetest.register_craft ( {
type = ' cooking ' ,
recipe = " default:tree " ,
cooktime = 30 ,
output = " basic_machines:charcoal " ,
} )
minetest.register_craft ( {
output = " default:coal_lump " ,
recipe = {
{ " basic_machines:charcoal " } ,
{ " basic_machines:charcoal " } ,
}
} )
minetest.register_craft ( {
type = " fuel " ,
recipe = " basic_machines:charcoal " ,
-- note: to make it you need to use 1 tree block for fuel + 1 tree block, thats 2, caloric value 2*30=60
burntime = 40 , -- coal lump has 40, tree block 30, coal block 370 (9*40=360!)
2016-05-12 18:28:58 +02:00
} )
2017-12-28 23:50:23 +01:00
-- add since minetest doesnt have moreores tin ingot recipe
minetest.register_craft ( {
output = " default:tin_ingot " ,
recipe = {
{ " moreores:tin_ingot " } ,
}
} )
2017-12-29 13:09:27 +01:00
-- COMPATIBILITY
minetest.register_alias ( " basic_machines:battery " , " basic_machines:battery_0 " )
2017-12-21 16:14:02 +01:00
print ( " [MOD] basic_machines " .. basic_machines.version .. " loaded. " )