From 2c4293b0f6833a0533b12e6b9a098fc730cffe29 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 5 Aug 2017 23:36:47 +0100
Subject: [PATCH] Update B/CB/S

---
 Spigot-API-Patches/LootTable-API.patch        | 45 ++++++------
 Spigot-API-Patches/POM-changes.patch          | 22 +++---
 ...-API-Replenishable-Lootables-Feature.patch | 68 ++++++++++---------
 Spigot-Server-Patches/POM-Changes.patch       |  4 +-
 ...oleAppender-for-console-improvements.patch |  4 +-
 work/Bukkit                                   |  2 +-
 work/CraftBukkit                              |  2 +-
 work/Spigot                                   |  2 +-
 8 files changed, 72 insertions(+), 77 deletions(-)

diff --git a/Spigot-API-Patches/LootTable-API.patch b/Spigot-API-Patches/LootTable-API.patch
index 61edb783a2..4fb0744475 100644
--- a/Spigot-API-Patches/LootTable-API.patch
+++ b/Spigot-API-Patches/LootTable-API.patch
@@ -295,7 +295,7 @@ index 00000000..2169493d
 +    }
 +}
 diff --git a/src/main/java/org/bukkit/block/Chest.java b/src/main/java/org/bukkit/block/Chest.java
-index ade09ddd..368306d0 100644
+index 97dc7813..a24a4094 100644
 --- a/src/main/java/org/bukkit/block/Chest.java
 +++ b/src/main/java/org/bukkit/block/Chest.java
 @@ -0,0 +0,0 @@
@@ -304,18 +304,17 @@ index ade09ddd..368306d0 100644
  import org.bukkit.Nameable;
 +import com.destroystokyo.paper.loottable.LootableInventory; // Paper
  import org.bukkit.inventory.Inventory;
- import org.bukkit.inventory.InventoryHolder;
  
  /**
-  * Represents a chest.
+  * Represents a captured state of a chest.
   */
