From 57cff1f17f3113c22c7b4806e159020cd5b18e67 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Sat, 25 Jun 2016 12:19:04 -0500
Subject: [PATCH] Update to MC 1.10.2

---
 Spigot-API-Patches/POM-changes.patch          |  2 +-
 .../Fix-Double-World-Add-issues.patch         |  2 +-
 .../MC-80966-Always-send-chunk-sections.patch | 22 -------------
 ...EntityItem-loads-before-EntityPotion.patch | 31 -------------------
 Spigot-Server-Patches/POM-Changes.patch       |  2 +-
 .../Use-Optimized-Collections.patch           | 21 +++++++------
 work/BuildData                                |  2 +-
 work/Bukkit                                   |  2 +-
 work/CraftBukkit                              |  2 +-
 work/Spigot                                   |  2 +-
 10 files changed, 18 insertions(+), 70 deletions(-)
 delete mode 100644 Spigot-Server-Patches/MC-80966-Always-send-chunk-sections.patch
 delete mode 100644 Spigot-Server-Patches/MC-99914-ensure-EntityItem-loads-before-EntityPotion.patch

diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch
index e75444c591..7c8362c5e0 100644
--- a/Spigot-API-Patches/POM-changes.patch
+++ b/Spigot-API-Patches/POM-changes.patch
@@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 -    <artifactId>spigot-api</artifactId>
 +    <groupId>com.destroystokyo.paper</groupId>
 +    <artifactId>paper-api</artifactId>
-     <version>1.10-R0.1-SNAPSHOT</version>
+     <version>1.10.2-R0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
  
 -    <name>Spigot-API</name>
diff --git a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch
index be6aab432c..72ff091d70 100644
--- a/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch
+++ b/Spigot-Server-Patches/Fix-Double-World-Add-issues.patch
@@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
              Iterator iterator = entity.bx().iterator();
  
 diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
