The Minestom testing module allows for the creation of tests that interact with specific parts of the server. However, its handling has some issues. For example, when you unregister an instance with players in it an exception is thrown. The players are not unregistered by default. Additionally, when creating a player, a position is required even in cases where it is unnecessary; a default value should be used instead.
This pull request aims to achieve the following goals:
Add a player creation method that does not require a position, using a default value instead.
Modify the instance unregistration method to include an option to remove all players from the instance, preventing an exception from being thrown.
Note: This pull request does not break existing tests. The new methods are additions that do not change existing behavior. Users can choose to remove players from an instance or specify a specific position when creating a player.
Types of changes
What types of changes does your code introduce to this project?
Put an x in the boxes that apply
[ ] Bugfix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[x] Documentation Update (if none of the other choices apply)
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of
them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before
merging your code.
[x] I have read the CONTRIBUTING.md
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have added necessary documentation (if appropriate)
Proposed changes
The Minestom testing module allows for the creation of tests that interact with specific parts of the server. However, its handling has some issues. For example, when you unregister an instance with players in it an exception is thrown. The players are not unregistered by default. Additionally, when creating a player, a position is required even in cases where it is unnecessary; a default value should be used instead.
This pull request aims to achieve the following goals:
Add a player creation method that does not require a position, using a default value instead. Modify the instance unregistration method to include an option to remove all players from the instance, preventing an exception from being thrown.
Note: This pull request does not break existing tests. The new methods are additions that do not change existing behavior. Users can choose to remove players from an instance or specify a specific position when creating a player.
Types of changes
What types of changes does your code introduce to this project? Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.