21
21
import com .velocitypowered .api .proxy .ProxyServer ;
22
22
import com .velocitypowered .api .proxy .server .RegisteredServer ;
23
23
import com .velocitypowered .api .util .GameProfile ;
24
- import java .nio .charset .StandardCharsets ;
25
- import java .util .*;
26
- import java .util .regex .Matcher ;
27
- import java .util .regex .Pattern ;
28
-
29
24
import com .velocitypowered .proxy .protocol .packet .LegacyPlayerListItemPacket ;
30
25
import com .velocitypowered .proxy .protocol .packet .RemovePlayerInfoPacket ;
31
26
import com .velocitypowered .proxy .protocol .packet .UpsertPlayerInfoPacket ;
27
+ import java .nio .charset .StandardCharsets ;
28
+ import java .util .EnumSet ;
29
+ import java .util .List ;
30
+ import java .util .Optional ;
31
+ import java .util .UUID ;
32
+ import java .util .regex .Matcher ;
33
+ import java .util .regex .Pattern ;
32
34
import net .elytrium .limboapi .api .player .LimboPlayer ;
33
35
import net .elytrium .limbohub .LimboHub ;
34
36
import net .elytrium .limbohub .Settings ;
@@ -136,7 +138,9 @@ public void spawn(LimboPlayer player) {
136
138
if (this .displayName != null ) {
137
139
player .writePacketAndFlush (new SpawnEntity (this .entityId + 1 , UUID .randomUUID (), ArmorStand ::getEntityType ,
138
140
this .positionX , this .positionY - 0.175 , this .positionZ , this .pitch , this .yaw , this .yaw , 0 ));
139
- player .writePacketAndFlush (new SetEntityMetadata (this .entityId + 1 , version -> ArmorStand .buildHologramMetadata (version , processPlaceholders (this .displayName ))));
141
+ player .writePacketAndFlush (
142
+ new SetEntityMetadata (this .entityId + 1 , version -> ArmorStand .buildHologramMetadata (version , this .processPlaceholders (this .displayName )))
143
+ );
140
144
}
141
145
}
142
146
@@ -147,7 +151,7 @@ private Component processPlaceholders(String text) {
147
151
StringBuilder result = new StringBuilder ();
148
152
int lastEnd = 0 ;
149
153
150
- for (int _i = 0 ; matcher .find (); _i ++ ) {
154
+ for (; matcher .find (); ) {
151
155
result .append (text , lastEnd , matcher .start ());
152
156
153
157
// Extract the text after the colon
@@ -161,7 +165,7 @@ private Component processPlaceholders(String text) {
161
165
int playerCount = server .getPlayersConnected ().size ();
162
166
163
167
result .append (playerCount );
164
- }else {
168
+ } else {
165
169
result .append ("LIMBOHUBHUB:SERVER_NOT_FOUND" );
166
170
}
167
171
0 commit comments