Grasscutter icon indicating copy to clipboard operation
Grasscutter copied to clipboard

Add a new command 'unlockmap' to unlock map for players

Open 360NENZ opened this issue 2 years ago • 3 comments

Description

Please carefully read the Contributing note and Code of conduct before making any pull requests. And, Do not make a pull request to merge into stable unless it is a hotfix. Use the development branch instead.

Issues fixed by this PR

Add a new command unlockmap to unlock map for players

Why was this command added? If you are a server owner, your server imitates the official server, and you need to work yourself to obtain materials, and you want to control the permissions of the players, so that they can only unlock the map, and cannot use all commands except unlockmap, because prop command it can not only unlock the map, but also execute other commands, so there is this separate command.

You can also add the permission player.unlockmap in config.json! Like this:

"defaultPermissions": [player.unlockmap]

Features:

  • Unlock map commands independent of props
  • Usage: unlockmap @<UID>
  • Alias: um @<UID>
  • Permission: player.unlockmap (Permission player.unlockmap.others is also required to use on other players)

Type of changes

  • [ ] Bug fix
  • [x] New feature
  • [ ] Enhancement
  • [ ] Documentation

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] My pull request is unique and no other pull requests have been opened for these changes
  • [x] I have read the Contributing note and Code of conduct
  • [x] I am responsible for any copyright issues with my code if it occurs in the future.

360NENZ avatar Dec 20 '22 05:12 360NENZ

However, the command to unlock the map is already exists in SetPropCommand, just use setprop unlockmap <SceneId> . Also, even if you cannot provide translations for all languages, you should add English translations as placeholders for other translation files.

TomyJan avatar Dec 22 '22 12:12 TomyJan

The whole unlocking the map via /prop thing was only made because we once had a working implementation for Statues, which would give the player a way to unlock the map naturally. However, that implementation has broken for some unknown reason ...

So, as an alternative to this new command, I would suggest the following two options: 1.) Figure out why Statues are broken, and fix them. 2.) Make the map unlocked by default again (only the map though, not teleport waypoints).

GanyusLeftHorn avatar Dec 26 '22 18:12 GanyusLeftHorn

You can extract this command from [SetPropCommand]

PDMengQAQ avatar Jan 13 '23 15:01 PDMengQAQ

closing due to inactivity; feel free to reopen/create a new PR with the requested changes if you wish

KingRainbow44 avatar Feb 22 '23 01:02 KingRainbow44