From 1c446c222d0930bbce88cb45ee9fd9234c49d266 Mon Sep 17 00:00:00 2001 From: jmp Date: Sun, 4 Oct 2020 20:46:18 -0700 Subject: [PATCH] Fix CME when adding a passenger during Spawn events (#4616) --- ...ng-a-passenger-in-CreatureSpawnEvent.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Spigot-Server-Patches/0584-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch diff --git a/Spigot-Server-Patches/0584-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch b/Spigot-Server-Patches/0584-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch new file mode 100644 index 000000000..00b49cb55 --- /dev/null +++ b/Spigot-Server-Patches/0584-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: jmp +Date: Sun, 4 Oct 2020 19:55:25 -0700 +Subject: [PATCH] Fix CME on adding a passenger in CreatureSpawnEvent + + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index 28e2d3f0a5e2ab084175bf0bba88816f80089799..b845e488e3b9a4f19d1fcf169533046b7e72ba28 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -3077,7 +3077,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public Stream co() { +- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::co)); ++ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::co)); // Paper + } + + public boolean hasSinglePlayerPassenger() {