Class GeneralUtils
java.lang.Object
io.github.sefiraat.slimetinker.utils.GeneralUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanday(org.bukkit.World world) static org.bukkit.Locationstatic introll(int upper) Rolls a number starting from 1 to upperstatic introll(int upper, boolean upLimit) Rolls a number starting from 1 to upperstatic StringserializeLocation(org.bukkit.Location l) static booleantestChance(int chance, int upper) Tests a chance roll starting from 1 to upper
-
Method Details
-
day
public static boolean day(@Nonnull org.bukkit.World world) -
serializeLocation
-
deserializeLocation
-
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 thanupper- 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
-