Rename WINNING_SCORE to CAPTURE_SCORE in GameConfig.
Updated variable and configuration references to reflect the renaming of WINNING_SCORE to CAPTURE_SCORE for clarity and consistency. Adjusted related usage in Flag class to align with the new naming convention.
This commit is contained in:
parent
8411db57a1
commit
7070165a94
|
|
@ -86,7 +86,7 @@ public class GameConfig extends AbstractConfig {
|
||||||
public static double y = 0;
|
public static double y = 0;
|
||||||
public static double z = 0;
|
public static double z = 0;
|
||||||
public static double CAPTURE_RADIUS = 5;
|
public static double CAPTURE_RADIUS = 5;
|
||||||
public static int WINNING_SCORE = 50;
|
public static int CAPTURE_SCORE = 50;
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
@SuppressWarnings("unused")
|
||||||
private static void load() {
|
private static void load() {
|
||||||
|
|
@ -95,7 +95,7 @@ public class GameConfig extends AbstractConfig {
|
||||||
y = config.getDouble(prefix, "y", y);
|
y = config.getDouble(prefix, "y", y);
|
||||||
z = config.getDouble(prefix, "z", z);
|
z = config.getDouble(prefix, "z", z);
|
||||||
CAPTURE_RADIUS = config.getDouble(prefix, "capture-radius", CAPTURE_RADIUS);
|
CAPTURE_RADIUS = config.getDouble(prefix, "capture-radius", CAPTURE_RADIUS);
|
||||||
WINNING_SCORE = config.getInt(prefix, "winning-score", WINNING_SCORE);
|
CAPTURE_SCORE = config.getInt(prefix, "capture-score", CAPTURE_SCORE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ public class Flag implements Runnable {
|
||||||
if (max.isEmpty()) {
|
if (max.isEmpty()) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
if (max.get().getValue() < GameConfig.FLAG.WINNING_SCORE) {
|
if (max.get().getValue() < GameConfig.FLAG.CAPTURE_SCORE) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
return gameManager.getTeam(max.get().getKey());
|
return gameManager.getTeam(max.get().getKey());
|
||||||
|
|
@ -282,7 +282,7 @@ public class Flag implements Runnable {
|
||||||
bossBar.setTitle(String.format("Team %s is capturing the flag", PlainTextComponentSerializer.plainText().serialize(team.get().getName())));
|
bossBar.setTitle(String.format("Team %s is capturing the flag", PlainTextComponentSerializer.plainText().serialize(team.get().getName())));
|
||||||
lastWinningTeamId = highestKey;
|
lastWinningTeamId = highestKey;
|
||||||
}
|
}
|
||||||
bossBar.setProgress(Math.min(GameConfig.FLAG.WINNING_SCORE, teamFlagPointCount.get(highestKey)) / (double) GameConfig.FLAG.WINNING_SCORE);
|
bossBar.setProgress(Math.min(GameConfig.FLAG.CAPTURE_SCORE, teamFlagPointCount.get(highestKey)) / (double) GameConfig.FLAG.CAPTURE_SCORE);
|
||||||
bossBar.setVisible(teamFlagPointCount.get(highestKey) > 0);
|
bossBar.setVisible(teamFlagPointCount.get(highestKey) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user