From 4a17a478bf984a72cc96b696fc44a6fea86a6b53 Mon Sep 17 00:00:00 2001 From: aPunch Date: Mon, 12 Mar 2012 14:13:20 -0500 Subject: [PATCH] Change --- .../java/net/citizensnpcs/npc/CitizensTraitManager.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/citizensnpcs/npc/CitizensTraitManager.java b/src/main/java/net/citizensnpcs/npc/CitizensTraitManager.java index 5a31d9522..3c3f5a0b7 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensTraitManager.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensTraitManager.java @@ -20,10 +20,9 @@ import net.citizensnpcs.trait.Powered; import net.citizensnpcs.trait.text.Text; import net.citizensnpcs.trait.waypoint.Waypoints; -import com.google.common.collect.Maps; - public class CitizensTraitManager implements TraitManager { private final Map> registered = new HashMap>(); + private final Map, Constructor> CACHED_CTORS = new HashMap, Constructor>(); public CitizensTraitManager() { // Register Citizens traits @@ -77,7 +76,6 @@ public class CitizensTraitManager implements TraitManager { if (clazz == null) return null; Trait t = getTrait(clazz, npc); - //t.setName(name); return (T) t; } @@ -94,9 +92,8 @@ public class CitizensTraitManager implements TraitManager { constructor = null; } CACHED_CTORS.put(trait, constructor); - } else { + } else constructor = CACHED_CTORS.get(trait); - } try { if (constructor == null || npc == null) @@ -107,6 +104,4 @@ public class CitizensTraitManager implements TraitManager { return null; } } - - private final Map, Constructor> CACHED_CTORS = Maps.newHashMap(); } \ No newline at end of file