From 3d6f241c12513c9ec039cac313dfd13d466c7264 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jan 2014 16:18:32 +1100 Subject: [PATCH] Fix double comparison issues. --- CraftBukkit-Patches/0100-Highly-Optimized-Tick-Loop.patch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0100-Highly-Optimized-Tick-Loop.patch b/CraftBukkit-Patches/0100-Highly-Optimized-Tick-Loop.patch index 36f280e8a..093dc8e26 100644 --- a/CraftBukkit-Patches/0100-Highly-Optimized-Tick-Loop.patch +++ b/CraftBukkit-Patches/0100-Highly-Optimized-Tick-Loop.patch @@ -1,4 +1,4 @@ -From ad6ccb8e038d440644721c1d4e586875230ad444 Mon Sep 17 00:00:00 2001 +From cb15a8dc8cee18a4d5b6a8ce3ccbbf28dfd0c65c Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 25 Jan 2014 14:08:35 +1100 Subject: [PATCH] Highly Optimized Tick Loop @@ -108,7 +108,7 @@ index 205249e..6634292 100755 } diff --git a/src/main/java/org/spigotmc/TicksPerSecondCommand.java b/src/main/java/org/spigotmc/TicksPerSecondCommand.java new file mode 100644 -index 0000000..0f73608 +index 0000000..36363ee --- /dev/null +++ b/src/main/java/org/spigotmc/TicksPerSecondCommand.java @@ -0,0 +1,44 @@ @@ -143,7 +143,7 @@ index 0000000..0f73608 + StringBuilder sb = new StringBuilder( ChatColor.GOLD + "TPS from last 1m, 5m, 15m: " ); + for ( double tps : MinecraftServer.getServer().recentTps ) + { -+ sb.append( format( Math.max( tps, 20 ) ) ); ++ sb.append( format( Math.max( tps, 20.0 ) ) ); + sb.append( ", " ); + } + sender.sendMessage( sb.substring( 0, sb.length() - 2 ) ); @@ -153,7 +153,7 @@ index 0000000..0f73608 + + private String format(double tps) + { -+ return ( ( tps > 18 ) ? ChatColor.GREEN : ( tps > 16 ) ? ChatColor.YELLOW : ChatColor.RED ).toString() + tps; ++ return ( ( tps > 18.0 ) ? ChatColor.GREEN : ( tps > 16.0 ) ? ChatColor.YELLOW : ChatColor.RED ).toString() + tps; + } +} --