-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BookTools - Added a rainbow text button to the book edit screen.
- Loading branch information
Showing
2 changed files
with
89 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,34 @@ | |
* @author Tas [@0xTas] <[email protected]> | ||
**/ | ||
public class StardustUtil { | ||
public enum RainbowColor { | ||
Reds(new String[]{"§c", "§4"}), | ||
Yellows(new String[]{"§e", "§6"}), | ||
Greens(new String[]{"§a", "§2"}), | ||
Cyans(new String[]{"§b", "§3"}), | ||
Blues(new String[]{"§9", "§1"}), | ||
Purples(new String[]{"§d", "§5"}); | ||
|
||
public final String[] labels; | ||
|
||
RainbowColor(String[] labels) { this.labels = labels; } | ||
|
||
public static RainbowColor getFirst() { | ||
return RainbowColor.values()[ThreadLocalRandom.current().nextInt(RainbowColor.values().length)]; | ||
} | ||
|
||
public static RainbowColor getNext(RainbowColor previous) { | ||
return switch (previous) { | ||
case Reds -> Yellows; | ||
case Yellows -> Greens; | ||
case Greens -> Cyans; | ||
case Cyans -> Blues; | ||
case Blues -> Purples; | ||
case Purples -> Reds; | ||
}; | ||
} | ||
} | ||
|
||
public enum TextColor { | ||
Black("§0"), White("§f"), Gray("§8"), Light_Gray("§7"), | ||
Dark_Green("§2"), Green("§a"), Dark_Aqua("§3"), Aqua("§b"), | ||
|