From dfdbaa3bd8f919246040a277f43364aae10a293e Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Mon, 25 May 2015 15:59:30 -0500
Subject: [PATCH] Update to 1.8.6

---
 Spigot-API-Patches/0001-POM-changes.patch     |  6 +-
 Spigot-Server-Patches/0001-POM-Changes.patch  |  6 +-
 .../0002-PaperSpigot-config-files.patch       | 10 +--
 .../0003-mc-dev-imports.patch                 | 65 ++++++++++---------
 4 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/Spigot-API-Patches/0001-POM-changes.patch b/Spigot-API-Patches/0001-POM-changes.patch
index 8cb1824259..c2b0142079 100644
--- a/Spigot-API-Patches/0001-POM-changes.patch
+++ b/Spigot-API-Patches/0001-POM-changes.patch
@@ -1,11 +1,11 @@
-From 14be070bc970eb0e38d436ff67c8c88e037f5b27 Mon Sep 17 00:00:00 2001
+From 943c6ec02e7d749b2815c280f673fbb17cd2ffbd Mon Sep 17 00:00:00 2001
 From: Zach Brown <Zbob750@live.com>
 Date: Tue, 6 Jan 2015 22:12:31 -0600
 Subject: [PATCH] POM changes
 
 
 diff --git a/pom.xml b/pom.xml
-index 39676c7..cf65e3a 100644
+index a8cde4f..a0d94d4 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -4,18 +4,18 @@
@@ -24,7 +24,7 @@ index 39676c7..cf65e3a 100644
 -    <artifactId>spigot-api</artifactId>
 +    <groupId>org.github.paperspigot</groupId>
 +    <artifactId>paperspigot-api</artifactId>
-     <version>1.8.5-R0.1-SNAPSHOT</version>
+     <version>1.8.6-R0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
  
 -    <name>Spigot-API</name>
diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch
index 9cb914e933..a28ddf2593 100644
--- a/Spigot-Server-Patches/0001-POM-Changes.patch
+++ b/Spigot-Server-Patches/0001-POM-Changes.patch
@@ -1,11 +1,11 @@
-From 014a476d8eec7b9eb767c686ceef28f66575f445 Mon Sep 17 00:00:00 2001
+From cd68e613ef1dab9ea6c0949808e692305bbd7b3d Mon Sep 17 00:00:00 2001
 From: Zach Brown <zach.brown@destroystokyo.com>
 Date: Thu, 19 Mar 2015 19:41:15 -0500
 Subject: [PATCH] POM Changes
 
 
 diff --git a/pom.xml b/pom.xml
-index f15cc07..0d5048e 100644
+index 99fe937..61d6346 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -1,12 +1,12 @@
@@ -17,7 +17,7 @@ index f15cc07..0d5048e 100644
 +    <groupId>org.github.paperspigot</groupId>
 +    <artifactId>paperspigot</artifactId>
      <packaging>jar</packaging>
-     <version>1.8.5-R0.1-SNAPSHOT</version>
+     <version>1.8.6-R0.1-SNAPSHOT</version>
 -    <name>Spigot</name>
 -    <url>http://www.spigotmc.org</url>
 +    <name>PaperSpigot</name>
diff --git a/Spigot-Server-Patches/0002-PaperSpigot-config-files.patch b/Spigot-Server-Patches/0002-PaperSpigot-config-files.patch
index a3d3af5117..0cf4236248 100644
--- a/Spigot-Server-Patches/0002-PaperSpigot-config-files.patch
+++ b/Spigot-Server-Patches/0002-PaperSpigot-config-files.patch
@@ -1,14 +1,14 @@
-From 844314dc850a96a99ad53ba82f6023d28b0ce6bc Mon Sep 17 00:00:00 2001
+From edaf8e2dbbeb2e4d9b4e467dba0b7f5e57f40102 Mon Sep 17 00:00:00 2001
 From: Zach Brown <zach.brown@destroystokyo.com>
 Date: Sat, 12 Jul 2014 19:32:01 -0500
 Subject: [PATCH] PaperSpigot config files
 
 
 diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java
-index 86ff385..b80ffe5 100644
+index ebb18c6..4698590 100644
 --- a/src/main/java/net/minecraft/server/DedicatedServer.java
 +++ b/src/main/java/net/minecraft/server/DedicatedServer.java
-@@ -178,6 +178,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
+@@ -177,6 +177,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer
              org.spigotmc.SpigotConfig.init();
              org.spigotmc.SpigotConfig.registerCommands();
              // Spigot end
@@ -20,7 +20,7 @@ index 86ff385..b80ffe5 100644
              DedicatedServer.LOGGER.info("Generating keypair");
              this.a(MinecraftEncryption.b());
 diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index ff73bfb..8b08c84 100644
+index 6de5ba5..117d44c 100644
 --- a/src/main/java/net/minecraft/server/World.java
 +++ b/src/main/java/net/minecraft/server/World.java
 @@ -161,6 +161,8 @@ public abstract class World implements IBlockAccess {
@@ -297,5 +297,5 @@ index 0000000..f3bc3aa
 +    }
 +}
 -- 
