minetest-mods / mesecons

Mod for Minetest that adds digital circuitry [=Minecraft redstone]
https://mesecons.net
Other
209 stars 120 forks source link

MineClonia/MineClone compatibility #650

Closed nonfreegithub closed 1 month ago

nonfreegithub commented 1 year ago

These Mesecons mods are compatible with MineClonia/MineClone:

you can install MineClonia/Mineclone and activate these mods and you will see that they work well except because the blocks cannot be dug.

the other Mesecons mods create conflict with MCL mods and it is difficult to make them compatible because MCL game already has forks of these mods.

dig groups are the problem.

It is simple to allow to dig these blocks in MCL simply by adding:

to: groups = { ... , handy=1, pickaxey=1}

and params:

minetest.register_node("... ", {
...
_mcl_blast_resistance = 1,
_mcl_hardness = 0.7,
...
})

If you prefer I can do it by sending a PR, it does not create conflict with MTG

sfan5 commented 1 year ago

because Mineclone game already has forks of these mods.

We can't fix this, can we?

dig groups are the problem. and params:

This could be made portable in a way similar to how mesecons_gamecompat works.

nonfreegithub commented 1 year ago

We can't fix this, can we?

This could be made portable in a way similar to how mesecons_gamecompat works.

Mmm maybe with

if minetest.get_modpath("mcl_core") then
minetest.override_item(item1, item2)
end
qupid2 commented 7 months ago

You get mesecons_gates, _insulated, _extrawires and _lamp to work in mineclone2 by adding 2 removed functions into ITEMS/REDSTONE/mesecones/util.lua (just unselect the mesecones.mesecones submodule after adding other submodules).

if default == nil then
    -- needed bh mesecons_gates and mesecons_insulated

    -- Returns a rules getter function that returns different rules depending on the node's horizontal rotation.
    -- If param2 % 4 == 0, then the rules returned by the getter are a copy of base_rules.
    function mesecon.horiz_rules_getter(base_rules)
        local rotations = {mesecon.tablecopy(base_rules)}
        for i = 2, 4 do
            local right_rules = rotations[i - 1]
            if not right_rules[1] or right_rules[1].x then
                -- flat rules
                rotations[i] = mesecon.rotate_rules_left(right_rules)
            else
                -- not flat
                rotations[i] = {}
                for j, rules in ipairs(right_rules) do
                    rotations[i][j] = mesecon.rotate_rules_left(rules)
                end
            end
        end
        return function(node)
            return rotations[node.param2 % 4 + 1]
        end
    end

    -- needed by mesecons_extrawires

    -- Merges two tables, with entries from `replacements` taking precedence over
    -- those from `base`. Returns the new table.
    -- Values are deep-copied from either table, keys are referenced.
    -- Numerical indices aren’t handled specially.
    function mesecon.merge_tables(base, replacements)
        local ret = mesecon.tablecopy(replacements) -- these are never overriden so have to be copied in any case
        for k, v in pairs(base) do
            if ret[k] == nil then -- it could be `false`
                ret[k] = mesecon.tablecopy(v)
            end
        end
        return ret
    end    

end