2018-08-06 01:46:43 +02:00
|
|
|
From c259b0b0cc6e23351d7f7a1ad344791a31eb8125 Mon Sep 17 00:00:00 2001
|
2016-06-23 04:50:19 +02: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-06 01:46:43 +02:00
|
|
|
index f007af2e1a..2f1488ee53 100644
|
2016-06-23 04:50:19 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
2018-07-22 07:27:46 +02:00
|
|
|
@@ -1050,7 +1050,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2016-06-23 04:50:19 +02:00
|
|
|
}
|
|
|
|
|
2018-07-16 22:08:09 +02: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 04:50:19 +02:00
|
|
|
// CraftBukkit end
|
2018-07-16 22:08:09 +02:00
|
|
|
Iterator iterator = entity.bP().iterator();
|
2016-06-23 04:50:19 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2018-08-06 01:46:43 +02:00
|
|
|
index b6efd8506b..e74b53c483 100644
|
2016-06-23 04:50:19 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/World.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/World.java
|
2018-07-29 18:42:07 +02:00
|
|
|
@@ -966,6 +966,7 @@ public abstract class World implements GeneratorAccess, IIBlockAccess, AutoClose
|
2016-06-23 04:50:19 +02: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 18:37:09 +01:00
|
|
|
|
|
|
|
org.bukkit.event.Cancellable event = null;
|
|
|
|
if (entity instanceof EntityLiving && !(entity instanceof EntityPlayer)) {
|
2016-06-23 04:50:19 +02:00
|
|
|
--
|
2018-07-04 09:55:24 +02:00
|
|
|
2.18.0
|
2016-06-23 04:50:19 +02:00
|
|
|
|