PaperMC/Spigot-Server-Patches/0578-Fix-CME-on-adding-a-passenger-in-CreatureSpawnEvent.patch

20 lines
1,011 B
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: jmp <jasonpenilla2@me.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/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
index 1840d64d1bbb1165981f79dd3deeb19816e6a230..e39be18fe6b45a1a53cb484c656872dda00fa274 100644
--- a/src/main/java/net/minecraft/server/Entity.java
+++ b/src/main/java/net/minecraft/server/Entity.java
@@ -3085,7 +3085,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
}
public Stream<Entity> recursiveStream() {
- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::recursiveStream));
+ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::recursiveStream)); // Paper
}
public boolean hasSinglePlayerPassenger() {