From 860f4c4b5879756176eff53fd1364d08339b33de Mon Sep 17 00:00:00 2001 From: Aikar Date: Tue, 30 Jun 2020 01:20:29 -0400 Subject: [PATCH] Updated Upstream (Bukkit/CraftBukkit/Spigot) 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: 42d5a714 SPIGOT-5899: Hoglins API similar to Piglins 2c1ee10e SPIGOT-5887: ClickType doesn't include off hand swaps 5ff7c7ce SPIGOT-5886: Missing BlockData CraftBukkit Changes: 7560f5f5 SPIGOT-5905: Fix hex colours not being allowed in MOTD d47c47ee SPIGOT-5889: Villager using composter should call EntityChangeBlockEvent 2fe6b4a3 SPIGOT-5899: Hoglins API similar to Piglins e09dbeca SPIGOT-5887: ClickType doesn't include off hand swaps 23aac2a5 SPIGOT-5903: EntityDismountEvent cannot be triggered asynchronously 92cbf656 SPIGOT-5884: Tab completions lost on reloadData / minecraft:reload fb4e54ad SPIGOT-5902: PlayerRespawnEvent places player at spawn before event is called aa8f3d5a SPIGOT-5901: Structures are generated in all worlds based on the setting for the main world a0c35937 SPIGOT-5895: PlayerChangedWorldEvent#getFrom is incorrect 89c0a5c3 SPIGOT-5886: Missing BlockData Spigot Changes: 0287a20d SPIGOT-5903: EntityDismountEvent cannot be triggered asynchronously --- ...sh-dismount-events-from-worldgen-thr.patch | 42 ------------------- ...-sneak-when-changing-worlds-MC-10657.patch | 2 +- Spigot-Server-Patches/MC-Dev-fixes.patch | 13 ------ ...entity-dismount-during-teleportation.patch | 10 ++--- work/Bukkit | 2 +- work/CraftBukkit | 2 +- work/Spigot | 2 +- 7 files changed, 9 insertions(+), 64 deletions(-) delete mode 100644 Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch diff --git a/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch b/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch deleted file mode 100644 index 4ebbffab0..000000000 --- a/Spigot-Server-Patches/Don-t-fire-unleash-dismount-events-from-worldgen-thr.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar -Date: Mon, 29 Jun 2020 04:00:07 -0400 -Subject: [PATCH] Don't fire unleash/dismount events from worldgen threads - -Mojang can trigger this during worldgen and tries to fire bukkit events. - -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - // CraftBukkit start - CraftEntity craft = (CraftEntity) entity.getBukkitEntity().getVehicle(); - Entity orig = craft == null ? null : craft.getHandle(); -- if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { -+ if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity && MCUtil.isMainThread()) { // Paper - VehicleExitEvent event = new VehicleExitEvent( - (Vehicle) getBukkitEntity(), - (LivingEntity) entity.getBukkitEntity(), !suppressCancellation // Paper -@@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - // CraftBukkit end - // Spigot start - org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity(), !suppressCancellation); // Paper -- Bukkit.getPluginManager().callEvent(event); -+ if (MCUtil.isMainThread()) Bukkit.getPluginManager().callEvent(event); // Paper - if (event.isCancelled()) { - return false; - } -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -0,0 +0,0 @@ public abstract class EntityInsentient extends EntityLiving { - boolean flag1 = super.a(entity, flag); - - if (flag1 && this.isLeashed()) { -- this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit -+ if (MCUtil.isMainThread()) this.world.getServer().getPluginManager().callEvent(new EntityUnleashEvent(this.getBukkitEntity(), UnleashReason.UNKNOWN)); // CraftBukkit // Paper - this.unleash(true, true); - } - diff --git a/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch b/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch index b6eb19fe0..7f90dd332 100644 --- a/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch +++ b/Spigot-Server-Patches/Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch @@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + setSneaking(false); // Paper - fix MC-10657 + // CraftBukkit start - PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver.getWorld()); + PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); this.world.getServer().getPluginManager().callEvent(changeEvent); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 diff --git a/Spigot-Server-Patches/MC-Dev-fixes.patch b/Spigot-Server-Patches/MC-Dev-fixes.patch index 7c1d4d68f..8771d9822 100644 --- a/Spigot-Server-Patches/MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/MC-Dev-fixes.patch @@ -279,19 +279,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 String s1 = ((INamable) t0).getName(); if (this.b.containsKey(s1)) { -diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/src/main/java/net/minecraft/server/ChunkStatus.java -+++ b/src/main/java/net/minecraft/server/ChunkStatus.java -@@ -0,0 +0,0 @@ public class ChunkStatus { - return (CompletableFuture) function.apply(ichunkaccess); - }); - private static final List q = ImmutableList.of(ChunkStatus.FULL, ChunkStatus.FEATURES, ChunkStatus.LIQUID_CARVERS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS, ChunkStatus.STRUCTURE_STARTS); -- private static final IntList r = (IntList) SystemUtils.a((Object) (new IntArrayList(a().size())), (intarraylist) -> { -+ private static final IntList r = (IntList) SystemUtils.a((new IntArrayList(a().size())), (java.util.function.Consumer)(IntArrayList intarraylist) -> { // Paper - decompile fix - int i = 0; - - for (int j = a().size() - 1; j >= 0; --j) { diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/CraftingManager.java diff --git a/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch index ef177f357..ce228b2c4 100644 --- a/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/force-entity-dismount-during-teleportation.patch @@ -60,17 +60,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - (LivingEntity) entity.getBukkitEntity() + (LivingEntity) entity.getBukkitEntity(), !suppressCancellation // Paper ); - Bukkit.getPluginManager().callEvent(event); - CraftEntity craftn = (CraftEntity) entity.getBukkitEntity().getVehicle(); + // Suppress during worldgen + if (this.valid) { @@ -0,0 +0,0 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end // Spigot start - org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()); + org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity(), !suppressCancellation); // Paper - Bukkit.getPluginManager().callEvent(event); - if (event.isCancelled()) { - return false; + // Suppress during worldgen + if (this.valid) { + Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java diff --git a/work/Bukkit b/work/Bukkit index 3c844f351..42d5a714f 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 3c844f351a81d1b9bce7a39e7055a933f10c9a96 +Subproject commit 42d5a714f434eb1324dfef1b38218d7e40c67644 diff --git a/work/CraftBukkit b/work/CraftBukkit index 32acc2621..7560f5f5a 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 32acc2621791b5f38e71df1da1b43858bdeaa0e2 +Subproject commit 7560f5f5a69fc5fa17ec0c33eaba8abe026a53ef diff --git a/work/Spigot b/work/Spigot index ad703da04..0287a20df 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit ad703da04d2ffbf84a75e5ee32f2829380864bb7 +Subproject commit 0287a20df344c0bc462ddc64851e5a160a1775fc