OneLiteFeatherNET / Microtus

Up to date Minestom fork caring about community, code quality & stability
https://wiki.microtus.dev
Other
9 stars 3 forks source link

Add utility method to verify active effects on an entity #97

Closed theEvilReaper closed 3 weeks ago

theEvilReaper commented 3 weeks ago

Proposed changes

The entity class includes methods to add, remove, or retrieve potions, as well as access other relevant data associated with each potion. It also allows for clearing each effect applied to the entity. However, it currently lacks a direct way to check if any effect is active.

While it’s possible to check for effects using the existing method that retrieves all effects from an entity, the newly added shorthand method simplifies this check, reducing line complexity and improving code readability.

To enhance the maintainability of the project, new tests have been added to validate this method, along with additional test cases for other related functionalities.

Note If you want to verify the changes, you need to comment out the GAME_EVENTS enum entry in the Tag class otherwise the test in general will fail (that behaviour should be fixed in the future)

Types of changes

What types of changes does your code introduce to this project? Put an x in the boxes that 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.

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud