Grasscutter
Grasscutter copied to clipboard
Add a new command 'unlockmap' to unlock map for players
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
(Permissionplayer.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.
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.
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).
You can extract this command from [SetPropCommand]
closing due to inactivity; feel free to reopen/create a new PR with the requested changes if you wish