modify toml4j fork to automatically add new fields without overwriting previous ones and setup motd

This commit is contained in:
Taah
2022-05-04 05:18:07 -07:00
parent 6756f2db76
commit b072e49d85
45 changed files with 3708 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
package dev.plex.util;
import net.kyori.adventure.text.format.NamedTextColor;
import java.util.concurrent.ThreadLocalRandom;
public class RandomUtil
{
public static NamedTextColor getRandomColor()
{
NamedTextColor[] colors = NamedTextColor.NAMES.values().stream().filter(namedTextColor -> namedTextColor != NamedTextColor.BLACK && namedTextColor != NamedTextColor.DARK_BLUE).toArray(NamedTextColor[]::new);
return colors[randomNum(colors.length)];
}
public static boolean randomBoolean()
{
return ThreadLocalRandom.current().nextBoolean();
}
public static int randomNum()
{
return ThreadLocalRandom.current().nextInt();
}
public static int randomNum(int limit)
{
return ThreadLocalRandom.current().nextInt(limit);
}
public static int randomNum(int start, int limit)
{
return ThreadLocalRandom.current().nextInt(start, limit);
}
}