Fix flying move logic

This commit is contained in:
fullwall 2017-01-17 16:06:16 +08:00
parent a8376242bc
commit db418648ab
2 changed files with 20 additions and 2 deletions

View File

@ -485,6 +485,16 @@ public class NMSImpl implements NMSBridge {
@Override
public void stop() {
if (navigation.k() != null) {
for (Player player : Bukkit.getOnlinePlayers()) {
for (int i = 0; i < navigation.k().d(); i++) {
PathPoint pp = navigation.k().a(i);
org.bukkit.block.Block block = new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld())
.getBlock();
player.sendBlockChange(block.getLocation(), block.getType(), block.getData());
}
}
}
stopNavigation(navigation);
}
@ -507,6 +517,15 @@ public class NMSImpl implements NMSBridge {
// but we'd prefer to make it just fit on 1 so hack around it a bit.
lastSpeed = params.speed();
}
if (params.debug() && !NMSImpl.isNavigationFinished(navigation)) {
for (Player player : Bukkit.getOnlinePlayers()) {
for (int i = 0; i < navigation.k().d(); i++) {
PathPoint pp = navigation.k().a(i);
player.sendBlockChange(new Vector(pp.a, pp.b, pp.c).toLocation(player.getWorld()),
Material.YELLOW_FLOWER, (byte) 0);
}
}
}
navigation.a(params.speed());
return NMSImpl.isNavigationFinished(navigation);
}
@ -1149,7 +1168,7 @@ public class NMSImpl implements NMSBridge {
double d1 = entity.locY;
float f4 = entity instanceof EntityPolarBear ? 0.98F : 0.8F;
float f3 = 0.02F;
float f2 = EnchantmentManager.d(entity);
float f2 = EnchantmentManager.a(Enchantments.DEPTH_STRIDER, entity);
if (f2 > 3.0F) {
f2 = 3.0F;
}

View File

@ -33,7 +33,6 @@ public class PlayerPathfinder {
this.d.a(paramIBlockAccess, paramEntityInsentient);
PathPoint localPathPoint1 = this.d.b();
PathPoint localPathPoint2 = this.d.a(paramDouble1, paramDouble2, paramDouble3);
PathEntity localPathEntity = a(localPathPoint1, localPathPoint2, paramFloat);
this.d.a();