diff options
author | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:13:01 -0400 |
---|---|---|
committer | TymanWasTaken <tyman@tyman.tech> | 2021-07-06 17:13:01 -0400 |
commit | bb75fd7b83b238f1f922ffc64b2a0a535c5524b7 (patch) | |
tree | 617c91cced71f672662bddea6c540939cb9a3953 /src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java | |
parent | 91464c8f433e8bf323932ac956678971207b607e (diff) | |
download | SkyblockHud-Death-Defied-bb75fd7b83b238f1f922ffc64b2a0a535c5524b7.tar.gz SkyblockHud-Death-Defied-bb75fd7b83b238f1f922ffc64b2a0a535c5524b7.tar.bz2 SkyblockHud-Death-Defied-bb75fd7b83b238f1f922ffc64b2a0a535c5524b7.zip |
Format
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java | 104 |
1 files changed, 54 insertions, 50 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java b/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java index e5299d5..4e6f398 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/ComponentBuilder.java @@ -2,54 +2,58 @@ 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(); - } - + 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(); + } } |