-
-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(vanish-service): Refactor the vanish service to uuid based #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
452dbb3
refactor(vanish): update player vanish methods to use UUIDs instead o…
theShadowsDust 72ccab0
refactor(vanish): update player vanish methods to use UUIDs instead o…
theShadowsDust e224105
chore(build): Bump runServer minecraft version to 1.21.10 for testing…
theShadowsDust d1a4fa7
refactor(vanish): optimize player visibility handling
theShadowsDust d4a5766
refactor(vanish): add missing documentation
theShadowsDust File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 27 additions & 22 deletions
49
src/main/java/net/onelitefeather/stardust/api/PlayerVanishService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,61 +1,66 @@ | ||
| package net.onelitefeather.stardust.api; | ||
|
|
||
| import org.bukkit.entity.Player; | ||
| import java.util.UUID; | ||
|
|
||
| public interface PlayerVanishService<P extends Player> { | ||
| public interface PlayerVanishService { | ||
|
|
||
| /** | ||
| * Hides a player for other players | ||
| * | ||
| * @param player to be hide | ||
| * @param playerId to be hidden | ||
| */ | ||
| void hidePlayer(P player); | ||
| void hidePlayer(UUID playerId); | ||
|
|
||
| /** | ||
| * Shows a player for other players | ||
| * | ||
| * @param player to be shown to other player | ||
| * @param playerId to be shown to other players | ||
| */ | ||
| void showPlayer(P player); | ||
| void showPlayer(UUID playerId); | ||
|
|
||
| /** | ||
| * Toggle vanish status of a player | ||
| * | ||
| * @param player be affected | ||
| /* | ||
| * @param playerId to be affected | ||
| * @return new vanish state | ||
| */ | ||
| boolean toggle(P player); | ||
| boolean toggle(UUID playerId); | ||
|
|
||
| /** | ||
| * Check if the player in vanish | ||
| * Check if the player is vanished | ||
| * | ||
| * @return the current status | ||
| */ | ||
| boolean isVanished(P player); | ||
| boolean isVanished(UUID playerId); | ||
|
|
||
| /** | ||
| * Set a user explicit the vanish status | ||
| * | ||
| * @param player to be affected | ||
| * @param vanished status of the user | ||
| * @param playerId to be affected | ||
| * @param vanished status of the user | ||
| */ | ||
| void setVanished(P player, boolean vanished); | ||
| void setVanished(UUID playerId, boolean vanished); | ||
|
|
||
| /** | ||
| * Handles if a player joining the server | ||
| * | ||
| * @param player be affected | ||
| * @param playerId to be affected | ||
| * @return true if the player is vanished | ||
| */ | ||
| boolean handlePlayerJoin(P player); | ||
| boolean handlePlayerJoin(UUID playerId); | ||
|
|
||
| /** | ||
| * Handles if a player quits the server | ||
| * | ||
| * @param player be affected | ||
| * @param playerId to be affected | ||
| */ | ||
| void handlePlayerQuit(P player); | ||
| void handlePlayerQuit(UUID playerId); | ||
|
|
||
| boolean canSee(P player, P target); | ||
| boolean canSee(UUID viewerId, UUID targetId); | ||
|
|
||
| boolean isVanishPermitted(P player); | ||
| /** | ||
| * Check if a player has permission to vanish | ||
| * | ||
| * @param playerId to be checked | ||
| * @return true if the player has permission to vanish | ||
| */ | ||
| boolean isVanishPermitted(UUID playerId); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.