@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof EntityHit)) { return false; } final EntityHit entityHit = (EntityHit) other; return this.entity.equals(entityHit.entity) && this.intersection.equals(entityHit.intersection) && this.normal.equals(entityHit.normal) && this.distance == entityHit.distance; }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Transform<?>)) { return false; } final Transform<?> otherTransform = (Transform<?>) other; return otherTransform.extent.equals(this.extent) && otherTransform.getPosition().equals(getPosition()) && otherTransform.getRotation().equals(getRotation()) && otherTransform.getScale().equals(getScale()); }
/** * Sets the direction and ending location. This or setting the direction * is required and can only be done once. * * @param end The ending location * @return This for chained calls */ public BlockRayBuilder<E> to(Vector3d end) { checkState(this.direction == null, "Direction has already been set"); checkNotNull(end, "end"); checkArgument(!this.position.equals(end), "Start and end cannot be equal"); this.direction = end.sub(this.position).normalize(); return stopFilter(new TargetBlockFilter<>(end)); }
@Override public boolean equals(Object other) { if (!(other instanceof Location<?>)) { return false; } Location<?> otherLoc = (Location<?>) other; return otherLoc.getExtent().equals(getExtent()) && otherLoc.getPosition().equals(getPosition()); }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof EntityHit)) { return false; } final EntityHit entityHit = (EntityHit) other; return this.entity.equals(entityHit.entity) && this.intersection.equals(entityHit.intersection) && this.normal.equals(entityHit.normal) && this.distance == entityHit.distance; }
@Override public boolean equals(Object other) { if (this == other) { return true; } if (!(other instanceof Transform<?>)) { return false; } final Transform<?> otherTransform = (Transform<?>) other; return otherTransform.extent.equals(this.extent) && otherTransform.getPosition().equals(getPosition()) && otherTransform.getRotation().equals(getRotation()) && otherTransform.getScale().equals(getScale()); }
/** * Sets the direction and ending location. This or setting the direction is required and can only be done once. * * @param end The ending location * @return This for chained calls */ public BlockRayBuilder<E> to(Vector3d end) { checkState(this.direction == null, "Direction has already been set"); checkNotNull(end, "end"); checkArgument(!this.position.equals(end), "Start and end cannot be equal"); this.direction = end.sub(this.position).normalize(); return stopFilter(new TargetBlockFilter<>(end)); }
@Override public boolean equals(Object other) { if (!(other instanceof Location<?>)) { return false; } Location<?> otherLoc = (Location<?>) other; return otherLoc.getExtent().equals(getExtent()) && otherLoc.getPosition().equals(getPosition()); }
/** * Gets the relative direction of 'other' from 'base'. * * @param base The location of base. * @param other The location of other. * @return The relative direction */ public static Direction getFacing(Location<World> base, Location<World> other) { for (Direction dir : Direction.values()) { if (base.getRelative(dir).getPosition().equals(other.getPosition())) return dir; } return null; }
@Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof VectorPoint)) return false; final VectorPoint other = (VectorPoint) o; return this.getPosition().equals(other.getPosition()) && this.getDirection().equals(other.getDirection()); }
@Override public boolean equals(Object o) { if (o == this) return true; if (!(o instanceof VectorPoint)) return false; final VectorPoint other = (VectorPoint) o; return this.getPosition().equals(other.getPosition()) && this.getDirection().equals(other.getDirection()); }