public @Nonnull BoundingBox scale(double x, double y, double z) { double w = ((maxX - minX) * (1 - x)) / 2; double h = ((maxY - minY) * (1 - y)) / 2; double d = ((maxZ - minZ) * (1 - z)) / 2; return new BoundingBox(minX + w, minY + h, minZ + d, maxX - w, maxY - h, maxZ - d); }
@Override public @Nonnull BoundingBox expand(double x, double y, double z) { return new BoundingBox(minX - x, minY - y, minZ - z, maxX + x, maxY + y, maxZ + z); }
@Override public @Nonnull BoundingBox setMaxY(double y2) { return new BoundingBox(this.minX, this.minY, this.minZ, this.maxX, y2, this.maxZ); }
public @Nonnull BoundingBox translate(float x, float y, float z) { return new BoundingBox(minX + x, minY + y, minZ + z, maxX + x, maxY + y, maxZ + z); }
public @Nonnull BoundingBox expand(double xyz) { return new BoundingBox(minX - xyz, minY - xyz, minZ - xyz, maxX + xyz, maxY + xyz, maxZ + xyz); }
public @Nonnull BoundingBox expandBy(@Nonnull BoundingBox other) { return new BoundingBox(Math.min(minX, other.minX), Math.min(minY, other.minY), Math.min(minZ, other.minZ), Math.max(maxX, other.maxX), Math.max(maxY, other.maxY), Math.max(maxZ, other.maxZ)); }
@Override protected @Nonnull BoundingBox getChargingStrength(@Nonnull IBlockState state, @Nonnull BlockPos pos) { return new BoundingBox(pos).expand(ChargerConfig.wirelessRange.get()); }
protected @Nonnull BoundingBox getChargingStrength(@Nonnull IBlockState state, @Nonnull BlockPos pos) { return new BoundingBox(pos).expand(ChargerConfig.wirelessRangeAntenna.get()); }
@Override protected @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(4, 1d, 4); } });
public @Nonnull BoundingBox transform(@Nonnull VertexTransform vertexTransform) { Vector3d min = new Vector3d(minX, minY, minZ); Vector3d max = new Vector3d(maxX, maxY, maxZ); vertexTransform.apply(min); vertexTransform.apply(max); return new BoundingBox(Math.min(min.x, max.x), Math.min(min.y, max.y), Math.min(min.z, max.z), Math.max(min.x, max.x), Math.max(min.y, max.y), Math.max(min.z, max.z)); }
public CrookHarvestingTarget(@Nonnull BlockPos pos) { this.bb = new BoundingBox(pos, pos.up(30)).expand(12, 0, 12); }
public AxeHarvestingTarget(@Nonnull IBlockState wood, @Nonnull BlockPos pos) { this.wood = wood; variant = getVariant(wood); this.bb = new BoundingBox(pos, pos.up(30)).expand(12, 0, 12); }
@Override @Nonnull public BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() + (range == 0 ? 1 / 32f : 0)); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() + (range == 0 ? 1 / 32f : 0)); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange() / 2d); }
@Override public @Nonnull BoundingBox getBounds() { return new BoundingBox(getPos()).expand(getRange(), 0, getRange()); }
default @Nonnull BoundingBox getBounds() { return new BoundingBox(getSpawnerPos()).expand(getRange(), 1d, getRange()); }
public FarmHarvestingTarget(@Nonnull TreeFarmer farmer, @Nonnull IFarmer farm) { this.farmer = farmer; this.bb = new BoundingBox(farm.getLocation(), farm.getLocation().up(30)).expand(farm.getFarmSize() + 7, 0, farm.getFarmSize() + 7); }
private @Nonnull BoundingBox scale(final @Nonnull BlockPos source, final @Nonnull BoundingBox bounds, float scale) { final double sourceX = source.getX() + .5, sourceY = source.getY() + .5, sourceZ = source.getZ() + .5; return new BoundingBox( // scale(sourceX, bounds.minX, scale), // scale(sourceY, bounds.minY, scale), // scale(sourceZ, bounds.minZ, scale), // scale(sourceX, bounds.maxX, scale), // scale(sourceY, bounds.maxY, scale), // scale(sourceZ, bounds.maxZ, scale)); }
private ConduitGeometryUtil(float size) { WIDTH = size; HEIGHT = size; HWIDTH = WIDTH / 2; HHEIGHT = HEIGHT / 2; final Vector3d core_min = new Vector3d(0.5f - HWIDTH, 0.5 - HHEIGHT, 0.5 - HWIDTH); final Vector3d core_max = new Vector3d(core_min.x + WIDTH, core_min.y + HEIGHT, core_min.z + WIDTH); CORE_BOUNDS = new BoundingBox(core_min, core_max); float connectorWidth = Math.min((2 / 16f) + (size * 3), 1); for (NNIterator<EnumFacing> itr = NNList.FACING.fastIterator(); itr.hasNext();) { EnumFacing dir = itr.next(); EXTERNAL_CONNECTOR_BOUNDS.put(dir, createExternalConnector(dir, CONNECTOR_DEPTH, connectorWidth)); } createIORingVerts(); }