Skip to content

Commit

Permalink
- fixed creating config.yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzybol committed Jan 22, 2024
1 parent b2c7335 commit d3714a8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>betterbox.mine.game</groupId>
<artifactId>BetterElo</artifactId>
<version>3.1.12-SNAPSHOT</version>
<version>3.1.13-SNAPSHOT</version>
<packaging>jar</packaging>

<name>BetterElo</name>
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/betterbox/mine/game/betterelo/BetterElo.java
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ public void run() {
}
}.runTaskLater(this, delay);
}


private void rewardAndReschedule(String period, long periodMillis, boolean useNextMonthTime) {
pluginLogger.log(PluginLogger.LogLevel.DEBUG, "BetterElo: rewardAndReschedule: Starting rewardTopPlayers");
rewardTopPlayers(period);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,11 +385,6 @@ private boolean handleBanCommand(CommandSender sender, String banName) {
return false;
}
}





public String getOfflinePlayerUUID(String playerName) {
pluginLogger.log(PluginLogger.LogLevel.DEBUG, "BetterEloCommand: getOfflinePlayerUUID called with parameter " + playerName);
try {
Expand All @@ -403,7 +398,6 @@ public String getOfflinePlayerUUID(String playerName) {
return null;
}
}

private String formatTime(long millis) {
long seconds = millis / 1000;
long minutes = seconds / 60;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/betterbox/mine/game/betterelo/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private double handleKillEvent(String rankingType, Player victim, Player killer)
// Zapisz informacje do bazy danych
PlayerKillDatabase playerKillDatabase = new PlayerKillDatabase(pluginLogger);
pluginLogger.log(PluginLogger.LogLevel.DEBUG, "Event: handleKillEvent calling saveKillData");
playerKillDatabase.saveKillData(rankingType, victim.getName(), killer.getName(), pointsEarned, dataManager.getPoints(killer.getUniqueId().toString(),rankingType), dataManager.getPoints(victim.getUniqueId().toString(),rankingType));
playerKillDatabase.saveKillData(rankingType, victim.getName(), killer.getName(), pointsEarned, killerElo, victimElo);

// Dodaj punkty graczowi, który zabił
pluginLogger.log(PluginLogger.LogLevel.DEBUG, "Event: handleKillEvent calling addPoints with parameters: " + killer.getUniqueId().toString() + " " + pointsEarned + " " + rankingType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ public void updateConfig(String configuration) {

if (!configFile.exists()) {
pluginLogger.log(PluginLogger.LogLevel.WARNING, "Config file does not exist, creating new one.");
plugin.saveDefaultConfig();
try {
configFile.createNewFile();
} catch (IOException e) {
pluginLogger.log(PluginLogger.LogLevel.ERROR, "Error while creating config file: " + e.getMessage());
}
updateConfig("log_level:\n - INFO\n - WARNING\n - ERROR");
}

try {
Expand All @@ -99,4 +104,5 @@ public void updateConfig(String configuration) {
pluginLogger.log(PluginLogger.LogLevel.ERROR, "Error while updating config file: " + e.getMessage());
}
}

}

0 comments on commit d3714a8

Please sign in to comment.