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

Warnings when loading a mod incompatible with this version of minetest #10336

Open
louisroyer opened this issue Aug 26, 2020 · 5 comments
Open
Labels
Concept approved Approved by a core dev: PRs welcomed! @ Content / PkgMgr Feature request Issues that request the addition or enhancement of a feature @ Mainmenu @ Script API @ Startup / Config / Util UI/UX

Comments

@louisroyer
Copy link

louisroyer commented Aug 26, 2020

Problem

On contentdb help, there is a page (see also the bottom of this page) about min_minetest_version and max_minetest_version tags. These tags are currently not used at all by the engine. They are already used by some mods (mostly min_minetest_version since max_minetest_version should typically be used in mods that are no longer maintained).

Solutions

  • Document these tags in the API (section mod.conf).
  • Raise a warning if the assertion min_minetest_version <= current minetest version <= max_minetest_version is false.
@louisroyer louisroyer added the Feature request Issues that request the addition or enhancement of a feature label Aug 26, 2020
@SmallJoker
Copy link
Member

That would not be fork-friendly. If mods require a certain Minetest version, they can check against the API features using minetest.features or the existence of a particular function.

@MoNTE48
Copy link
Contributor

MoNTE48 commented Aug 26, 2020

@SmallJoker, who cares about forks here?)
I think that API Level could be an alternative, for example. Fork has version 1.1.1, and Minetest API Level 3, which corresponds to Minetest 5.4.

@louisroyer
Copy link
Author

Maybe not something as strong as raising a warning, but at least printing to the user in the mod selection panel, that this mod will probably be broken (it is more an information than a constraint). I agree that mods should check against the existence of functions, it's just that some mods are almost guaranteed to be broken when using an older minetest version (since the modder indicated it in mod.conf) and it is not even worth for the user to enable them. Forks could just disable this display via a compilation option…

@HybridDog
Copy link
Contributor

Mods could have an on_enable.lua file which is executed in the main menu when somebody enables the mod there. Modders can then use this script to show a warning if some new feature is missing for this mod. This script should be lightweight, so it should not install or download something for the mod.

@rubenwardy
Copy link
Member

rubenwardy commented Mar 24, 2023

ContentDB supports min_minetest_version and max_minetest_version in mod.conf for this purpose. The patch is ignored, only the MAJOR.MINOR is used.

To support forks, ContentDB also uses the protocol_version to find the matching Minetest version - but this is in the package API, and not in the mod.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Concept approved Approved by a core dev: PRs welcomed! @ Content / PkgMgr Feature request Issues that request the addition or enhancement of a feature @ Mainmenu @ Script API @ Startup / Config / Util UI/UX
Projects
None yet
Development

No branches or pull requests

6 participants