2017-01-18 03:57:20 +01:00
digtron = { }
2019-08-25 19:15:50 +02:00
digtron.doc = { } -- TODO: move to doc file
2019-08-21 02:58:32 +02:00
2019-08-31 19:50:51 +02:00
-- A global dictionary is used here so that other substitutions can be added easily by other mods, if necessary
digtron.builder_read_item_substitutions = {
[ " default:torch_ceiling " ] = " default:torch " ,
[ " default:torch_wall " ] = " default:torch " ,
[ " default:dirt_with_grass " ] = " default:dirt " ,
[ " default:dirt_with_grass_footsteps " ] = " default:dirt " ,
[ " default:dirt_with_dry_grass " ] = " default:dirt " ,
[ " default:dirt_with_rainforest_litter " ] = " default:dirt " ,
[ " default:dirt_with_snow " ] = " default:dirt " ,
[ " default:furnace_active " ] = " default:furnace " ,
[ " farming:soil " ] = " default:dirt " ,
[ " farming:soil_wet " ] = " default:dirt " ,
[ " farming:desert_sand_soil " ] = " default:desert_sand " ,
[ " farming:desert_sand_soil_wet " ] = " default:desert_sand " ,
}
2019-08-26 07:49:04 +02:00
-- Sometimes we want builder heads to call an item's "on_place" method, other times we
-- don't want them to. There's no way to tell which situation is best programmatically
-- so we have to rely on whitelists to be on the safe side.
--first exact matches are tested, and the value given in this global table is returned
digtron.builder_on_place_items = {
[ " default:torch " ] = true ,
}
-- Then a string prefix is checked, returning this value. Useful for enabling on_placed on a mod-wide basis.
digtron.builder_on_place_prefixes = {
[ " farming: " ] = true ,
[ " farming_plus: " ] = true ,
[ " crops: " ] = true ,
}
-- Finally, items belonging to group "digtron_on_place" will have their on_place methods called.
2019-08-25 20:33:44 +02:00
digtron.mod_meta = minetest.get_mod_storage ( )
2019-08-17 09:47:16 +02:00
local modpath = minetest.get_modpath ( minetest.get_current_modname ( ) )
2019-08-26 07:49:04 +02:00
dofile ( modpath .. " /config.lua " )
2017-01-22 04:38:19 +01:00
2019-08-26 07:49:04 +02:00
dofile ( modpath .. " /class_fakeplayer.lua " )
2019-08-26 01:16:23 +02:00
digtron.fake_player = DigtronFakePlayer.create ( { x = 0 , y = 0 , z = 0 } , " fake_player " ) -- since we only need one fake player at a time and it doesn't retain useful state, create a global one and just update it as needed.
2019-08-26 07:49:04 +02:00
dofile ( modpath .. " /util_item_place_node.lua " )
2019-08-26 01:16:23 +02:00
2019-08-28 04:23:02 +02:00
dofile ( modpath .. " /geometry.lua " )
2019-08-21 02:58:32 +02:00
dofile ( modpath .. " /entities.lua " )
2019-08-18 07:12:12 +02:00
dofile ( modpath .. " /functions.lua " )
2019-08-17 09:47:16 +02:00
dofile ( modpath .. " /controller.lua " )
dofile ( modpath .. " /nodes/node_misc.lua " )
2019-08-21 09:21:03 +02:00
dofile ( modpath .. " /nodes/node_storage.lua " )
2019-08-26 04:09:09 +02:00
dofile ( modpath .. " /nodes/node_digger.lua " )
2019-09-01 20:49:15 +02:00
dofile ( modpath .. " /nodes/node_builder.lua " )
2019-09-02 22:28:13 +02:00
dofile ( modpath .. " /nodes/node_duplicator.lua " )
2019-09-01 22:25:46 +02:00
dofile ( modpath .. " /nodes/recipes.lua " )
-- digtron group numbers:
-- 1 - generic digtron node, nothing special is done with these. They're just dragged along.
-- 2 - inventory-holding digtron, has a "main" inventory that the digtron can add to and take from.
-- 4 - builder head
-- 5 - fuel-holding digtron, has a "fuel" invetory that the control node can draw fuel items from. Separate from general inventory, nothing gets put here automatically.
-- 6 - holds both fuel and main inventories
-- 7 - holds batteries (RE Battery from technic) to provide clean renewable power
-- 8 - connects to adjacent HV technic cable
-- 9 - connects to pipeworks
2019-09-02 07:33:52 +02:00
-- 10 digger
-- 11 dual-headed digger
-- 12 soft digger
-- 13 dual-headed soft digger