Skip to content

Commit

Permalink
Merge pull request #7 from BT-Pluginz/Version-1.0
Browse files Browse the repository at this point in the history
Config Manager Changes, Remove Combattimer on Death
  • Loading branch information
TubYoub authored Apr 30, 2024
2 parents 8495e59 + e02a467 commit fee910e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ public DeathListener(CombatLoggerPlugin plugin){
this.plugin = plugin;
}
@EventHandler
public void onPlayerQuit(PlayerDeathEvent event) {
public void onPlayerDeath(PlayerDeathEvent event) {
if (Objects.equals(event.getDeathMessage(), event.getEntity().getPlayer().getName() + " died")){
event.setDeathMessage(event.getEntity().getPlayer().getName() + " died because he left during combat");
}
plugin.getCombatManager().removePlayerFromCombat(event.getEntity().getPlayer());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ public void loadConfig() {
combatTimeout = config.getInt("combatTimeout", 30);
checkVersion = config.getBoolean("checkVersion", true);
} catch (IOException e) {
plugin.getLogger().severe("Could not load configuration: " + e.getMessage());
//plugin.getLogger().severe("Could not load configuration: " + e.getMessage());
plugin.getLogger().severe("Error while loading the configuration");
}
}

public void saveConfig() {
try {
config.save();
} catch (IOException e) {
plugin.getLogger().severe("Could not save configuration: " + e.getMessage());
plugin.getLogger().severe("Error while saving the configuration");
}
}
public void reloadConfig() {
Expand Down

0 comments on commit fee910e

Please sign in to comment.