From 8a65e6b9590d408bea3abf8001e8e8f37713b7d4 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Mon, 8 Mar 2021 18:12:31 -0500 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5325) Upstream has released updates that appear 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: d264e972 #591: Add option for a consumer before spawning an item 1c537fce #590: Add spawn and transform reasons for piglin zombification. CraftBukkit Changes: ee5006d1 #810: Add option for a consumer before spawning an item f6a39d3c #809: Add spawn and transform reasons for piglin zombification. 0c24068a Organise imports Spigot Changes: bff52619 Organise imports --- .../Add-ArmorStand-Item-Meta.patch | 4 ++-- .../Add-BeaconEffectEvent.patch | 4 ++-- ...d-MinecraftKey-Information-to-Objects.patch | 2 +- .../Add-PlayerInitialSpawnEvent.patch | 6 +++--- Spigot-Server-Patches/Add-TNTPrimeEvent.patch | 2 +- ...ng-for-servers-not-running-on-Java-11.patch | 8 ++++---- .../Added-ServerResourcesReloadedEvent.patch | 6 ++++-- Spigot-Server-Patches/EntityMoveEvent.patch | 2 +- .../Further-improve-server-tick-loop.patch | 2 +- .../Implement-Brigadier-Mojang-API.patch | 6 +++--- ...nk-Priority-Urgency-System-for-Chunks.patch | 4 ++-- ...plement-alternative-item-despawn-rate.patch | 4 ++-- ...ent-furnace-cook-speed-multiplier-API.patch | 4 ++-- .../No-Tick-view-distance-implementation.patch | 2 +- Spigot-Server-Patches/RangedEntity-API.patch | 5 +++-- .../Slime-Pathfinder-Events.patch | 4 ++-- ...pawn-player-in-correct-world-on-login.patch | 2 +- Spigot-Server-Patches/Timings-v2.patch | 18 +++++++++--------- ...soleAppender-for-console-improvements.patch | 6 +++--- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 22 files changed, 50 insertions(+), 47 deletions(-) diff --git a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch index 9240c0c23..cf2774907 100644 --- a/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch +++ b/Spigot-Server-Patches/Add-ArmorStand-Item-Meta.patch @@ -16,8 +16,8 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand. index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaArmorStand.java -@@ -0,0 +0,0 @@ import org.bukkit.Material; - import org.bukkit.configuration.serialization.DelegateDeserialization; +@@ -0,0 +0,0 @@ import org.bukkit.configuration.serialization.DelegateDeserialization; + import org.bukkit.craftbukkit.inventory.CraftMetaItem.ItemMetaKey; @DelegateDeserialization(CraftMetaItem.SerializableMeta.class) -public class CraftMetaArmorStand extends CraftMetaItem { diff --git a/Spigot-Server-Patches/Add-BeaconEffectEvent.patch b/Spigot-Server-Patches/Add-BeaconEffectEvent.patch index dfcb7a192..906edbcae 100644 --- a/Spigot-Server-Patches/Add-BeaconEffectEvent.patch +++ b/Spigot-Server-Patches/Add-BeaconEffectEvent.patch @@ -8,8 +8,8 @@ diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.potion.CraftPotionUtil; - import org.bukkit.entity.HumanEntity; +@@ -0,0 +0,0 @@ import javax.annotation.Nullable; + import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.potion.PotionEffect; // CraftBukkit end +// Paper start diff --git a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch index 0841ad5f7..b33fd8c4b 100644 --- a/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/Add-MinecraftKey-Information-to-Objects.patch @@ -96,7 +96,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; - // CraftBukkit end + import org.spigotmc.CustomTimingsHandler; // Spigot -public abstract class TileEntity { diff --git a/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch b/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch index df948df91..cb6161036 100644 --- a/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-Server-Patches/Add-PlayerInitialSpawnEvent.patch @@ -16,9 +16,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // Spigot start - spawn location event Player bukkitPlayer = entityplayer.getBukkitEntity(); -- PlayerSpawnLocationEvent ev = new PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation()); -+ PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event - Bukkit.getPluginManager().callEvent(ev); +- org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(bukkitPlayer, bukkitPlayer.getLocation()); ++ org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new com.destroystokyo.paper.event.player.PlayerInitialSpawnEvent(bukkitPlayer, bukkitPlayer.getLocation()); // Paper use our duplicate event + cserver.getPluginManager().callEvent(ev); Location loc = ev.getSpawnLocation(); @@ -0,0 +0,0 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch index e6afe9af8..4bf4394d2 100644 --- a/Spigot-Server-Patches/Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/Add-TNTPrimeEvent.patch @@ -124,8 +124,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 // CraftBukkit end +import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent - // PAIL: Fixme public class EntityEnderDragon extends EntityInsentient implements IMonster { + @@ -0,0 +0,0 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { }); craftBlock.getNMS().dropNaturally((WorldServer) world, blockposition, ItemStack.b); diff --git a/Spigot-Server-Patches/Add-warning-for-servers-not-running-on-Java-11.patch b/Spigot-Server-Patches/Add-warning-for-servers-not-running-on-Java-11.patch index a9edc00c6..3ea9f0258 100644 --- a/Spigot-Server-Patches/Add-warning-for-servers-not-running-on-Java-11.patch +++ b/Spigot-Server-Patches/Add-warning-for-servers-not-running-on-Java-11.patch @@ -62,14 +62,14 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ 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 @@ import org.bukkit.craftbukkit.Main; - import org.bukkit.event.server.ServerLoadEvent; - // CraftBukkit end +@@ -0,0 +0,0 @@ import org.bukkit.event.server.ServerLoadEvent; + import co.aikar.timings.MinecraftTimings; // Paper -+import io.papermc.paper.util.PaperJvmChecker; // Paper import org.spigotmc.SlackActivityAccountant; // Spigot ++import io.papermc.paper.util.PaperJvmChecker; // Paper public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { + @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { + @@ -0,0 +0,0 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant { // Paper diff --git a/Spigot-Server-Patches/Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/Slime-Pathfinder-Events.patch index d647ba500..ef36fd9e7 100644 --- a/Spigot-Server-Patches/Slime-Pathfinder-Events.patch +++ b/Spigot-Server-Patches/Slime-Pathfinder-Events.patch @@ -8,10 +8,10 @@ diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java -@@ -0,0 +0,0 @@ import java.util.Objects; - import java.util.Optional; +@@ -0,0 +0,0 @@ import java.util.Optional; import java.util.Random; import javax.annotation.Nullable; + +// Paper start +import com.destroystokyo.paper.event.entity.SlimeChangeDirectionEvent; +import com.destroystokyo.paper.event.entity.SlimeSwimEvent; diff --git a/Spigot-Server-Patches/Spawn-player-in-correct-world-on-login.patch b/Spigot-Server-Patches/Spawn-player-in-correct-world-on-login.patch index 814822259..ef6c1bba8 100644 --- a/Spigot-Server-Patches/Spawn-player-in-correct-world-on-login.patch +++ b/Spigot-Server-Patches/Spawn-player-in-correct-world-on-login.patch @@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + // Paper start - move logic in Entity to here, to use bukkit supplied world UUID. + if (nbttagcompound != null && nbttagcompound.hasKey("WorldUUIDMost") && nbttagcompound.hasKey("WorldUUIDLeast")) { + UUID uid = new UUID(nbttagcompound.getLong("WorldUUIDMost"), nbttagcompound.getLong("WorldUUIDLeast")); -+ org.bukkit.World bWorld = Bukkit.getServer().getWorld(uid); ++ org.bukkit.World bWorld = org.bukkit.Bukkit.getServer().getWorld(uid); + if (bWorld != null) { + resourcekey = ((CraftWorld) bWorld).getHandle().getDimensionKey(); + } else { diff --git a/Spigot-Server-Patches/Timings-v2.patch b/Spigot-Server-Patches/Timings-v2.patch index bfb2f83e4..e328620d0 100644 --- a/Spigot-Server-Patches/Timings-v2.patch +++ b/Spigot-Server-Patches/Timings-v2.patch @@ -1176,10 +1176,10 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ 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 @@ import org.bukkit.craftbukkit.CraftServer; - import org.bukkit.craftbukkit.Main; +@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.Main; import org.bukkit.event.server.ServerLoadEvent; // CraftBukkit end + -import org.bukkit.craftbukkit.SpigotTimings; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper import org.spigotmc.SlackActivityAccountant; // Spigot @@ -1620,11 +1620,10 @@ diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/ index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java -@@ -0,0 +0,0 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; - import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; - import org.bukkit.inventory.InventoryHolder; +@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryHolder; // CraftBukkit end --import org.spigotmc.CustomTimingsHandler; // Spigot + + import org.spigotmc.CustomTimingsHandler; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper +import co.aikar.timings.Timing; // Paper @@ -1814,7 +1813,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { - private final Spigot spigot = new Spigot() + private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { + @Deprecated @@ -2121,13 +2120,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; import org.bukkit.scheduler.BukkitTask; + -import org.bukkit.craftbukkit.SpigotTimings; // Spigot --import org.spigotmc.CustomTimingsHandler; // Spigot + import org.spigotmc.CustomTimingsHandler; // Spigot +import co.aikar.timings.MinecraftTimings; // Paper +import co.aikar.timings.Timing; // Paper - public class CraftTask implements BukkitTask, Runnable { // Spigot + @@ -0,0 +0,0 @@ public class CraftTask implements BukkitTask, Runnable { // Spigot */ private volatile long period; diff --git a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch index c1623662f..af2f84d33 100644 --- a/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -189,9 +189,9 @@ diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/ 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 @@ import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; - // CraftBukkit start +@@ -0,0 +0,0 @@ import org.apache.logging.log4j.Logger; + import com.mojang.serialization.DynamicOps; + import com.mojang.serialization.Lifecycle; import com.google.common.collect.ImmutableSet; -import jline.console.ConsoleReader; +// import jline.console.ConsoleReader; // Paper diff --git a/work/Bukkit b/work/Bukkit index 9d0ad3184..d264e972e 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 9d0ad3184ec89c61eecd7a1234005391fee66297 +Subproject commit d264e972e9fecfea2f4a016c5d89ab8611680eb3 diff --git a/work/CraftBukkit b/work/CraftBukkit index a021e334a..ee5006d18 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit a021e334aa342a60945b330d11b7dbd5d0fff017 +Subproject commit ee5006d1873170ce1ad908455f680b228096da87 diff --git a/work/Spigot b/work/Spigot index db99f8216..bff526193 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit db99f82161b38f74d56351b3f941d4fb42bfa588 +Subproject commit bff526193eec525c624bf7e65f8a5239866bfcbf