Skip to content

Commit

Permalink
Fix /npc gravity for players
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Jul 19, 2016
1 parent 4a93ec4 commit 72ce879
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public void m() {

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);
}
Expand Down
4 changes: 0 additions & 4 deletions src/main/java/net/citizensnpcs/trait/Gravity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.citizensnpcs.trait;

import org.bukkit.entity.Player;
import org.bukkit.util.Vector;

import net.citizensnpcs.api.persistence.Persist;
Expand Down Expand Up @@ -28,9 +27,6 @@ public boolean hasGravity() {
public void run() {
if (!npc.isSpawned())
return;
if (npc.getEntity() instanceof Player) {
return;
}
if (!enabled || npc.getNavigator().isNavigating())
return;
Vector vector = npc.getEntity().getVelocity();
Expand Down

0 comments on commit 72ce879

Please sign in to comment.