Class MaskUtils
java.lang.Object
io.github.projectunified.craftux.mask.MaskUtils
Utility class providing static methods for generating position lists used in masks.
Includes methods for creating filled areas and outline borders between two positions.
Example usage:
Position start = Position.of(0, 0);
Position end = Position.of(2, 2);
List<Position> area = MaskUtils.generateAreaPositions(start, end); // 3x3 grid
List<Position> outline = MaskUtils.generateOutlinePositions(start, end); // border
-
Method Summary
Modifier and TypeMethodDescriptiongenerateAreaPositions(@NotNull Position position1, @NotNull Position position2) Generate the stream of positions in the area between two positionsgenerateOutlinePositions(@NotNull Position position1, @NotNull Position position2) Get the stream of positions drawing the outline of the area between 2 positions
-
Method Details
-
generateAreaPositions
@NotNull public static @NotNull List<Position> generateAreaPositions(@NotNull @NotNull Position position1, @NotNull @NotNull Position position2) Generate the stream of positions in the area between two positions- Parameters:
position1- the first positionposition2- the second position- Returns:
- the stream of positions
-
generateOutlinePositions
@NotNull public static @NotNull List<Position> generateOutlinePositions(@NotNull @NotNull Position position1, @NotNull @NotNull Position position2) Get the stream of positions drawing the outline of the area between 2 positions- Parameters:
position1- the first positionposition2- the second position- Returns:
- the stream of positions
-