diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-06 15:10:29 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-06 15:10:29 -0230 |
commit | 6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a (patch) | |
tree | 7451e53ceeae3c324d83a7faba83ce80005e6f23 /src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java | |
download | SkyblockHud-Death-Defied-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.tar.gz SkyblockHud-Death-Defied-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.tar.bz2 SkyblockHud-Death-Defied-6d8e1e5659f64a4f9ba86d6ab5bbc8e688faf22a.zip |
Initial Commit
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java b/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java new file mode 100644 index 0000000..e5299d5 --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java @@ -0,0 +1,55 @@ +package com.thatgravyboat.skyblockhud; + +public class ComponentBuilder { + + public StringBuilder builder; + + public ComponentBuilder(){ + this.builder = new StringBuilder(); + } + + public ComponentBuilder apd(String text) { + return apd(text, '7'); + } + + public ComponentBuilder apd(String text, char[] colors) { + for (char color: colors) { + builder.append("\u00A7").append(color); + } + builder.append(text).append("\u00A7").append('r'); + return this; + } + + public ComponentBuilder apd(String text, char color) { + builder.append("\u00A7").append(color).append(text).append("\u00A7").append('r'); + return this; + } + + public ComponentBuilder nl(){ + builder.append("\n"); + return this; + } + + public ComponentBuilder nl(String text, char color){ + apd(text, color); + builder.append("\n"); + return this; + } + + public ComponentBuilder nl(String text, char[] colors){ + apd(text, colors); + builder.append("\n"); + return this; + } + + public ComponentBuilder nl(String text){ + apd(text); + builder.append("\n"); + return this; + } + + public String build() { + return builder.toString(); + } + +} |