mirror of
https://github.com/songoda/UltimateModeration.git
synced 2024-11-22 18:26:10 +01:00
Spying twice in a row will no longer cause you to get stuck.
This commit is contained in:
parent
0f64daeb5b
commit
d43cbe2b46
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user