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

support for fluxionary's [moreblocks] fork --> [stairsplus] #54

Open
wants to merge 3 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
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
20240721 * SwissalpS added support for fluxionary's fork of moreblocks --> stairsplus.api
thanks fluxionary, sorry for not doing it the way you PRed.
20240225 * SwissalpS patched a crash situation with multinode-nodes. Thanks frogTheSecond and Huhhila for detecting and reporting.
20221107 * fluxionary fixed typo unkown -> unknown
20220830 * SwissalpS fixed de translation typo. Thanks Niklp09 for reporting.
Expand Down
14 changes: 11 additions & 3 deletions compat/moreblocks.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
-- support circular_saw from moreblocks' and fluxionary's fork
local r = replacer
if not r.has_circular_saw then return end
-- ?? TODO do we need to also check for stairsplus and add it to optional_depends ??
if not (r.has_circular_saw or r.has_stairsplus_mod) then return end

local core_registered_nodes = minetest.registered_nodes
local shapes_list_sorted = nil
Expand Down Expand Up @@ -66,7 +66,12 @@ end -- is_saw_output

local S = replacer.S
local function add_circular_saw_recipe(node_name, _, recipes)
local basic_node_name = is_saw_output(node_name)
local basic_node_name
if r.has_stairsplus_mod then
basic_node_name = stairsplus.api.node_by_shaped_node[node_name]
else
basic_node_name = is_saw_output(node_name)
end
if not basic_node_name then return end

-- node found that fits into the saw
Expand All @@ -81,6 +86,9 @@ end -- add_circular_saw_recipe

-- for replacer
r.register_set_enabler(function(node)
if r.has_stairsplus_mod then
return node and stairsplus.api.node_by_shaped_node[node.name]
end
return node and is_saw_output(node.name)
end)

Expand Down
14 changes: 9 additions & 5 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Copyright (C) 2013 Sokomine
Copyright (C) 2019 coil0
Copyright (C) 2019 HybridDog
Copyright (C) 2019-2022 SwissalpS
Copyright (C) 2019-2024 SwissalpS

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
Expand All @@ -19,23 +19,27 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
--]]

-- Version 4.91 (20220830)
-- Version 4.92 (20240721)

-- Changelog: see CHANGELOG file

replacer = {}
replacer.version = 20240225
replacer.version = 20240721

replacer.has_bakedclay = minetest.get_modpath('bakedclay')
and true or false
replacer.has_basic_dyes = minetest.get_modpath('dye')
and minetest.global_exists('dye')
and dye.basecolors
and dye.basecolors and true or false
replacer.has_circular_saw = minetest.get_modpath('moreblocks')
and minetest.global_exists('moreblocks')
and minetest.global_exists('circular_saw')
and circular_saw.names
and circular_saw.names and true or false
replacer.has_colormachine_mod = minetest.get_modpath('colormachine')
and minetest.global_exists('colormachine')
replacer.has_stairsplus_mod = minetest.get_modpath('stairsplus')
and minetest.global_exists('stairsplus')
and stairsplus.api and true or false
replacer.has_technic_mod = minetest.get_modpath('technic')
and minetest.global_exists('technic')
replacer.has_unifieddyes_mod = minetest.get_modpath('unifieddyes')
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