Skip to content

Commit

Permalink
Fix potential loss of precision when calculating default respawn ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
RoboMWM committed Feb 26, 2017
1 parent 6854621 commit c0fa112
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/to/us/tf/DeathSpectating/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ConfigManager
config.options().copyDefaults(true);
instance.saveConfig();

respawnTicks = (long)(config.getDouble("respawnTimeInSeconds") * 20L);
respawnTicks = (long)((config.getDouble("respawnTimeInSeconds") * 20L));
usePermissionForSpectating = config.getBoolean("usePermissionForSpectating");
if (config.getBoolean("useDamageCauseBlacklist"))
{
Expand Down Expand Up @@ -103,11 +103,11 @@ public class ConfigManager
ConfigurationSection titleSection = config.getConfigurationSection("titleMessages");
if (titleSection == null)
titleSection = config.createSection("titleMessages");

if (titleSection.getStringList("titles").isEmpty())
titleSection.set("titles", new ArrayList<String>(Arrays.asList("&cYou died!", "&cGame over!")));
titleSection.set("titles", new ArrayList<>(Arrays.asList("&cYou died!", "&cGame over!")));
if (titleSection.getStringList("subtitles").isEmpty())
titleSection.set("subtitles", new ArrayList<String>(Arrays.asList("Respawning in {0}", "Score: &e{1}", "Score: &e{1}&f, Respawning in {0}")));
titleSection.set("subtitles", new ArrayList<>(Arrays.asList("Respawning in {0}", "Score: &e{1}", "Score: &e{1}&f, Respawning in {0}")));

instance.saveConfig();
}
Expand Down

0 comments on commit c0fa112

Please sign in to comment.