PaperMC/Spigot-Server-Patches/0124-Fix-Double-World-Add-issues.patch
Shane Freeder 3496f2d7e4
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this

Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
b850a822 SPIGOT-4526: Add conversion time API for Zombie & subclasses

CraftBukkit Changes:
38cf676e SPIGOT-4534: CreatureSpawnEvent not being called for CHUNK_GEN
b446cb5d SPIGOT-4527: Fix sponges with waterlogged blocks
6ec8ea5c SPIGOT-4526: Add conversion time API for Zombie & subclasses
c64fe508 Mappings Update
a3c2ec03 Fix missing ServerListPingEvent call for legacy pings

Spigot Changes:
1dc156ce Rebuild patches
140f654d Mappings Update
2018-12-17 05:19:39 +00:00

37 lines
1.9 KiB
Diff

From af2828a58a4f89566cc230a26042e7811491def3 Mon Sep 17 00:00:00 2001
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
index 3b39b5472..6093ae408 100644
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
@@ -1052,7 +1052,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
}
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
// CraftBukkit end
Iterator iterator = entity.bP().iterator();
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
index 6f672aa22..0d04b14cf 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -992,6 +992,7 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
public boolean addEntity(Entity entity, SpawnReason spawnReason) { // Changed signature, added SpawnReason
org.spigotmc.AsyncCatcher.catchOp( "entity add"); // Spigot
+ if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); return true; } // Paper
if (!CraftEventFactory.doEntityAddEventCalling(this, entity, spawnReason)) {
return false;
}
--
2.20.0