3 Commits

Author SHA1 Message Date
1fd279435c fix crash due nil itemstack (#13)
* fix crashes due nil itemstacks
2023-03-10 21:30:49 +01:00
40b911e184 Prevent warning for accessing missing global (#11) 2022-07-26 22:53:26 -04:00
0724b0dda9 fix and add crafting recipes (#10)
* fix and add crafting recipes

* Update home_vending_machines/crafts.lua

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>

* fix luacheck warning

Co-authored-by: SX <50966843+S-S-X@users.noreply.github.com>
2022-06-29 14:02:38 +02:00
8 changed files with 32 additions and 7 deletions

View File

@ -21,5 +21,5 @@ read_globals = {
"vector", "ItemStack", "dump", "DIR_DELIM", "VoxelArea", "Settings", "PcgRandom", "VoxelManip", "PseudoRandom",
--mod produced
"default", "screwdriver", "unifieddyes", "computers",
"default", "screwdriver", "unifieddyes", "computers", "farming",
}

View File

@ -28,6 +28,7 @@ local function reg_simple(name, def)
end
end,
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
if not itemstack then return end
local pname = clicker:get_player_name()
local iname = itemstack:get_name()
local dpos = vector.add((vector.multiply(minetest.facedir_to_dir(node.param2), -1)), pos)

View File

@ -9,7 +9,7 @@ if minetest.get_modpath("default") then
},
})
end
if minetest.get_modpath("vessel") then
if minetest.get_modpath("vessels") then
minetest.register_craft({
output = "home_vending_machines:drink_machine",
recipe = {
@ -19,7 +19,7 @@ if minetest.get_modpath("default") then
},
})
end
if minetest.get_modpath("farming") then
if minetest.global_exists("farming") and farming.mod == "redo" then
minetest.register_craft({
output = "home_vending_machines:sweet_machine",
recipe = {
@ -29,4 +29,4 @@ if minetest.get_modpath("default") then
},
})
end
end
end

View File

@ -1 +1,2 @@
optional_depends = screwdriver
name = home_vending_machines
optional_depends = screwdriver, default, dye, vessels, farming

View File

@ -61,6 +61,28 @@ minetest.register_node("home_workshop_machines:3dprinter_corexy", {
on_rotate = unifieddyes.fix_after_screwdriver_nsew,
})
if minetest.get_modpath("basic_materials") then
minetest.register_craft({
output = "home_workshop_machines:3dprinter_bedflinger",
recipe = {
{"basic_materials:plastic_sheet", "dye:white", "basic_materials:plastic_sheet"},
{"basic_materials:motor", "basic_materials:heating_element", "basic_materials:motor"},
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
},
})
end
if minetest.get_modpath("basic_materials") then
minetest.register_craft({
output = "home_workshop_machines:3dprinter_corexy",
recipe = {
{"default:steel_ingot", "basic_materials:motor", "basic_materials:plastic_sheet"},
{"default:glass", "basic_materials:heating_element", "default:glass"},
{"default:steel_ingot", "basic_materials:motor", "default:steel_ingot"},
},
})
end
minetest.register_alias("computer:3dprinter_bedflinger", "home_workshop_machines:3dprinter_bedflinger")
minetest.register_alias("computers:3dprinter_bedflinger", "home_workshop_machines:3dprinter_bedflinger")
minetest.register_alias("computer:3dprinter_corexy", "home_workshop_machines:3dprinter_corexy")

View File

@ -1,4 +1,3 @@
name = home_workshop_machines
depends = unifieddyes
optional_depends = default
optional_depends = screwdriver
optional_depends = default, screwdriver, dye, basic_materials

View File

@ -44,6 +44,7 @@ minetest.register_node("home_workshop_misc:beer_tap", {
},
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
local inv = clicker:get_inventory()
if not itemstack then return end
local wieldname = itemstack:get_name()
if wieldname == "vessels:drinking_glass" then

View File

@ -0,0 +1 @@
name = home_workshop_modpack