Spying twice in a row will no longer cause you to get stuck.

This commit is contained in:
Brianna 2020-06-04 09:52:43 -05:00
parent 0f64daeb5b
commit d43cbe2b46

View File

@ -27,8 +27,8 @@ public class CommandSpy extends AbstractCommand {
public static void spy(OfflinePlayer oPlayer, Player senderP) {
UltimateModeration instance = UltimateModeration.getInstance();
if (isSpying(senderP) && oPlayer == null) {
CommandSpy.Spy spyingEntry = CommandSpy.getSpying().remove(senderP.getUniqueId());
if (spying.containsKey(senderP) && oPlayer == null) {
Spy spyingEntry = spying.remove(senderP.getUniqueId());
senderP.teleport(spyingEntry.getLastLocation());
if (spyingEntry.isVanishApplied() && CommandVanish.isVanished(senderP))
CommandVanish.vanish(senderP);
@ -82,7 +82,7 @@ public class CommandSpy extends AbstractCommand {
Player senderP = ((Player) sender);
if (args.length == 0) {
if (args.length == 0 || spying.containsKey(senderP.getUniqueId())) {
if (!spying.containsKey(senderP.getUniqueId()))
return ReturnType.SYNTAX_ERROR;
Spy spyingEntry = spying.remove(senderP.getUniqueId());
@ -138,10 +138,6 @@ public class CommandSpy extends AbstractCommand {
return "Allows you to spy on a player.";
}
public static Map<UUID, Spy> getSpying() {
return spying;
}
public static class Spy {
private Location lastLocation;
private boolean vanishApplied;