-1.9.1
+2.4.1.windows.1
 
diff --git a/Spigot-Server-Patches/0003-mc-dev-imports.patch b/Spigot-Server-Patches/0003-mc-dev-imports.patch
index db7414b55c..2cae4ee172 100644
--- a/Spigot-Server-Patches/0003-mc-dev-imports.patch
+++ b/Spigot-Server-Patches/0003-mc-dev-imports.patch
@@ -1,6 +1,6 @@
-From 4e15946e8e4c8df9593b9f1f10b3390e29526311 Mon Sep 17 00:00:00 2001
+From 5e4159e70b2932ce23205409a0fef2c2ac12fa41 Mon Sep 17 00:00:00 2001
 From: Zach Brown <zach.brown@destroystokyo.com>
-Date: Sat, 23 May 2015 13:00:52 -0500
+Date: Mon, 25 May 2015 15:37:00 -0500
 Subject: [PATCH] mc-dev imports
 
 
@@ -690,10 +690,10 @@ index 0000000..0d108eb
 +}
 diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java
 new file mode 100644
-index 0000000..264bcfa
+index 0000000..57b3d9d
 --- /dev/null
 +++ b/src/main/java/net/minecraft/server/ItemBlock.java
-@@ -0,0 +1,97 @@
+@@ -0,0 +1,100 @@
 +package net.minecraft.server;
 +
 +public class ItemBlock extends Item {
@@ -728,7 +728,7 @@ index 0000000..264bcfa
 +            if (world.setTypeAndData(blockposition, iblockdata1, 3)) {
 +                iblockdata1 = world.getType(blockposition);
 +                if (iblockdata1.getBlock() == this.a) {
-+                    a(world, blockposition, itemstack);
++                    a(world, entityhuman, blockposition, itemstack);
 +                    this.a.postPlace(world, blockposition, iblockdata1, entityhuman, itemstack);
 +                }
 +
@@ -742,33 +742,43 @@ index 0000000..264bcfa
 +        }
 +    }
 +
-+    public static boolean a(World world, BlockPosition blockposition, ItemStack itemstack) {
-+        if (itemstack.hasTag() && itemstack.getTag().hasKeyOfType("BlockEntityTag", 10)) {
-+            TileEntity tileentity = world.getTileEntity(blockposition);
++    public static boolean a(World world, EntityHuman entityhuman, BlockPosition blockposition, ItemStack itemstack) {
++        MinecraftServer minecraftserver = MinecraftServer.getServer();
 +
-+            if (tileentity != null) {
-+                NBTTagCompound nbttagcompound = new NBTTagCompound();
-+                NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.clone();
++        if (minecraftserver == null) {
++            return false;
++        } else {
++            if (itemstack.hasTag() && itemstack.getTag().hasKeyOfType("BlockEntityTag", 10)) {
++                TileEntity tileentity = world.getTileEntity(blockposition);
 +
-+                tileentity.b(nbttagcompound);
-+                NBTTagCompound nbttagcompound2 = (NBTTagCompound) itemstack.getTag().get("BlockEntityTag");
++                if (tileentity != null) {
++                    if (!world.isClientSide && tileentity.F() && !minecraftserver.getPlayerList().isOp(entityhuman.getProfile())) {
++                        return false;
++                    }
 +
-+                nbttagcompound.a(nbttagcompound2);
-+                nbttagcompound.setInt("x", blockposition.getX());
-+                nbttagcompound.setInt("y", blockposition.getY());
-+                nbttagcompound.setInt("z", blockposition.getZ());
-+                if (!nbttagcompound.equals(nbttagcompound1)) {
-+                    tileentity.a(nbttagcompound);
-+                    tileentity.update();
-+                    return true;
++                    NBTTagCompound nbttagcompound = new NBTTagCompound();
++                    NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttagcompound.clone();
++
++                    tileentity.b(nbttagcompound);
++                    NBTTagCompound nbttagcompound2 = (NBTTagCompound) itemstack.getTag().get("BlockEntityTag");
++
++                    nbttagcompound.a(nbttagcompound2);
++                    nbttagcompound.setInt("x", blockposition.getX());
++                    nbttagcompound.setInt("y", blockposition.getY());
++                    nbttagcompound.setInt("z", blockposition.getZ());
++                    if (!nbttagcompound.equals(nbttagcompound1)) {
++                        tileentity.a(nbttagcompound);
++                        tileentity.update();
++                        return true;
++                    }
 +                }
 +            }
-+        }
 +
-+        return false;
++            return false;
++        }
 +    }
 +
-+    public String f_(ItemStack itemstack) {
++    public String e_(ItemStack itemstack) {
 +        return this.a.a();
 +    }
 +
@@ -780,13 +790,6 @@ index 0000000..264bcfa
 +        return this.a;
 +    }
 +
-+    public static void d_(ItemStack itemstack) {
-+        if (itemstack.hasTag() && itemstack.getTag().hasKeyOfType("BlockEntityTag", 10)) {
-+            itemstack.getTag().remove("BlockEntityTag");
-+        }
-+
-+    }
-+
 +    public Item c(String s) {
 +        return this.b(s);
 +    }