+index 1d47a117..f7d9a7c 100644
 --- a/src/main/java/net/minecraft/server/World.java
 +++ b/src/main/java/net/minecraft/server/World.java
 @@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess {
diff --git a/Spigot-Server-Patches/MC-80966-Always-send-chunk-sections.patch b/Spigot-Server-Patches/MC-80966-Always-send-chunk-sections.patch
deleted file mode 100644
index aab278ac99..0000000000
--- a/Spigot-Server-Patches/MC-80966-Always-send-chunk-sections.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Zach Brown <1254957+zachbr@users.noreply.github.com>
-Date: Sat, 11 Jun 2016 14:59:15 -0500
-Subject: [PATCH] MC-80966 - Always send chunk sections
-
-
-diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/ChunkSection.java
-+++ b/src/main/java/net/minecraft/server/ChunkSection.java
-@@ -0,0 +0,0 @@ public class ChunkSection {
-     }
- 
-     public boolean a() {
--        return this.nonEmptyBlockCount == 0;
-+        // Paper - MC-80966
-+        // Even if there are no blocks, there may be other information associated with the chunk, always send it.
-+        return false;
-     }
- 
-     public boolean shouldTick() {
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/MC-99914-ensure-EntityItem-loads-before-EntityPotion.patch b/Spigot-Server-Patches/MC-99914-ensure-EntityItem-loads-before-EntityPotion.patch
deleted file mode 100644
index 03e275e415..0000000000
--- a/Spigot-Server-Patches/MC-99914-ensure-EntityItem-loads-before-EntityPotion.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Aikar <aikar@aikar.co>
-Date: Mon, 16 May 2016 22:54:36 -0400
-Subject: [PATCH] MC-99914 - ensure EntityItem loads before EntityPotion
-
-
-diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/EntityItem.java
-+++ b/src/main/java/net/minecraft/server/EntityItem.java
-@@ -0,0 +0,0 @@ public class EntityItem extends Entity {
-         this.setItemStack(itemstack);
-     }
- 
-+    static int uglyHack = 1; // Paper - MC-99914 - ensure EntityItem loads before EntityPotion
-     protected boolean playStepSound() {
-         return false;
-     }
-diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/MinecraftServer.java
-+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
-@@ -0,0 +0,0 @@ public abstract class MinecraftServer implements Runnable, ICommandListener, IAs
-         this.dataConverterManager = dataconvertermanager;
-         // CraftBukkit start
-         this.options = options;
-+        EntityItem.uglyHack++; // Paper - MC-99914 - ensure EntityItem loads before EntityPotion
-         // Try to see if we're actually running in a terminal, disable jline if not
-         if (System.console() == null && System.getProperty("jline.terminal") == null) {
-             System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
---
\ No newline at end of file
diff --git a/Spigot-Server-Patches/POM-Changes.patch b/Spigot-Server-Patches/POM-Changes.patch
index 39352dd7cc..9cde258e27 100644
--- a/Spigot-Server-Patches/POM-Changes.patch
+++ b/Spigot-Server-Patches/POM-Changes.patch
@@ -17,7 +17,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +    <groupId>com.destroystokyo.paper</groupId>
 +    <artifactId>paper</artifactId>
      <packaging>jar</packaging>
-     <version>1.10-R0.1-SNAPSHOT</version>
+     <version>1.10.2-R0.1-SNAPSHOT</version>
 -    <name>Spigot</name>
 -    <url>http://www.spigotmc.org</url>
 +    <name>Paper</name>
diff --git a/Spigot-Server-Patches/Use-Optimized-Collections.patch b/Spigot-Server-Patches/Use-Optimized-Collections.patch
index 72cd1b0cea..d5152da952 100644
--- a/Spigot-Server-Patches/Use-Optimized-Collections.patch
+++ b/Spigot-Server-Patches/Use-Optimized-Collections.patch
@@ -35,14 +35,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  import javax.annotation.Nullable;
 +import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper
  import org.apache.commons.lang3.ObjectUtils;
- 
- public class DataWatcher {
- 
-     private static final Map<Class<? extends Entity>, Integer> a = Maps.newHashMap();
-     private final Entity b;
--    private final Map<Integer, DataWatcher.Item<?>> c = Maps.newHashMap();
-+    private final Map<Integer, DataWatcher.Item<?>> c = new Int2ObjectOpenHashMap<>(); // Paper
-     private final ReadWriteLock d = new ReentrantReadWriteLock();
-     private boolean e = true;
-     private boolean f;
+ import org.apache.logging.log4j.LogManager;
+ import org.apache.logging.log4j.Logger;
+@@ -0,0 +0,0 @@ public class DataWatcher {
+     private static final Logger a = LogManager.getLogger();
+     private static final Map<Class<? extends Entity>, Integer> b = Maps.newHashMap();
+     private final Entity c;
+-    private final Map<Integer, DataWatcher.Item<?>> d = Maps.newHashMap();
++    private final Map<Integer, DataWatcher.Item<?>> d = new Int2ObjectOpenHashMap<>(); // Paper
+     private final ReadWriteLock e = new ReentrantReadWriteLock();
+     private boolean f = true;
+     private boolean g;
 --
\ No newline at end of file
diff --git a/work/BuildData b/work/BuildData
index cede5450c9..f37e6395d8 160000
--- a/work/BuildData
+++ b/work/BuildData
@@ -1 +1 @@
-Subproject commit cede5450c952c76341e047b8d04f9894f16e596d
+Subproject commit f37e6395d8f7d4865df27a4ab77e0c0d45de8fb9
diff --git a/work/Bukkit b/work/Bukkit
index da1195392a..c3a46c9b8d 160000
--- a/work/Bukkit
+++ b/work/Bukkit
@@ -1 +1 @@
-Subproject commit da1195392ac6db7015a83165a01b9c62b8380a24
+Subproject commit c3a46c9b8db54daf9425d73aa593e494f809bbde
diff --git a/work/CraftBukkit b/work/CraftBukkit
index 1953f52da1..4c1e9342cb 160000
--- a/work/CraftBukkit
+++ b/work/CraftBukkit
@@ -1 +1 @@
-Subproject commit 1953f52da1ece0feb56dea20592c1b86616b31a5
+Subproject commit 4c1e9342cbe16f4c83d9360e3a21283d3fd80e50
diff --git a/work/Spigot b/work/Spigot
index c3e4052b69..687a0190ef 160000
--- a/work/Spigot
+++ b/work/Spigot
@@ -1 +1 @@
-Subproject commit c3e4052b69acbcf52439c51ae8b0d65a4b1bb98a
+Subproject commit 687a0190ef59611cca4cba981e17b4881c51df17