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

MineClonia/MineClone compatibility #650

Open
nonfreegithub opened this issue Aug 19, 2023 · 3 comments
Open

MineClonia/MineClone compatibility #650

nonfreegithub opened this issue Aug 19, 2023 · 3 comments

Comments

@nonfreegithub
Copy link

nonfreegithub commented Aug 19, 2023

These Mesecons mods are compatible with MineClonia/MineClone:

  • mesecons_powerplant
  • mesecons_blinkyplant
  • mesecons_gamecompat
  • mesecons_fpga
  • mesecons_switch
  • mesecons_hydroturbine
  • mesecons_detector
  • mesecons_materials
  • mesecons_microcontroller
  • mesecons_random
  • mesecons_luacontroller

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
Copy link
Member

sfan5 commented Aug 19, 2023

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
Copy link
Author

nonfreegithub commented Aug 19, 2023

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

@nonfreegithub nonfreegithub changed the title MineClone compatibility MineClonia/MineClone compatibility Sep 24, 2023
@qupid2
Copy link

qupid2 commented Feb 21, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants