From 4e22d92b5e04c6793aabc077df52528d129c50a5 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 5 Jun 2021 03:03:19 +1200 Subject: [PATCH] Fix toggle of self disguises, fixes #566 --- src/main/java/me/libraryaddict/disguise/DisguiseAPI.java | 6 +++--- .../disguise/commands/disguise/DisguiseCommand.java | 2 +- .../disguise/commands/disguise/DisguisePlayerCommand.java | 2 +- .../disguise/commands/disguise/DisguiseRadiusCommand.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java b/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java index 25e4b97c..57317a42 100644 --- a/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java +++ b/src/main/java/me/libraryaddict/disguise/DisguiseAPI.java @@ -184,7 +184,7 @@ public class DisguiseAPI { } // They prefer to have the opposite of whatever the view disguises option is - if (hasSelfDisguisePreference(entity) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewDisguises()) { + if (hasSelfDisguisePreference(entity) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewSelfDisguisesDefault()) { disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible()); } @@ -400,7 +400,7 @@ public class DisguiseAPI { * @return */ public static boolean isViewSelfToggled(Entity entity) { - return hasSelfDisguisePreference(entity) != DisguiseConfig.isViewDisguises(); + return hasSelfDisguisePreference(entity) != DisguiseConfig.isViewSelfDisguisesDefault(); } /** @@ -462,7 +462,7 @@ public class DisguiseAPI { } } - if (!canSeeSelfDisguises == DisguiseConfig.isViewDisguises()) { + if (!canSeeSelfDisguises == DisguiseConfig.isViewSelfDisguisesDefault()) { if (!hasSelfDisguisePreference(entity)) { DisguiseUtilities.getViewSelf().add(entity.getUniqueId()); DisguiseUtilities.addSaveAttempt(); diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java index c0d50bf3..7d0c8769 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java @@ -71,7 +71,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter if (!setViewDisguise(args)) { // They prefer to have the opposite of whatever the view disguises option is - if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewDisguises()) { + if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewSelfDisguisesDefault()) { disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible()); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java index 1a5b38e5..822dab01 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java @@ -109,7 +109,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom if (!setViewDisguise(args)) { // They prefer to have the opposite of whatever the view disguises option is - if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewDisguises()) { + if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewSelfDisguisesDefault()) { disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible()); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java index 5dedc0b4..a65d2e8c 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java @@ -189,7 +189,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom if (!setViewDisguise(args)) { // They prefer to have the opposite of whatever the view disguises option is - if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewDisguises()) { + if (DisguiseAPI.hasSelfDisguisePreference(disguise.getEntity()) && disguise.isSelfDisguiseVisible() == DisguiseConfig.isViewSelfDisguisesDefault()) { disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible()); } }