aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
diff options
context:
space:
mode:
authorLorenz <ESs95s3P5z8Pheb>2022-07-07 00:31:50 +0200
committerLorenz <ESs95s3P5z8Pheb>2022-07-07 00:31:50 +0200
commit99773d6a593c444151503de315f127bea6f74d49 (patch)
tree9ee1ae505e5f82aba62f10c882af85a3acd6e483 /src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
downloadskyhanni-99773d6a593c444151503de315f127bea6f74d49.tar.gz
skyhanni-99773d6a593c444151503de315f127bea6f74d49.tar.bz2
skyhanni-99773d6a593c444151503de315f127bea6f74d49.zip
init lorenz mod
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java b/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
new file mode 100644
index 000000000..1a73e9558
--- /dev/null
+++ b/src/main/java/com/thatgravyboat/skyblockhud/utils/ComponentBuilder.java
@@ -0,0 +1,54 @@
+package com.thatgravyboat.skyblockhud.utils;
+
+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();
+ }
+}