Esempio n. 1
0
  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;
    }
  }