mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-09 22:38:04 +02:00
More realistic gravity
This commit is contained in:
parent
ce8bc53b5b
commit
6e26252328
@ -314,9 +314,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
updatePackets(navigating);
|
updatePackets(navigating);
|
||||||
if (gravity && !navigating && getBukkitEntity() != null
|
if (gravity && !navigating && getBukkitEntity() != null
|
||||||
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && !NMS.inWater(getBukkitEntity())) {
|
&& Util.isLoaded(getBukkitEntity().getLocation(LOADED_LOCATION)) && !NMS.inWater(getBukkitEntity())) {
|
||||||
move(0, -0.2, 0);
|
g(0, 0);
|
||||||
// gravity. also works around an entity.onGround not updating issue
|
|
||||||
// (onGround is normally updated by the client)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
if (Math.abs(motX) < EPSILON && Math.abs(motY) < EPSILON && Math.abs(motZ) < EPSILON) {
|
||||||
@ -327,9 +325,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
|
|||||||
NMS.updateNavigation(navigation);
|
NMS.updateNavigation(navigation);
|
||||||
}
|
}
|
||||||
moveOnCurrentHeading();
|
moveOnCurrentHeading();
|
||||||
} else if (motX != 0 || motZ != 0 || motY != 0) {
|
|
||||||
g(0, 0); // is this necessary? it does controllable but sometimes
|
|
||||||
// players sink into the ground
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noDamageTicks > 0) {
|
if (noDamageTicks > 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user