Class MaskUtils

java.lang.Object
me.hsgamer.hscore.minecraft.gui.mask.MaskUtils

public class MaskUtils extends Object
The utility class for Mask
  • Method Details

    • toSlot

      public static int toSlot(int x, int y, int slotPerRow)
      Get the raw slot from the position
      Parameters:
      x - the x position
      y - the y position
      slotPerRow - 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 position
      y - the y position
      Returns:
      the raw slot
    • toPosition

      @NotNull public static @NotNull InventoryPosition toPosition(int slot, int slotPerRow)
      Convert the slot to the position
      Parameters:
      slot - the slot
      slotPerRow - the number of slots for each row
      Returns:
      the position
    • toPosition

      @NotNull public static @NotNull InventoryPosition toPosition(int slot)
      Convert the slot to the position, assuming the number of slots for each row is 9
      Parameters:
      slot - the slot
      Returns:
      the position
    • toSlot

      public static int toSlot(@NotNull @NotNull InventoryPosition position, int slotPerRow)
      Get the raw slot from the position
      Parameters:
      position - the pair value for the position
      slotPerRow - the number of slots for each row
      Returns:
      the raw slot
    • toSlot

      public static int toSlot(@NotNull @NotNull InventoryPosition position)
      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

      public static IntStream generateAreaSlots(int x1, int y1, int x2, int y2, int slotPerRow)
      Generate the stream of slots in the area between two positions
      Parameters:
      x1 - the x of the first position
      y1 - the y of the first position
      x2 - the x of the second position
      y2 - the y of the second position
      slotPerRow - the number of slots for each row
      Returns:
      the stream of slots
    • generateAreaSlots

      public static IntStream generateAreaSlots(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 9
      Parameters:
      x1 - the x of the first position
      y1 - the y of the first position
      x2 - the x of the second position
      y2 - 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 position
      position2 - the second position
      slotPerRow - 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 position
      position2 - 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 position
      y1 - the y of the first position
      x2 - the x of the second position
      y2 - the y of the second position
      slotPerRow - the number of slots for each row
      Returns:
      the stream of slots
    • generateOutlineSlots

      @NotNull public static @NotNull IntStream generateOutlineSlots(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 9
      Parameters:
      x1 - the x of the first position
      y1 - the y of the first position
      x2 - the x of the second position
      y2 - 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 position
      position2 - the second position
      slotPerRow - 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 position
      position2 - the second position
      Returns:
      the stream of slots