Skip to content

Commit

Permalink
chore: move pv try/catch inside vanish integration if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Syrent committed Nov 24, 2024
1 parent 80c63dd commit ee5ff07
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ public interface Platform {
* @return {@code true} if can see, {@code false} if not.
*/
default boolean canSee(@NotNull TabPlayer viewer, @NotNull TabPlayer target) {
try {
if (!VanishIntegration.getHandlers().isEmpty()) {
if (!VanishIntegration.getHandlers().isEmpty()) {
try {
return VanishIntegration.getHandlers().stream().allMatch(integration -> integration.canSee(viewer, target));
} catch (ConcurrentModificationException e) {
// PV error, try again
return canSee(viewer, target);
}
} catch (ConcurrentModificationException e) {
// PV error, try again
return canSee(viewer, target);
}
return !target.isVanished() || viewer.hasPermission(TabConstants.Permission.SEE_VANISHED);
}
Expand Down

0 comments on commit ee5ff07

Please sign in to comment.