Skip to content

Commit 699b39d

Browse files
DHCPCD9JNNGL
authored andcommitted
format: code style
1 parent 5272252 commit 699b39d

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/main/java/net/elytrium/limbohub/LimboHub.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public void reload() {
321321
Settings.IMP.MAIN.NPCS.forEach(data -> {
322322
NPC npc = new NPC(
323323
data.DISPLAY_NAME.isBlank() ? null : data.DISPLAY_NAME, data.X, data.Y,
324-
data.Z, (float) data.YAW, (float) data.PITCH, data.LOAD_SKIN ? data.SKIN_DATA : null, data.ACTION, data.COOLDOWN, server
324+
data.Z, (float) data.YAW, (float) data.PITCH, data.LOAD_SKIN ? data.SKIN_DATA : null, data.ACTION, data.COOLDOWN, this.server
325325
);
326326

327327
this.npcs.put(npc.getEntityId(), npc);

src/main/java/net/elytrium/limbohub/entities/NPC.java

+12-8
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@
2121
import com.velocitypowered.api.proxy.ProxyServer;
2222
import com.velocitypowered.api.proxy.server.RegisteredServer;
2323
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-
2924
import com.velocitypowered.proxy.protocol.packet.LegacyPlayerListItemPacket;
3025
import com.velocitypowered.proxy.protocol.packet.RemovePlayerInfoPacket;
3126
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;
3234
import net.elytrium.limboapi.api.player.LimboPlayer;
3335
import net.elytrium.limbohub.LimboHub;
3436
import net.elytrium.limbohub.Settings;
@@ -136,7 +138,9 @@ public void spawn(LimboPlayer player) {
136138
if (this.displayName != null) {
137139
player.writePacketAndFlush(new SpawnEntity(this.entityId + 1, UUID.randomUUID(), ArmorStand::getEntityType,
138140
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+
);
140144
}
141145
}
142146

@@ -147,7 +151,7 @@ private Component processPlaceholders(String text) {
147151
StringBuilder result = new StringBuilder();
148152
int lastEnd = 0;
149153

150-
for (int _i = 0; matcher.find(); _i++) {
154+
for (; matcher.find(); ) {
151155
result.append(text, lastEnd, matcher.start());
152156

153157
// Extract the text after the colon
@@ -161,7 +165,7 @@ private Component processPlaceholders(String text) {
161165
int playerCount = server.getPlayersConnected().size();
162166

163167
result.append(playerCount);
164-
}else{
168+
} else {
165169
result.append("LIMBOHUBHUB:SERVER_NOT_FOUND");
166170
}
167171

0 commit comments

Comments
 (0)