Skip to content

Commit 2d2a7d8

Browse files
committed
Spaces at the start of line comments
1 parent 29099a4 commit 2d2a7d8

File tree

15 files changed

+57
-61
lines changed

15 files changed

+57
-61
lines changed

addon/src/main/java/com/jaimemartz/playerbalanceraddon/PlayerBalancerAddon.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public void onEnable() {
1919

2020
@Override
2121
public void onDisable() {
22-
//Nothing to do...
22+
// Nothing to do...
2323
}
2424

2525
public PluginMessageManager getManager() {

addon/src/main/java/com/jaimemartz/playerbalanceraddon/PlayerBalancerPlaceholderExpansion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public String onRequest(OfflinePlayer player, String identifier) {
2222
if (section == null)
2323
return null;
2424

25-
//For the first call this placeholder will return 0
26-
//For the next one, the result of the previous one
25+
// For the first call this placeholder will return 0
26+
// For the next one, the result of the previous one
2727
plugin.getManager().getSectionPlayerCount(section, (count) -> {
2828
sectionPlayerCounts.put(section, count);
2929
});

addon/src/main/java/com/jaimemartz/playerbalanceraddon/PluginMessageManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public PluginMessageManager(PlayerBalancerAddon plugin) {
2727
plugin.getServer().getMessenger().registerIncomingPluginChannel(plugin, PB_CHANNEL, this);
2828
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, PB_CHANNEL);
2929

30-
//In case we need to use BungeeCord channels
30+
// In case we need to use BungeeCord channels
3131
plugin.getServer().getMessenger().registerIncomingPluginChannel(plugin, BC_CHANNEL, this);
3232
plugin.getServer().getMessenger().registerOutgoingPluginChannel(plugin, BC_CHANNEL);
3333
}

balancer/src/main/java/com/jaimemartz/playerbalancer/PlayerBalancer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void onEnable() {
7878

7979
public boolean checkUpToDate() {
8080
try {
81-
URLConnection con = new URL("https://api.spigotmc.org/legacy/update.php?resource=10788").openConnection();
81+
URLConnection con = new URL("https:// api.spigotmc.org/legacy/update.php?resource=10788").openConnection();
8282
String reply = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine();
8383
return getDescription().getVersion().equals(reply);
8484
} catch (IOException e) {
@@ -89,7 +89,7 @@ public boolean checkUpToDate() {
8989

9090
@Override
9191
public void onDisable() {
92-
//Nothing else to do than normal stop
92+
// Nothing else to do than normal stop
9393
this.execStop();
9494
}
9595

@@ -198,7 +198,7 @@ private void execStop() {
198198
}
199199

200200
if (settings.getGeneralProps().isEnabled()) {
201-
//Do not try to do anything if the plugin has not loaded correctly
201+
// Do not try to do anything if the plugin has not loaded correctly
202202
if (failed) return;
203203

204204
if (settings.getGeneralProps().isAutoReload()) {

balancer/src/main/java/com/jaimemartz/playerbalancer/connection/ConnectionIntent.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,10 @@ public void execute() {
3939
.replace("{alias}", safeNull(section.getProps().getAlias()))
4040
);
4141

42+
// Ensure a new copy of the section servers
4243
List<ServerInfo> servers = new ArrayList<>(section.getServers());
4344

44-
//Prevents removing servers from the section
45-
if (servers == section.getServers()) {
46-
throw new IllegalStateException("The servers list parameter is the same reference, this cannot happen");
47-
}
48-
49-
//Prevents connections to the same server
45+
// Prevents connections to the same server
5046
Server current = player.getServer();
5147
if (current != null) {
5248
servers.remove(current.getInfo());
@@ -56,7 +52,7 @@ public void execute() {
5652
ServerInfo target = this.fetchServer(player, section, section.getImplicitProvider(), servers);
5753
if (target != null) {
5854
this.connect(target, (response, throwable) -> {
59-
if (response) { //only if the connect has been executed correctly
55+
if (response) { // only if the connect has been executed correctly
6056
MessageUtils.send(player, plugin.getSettings().getMessagesProps().getConnectedMessage(),
6157
(str) -> str.replace("{server}", target.getName())
6258
.replace("{section}", section.getName())

balancer/src/main/java/com/jaimemartz/playerbalancer/helper/PasteHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public URL paste(PlayerBalancer plugin) throws Exception {
3737
try (FileInputStream stream = new FileInputStream(file)) {
3838
try (InputStreamReader reader = new InputStreamReader(stream, "UTF-8")) {
3939
String content = CharStreams.toString(reader);
40-
HastebinPaste paste = new HastebinPaste("https://file.properties/paste/", content);
40+
HastebinPaste paste = new HastebinPaste("https:// file.properties/paste/", content);
4141
return paste.paste();
4242
}
4343
}
@@ -62,7 +62,7 @@ public URL paste(PlayerBalancer plugin) throws Exception {
6262
try (InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
6363
String content = CharStreams.toString(reader);
6464
content = content.replaceAll("[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}", "?.?.?.?");
65-
HastebinPaste paste = new HastebinPaste("https://file.properties/paste/", content);
65+
HastebinPaste paste = new HastebinPaste("https:// file.properties/paste/", content);
6666
return paste.paste();
6767
}
6868
}
@@ -86,7 +86,7 @@ public URL paste(PlayerBalancer plugin) throws Exception {
8686
try (FileInputStream stream = new FileInputStream(file)) {
8787
try (InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8)) {
8888
String content = CharStreams.toString(reader);
89-
HastebinPaste paste = new HastebinPaste("https://file.properties/paste/", content);
89+
HastebinPaste paste = new HastebinPaste("https:// file.properties/paste/", content);
9090
return paste.paste();
9191
}
9292
}

balancer/src/main/java/com/jaimemartz/playerbalancer/listeners/PluginMessageListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public PluginMessageListener(PlayerBalancer plugin) {
3131
this.plugin = plugin;
3232
GsonBuilder builder = new GsonBuilder();
3333

34-
//Only serialize the name of ServerInfo
34+
// Only serialize the name of ServerInfo
3535
builder.registerTypeAdapter(ServerInfo.class, (JsonSerializer<ServerInfo>) (server, type, context) ->
3636
context.serialize(server.getName())
3737
);

balancer/src/main/java/com/jaimemartz/playerbalancer/listeners/ServerConnectListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ private ServerSection getSection(ProxiedPlayer player, ServerInfo target) {
5656
ServerSection section = plugin.getSectionManager().getByServer(target);
5757

5858
if (section != null) {
59-
//Checks only for servers (not the section server)
59+
// Checks only for servers (not the section server)
6060
if (!target.equals(section.getServer())) {
6161
if (plugin.getSectionManager().isDummy(section)) {
6262
return null;

balancer/src/main/java/com/jaimemartz/playerbalancer/ping/PingTactic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public void ping(ServerInfo server, Callback<ServerStatus> callback, PlayerBalan
3737
try {
3838
server.ping((ping, throwable) -> {
3939
if (ping != null) {
40-
//using deprecated method for bungee 1.8 compatibility
40+
// Using deprecated method for bungee 1.8 compatibility
4141
callback.done(new ServerStatus(
4242
ping.getDescription(),
4343
ping.getPlayers().getOnline(),

balancer/src/main/java/com/jaimemartz/playerbalancer/section/SectionManager.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@ public ServerSection getByPlayer(ProxiedPlayer player) {
236236

237237
public void registerServer(ServerInfo server, ServerSection section) {
238238
if (!isDummy(section)) {
239-
// Checking for already we already added this server to other section
240-
// This can only happen if another non dummy section registers this server
239+
// Checking for already we already added this server to other section
240+
// This can only happen if another non dummy section registers this server
241241
if (servers.containsKey(server)) {
242242
ServerSection other = servers.get(server);
243243
throw new IllegalArgumentException(String.format(
@@ -259,7 +259,7 @@ public void registerServer(ServerInfo server, ServerSection section) {
259259
public void calculateServers(ServerSection section) {
260260
Set<ServerInfo> results = new HashSet<>();
261261

262-
//Searches for matches
262+
// Searches for matches
263263
section.getProps().getServerEntries().forEach(entry -> {
264264
Pattern pattern = Pattern.compile(entry);
265265
plugin.getProxy().getServers().forEach((name, server) -> {
@@ -270,7 +270,7 @@ public void calculateServers(ServerSection section) {
270270
});
271271
});
272272

273-
//Checks if there are servers previously matched that are no longer valid
273+
// Checks if there are servers previously matched that are no longer valid
274274
section.getServers().forEach(server -> {
275275
if (!results.contains(server)) {
276276
servers.remove(server);
@@ -281,7 +281,7 @@ public void calculateServers(ServerSection section) {
281281
}
282282
});
283283

284-
//Add matched servers to the section
284+
// Add matched servers to the section
285285
int addedServers = 0;
286286
for (ServerInfo server : results) {
287287
if (!section.getServers().contains(server)) {
@@ -306,7 +306,7 @@ public void calculateServers(ServerSection section) {
306306
public int calculatePosition(ServerSection section) {
307307
ServerSection current = section;
308308

309-
//Calculate above principal
309+
// Calculate above principal
310310
int iterations = 0;
311311
while (current != null) {
312312
if (current == principal) {
@@ -317,7 +317,7 @@ public int calculatePosition(ServerSection section) {
317317
iterations++;
318318
}
319319

320-
//Calculate below principal
320+
// Calculate below principal
321321
if (principal != null) {
322322
iterations = 0;
323323
current = principal;

0 commit comments

Comments
 (0)