Deny setCustomNameVisible if overriden custom names
This commit is contained in:
		| @@ -359,16 +359,13 @@ public class FlagWatcher { | |||||||
|     public void setCustomName(String name) { |     public void setCustomName(String name) { | ||||||
|         if (!getDisguise().isPlayerDisguise() && DisguiseConfig.isArmorstandsName() && |         if (!getDisguise().isPlayerDisguise() && DisguiseConfig.isArmorstandsName() && | ||||||
|                 DisguiseConfig.isOverrideCustomNames()) { |                 DisguiseConfig.isOverrideCustomNames()) { | ||||||
|             if (NmsVersion.v1_13.isSupported()) { |             MetaIndex custom = | ||||||
|                 if (!hasValue(MetaIndex.ENTITY_CUSTOM_NAME)) { |                     NmsVersion.v1_13.isSupported() ? MetaIndex.ENTITY_CUSTOM_NAME : MetaIndex.ENTITY_CUSTOM_NAME_OLD; | ||||||
|                     setData(MetaIndex.ENTITY_CUSTOM_NAME, Optional.empty()); |  | ||||||
|  |             if (!hasValue(custom)) { | ||||||
|  |                 setData(custom, custom.getDefault()); | ||||||
|                 sendData(MetaIndex.ENTITY_CUSTOM_NAME); |                 sendData(MetaIndex.ENTITY_CUSTOM_NAME); | ||||||
|                 } |                 setCustomNameVisible(false); | ||||||
|             } else { |  | ||||||
|                 if (!hasValue(MetaIndex.ENTITY_CUSTOM_NAME_OLD)) { |  | ||||||
|                     setData(MetaIndex.ENTITY_CUSTOM_NAME_OLD, ""); |  | ||||||
|                     sendData(MetaIndex.ENTITY_CUSTOM_NAME_OLD); |  | ||||||
|                 } |  | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             if (Strings.isNullOrEmpty(name)) { |             if (Strings.isNullOrEmpty(name)) { | ||||||
| @@ -483,6 +480,10 @@ public class FlagWatcher { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     public void setCustomNameVisible(boolean display) { |     public void setCustomNameVisible(boolean display) { | ||||||
|  |         if (DisguiseConfig.isArmorstandsName() && DisguiseConfig.isOverrideCustomNames()) { | ||||||
|  |             display = false; | ||||||
|  |         } | ||||||
|  |  | ||||||
|         setData(MetaIndex.ENTITY_CUSTOM_NAME_VISIBLE, display); |         setData(MetaIndex.ENTITY_CUSTOM_NAME_VISIBLE, display); | ||||||
|         sendData(MetaIndex.ENTITY_CUSTOM_NAME_VISIBLE); |         sendData(MetaIndex.ENTITY_CUSTOM_NAME_VISIBLE); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user