From 5f03f206c3943cab8126fddec7bc715c652d11e4 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 9 Apr 2014 15:21:59 +0100 Subject: [PATCH] Don't spam warnings when Mojang's API goes down. (Which happens a lot) --- .../0129-Convert-player-heads-async.patch | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0129-Convert-player-heads-async.patch b/CraftBukkit-Patches/0129-Convert-player-heads-async.patch index 4aae9e7b44..36b230cc17 100644 --- a/CraftBukkit-Patches/0129-Convert-player-heads-async.patch +++ b/CraftBukkit-Patches/0129-Convert-player-heads-async.patch @@ -1,4 +1,4 @@ -From d303eb8ffc3f82badc690c1bad71782f0d5f7b57 Mon Sep 17 00:00:00 2001 +From 2734342f54016d2ca4440bd07ed371a6458f5ccc Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Wed, 9 Apr 2014 13:29:57 +0100 Subject: [PATCH] Convert player heads async @@ -112,10 +112,10 @@ index b241cfe..925e017 100644 public Packet getUpdatePacket() { diff --git a/src/main/java/org/spigotmc/HeadConverter.java b/src/main/java/org/spigotmc/HeadConverter.java new file mode 100644 -index 0000000..bc949a1 +index 0000000..a284768 --- /dev/null +++ b/src/main/java/org/spigotmc/HeadConverter.java -@@ -0,0 +1,163 @@ +@@ -0,0 +1,168 @@ +package org.spigotmc; + +import com.google.common.base.Charsets; @@ -148,6 +148,7 @@ index 0000000..bc949a1 + .setNameFormat( "Head Conversion Thread - %1$d" ) + .build() + ); ++ private static boolean hasWarned = false; + + public static void convertHead(final TileEntitySkull head) + { @@ -267,7 +268,11 @@ index 0000000..bc949a1 + e.printStackTrace(); + } catch ( IOException e ) + { -+ Bukkit.getLogger().warning( "Error connecting to Mojang servers, cannot convert player heads" ); ++ if (!hasWarned) ++ { ++ hasWarned = true; ++ Bukkit.getLogger().warning( "Error connecting to Mojang servers, cannot convert player heads" ); ++ } + } finally + { + if ( connection != null )