From 9166120071b49f96acf0ea903fe592ab11e4630f Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 11 Aug 2020 08:56:40 +1200 Subject: [PATCH] Don't ignore config view self disguise option, fixes #502 --- .../disguise/disguisetypes/Disguise.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index a9c2a230..934254fa 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -837,7 +837,7 @@ public abstract class Disguise { * @return viewSelfDisguise */ public boolean isSelfDisguiseVisible() { - return viewSelfDisguise; + return DisguiseConfig.isViewDisguises() && viewSelfDisguise; } public void setSelfDisguiseVisible(boolean selfDisguiseVisible) { @@ -1055,20 +1055,18 @@ public abstract class Disguise { */ @Deprecated public Disguise setViewSelfDisguise(boolean viewSelfDisguise) { - if (viewSelfDisguise && !isTallDisguisesVisible()) { - setTallDisguisesVisible(true); + if (isSelfDisguiseVisible() == viewSelfDisguise || !DisguiseConfig.isViewDisguises()) { + return this; } - if (isSelfDisguiseVisible() != viewSelfDisguise) { - this.viewSelfDisguise = viewSelfDisguise; + this.viewSelfDisguise = viewSelfDisguise; - if (getEntity() != null && getEntity() instanceof Player) { - if (DisguiseAPI.getDisguise((Player) getEntity(), getEntity()) == this) { - if (isSelfDisguiseVisible()) { - DisguiseUtilities.setupFakeDisguise(this); - } else { - DisguiseUtilities.removeSelfDisguise(this); - } + if (getEntity() != null && getEntity() instanceof Player) { + if (DisguiseAPI.getDisguise((Player) getEntity(), getEntity()) == this) { + if (isSelfDisguiseVisible()) { + DisguiseUtilities.setupFakeDisguise(this); + } else { + DisguiseUtilities.removeSelfDisguise(this); } } }