Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatability w/ WIP moreblocks/stairsplus #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions compat/stairsplus.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
local r = replacer
if not r.has_stairsplus then return end

local S = replacer.S
local function add_circular_saw_recipe(node_name, _, recipes)
local basic_node_name = stairsplus.api.get_node_of_shaped_node(node_name)
if not basic_node_name then return end

-- node found that fits into the saw
recipes[#recipes + 1] = {
method = S('sawing'),
type = 'saw',
items = { basic_node_name },
output = node_name
}
end -- add_circular_saw_recipe


-- for replacer
r.register_set_enabler(function(node)
return node and stairsplus.api.get_node_of_shaped_node(node.name)
end)


-- for inspection tool
r.register_craft_method('saw', 'moreblocks:circular_saw', add_circular_saw_recipe)

3 changes: 3 additions & 0 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ replacer.has_circular_saw = minetest.get_modpath('moreblocks')
and minetest.global_exists('moreblocks')
and minetest.global_exists('circular_saw')
and circular_saw.names
replacer.has_stairsplus = minetest.get_modpath('stairsplus')
and minetest.global_exists('stairsplus')
and stairsplus.api
replacer.has_colormachine_mod = minetest.get_modpath('colormachine')
and minetest.global_exists('colormachine')
replacer.has_technic_mod = minetest.get_modpath('technic')
Expand Down
2 changes: 1 addition & 1 deletion mod.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = replacer
description = Replacement tool for creative building and tool to inspect nodes.
depends = default
optional_depends = colormachine, dye, moreblocks, technic, unifieddyes
optional_depends = colormachine, dye, moreblocks, stairsplus, technic, unifieddyes