2018-08-26 18:11:49 +00:00
|
|
|
From fef43c023a1486d881ecc405c59fc00acf543c3c Mon Sep 17 00:00:00 2001
|
2016-06-23 02:50:19 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 21 Jun 2016 22:54:34 -0400
|
|
|
|
Subject: [PATCH] Fix Double World Add issues
|
|
|
|
|
|
|
|
Vanilla will double add Spider Jockeys to the world, so ignore already added.
|
|
|
|
|
|
|
|
Also add debug if something else tries to, and abort before world gets bad state
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2018-08-26 18:11:49 +00:00
|
|
|
index dcd236a8e5..c85a8dac3e 100644
|
2016-06-23 02:50:19 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -1036,7 +1036,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2016-06-23 02:50:19 +00:00
|
|
|
}
|
|
|
|
|
2018-07-16 20:08:09 +00:00
|
|
|
public static void a(Entity entity, GeneratorAccess generatoraccess, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
|
|
|
|
- if (generatoraccess.addEntity(entity, reason) && entity.isVehicle()) {
|
|
|
|
+ if (!entity.valid && generatoraccess.addEntity(entity, reason) && entity.isVehicle()) { // Paper
|
2016-06-23 02:50:19 +00:00
|
|
|
// CraftBukkit end
|
2018-07-16 20:08:09 +00:00
|
|
|
Iterator iterator = entity.bP().iterator();
|
2016-06-23 02:50:19 +00:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2018-08-26 18:11:49 +00:00
|
|
|
index c6fa54848e..1ed4408e2a 100644
|
2016-06-23 02:50:19 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2018-08-26 18:11:49 +00:00
|
|
|
@@ -987,6 +987,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
|
2016-06-23 02:50:19 +00:00
|
|
|
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
|
|
|
|
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
|
|
|
|
if (entity == null) return false;
|
|
|
|
+ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
|
2017-12-09 17:37:09 +00:00
|
|
|
|
|
|
|
org.bukkit.event.Cancellable event = null;
|
|
|
|
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
|
2016-06-23 02:50:19 +00:00
|
|
|
--
|
2018-07-04 07:55:24 +00:00
|
|
|
2.18.0
|
2016-06-23 02:50:19 +00:00
|
|
|
|