Fix toggle of self disguises, fixes #566

This commit is contained in:
libraryaddict 2021-06-05 03:03:19 +12:00
parent bde28a6521
commit 4e22d92b5e
4 changed files with 6 additions and 6 deletions

View File

@ -184,7 +184,7 @@ public class DisguiseAPI {
} }
// They prefer to have the opposite of whatever the view disguises option is // 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()); disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible());
} }
@ -400,7 +400,7 @@ public class DisguiseAPI {
* @return * @return
*/ */
public static boolean isViewSelfToggled(Entity entity) { 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)) { if (!hasSelfDisguisePreference(entity)) {
DisguiseUtilities.getViewSelf().add(entity.getUniqueId()); DisguiseUtilities.getViewSelf().add(entity.getUniqueId());
DisguiseUtilities.addSaveAttempt(); DisguiseUtilities.addSaveAttempt();

View File

@ -71,7 +71,7 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
if (!setViewDisguise(args)) { if (!setViewDisguise(args)) {
// They prefer to have the opposite of whatever the view disguises option is // 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()); disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible());
} }
} }

View File

@ -109,7 +109,7 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
if (!setViewDisguise(args)) { if (!setViewDisguise(args)) {
// They prefer to have the opposite of whatever the view disguises option is // 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()); disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible());
} }
} }

View File

@ -189,7 +189,7 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
if (!setViewDisguise(args)) { if (!setViewDisguise(args)) {
// They prefer to have the opposite of whatever the view disguises option is // 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()); disguise.setViewSelfDisguise(!disguise.isSelfDisguiseVisible());
} }
} }