2018-07-04 09:55:24 +02:00
|
|
|
From 244438affa544cd9fb04141577b56ef2a0b11788 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-01-18 07:00:51 +01:00
|
|
|
index 12bd558a7..8747d9a45 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
|
2017-08-12 23:32:01 +02:00
|
|
|
@@ -546,7 +546,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2016-06-23 04:50:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
|
|
|
|
- if (world.addEntity(entity, reason) && entity.isVehicle()) {
|
|
|
|
+ if (!entity.valid && world.addEntity(entity, reason) && entity.isVehicle()) { // Paper
|
|
|
|
// CraftBukkit end
|
2017-06-08 16:16:51 +02:00
|
|
|
Iterator iterator = entity.bF().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-07-04 09:55:24 +02:00
|
|
|
index 36a78daff..6e37c4366 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
|
2017-08-03 16:36:06 +02:00
|
|
|
@@ -1103,6 +1103,7 @@ public abstract class World implements IBlockAccess {
|
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
|
|
|
|