Fix /npc gravity for players

This commit is contained in:
fullwall 2016-07-20 00:51:06 +08:00
parent 495e8ad286
commit 726cf9b54a
2 changed files with 1 additions and 5 deletions

View File

@ -287,7 +287,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
boolean navigating = npc.getNavigator().isNavigating();
updatePackets(navigating);
if (npc.getTrait(Gravity.class).hasGravity() && !navigating && getBukkitEntity() != null
if (!navigating && getBukkitEntity() != null && npc.getTrait(Gravity.class).hasGravity()
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) {
g(0, 0);
}

View File

@ -1,6 +1,5 @@
package net.citizensnpcs.trait;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import net.citizensnpcs.api.persistence.Persist;
@ -28,9 +27,6 @@ public class Gravity extends Trait implements Toggleable {
public void run() {
if (!npc.isSpawned())
return;
if (npc.getEntity() instanceof Player) {
return;
}
if (!enabled || npc.getNavigator().isNavigating())
return;
Vector vector = npc.getEntity().getVelocity();