use of net.minecraft.server.v1_15_R1.AxisAlignedBB in project Citizens2 by CitizensDev.
the class NMSImpl method setSize.
public static void setSize(Entity entity, float f, float f1, boolean justCreated) {
if ((f != entity.width) || (f1 != entity.length)) {
float f2 = entity.width;
entity.width = f;
entity.length = f1;
entity.a(new AxisAlignedBB(entity.getBoundingBox().a, entity.getBoundingBox().b, entity.getBoundingBox().c, entity.getBoundingBox().a + entity.width, entity.getBoundingBox().b + entity.length, entity.getBoundingBox().c + entity.width));
if ((entity.width > f2) && (!justCreated) && (!entity.world.isClientSide))
entity.move((f2 - entity.width) / 2, 0.0D, (f2 - entity.width) / 2);
}
}
use of net.minecraft.server.v1_15_R1.AxisAlignedBB 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_15_R1.AxisAlignedBB in project Citizens2 by CitizensDev.
the class NMSImpl method setSize.
public static void setSize(Entity entity, float f, float f1, boolean justCreated) {
if ((f != entity.width) || (f1 != entity.length)) {
float f2 = entity.width;
entity.width = f;
entity.length = f1;
entity.a(new AxisAlignedBB(entity.getBoundingBox().a, entity.getBoundingBox().b, entity.getBoundingBox().c, entity.getBoundingBox().a + entity.width, entity.getBoundingBox().b + entity.length, entity.getBoundingBox().c + entity.width));
if ((entity.width > f2) && (!justCreated) && (!entity.world.isClientSide))
entity.move(EnumMoveType.SELF, (f2 - entity.width) / 2, 0.0D, (f2 - entity.width) / 2);
}
}
use of net.minecraft.server.v1_15_R1.AxisAlignedBB 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);
}
use of net.minecraft.server.v1_15_R1.AxisAlignedBB 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);
}
Aggregations