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

20 lines
1.0 KiB
Diff
Raw Normal View History

2021-06-11 14:02:28 +02:00
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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a623c22cd03ad92657e661851fddc76a30986755..90e9797cc1f3a4aa0a2bee28dca364e6f6dd0c0b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3180,7 +3180,7 @@ public abstract class Entity implements Nameable, CommandSource, net.minecraft.s
}
public Stream<Entity> getSelfAndPassengers() {
- return Stream.concat(Stream.of(this), this.passengers.stream().flatMap(Entity::getSelfAndPassengers));
+ return Stream.concat(Stream.of(this), com.google.common.collect.ImmutableList.copyOf(this.passengers).stream().flatMap(Entity::getSelfAndPassengers)); // Paper
}
public boolean hasOnePlayerPassenger() {