Fix NPC targeting

This commit is contained in:
fullwall 2014-12-21 23:34:54 +08:00
parent 954a3bd27b
commit 516035fc70
3 changed files with 9 additions and 6 deletions

View File

@ -842,6 +842,8 @@ public class NPCCommands {
String message = " <e>- <a>" + trait.getName();
Messaging.send(sender, message);
}
npc.getNavigator().setTarget((Entity) sender, true);
}
@Command(

View File

@ -177,7 +177,7 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
@Override
public void setPath() {
navigation.a(target, parameters.speed());
navigation.a(target, 1f);
}
@Override

View File

@ -79,7 +79,8 @@ public class NMS {
}
public static void attack(EntityLiving handle, Entity target) {
float f = (float) handle.getAttributeInstance(GenericAttributes.e).getValue();
AttributeInstance attackDamage = handle.getAttributeInstance(GenericAttributes.e);
float f = (float) (attackDamage == null ? 1 : attackDamage.getValue());
int i = 0;
if (target instanceof EntityLiving) {