mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-10-31 17:23:42 +01:00 
			
		
		
		
	Clear mob health display if it gets stuck. Fixes #933
This commit is contained in:
		| @@ -308,10 +308,16 @@ public final class CombatUtils { | |||||||
|                         oldName = ""; |                         oldName = ""; | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|                     if (!ChatColor.stripColor(oldName).equalsIgnoreCase(ChatColor.stripColor(newName))) { |                     boolean updateName = !ChatColor.stripColor(oldName).equalsIgnoreCase(ChatColor.stripColor(newName)); | ||||||
|  |  | ||||||
|  |                     if (updateName) { | ||||||
|                         target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, oldName)); |                         target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, oldName)); | ||||||
|                         target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, oldNameVisible)); |                         target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, oldNameVisible)); | ||||||
|                     } |                     } | ||||||
|  |                     else if (!target.hasMetadata(mcMMO.customNameKey)) { | ||||||
|  |                         target.setMetadata(mcMMO.customNameKey, new FixedMetadataValue(mcMMO.p, "")); | ||||||
|  |                         target.setMetadata(mcMMO.customVisibleKey, new FixedMetadataValue(mcMMO.p, false)); | ||||||
|  |                     } | ||||||
|  |  | ||||||
|                     new MobHealthDisplayUpdaterTask(target).runTaskLater(mcMMO.p, displayTime * 20); // Clear health display after 3 seconds |                     new MobHealthDisplayUpdaterTask(target).runTaskLater(mcMMO.p, displayTime * 20); // Clear health display after 3 seconds | ||||||
|                 } |                 } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 GJ
					GJ