From ad0aae4e0f52872cb220f7c084ccdd1ec8b98d2e Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 17 Nov 2020 19:45:18 -0800
Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit) (#4779)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
f47abd88 SPIGOT-6242: Fix some file line endings
de96535b SPIGOT-6234: enum classes don't serialize properly when implementing ConfigurationSerializable

CraftBukkit Changes:
4475707d SPIGOT-6244: /spawnpoint ignores angle
8b3b096d SPIGOT-6242: Fix some file line endings
4b33c749 SPIGOT-6186: Canceling a CreatureSpawnEvent​ results in a "Unable to summon entity due to duplicate UUIDs" error
2b3ca726 SPIGOT-6236: Vehicle passenger portal cooldown does not change
---
 ...support.patch => 0548-Brand-support.patch} |  0
 ...support.patch => 0558-Brand-support.patch} |  0
 .../Entity-Activation-Range-2.0.patch         |  1 +
 ...turn-for-WorldServer-addAllEntitiesS.patch | 23 -------------------
 ...ement-optional-per-player-mob-spawns.patch |  4 ++--
 work/Bukkit                                   |  2 +-
 work/CraftBukkit                              |  2 +-
 7 files changed, 5 insertions(+), 27 deletions(-)
 rename Spigot-Server-Patches/{0549-Brand-support.patch => 0548-Brand-support.patch} (100%)
 rename Spigot-Server-Patches/{0559-Brand-support.patch => 0558-Brand-support.patch} (100%)
 delete mode 100644 Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch

diff --git a/Spigot-Server-Patches/0549-Brand-support.patch b/Spigot-Server-Patches/0548-Brand-support.patch
similarity index 100%
rename from Spigot-Server-Patches/0549-Brand-support.patch
rename to Spigot-Server-Patches/0548-Brand-support.patch
diff --git a/Spigot-Server-Patches/0559-Brand-support.patch b/Spigot-Server-Patches/0558-Brand-support.patch
similarity index 100%
rename from Spigot-Server-Patches/0559-Brand-support.patch
rename to Spigot-Server-Patches/0558-Brand-support.patch
diff --git a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
index 4876e71c9e..701bfbdd4d 100644
--- a/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
+++ b/Spigot-Server-Patches/Entity-Activation-Range-2.0.patch
@@ -421,6 +421,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +                    // Paper start - EAR 2
 +                    if (isActive) {
                      entity1.passengerTick();
+                     entity1.postTick(); // CraftBukkit
 +                    } else {
 +                        entity1.setMot(Vec3D.ORIGIN);
 +                        entity1.inactiveTick();
diff --git a/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch b/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch
deleted file mode 100644
index 71c09c761c..0000000000
--- a/Spigot-Server-Patches/Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: William Blake Galbreath <Blake.Galbreath@GMail.com>
-Date: Sat, 15 Aug 2020 09:32:00 -0500
-Subject: [PATCH] Fix incorrect return for WorldServer#addAllEntitiesSafely
-
-
-diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java
-index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
---- a/src/main/java/net/minecraft/server/WorldServer.java
-+++ b/src/main/java/net/minecraft/server/WorldServer.java
-@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
-         if (entity.cp().anyMatch(this::isUUIDTaken)) {
-             return false;
-         } else {
--            return this.addAllEntities(entity, reason); // CraftBukkit
-+            // Paper start - this method is _only_ designed to return false on duplicate uuids
-+            // fixes issues with things such as a plugin cancelling spawn of a /summon
-+            this.addAllEntities(entity, reason); // CraftBukkit
-+            return true;
-+            // Paper end
-         }
-     }
- 
diff --git a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch
index 08dffb10d2..a845b02da6 100644
--- a/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch
+++ b/Spigot-Server-Patches/implement-optional-per-player-mob-spawns.patch
@@ -775,9 +775,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
  
                                          entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F);
 @@ -0,0 +0,0 @@ public final class SpawnerCreature {
-                                             groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null);
                                              // CraftBukkit start
-                                             if (worldserver.addAllEntities(entityinsentient, SpawnReason.NATURAL)) {
+                                             worldserver.addAllEntities(entityinsentient, SpawnReason.NATURAL);
+                                             if (!entityinsentient.dead) {
 -                                                ++j;
 +                                                ++j; // Paper - force diff on name change - we expect this to be the total amount spawned
                                                  ++k1;
diff --git a/work/Bukkit b/work/Bukkit
index 2e244e41b4..f47abd8878 160000
--- a/work/Bukkit
+++ b/work/Bukkit
@@ -1 +1 @@
-Subproject commit 2e244e41b4c8ca3236d3a6fac512a8b63a2edcdd
+Subproject commit f47abd8878a775a446e9608a7ee1584cf827c015
diff --git a/work/CraftBukkit b/work/CraftBukkit
index 23618b2cb5..4475707d74 160000
--- a/work/CraftBukkit
+++ b/work/CraftBukkit
@@ -1 +1 @@
-Subproject commit 23618b2cb56759e176e5c7796f945782cd065bc6
+Subproject commit 4475707d74625f37145240027c3ba4c33ba5a183