Class GeneralUtils

java.lang.Object
io.github.sefiraat.slimetinker.utils.GeneralUtils

public final class GeneralUtils extends Object
  • Method Details

    • day

      public static boolean day(@Nonnull org.bukkit.World world)
    • serializeLocation

      @Nonnull public static String serializeLocation(@Nonnull org.bukkit.Location l)
    • deserializeLocation

      @Nonnull public static org.bukkit.Location deserializeLocation(@Nonnull String s)
    • testChance

      public static boolean testChance(int chance, int upper)
      Tests a chance roll starting from 1 to upper
      Parameters:
      chance - The number the roll must be lower than
      upper - The highest possible number that could roll (inclusive)
      Returns:
      true if roll passes
    • roll

      public static int roll(int upper)
      Rolls a number starting from 1 to upper
      Parameters:
      upper - The highest possible number that could roll (inclusive)
      Returns:
      rolled int
    • roll

      public static int roll(int upper, boolean upLimit)
      Rolls a number starting from 1 to upper
      Parameters:
      upper - The highest possible number that could roll (inclusive)
      upLimit - If true, the bound will be increased for 1 for inclusivity while maintaining readability for manually typed numbers (i.e. Upper 50 converts to 51 returning a max of 50 still). Set false when using 0 based indexes (list.size())
      Returns:
      rolled int