mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Fix CME when adding a passenger during Spawn events (#4616)
This commit is contained in:
parent
6444280b12
commit
79106fd44b
1 changed files with 19 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
||||||
|
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/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
|
||||||
|
}
|
||||||
|
|
||||||
|
public Stream<Entity> 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() {
|
Loading…
Reference in a new issue