Remove concurrenthashmap as its a relic of a failed async implemention and causes performance issues, fixes #478
This commit is contained in:
		| @@ -55,7 +55,6 @@ import java.io.*; | |||||||
| import java.lang.reflect.*; | import java.lang.reflect.*; | ||||||
| import java.nio.charset.StandardCharsets; | import java.nio.charset.StandardCharsets; | ||||||
| import java.util.*; | import java.util.*; | ||||||
| import java.util.concurrent.ConcurrentHashMap; |  | ||||||
| import java.util.logging.Logger; | import java.util.logging.Logger; | ||||||
| import java.util.regex.Matcher; | import java.util.regex.Matcher; | ||||||
| import java.util.regex.Pattern; | import java.util.regex.Pattern; | ||||||
| @@ -113,7 +112,7 @@ public class DisguiseUtilities { | |||||||
|      * A hashmap of the uuid's of entitys, alive and dead. And their disguises in use |      * A hashmap of the uuid's of entitys, alive and dead. And their disguises in use | ||||||
|      */ |      */ | ||||||
|     @Getter |     @Getter | ||||||
|     private static Map<UUID, Set<TargetedDisguise>> disguises = new ConcurrentHashMap<>(); |     private static Map<UUID, Set<TargetedDisguise>> disguises = new HashMap<>(); | ||||||
|     /** |     /** | ||||||
|      * Disguises which are stored ready for a entity to be seen by a player Preferably, disguises in this should only |      * Disguises which are stored ready for a entity to be seen by a player Preferably, disguises in this should only | ||||||
|      * stay in for |      * stay in for | ||||||
| @@ -679,9 +678,11 @@ public class DisguiseUtilities { | |||||||
|  |  | ||||||
|         if (getDisguises().containsKey(entityId)) { |         if (getDisguises().containsKey(entityId)) { | ||||||
|             for (TargetedDisguise disguise : getDisguises().get(entityId)) { |             for (TargetedDisguise disguise : getDisguises().get(entityId)) { | ||||||
|                 if (disguise.canSee(observer)) { |                 if (!disguise.canSee(observer)) { | ||||||
|                     return disguise; |                     continue; | ||||||
|                 } |                 } | ||||||
|  |  | ||||||
|  |                 return disguise; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user