--public interface Chest extends BlockState, InventoryHolder, Lockable, Nameable {
-+public interface Chest extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
+-public interface Chest extends Container, Nameable {
++public interface Chest extends Container, Nameable, LootableInventory { // Paper
  
      /**
-      * Returns the chest's inventory. If this is a double chest, it returns
+      * Gets the inventory of the chest block represented by this block state.
 diff --git a/src/main/java/org/bukkit/block/Dispenser.java b/src/main/java/org/bukkit/block/Dispenser.java
-index 39ee9b04..236ffa32 100644
+index 108332df..4430b123 100644
 --- a/src/main/java/org/bukkit/block/Dispenser.java
 +++ b/src/main/java/org/bukkit/block/Dispenser.java
 @@ -0,0 +0,0 @@
@@ -323,19 +322,18 @@ index 39ee9b04..236ffa32 100644
  
  import org.bukkit.Nameable;
 +import com.destroystokyo.paper.loottable.LootableInventory; // Paper
- import org.bukkit.inventory.InventoryHolder;
  import org.bukkit.projectiles.BlockProjectileSource;
  
  /**
-  * Represents a dispenser.
+  * Represents a captured state of a dispenser.
   */
--public interface Dispenser extends BlockState, InventoryHolder, Lockable, Nameable {
-+public interface Dispenser extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
+-public interface Dispenser extends Container, Nameable {
++public interface Dispenser extends Container, Nameable, LootableInventory { // Paper
  
      /**
-      * Gets the BlockProjectileSource object for this dispenser.
+      * Gets the BlockProjectileSource object for the dispenser.
 diff --git a/src/main/java/org/bukkit/block/Hopper.java b/src/main/java/org/bukkit/block/Hopper.java
-index 8e5e3e89..c08a1a50 100644
+index bc3aeef2..5b698613 100644
 --- a/src/main/java/org/bukkit/block/Hopper.java
 +++ b/src/main/java/org/bukkit/block/Hopper.java
 @@ -0,0 +0,0 @@
@@ -343,17 +341,15 @@ index 8e5e3e89..c08a1a50 100644
  
  import org.bukkit.Nameable;
 +import com.destroystokyo.paper.loottable.LootableInventory; // Paper
- import org.bukkit.inventory.InventoryHolder;
  
  /**
-  * Represents a hopper.
+  * Represents a captured state of a hopper.
   */
--public interface Hopper extends BlockState, InventoryHolder, Lockable, Nameable { }
-+public interface Hopper extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
-+
-+}
+-public interface Hopper extends Container, Nameable { }
++public interface Hopper extends Container, Nameable, LootableInventory { } // Paper
+\ No newline at end of file
 diff --git a/src/main/java/org/bukkit/block/ShulkerBox.java b/src/main/java/org/bukkit/block/ShulkerBox.java
-index 003cfb8a..7b40df14 100644
+index 4c1740e7..aa1109c4 100644
 --- a/src/main/java/org/bukkit/block/ShulkerBox.java
 +++ b/src/main/java/org/bukkit/block/ShulkerBox.java
 @@ -0,0 +0,0 @@
@@ -362,13 +358,12 @@ index 003cfb8a..7b40df14 100644
 +import com.destroystokyo.paper.loottable.LootableInventory;
  import org.bukkit.DyeColor;
  import org.bukkit.Nameable;
- import org.bukkit.inventory.InventoryHolder;
-@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder;
+ 
  /**
-  * Represents a ShulkerBox.
+  * Represents a captured state of a ShulkerBox.
   */
--public interface ShulkerBox extends BlockState, InventoryHolder, Lockable, Nameable {
-+public interface ShulkerBox extends BlockState, InventoryHolder, Lockable, Nameable, LootableInventory { // Paper
+-public interface ShulkerBox extends Container, Nameable {
++public interface ShulkerBox extends Container, Nameable, LootableInventory { // Paper
  
      /**
       * Get the {@link DyeColor} corresponding to this ShulkerBox
diff --git a/Spigot-API-Patches/POM-changes.patch b/Spigot-API-Patches/POM-changes.patch
index 55b83db04f..22578799a5 100644
--- a/Spigot-API-Patches/POM-changes.patch
+++ b/Spigot-API-Patches/POM-changes.patch
@@ -5,30 +5,28 @@ Subject: [PATCH] POM changes
 
 
 diff --git a/pom.xml b/pom.xml
-index 8c6d1aa1..07143b46 100644
+index f175b611..2fe7b78e 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -0,0 +0,0 @@
+          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
  
-     <parent>
--        <groupId>org.sonatype.oss</groupId>
--        <artifactId>oss-parent</artifactId>
--        <version>9</version>
-+        <groupId>com.destroystokyo.paper</groupId>
-+        <artifactId>paper-parent</artifactId>
-+        <version>dev-SNAPSHOT</version>
-     </parent>
- 
 -    <groupId>org.spigotmc</groupId>
 -    <artifactId>spigot-api</artifactId>
++    <parent>
++        <groupId>com.destroystokyo.paper</groupId>
++        <artifactId>paper-parent</artifactId>
++        <version>dev-SNAPSHOT</version>
++    </parent>
++
 +    <groupId>com.destroystokyo.paper</groupId>
 +    <artifactId>paper-api</artifactId>
      <version>1.12.1-R0.1-SNAPSHOT</version>
      <packaging>jar</packaging>
  
 -    <name>Spigot-API</name>
--    <url>http://www.spigotmc.org/</url>
+-    <url>https://www.spigotmc.org/</url>
 +    <name>Paper-API</name>
 +    <url>https://github.com/PaperMC/Paper</url>
      <description>An enhanced plugin API for Minecraft servers.</description>
@@ -138,8 +136,6 @@ index 8c6d1aa1..07143b46 100644
                      </execution>
                  </executions>
                  <configuration>
--                    <!-- utterly useless artifact from shade 2.x -->
--                    <createDependencyReducedPom>false</createDependencyReducedPom>
 +                    <dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
                      <!-- when downloading via Maven we can pull depends individually -->
                      <shadedArtifactAttached>true</shadedArtifactAttached>
diff --git a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
index dc9f6c630e..07816223df 100644
--- a/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
+++ b/Spigot-Server-Patches/LootTable-API-Replenishable-Lootables-Feature.patch
@@ -657,8 +657,21 @@ index a97ad2037..618521304 100644
 +    // Paper end
 +
  }
+diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+index cf94c0626..52c982893 100644
+--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
++++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
+@@ -0,0 +0,0 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
+     }
+ 
+     // gets the wrapped TileEntity
+-    protected T getTileEntity() {
++    public T getTileEntity() { // Paper - protected -> public
+         return tileEntity;
+     }
+ 
 diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
-index 3de7e14d8..6cab545e5 100644
+index 85f3bb272..733c04ef7 100644
 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java
 @@ -0,0 +0,0 @@
@@ -672,13 +685,13 @@ index 3de7e14d8..6cab545e5 100644
  import org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest;
  import org.bukkit.inventory.Inventory;
  
--public class CraftChest extends CraftLootable implements Chest {
-+public class CraftChest extends CraftLootable implements Chest, CraftLootableBlockInventory { // Paper
-     private final CraftWorld world;
-     private final TileEntityChest chest;
+-public class CraftChest extends CraftLootable<TileEntityChest> implements Chest {
++public class CraftChest extends CraftLootable<TileEntityChest> implements Chest, CraftLootableBlockInventory { // Paper
  
+     public CraftChest(final Block block) {
+         super(block, TileEntityChest.class);
 diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java b/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java
-index cc0d28f21..1b28e8ba2 100644
+index 1dc8bfecd..bfcf9b6c4 100644
 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java
 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftDispenser.java
 @@ -0,0 +0,0 @@
@@ -692,13 +705,13 @@ index cc0d28f21..1b28e8ba2 100644
  import org.bukkit.inventory.Inventory;
  import org.bukkit.projectiles.BlockProjectileSource;
  
--public class CraftDispenser extends CraftLootable implements Dispenser {
-+public class CraftDispenser extends CraftLootable implements Dispenser, CraftLootableBlockInventory { // Paper
-     private final CraftWorld world;
-     private final TileEntityDispenser dispenser;
+-public class CraftDispenser extends CraftLootable<TileEntityDispenser> implements Dispenser {
++public class CraftDispenser extends CraftLootable<TileEntityDispenser> implements Dispenser, CraftLootableBlockInventory {
  
+     public CraftDispenser(final Block block) {
+         super(block, TileEntityDispenser.class);
 diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
-index b7a04bd84..5d4a5519d 100644
+index 6566554ab..df156d0d9 100644
 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java
 @@ -0,0 +0,0 @@
@@ -708,17 +721,17 @@ index b7a04bd84..5d4a5519d 100644
  import net.minecraft.server.TileEntityHopper;
  import org.bukkit.Material;
  import org.bukkit.block.Block;
-@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftWorld;
+@@ -0,0 +0,0 @@ import org.bukkit.block.Hopper;
  import org.bukkit.craftbukkit.inventory.CraftInventory;
  import org.bukkit.inventory.Inventory;
  
--public class CraftHopper extends CraftLootable implements Hopper {
-+public class CraftHopper extends CraftLootable implements Hopper, CraftLootableBlockInventory { // Paper
-     private final TileEntityHopper hopper;
+-public class CraftHopper extends CraftLootable<TileEntityHopper> implements Hopper {
++public class CraftHopper extends CraftLootable<TileEntityHopper> implements Hopper, CraftLootableBlockInventory {
  
      public CraftHopper(final Block block) {
+         super(block, TileEntityHopper.class);
 diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
-index 788c60263..dc2648094 100644
+index c029a1244..c26f0b5af 100644
 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
 +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java
 @@ -0,0 +0,0 @@
@@ -726,26 +739,17 @@ index 788c60263..dc2648094 100644
  
 +import com.destroystokyo.paper.loottable.CraftLootableBlockInventory;
  import net.minecraft.server.BlockShulkerBox;
- import net.minecraft.server.TileEntity;
  import net.minecraft.server.TileEntityShulkerBox;
-@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.CraftWorld;
- import org.bukkit.craftbukkit.inventory.CraftInventory;
+ import org.bukkit.DyeColor;
+@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.inventory.CraftInventory;
+ import org.bukkit.craftbukkit.util.CraftMagicNumbers;
  import org.bukkit.inventory.Inventory;
  
--public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
-+public class CraftShulkerBox extends CraftLootable implements ShulkerBox, CraftLootableBlockInventory { // Paper
- 
-     private final CraftWorld world;
-     private final TileEntityShulkerBox box;
-@@ -0,0 +0,0 @@ public class CraftShulkerBox extends CraftLootable implements ShulkerBox {
-     }
- 
-     @Override
--    public TileEntity getTileEntity() {
-+    public TileEntityShulkerBox getTileEntity() { // Paper
-         return box;
-     }
+-public class CraftShulkerBox extends CraftLootable<TileEntityShulkerBox> implements ShulkerBox {
++public class CraftShulkerBox extends CraftLootable<TileEntityShulkerBox> implements ShulkerBox, CraftLootableBlockInventory {
  
+     public CraftShulkerBox(final Block block) {
+         super(block, TileEntityShulkerBox.class);
 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
 index 69435c457..4291edf25 100644
 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMinecartChest.java
diff --git a/Spigot-Server-Patches/POM-Changes.patch b/Spigot-Server-Patches/POM-Changes.patch
index 31cc22c750..1c6df720be 100644
--- a/Spigot-Server-Patches/POM-Changes.patch
+++ b/Spigot-Server-Patches/POM-Changes.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] POM Changes
 
 
 diff --git a/pom.xml b/pom.xml
-index 9072ab9f4..bb305c7c2 100644
+index cbd561aed..7f6f7fe84 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -0,0 +0,0 @@
@@ -141,7 +141,7 @@ index 9072ab9f4..bb305c7c2 100644
 @@ -0,0 +0,0 @@
                  <groupId>org.apache.maven.plugins</groupId>
                  <artifactId>maven-compiler-plugin</artifactId>
-                 <version>3.6.1</version>
+                 <version>3.6.2</version>
 -                <configuration>
 -                    <!-- we use the Eclipse compiler as it doesn't need a JDK -->
 -                    <compilerId>eclipse</compilerId>
diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch
index 4135118201..163c79db0a 100644
--- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch
+++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch
@@ -20,7 +20,7 @@ Other changes:
     configuration
 
 diff --git a/pom.xml b/pom.xml
-index bb305c7c2..793d2724c 100644
+index 7f6f7fe84..d36611644 100644
 --- a/pom.xml
 +++ b/pom.xml
 @@ -0,0 +0,0 @@
@@ -35,7 +35,7 @@ index bb305c7c2..793d2724c 100644
 -        <dependency>
              <groupId>org.xerial</groupId>
              <artifactId>sqlite-jdbc</artifactId>
-             <version>3.18.0</version>
+             <version>3.19.3</version>
 @@ -0,0 +0,0 @@
              <version>3.0.3</version>
              <scope>compile</scope>
diff --git a/work/Bukkit b/work/Bukkit
index 0aeac440c0..079e67c2b0 160000
--- a/work/Bukkit
+++ b/work/Bukkit
@@ -1 +1 @@
-Subproject commit 0aeac440c05a3ae3b69095e109372b7400f0feae
+Subproject commit 079e67c2b0a68e8ab64bc292681161031e4211fa
diff --git a/work/CraftBukkit b/work/CraftBukkit
index 63029f4ff3..571760182f 160000
--- a/work/CraftBukkit
+++ b/work/CraftBukkit
@@ -1 +1 @@
-Subproject commit 63029f4ff3745380bedc1d6557b81c1a183d45ec
+Subproject commit 571760182fb8c5326de812259ddef80564953a1d
diff --git a/work/Spigot b/work/Spigot
index edd03964c6..0d820fa70f 160000
--- a/work/Spigot
+++ b/work/Spigot
@@ -1 +1 @@
-Subproject commit edd03964c6c1d7fb9617ac3f7183357dcbbc28fe
+Subproject commit 0d820fa70fa4ca6bdfc6cd3c8a13377a60424774