Skip to content

provide a minetest.DEFAULT_PHYSICS value #14764

Open
@Zughy

Description

@Zughy

Problem

Different mods might have to rely on what's the server default physics setting (e.g. to restore it), but there's no way to know what default is

Solutions

Provide a minetest.DEFAULT_PHYSICS parameter, so that:

  • some mods can tweak it
  • some others can be informed on what the default value is

If untouched, fields should be equal to the ones inside the documentation

Alternatives

  • Have player:set_physics_override() reset to an internal default value - but that breaks retrocompatibility and it doesn't provide the option to tweak the default value anyway
  • Let a mod do it (but why should mods have a dependency that is just a single table value?)

Additional context

Right now I have to declare things like this https://gitlab.com/zughy-friends-minetest/arena_lib/-/blob/master/IGNOREME/SETTINGS.lua?ref_type=heads#L9 but, since I'm working on another mod that requires exactly the same thing but it's in no way related to the first mod (and yet they must both run), you can smell the air of conflicts approaching. Also, that requires me to update the table every time a new physics override parameter is added

I'm also aware mods like https://content.minetest.net/packages/Wuzzy/playerphysics/ exist, but they can't tackle booleans such as sneak and we're also back again to the mod dependency just to reset physics

Metadata

Metadata

Assignees

No one assigned

    Labels

    @ Script APIFeature requestIssues that request the addition or enhancement of a feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions