2016-12-20 22:34:27 +00:00
|
|
|
From 82ddaaf2cda9494934ab537cdb655401b7d5a29e 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
|
2016-12-20 22:34:27 +00:00
|
|
|
index 192705f..ef17262 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
|
2016-11-17 02:23:38 +00:00
|
|
|
@@ -525,7 +525,7 @@ public class ChunkRegionLoader implements IChunkLoader, IAsyncChunkSaver {
|
2016-06-23 02:50:19 +00: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
|
|
|
|
Iterator iterator = entity.bx().iterator();
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
|
2016-12-20 22:34:27 +00:00
|
|
|
index 8aaea1d..e833657 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
|
2016-11-17 02:23:38 +00:00
|
|
|
@@ -1098,6 +1098,7 @@ public abstract class World implements IBlockAccess {
|
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
|
|
|
|
// CraftBukkit end
|
|
|
|
int i = MathHelper.floor(entity.locX / 16.0D);
|
|
|
|
int j = MathHelper.floor(entity.locZ / 16.0D);
|
|
|
|
--
|
2016-12-10 23:50:31 +00:00
|
|
|
2.9.3
|
2016-06-23 02:50:19 +00:00
|
|
|
|