File tree Expand file tree Collapse file tree 1 file changed +13
-16
lines changed
dist/src/main/kotlin/kr/toxicity/hud/util Expand file tree Collapse file tree 1 file changed +13
-16
lines changed Original file line number Diff line number Diff line change @@ -49,20 +49,17 @@ fun Int.parseChar(): String {
49
49
}
50
50
51
51
fun Int.toSpaceComponent () = toSpaceComponent(this )
52
- fun Int.toSpaceComponent (width : Int ): WidthComponent {
53
- val builder = Component .text()
54
- return if (VERSION .version <= 18 ) {
55
- val abs = abs(this )
56
- if (abs > 256 ) {
57
- val i = (if (this > 0 ) 1 else - 1 )
58
- WidthComponent (
59
- builder.font(LEGACY_SPACE_KEY )
60
- .append(Component .text(((abs / 256 + 255 ) * i + 0xFFC00 ).parseChar()))
61
- .append(Component .text(((abs % 256 ) * i + 0xFFC00 ).parseChar())),
62
- width
63
- )
64
- } else WidthComponent (builder.font(LEGACY_SPACE_KEY ).content((this + 0xFFC00 ).parseChar()), width)
65
- } else {
66
- WidthComponent (builder.font(SPACE_KEY ).content((this + 0xD0000 ).parseChar()), width)
67
- }
52
+ fun Int.toSpaceComponent (width : Int ) = if (VERSION .version <= 18 ) {
53
+ val abs = abs(this )
54
+ if (abs > 256 ) {
55
+ val i = if (this > 0 ) 1 else - 1
56
+ WidthComponent (
57
+ Component .text().font(LEGACY_SPACE_KEY )
58
+ .append(Component .text(((abs / 256 + 255 ) * i + 0xFFC00 ).parseChar()))
59
+ .append(Component .text(((abs % 256 ) * i + 0xFFC00 ).parseChar())),
60
+ width
61
+ )
62
+ } else WidthComponent (Component .text().font(LEGACY_SPACE_KEY ).content((this + 0xFFC00 ).parseChar()), width)
63
+ } else {
64
+ WidthComponent (Component .text().font(SPACE_KEY ).content((this + 0xD0000 ).parseChar()), width)
68
65
}
You can’t perform that action at this time.
0 commit comments