From 9300f163fd6a662bc095d4017807192966007c45 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 21 Mar 2016 20:46:54 -0400
Subject: [PATCH] fix rebuild patches and rebuild current patches

---
 .../Catch-Async-PlayerChunkMap-operations.patch               | 4 +---
 rebuildPatches.sh                                             | 2 ++
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch b/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch
index 9c70bca57f..9fd51c0a8e 100644
--- a/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch
+++ b/Spigot-Server-Patches/Catch-Async-PlayerChunkMap-operations.patch
@@ -21,6 +21,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
          ChunkCoordIntPair chunkcoordintpair = playerchunk.a();
          long i = d(chunkcoordintpair.x, chunkcoordintpair.z);
  
--- 
-2.5.4 (Apple Git-61)
-
+--
\ No newline at end of file
diff --git a/rebuildPatches.sh b/rebuildPatches.sh
index b18d70b29c..dfcccf6d11 100755
--- a/rebuildPatches.sh
+++ b/rebuildPatches.sh
@@ -30,6 +30,8 @@ function savePatches {
     target=$2
     echo "Formatting patches for $what..."
     cd "$basedir/$target"
+
+    rm -rf "$basedir/${what_name}-Patches/*.patch"
     git format-patch --no-stat -N -o "$basedir/${what_name}-Patches/" upstream/upstream >/dev/null
     cd "$basedir"
     git add -A "$basedir/${what_name}-Patches"