use of net.minecraft.server.v1_12_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method l.
@Override
public void l() {
this.h += 1;
if (this.p) {
j();
}
if (n()) {
return;
}
if (b()) {
m();
} else if ((this.c != null) && (this.c.e() < this.c.d())) {
Vec3D localVec3D = c();
Vec3D localObject = this.c.a(this.a, this.c.e());
if ((localVec3D.y > localObject.y) && (!this.a.onGround) && (MathHelper.floor(localVec3D.x) == MathHelper.floor(localObject.x)) && (MathHelper.floor(localVec3D.z) == MathHelper.floor(localObject.z))) {
this.c.c(this.c.e() + 1);
}
}
if (n()) {
return;
}
Vec3D localVec3D = this.c.a(this.a);
if (localVec3D == null) {
return;
}
Object localObject = new BlockPosition(localVec3D).down();
AxisAlignedBB localAxisAlignedBB = this.b.getType((BlockPosition) localObject).c(this.b, (BlockPosition) localObject);
localVec3D = localVec3D.a(0.0D, 1.0D - localAxisAlignedBB.e, 0.0D);
this.a.getControllerMove().a(localVec3D.x, localVec3D.y, localVec3D.z, this.d);
}
use of net.minecraft.server.v1_12_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method m.
@Override
protected void m() {
Vec3D localVec3D1 = c();
int i1 = this.c.d();
for (int i2 = this.c.e(); i2 < this.c.d(); i2++) {
if (this.c.a(i2).b != Math.floor(localVec3D1.y)) {
i1 = i2;
break;
}
}
this.o = (this.a.width > 0.75F ? this.a.width / 2.0F : 0.75F - this.a.width / 2.0F);
Vec3D localVec3D2 = this.c.f();
if ((MathHelper.e((float) (this.a.locX - (localVec3D2.x + 0.5D))) < this.o) && (MathHelper.e((float) (this.a.locZ - (localVec3D2.z + 0.5D))) < this.o)) {
this.c.c(this.c.e() + 1);
}
int i3 = MathHelper.f(this.a.width);
int i4 = (int) this.a.length + 1;
int i5 = i3;
for (int i6 = i1 - 1; i6 >= this.c.e(); i6--) {
if (a(localVec3D1, this.c.a(this.a, i6), i3, i4, i5)) {
this.c.c(i6);
break;
}
}
a(localVec3D1);
}
use of net.minecraft.server.v1_12_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method a.
@Override
public boolean a(PathEntity paramPathEntity, double paramDouble) {
if (paramPathEntity == null) {
this.c = null;
return false;
}
if (!paramPathEntity.a(this.c)) {
this.c = paramPathEntity;
}
d();
if (this.c.d() == 0) {
return false;
}
this.d = paramDouble;
Vec3D localVec3D = c();
this.i = this.h;
this.j = localVec3D;
return true;
}
use of net.minecraft.server.v1_12_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method k.
@Override
public void k() {
this.f += 1;
if (m()) {
return;
}
if (b()) {
l();
} else if ((this.d != null) && (this.d.e() < this.d.d())) {
Vec3D localVec3D = c();
Vec3D localObject = this.d.a(this.b, this.d.e());
if ((localVec3D.b > localObject.b) && (!this.b.onGround) && (MathHelper.floor(localVec3D.a) == MathHelper.floor(localObject.a)) && (MathHelper.floor(localVec3D.c) == MathHelper.floor(localObject.c))) {
this.d.c(this.d.e() + 1);
}
}
if (m()) {
return;
}
Vec3D localVec3D = this.d.a(this.b);
if (localVec3D == null) {
return;
}
Object localObject = new AxisAlignedBB(localVec3D.a, localVec3D.b, localVec3D.c, localVec3D.a, localVec3D.b, localVec3D.c).grow(0.5D, 0.5D, 0.5D);
List<AxisAlignedBB> localList = this.c.getCubes(this.b, ((AxisAlignedBB) localObject).a(0.0D, -1.0D, 0.0D));
double d1 = -1.0D;
localObject = ((AxisAlignedBB) localObject).c(0.0D, 1.0D, 0.0D);
for (AxisAlignedBB localAxisAlignedBB : localList) {
d1 = localAxisAlignedBB.b((AxisAlignedBB) localObject, d1);
}
this.b.getControllerMove().a(localVec3D.a, localVec3D.b + d1, localVec3D.c, this.e);
}
use of net.minecraft.server.v1_12_R1.Vec3D in project Citizens2 by CitizensDev.
the class PlayerNavigation method l.
@Override
public void l() {
this.g += 1;
if (this.o) {
j();
}
if (n()) {
return;
}
if (b()) {
m();
} else if ((this.c != null) && (this.c.e() < this.c.d())) {
Vec3D localVec3D = c();
Vec3D localObject = this.c.a(this.a, this.c.e());
if ((localVec3D.y > localObject.y) && (!this.a.onGround) && (MathHelper.floor(localVec3D.x) == MathHelper.floor(localObject.x)) && (MathHelper.floor(localVec3D.z) == MathHelper.floor(localObject.z))) {
this.c.c(this.c.e() + 1);
}
}
if (n()) {
return;
}
Vec3D localVec3D = this.c.a(this.a);
if (localVec3D == null) {
return;
}
Object localObject = new BlockPosition(localVec3D).down();
AxisAlignedBB localAxisAlignedBB = this.b.getType((BlockPosition) localObject).d(this.b, (BlockPosition) localObject);
localVec3D = localVec3D.a(0.0D, 1.0D - localAxisAlignedBB.e, 0.0D);
this.a.getControllerMove().a(localVec3D.x, localVec3D.y, localVec3D.z, this.d);
}
Aggregations