Soil is passable

This commit is contained in:
fullwall 2014-03-08 15:09:13 +08:00
parent 27a7b4e416
commit 94418b0934

View File

@ -15,7 +15,6 @@ import net.citizensnpcs.util.Util;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.util.Vector;
public class AStarNavigationStrategy extends AbstractPathStrategy {
@ -77,16 +76,12 @@ public class AStarNavigationStrategy extends AbstractPathStrategy {
double distance = xzDistance + dY * dY;
if (Setting.DEBUG_PATHFINDING.asBoolean()) {
npc.getEntity().getWorld()
.playEffect(vector.toLocation(npc.getEntity().getWorld()), Effect.ENDER_SIGNAL, 0);
.playEffect(vector.toLocation(npc.getEntity().getWorld()), Effect.ENDER_SIGNAL, 0);
}
if (distance > 0 && dY > 0 && dY < 1 && xzDistance <= 2.75) {
NMS.setShouldJump(npc.getEntity());
}
double destX = vector.getX(), destZ = vector.getZ();
if (npc.getEntity().getWorld().getBlockAt(vector.getBlockX(), vector.getBlockY(), vector.getBlockZ()).getType() == Material.LADDER) {
destX += 0.5;
destZ += 0.5;
}
double destX = vector.getX() + 0.5, destZ = vector.getZ() + 0.5;
NMS.setDestination(npc.getEntity(), destX, vector.getY(), destZ, params.speed());
params.run();
plan.run(npc);