Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ public class SpectateManagerImpl implements Loadable, SpectateManager {
private final Multimap<Arena, SpectatorImpl> arenas = HashMultimap.create();

private Teleport teleport;
@Nullable
private MyPetHook myPet;
@Nullable
private EssentialsHook essentials;

public SpectateManagerImpl(final DuelsPlugin plugin) {
Expand Down Expand Up @@ -139,7 +141,7 @@ public Result startSpectating(@NotNull final Player player, @NotNull final Playe
final MatchImpl match = arena.getMatch();

// Hide from players in match
if (match != null && !essentials.isVanished(player)) {
if (match != null && !(essentials != null && essentials.isVanished(player))) {
match.getAllPlayers()
.stream()
.filter(arenaPlayer -> arenaPlayer.isOnline() && arenaPlayer.canSee(player))
Expand Down Expand Up @@ -224,7 +226,7 @@ public void stopSpectating(final Player player, final SpectatorImpl spectator) {
final MatchImpl match = spectator.getArena().getMatch();

// Show to players in match
if (match != null && !essentials.isVanished(player)) {
if (match != null && !(essentials != null && essentials.isVanished(player))) {
match.getAllPlayers()
.stream()
.filter(Player::isOnline)
Expand Down