Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 12:30:06 +01:00
Avoid CME when lightning strikes by making a copy. Fixes BUKKIT-2055
Dieser Commit ist enthalten in:
Ursprung
a5da834258
Commit
fdd01feb8c
@ -107,8 +107,10 @@ public class EntityLightning extends EntityWeather {
|
||||
|
||||
if (this.lifeTicks >= 0 && !this.isEffect) { // CraftBukkit
|
||||
double d0 = 3.0D;
|
||||
List list = this.world.getEntities(this, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0));
|
||||
Iterator iterator = list.iterator();
|
||||
// CraftBukkit start - switch to array copy of list to avoid CMEs
|
||||
Object[] array = this.world.getEntities(this, AxisAlignedBB.a().a(this.locX - d0, this.locY - d0, this.locZ - d0, this.locX + d0, this.locY + 6.0D + d0, this.locZ + d0)).toArray();
|
||||
Iterator iterator = com.google.common.collect.Iterators.forArray(array);
|
||||
// CraftBukkit end
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
Entity entity = (Entity) iterator.next();
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren