mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Fix flying move logic
This commit is contained in:
parent
a8376242bc
commit
db418648ab
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user