Search in sources :

Example 11 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class SpawningSphereRenderer method render.

@Override
public void render(BoundingBoxSpawningSphere boundingBox) {
    Point point = boundingBox.getPoint();
    OffsetPoint sphereCenter = new OffsetPoint(point);
    Color safeAreaColor = ColorHelper.getColor(ConfigManager.colorAFKSpheresSafeArea);
    renderSphere(point, BoundingBoxSpawningSphere.SAFE_RADIUS, safeAreaColor);
    renderOuterSphere(boundingBox, point);
    OffsetBox offsetBox = new OffsetBox(sphereCenter, sphereCenter).grow(0.5, 0, 0.5);
    renderCuboid(offsetBox, safeAreaColor);
    Integer spawnableSpacesCount = boundingBox.getSpawnableSpacesCount();
    if (spawnableSpacesCount != null) {
        renderText(sphereCenter, I18n.format("bbor.renderer.spawningSphere.spawnable"), spawnableSpacesCount == 0 ? I18n.format("bbor.renderer.spawningSphere.none") : String.format("%,d", spawnableSpacesCount));
    }
    renderSphere(point, BoundingBoxSpawningSphere.SAFE_RADIUS, safeAreaColor);
    if (ConfigManager.renderAFKSpawnableBlocks.get() && boundingBox.isWithinSphere(Player.getPoint())) {
        renderSpawnableSpaces(boundingBox);
    }
}
Also used : Point(com.irtimaled.bbor.client.models.Point)

Example 12 with Point

use of com.irtimaled.bbor.client.models.Point in project BoundingBoxOutlineReloaded by irtimaled.

the class LineCommandBuilder method addLine.

private static int addLine(CommandContext<CommandSource> context) throws CommandSyntaxException {
    Point from = Arguments.getPoint(context, ArgumentNames.FROM).snapXZ(0.5d);
    Point to = Arguments.getPoint(context, ArgumentNames.TO).snapXZ(0.5d);
    Double width = Arguments.getDouble(context, WIDTH);
    CustomLineProvider.add(from, to, width);
    CommandHelper.feedback(context, "bbor.commands.line.added", from.getX(), from.getY(), from.getZ(), to.getX(), to.getY(), to.getZ());
    return 0;
}
Also used : Point(com.irtimaled.bbor.client.models.Point)

Aggregations

Point (com.irtimaled.bbor.client.models.Point)12 DimensionId (com.irtimaled.bbor.common.models.DimensionId)4 BoundingBoxLine (com.irtimaled.bbor.client.models.BoundingBoxLine)1 BoundingBoxSphere (com.irtimaled.bbor.client.models.BoundingBoxSphere)1 BlockState (net.minecraft.block.BlockState)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1