protected void checkBlockCollision() { Vector3 vector = new Vector3(0, 0, 0); for (Block block : this.getBlocksAround()) { block.onEntityCollide(this); block.addVelocityToEntity(this, vector); } if (vector.lengthSquared() > 0) { vector = vector.normalize(); double d = 0.014d; this.motionX += vector.x * d; this.motionY += vector.y * d; this.motionZ += vector.z * d; } }
@Override public Position subtract(Vector3 x) { return this.add(-x.getX(), -x.getY(), -x.getZ()); }
@Override public Position add(Vector3 x) { return new Position(this.x + x.getX(), this.y + x.getY(), this.z + x.getZ(), this.level); }