mirror of
https://github.com/minetest-mods/digtron.git
synced 2025-01-03 09:37:27 +01:00
add builder read substitutions dictionary
This commit is contained in:
parent
576aeeade0
commit
d66cbc2164
16
init.lua
16
init.lua
@ -4,6 +4,22 @@ digtron.auto_controller_colorize = "#88000030"
|
||||
digtron.pusher_controller_colorize = "#00880030"
|
||||
digtron.soft_digger_colorize = "#88880030"
|
||||
|
||||
-- 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",
|
||||
}
|
||||
|
||||
dofile( minetest.get_modpath( "digtron" ) .. "/config.lua" )
|
||||
dofile( minetest.get_modpath( "digtron" ) .. "/util.lua" )
|
||||
dofile( minetest.get_modpath( "digtron" ) .. "/doc.lua" )
|
||||
|
@ -175,7 +175,8 @@ minetest.register_node("digtron:builder", {
|
||||
if target_node.name ~= "air" and minetest.get_item_group(target_node.name, "digtron") == 0 then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local inv = meta:get_inventory()
|
||||
inv:set_stack("main", 1, target_node.name)
|
||||
local target_name = digtron.builder_read_item_substitutions[target_node.name] or target_node.name
|
||||
inv:set_stack("main", 1, target_name)
|
||||
meta:set_int("build_facing", target_node.param2)
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user