Class MaskUtils
java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.MaskUtils
The utility class for
Mask-
Method Summary
Modifier and TypeMethodDescriptionstatic IntStreamgenerateAreaSlots(int x1, int y1, int x2, int y2) Generate the stream of slots in the area between two positions, assuming the number of slots for each row is 9static IntStreamgenerateAreaSlots(int x1, int y1, int x2, int y2, int slotPerRow) Generate the stream of slots in the area between two positionsstatic @NotNull IntStreamgenerateAreaSlots(@NotNull InventoryPosition position1, @NotNull InventoryPosition position2) Generate the stream of slots in the area between two positions, assuming the number of slots for each row is 9static @NotNull IntStreamgenerateAreaSlots(@NotNull InventoryPosition position1, @NotNull InventoryPosition position2, int slotPerRow) Generate the stream of slots in the area between two positionsstatic @NotNull IntStreamgenerateOutlineSlots(int x1, int y1, int x2, int y2) Get the stream of slots drawing the outline of the area between 2 positions, assuming the number of slots for each row is 9static @NotNull IntStreamgenerateOutlineSlots(int x1, int y1, int x2, int y2, int slotPerRow) Get the stream of slots drawing the outline of the area between 2 positionsstatic @NotNull IntStreamgenerateOutlineSlots(InventoryPosition position1, InventoryPosition position2) Get the stream of slots drawing the outline of the area between 2 positions, assuming the number of slots for each row is 9static @NotNull IntStreamgenerateOutlineSlots(InventoryPosition position1, InventoryPosition position2, int slotPerRow) Get the stream of slots drawing the outline of the area between 2 positionsstatic @NotNull InventoryPositiontoPosition(int slot) Convert the slot to the position, assuming the number of slots for each row is 9static @NotNull InventoryPositiontoPosition(int slot, int slotPerRow) Convert the slot to the positionstatic inttoSlot(int x, int y) Get the raw slot from the position, assuming the number of slots for each row is 9static inttoSlot(int x, int y, int slotPerRow) Get the raw slot from the positionstatic inttoSlot(@NotNull InventoryPosition position) Get the raw slot from the position, assuming the number of slots for each row is 9static inttoSlot(@NotNull InventoryPosition position, int slotPerRow) Get the raw slot from the position
-
Method Details
-
toSlot
public static int toSlot(int x, int y, int slotPerRow) Get the raw slot from the position- Parameters:
x- the x positiony- the y positionslotPerRow- the number of slots for each row- Returns:
- the raw slot
-
toSlot
public static int toSlot(int x, int y) Get the raw slot from the position, assuming the number of slots for each row is 9- Parameters:
x- the x positiony- the y position- Returns:
- the raw slot
-
toPosition
Convert the slot to the position- Parameters:
slot- the slotslotPerRow- the number of slots for each row- Returns:
- the position
-
toPosition
Convert the slot to the position, assuming the number of slots for each row is 9- Parameters:
slot- the slot- Returns:
- the position
-
toSlot
Get the raw slot from the position- Parameters:
position- the pair value for the positionslotPerRow- the number of slots for each row- Returns:
- the raw slot
-
toSlot
Get the raw slot from the position, assuming the number of slots for each row is 9- Parameters:
position- the pair value for the position- Returns:
- the raw slot
-
generateAreaSlots
Generate the stream of slots in the area between two positions- Parameters:
x1- the x of the first positiony1- the y of the first positionx2- the x of the second positiony2- the y of the second positionslotPerRow- the number of slots for each row- Returns:
- the stream of slots
-
generateAreaSlots
Generate the stream of slots in the area between two positions, assuming the number of slots for each row is 9- Parameters:
x1- the x of the first positiony1- the y of the first positionx2- the x of the second positiony2- the y of the second position- Returns:
- the stream of slots
-
generateAreaSlots
@NotNull public static @NotNull IntStream generateAreaSlots(@NotNull @NotNull InventoryPosition position1, @NotNull @NotNull InventoryPosition position2, int slotPerRow) Generate the stream of slots in the area between two positions- Parameters:
position1- the first positionposition2- the second positionslotPerRow- the number of slots for each row- Returns:
- the stream of slots
-
generateAreaSlots
@NotNull public static @NotNull IntStream generateAreaSlots(@NotNull @NotNull InventoryPosition position1, @NotNull @NotNull InventoryPosition position2) Generate the stream of slots in the area between two positions, assuming the number of slots for each row is 9- Parameters:
position1- the first positionposition2- the second position- Returns:
- the stream of slots
-
generateOutlineSlots
@NotNull public static @NotNull IntStream generateOutlineSlots(int x1, int y1, int x2, int y2, int slotPerRow) Get the stream of slots drawing the outline of the area between 2 positions- Parameters:
x1- the x of the first positiony1- the y of the first positionx2- the x of the second positiony2- the y of the second positionslotPerRow- the number of slots for each row- Returns:
- the stream of slots
-
generateOutlineSlots
Get the stream of slots drawing the outline of the area between 2 positions, assuming the number of slots for each row is 9- Parameters:
x1- the x of the first positiony1- the y of the first positionx2- the x of the second positiony2- the y of the second position- Returns:
- the stream of slots
-
generateOutlineSlots
@NotNull public static @NotNull IntStream generateOutlineSlots(InventoryPosition position1, InventoryPosition position2, int slotPerRow) Get the stream of slots drawing the outline of the area between 2 positions- Parameters:
position1- the first positionposition2- the second positionslotPerRow- the number of slots for each row- Returns:
- the stream of slots
-
generateOutlineSlots
@NotNull public static @NotNull IntStream generateOutlineSlots(InventoryPosition position1, InventoryPosition position2) Get the stream of slots drawing the outline of the area between 2 positions, assuming the number of slots for each row is 9- Parameters:
position1- the first positionposition2- the second position- Returns:
- the stream of slots
-