mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-10-06 03:17:27 +02:00
Fix /npc gravity for players
This commit is contained in:
parent
495e8ad286
commit
726cf9b54a
@ -287,7 +287,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
|
|
||||||
boolean navigating = npc.getNavigator().isNavigating();
|
boolean navigating = npc.getNavigator().isNavigating();
|
||||||
updatePackets(navigating);
|
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))) {
|
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION))) {
|
||||||
g(0, 0);
|
g(0, 0);
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package net.citizensnpcs.trait;
|
package net.citizensnpcs.trait;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
import net.citizensnpcs.api.persistence.Persist;
|
import net.citizensnpcs.api.persistence.Persist;
|
||||||
@ -28,9 +27,6 @@ public class Gravity extends Trait implements Toggleable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (!npc.isSpawned())
|
if (!npc.isSpawned())
|
||||||
return;
|
return;
|
||||||
if (npc.getEntity() instanceof Player) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!enabled || npc.getNavigator().isNavigating())
|
if (!enabled || npc.getNavigator().isNavigating())
|
||||||
return;
|
return;
|
||||||
Vector vector = npc.getEntity().getVelocity();
|
Vector vector = npc.getEntity().getVelocity();
|
||||||
|
Loading…
Reference in New Issue
Block a user