mt-mods / technic

Technic mod for Minetest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add aliases for old wrench node names

S-S-X opened this issue · comments

commented

See pandorabox-io/pandorabox-mods#1962
And #242

Basically add some legacy.lua with aliases for old wrench picked up nodes.

Also @OgelGames if you were going to actually fix wrench, maybe resolve aliases for new pickups instead of using whatever was given when node was registered...

commented

And maybe make it not register new node for each pickup ever when single item with some metadata is more than enough... still maybe should keep upgrade compatibility.

Also: minetest/minetest#5686

commented

See PR comments, probably should just close this and fix failing tests to ignore legacy stuff.

Also @OgelGames if you were going to actually fix wrench, maybe resolve aliases for new pickups instead of using whatever was given when node was registered...

I think checking minetest.registered_aliases will work for that 👍

And maybe make it not register new node for each pickup ever when single item with some metadata is more than enough...

Yes, there will be no additional nodes or items registered at all, it will instead override after_place_node of the registered nodes.

Also: minetest/minetest#5686

That's been sitting there for over 2 years with a bounty on it 👀

commented

Yes, there will be no additional nodes or items registered at all, it will instead override after_place_node of the registered nodes.

Just having single item even for just backwards compatibility would be good thing to do, there will be picked up items in inventories and those will need some compatibility shim unless keeping all the previous functionality.
I bet you're going to just check metadata for items when placed, if so just keep in mind to allow overriding metadata based placement for node itself (best would probably be some clearly wrench specific marking).

However if you're able to get this forward soon I think nodes added in recent update can be just removed and only older stuff kept or aliased to compatible item.

Also I think some registered items been impossible to pick up using wrench for some time, if there's nodes where situation been like this long enough then I think those could also be just dropped.

I bet you're going to just check metadata for items when placed, if so just keep in mind to allow overriding metadata based placement for node itself (best would probably be some clearly wrench specific marking).

Yep, and there are multiple checks for values in the stored data.

However if you're able to get this forward soon I think nodes added in recent update can be just removed and only older stuff kept or aliased to compatible item.

Well I've already got it functional and backwards compatible (just got a few minor things to work out), so I'll probably be opening a PR tomorrow.

All the nodes will get aliases when being registered, even the new ones, as that's the only way to ensure compatibility for nodes registered outside of the mod.

Also I think some registered items been impossible to pick up using wrench for some time, if there's nodes where situation been like this long enough then I think those could also be just dropped.

Do you know which ones? It would be good to check those if possible.

commented

Do you know which ones? It would be good to check those if possible.

Ones that were registered using legacy aliases, lv grinder being one of nodes that might have this problem (before latest wrench update, idk since when).
Also those aliases will most probably be removed completely and wont exist at all after removed: #244

edit. To extend this answer: any node that were registered with alias were not available for pickup since alias was introduced (nname is never alias because wrench did not resolve aliases):

technic/wrench/init.lua

Lines 136 to 139 in b283cc6

local def = wrench.registered_nodes[nname]
if not def then
return
end

If alias is old enough then it is highly unlikely that there's any picked up nodes anywhere and even if there is those special cases can still easily fix it by themselves.

Some aliased technic nodes for example have not been available for 8 years, how many over 8 years old servers / worlds there's still available?

commented

All the nodes will get aliases when being registered, even the new ones, as that's the only way to ensure compatibility for nodes registered outside of the mod.

Or simply break that compatibility and require aliases to be defined in mods that are registering nodes.

Wrench is still more admin tool than tool for everyone, this should make it bit simpler to enforce upgrading to new system without adding a lot of useless definitions just because it is not known if those will be needed.
That's why it could be best to do now instead of after fixing wrench and making it more reliable.

commented

So all aliases listed in linked PR were between 6 to 8 year old, closed that PR being useless legacy crap that should not be added again or supported in any way directly.

If support for legacy stuff like that is wanted and someone wants to keep useless legacy stuff around then I think BuckarooBanzai's suggestion seems to be best option imo:

Maybe we should rip stuff like that out and put it in a dedicated technic-legacy mod for the more ancient servers

(so far I've not seen any such servers, private or public, if someone is really running one they can ask)

Wrench is still more admin tool than tool for everyone

Not since ac64e0a, which added a setting to allow crafting.

But I realized something that makes this much simpler: it was never even possible to register nodes outside of the mod.