PocketMine-MP
PocketMine-MP copied to clipboard
feat(Server): add a setter for `maxPlayers`
Introduction
This PR allows plugins to modify the server's max players count during runtime
Relevant issues
Changes
API changes
Added Server::setMaxPlayers(int $maxPlayers): void
Behavioural changes
Backwards compatibility
Follow-up
Tests
I tested this PR by doing the following (tick all that apply):
- [ ] Writing PHPUnit tests (commit these in the
tests/phpunit
folder) - [x] Playtesting using a Minecraft client (provide screenshots or a video)
- [x] Writing a test plugin (provide the code and sample output)
- [ ] Other (provide details)
note that this is a BC break, e.g. for plugins that do a SplFixedArray($server->getMaxPlayers())
does anyone do that?
there is no bc break because there is no such plugins that call setMaxPlayers()
rip i was about to make a pr doing this too 🙏