diff --git a/src/main/java/net/citizensnpcs/npc/CitizensTraitFactory.java b/src/main/java/net/citizensnpcs/npc/CitizensTraitFactory.java index dfc48bce5..17077fcea 100644 --- a/src/main/java/net/citizensnpcs/npc/CitizensTraitFactory.java +++ b/src/main/java/net/citizensnpcs/npc/CitizensTraitFactory.java @@ -1,14 +1,15 @@ package net.citizensnpcs.npc; import java.util.Map; +import java.util.Set; import net.citizensnpcs.Metrics; import net.citizensnpcs.Metrics.Graph; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.trait.Trait; -import net.citizensnpcs.api.trait.TraitInfo; import net.citizensnpcs.api.trait.TraitFactory; +import net.citizensnpcs.api.trait.TraitInfo; import net.citizensnpcs.api.trait.trait.Equipment; import net.citizensnpcs.api.trait.trait.Inventory; import net.citizensnpcs.api.trait.trait.MobType; @@ -29,6 +30,7 @@ import net.citizensnpcs.trait.waypoint.Waypoints; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; +import com.google.common.collect.Sets; public class CitizensTraitFactory implements TraitFactory { private final Map> registered = Maps.newHashMap(); @@ -52,10 +54,17 @@ public class CitizensTraitFactory implements TraitFactory { registerTrait(TraitInfo.create(WoolColor.class).withName("woolcolor")); registerTrait(TraitInfo.create(Controllable.class).withName("controllable")); registerTrait(TraitInfo.create(Behaviour.class).withName("behaviour")); + + for (String trait : registered.keySet()) + INTERNAL_TRAITS.add(trait); } + private static final Set INTERNAL_TRAITS = Sets.newHashSet(); + public void addPlotters(Graph graph) { for (Map.Entry> entry : registered.entrySet()) { + if (INTERNAL_TRAITS.contains(entry.getKey())) + continue; final Class traitClass = entry.getValue(); graph.addPlotter(new Metrics.Plotter(entry.getKey()) { @Override diff --git a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java index adf815715..49c5c1574 100644 --- a/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java +++ b/src/main/java/net/citizensnpcs/npc/ai/CitizensNavigator.java @@ -2,7 +2,6 @@ package net.citizensnpcs.npc.ai; import java.lang.reflect.Field; import java.util.Map; -import java.util.Set; import net.citizensnpcs.api.ai.EntityTarget; import net.citizensnpcs.api.ai.Navigator; @@ -11,7 +10,6 @@ import net.citizensnpcs.api.ai.event.NavigationBeginEvent; import net.citizensnpcs.api.ai.event.NavigationCancelEvent; import net.citizensnpcs.api.ai.event.NavigationReplaceEvent; import net.citizensnpcs.npc.CitizensNPC; -import net.citizensnpcs.util.Messaging; import net.minecraft.server.EntityLiving; import org.bukkit.Bukkit; @@ -20,7 +18,6 @@ import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; public class CitizensNavigator implements Navigator { private PathStrategy executing; @@ -100,16 +97,10 @@ public class CitizensNavigator implements Navigator { public void setTarget(Location target) { if (!npc.isSpawned()) throw new IllegalStateException("npc is not spawned"); - if (!logged.contains(target)) { - Messaging.log(target); - logged.add(target); - } PathStrategy newStrategy = new MCNavigationStrategy(npc, target, speed); switchStrategyTo(newStrategy); } - private final Set logged = Sets.newHashSet(); - private void switchStrategyTo(PathStrategy newStrategy) { if (executing != null) Bukkit.getPluginManager().callEvent(new NavigationReplaceEvent(this));