Paper/patches/server/0533-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch

20 lines
966 B
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index c9a4598f9856b82f852d79c7c1e33767bc590c21..10cc9daf2a6d29c1148b7ead70a21b29c4ae5d24 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3436,7 +3436,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, n
}
private Stream<Entity> getIndirectPassengersStream() {
- return this.passengers.stream().flatMap(Entity::getSelfAndPassengers);
+ return ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::getSelfAndPassengers); // Paper
}
@Override