mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 22:13:42 +01:00
abba3d113b
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: bb813f6f SPIGOT-4605: Warn against hacking physics CraftBukkit Changes:2ced0233
Don't handle sync packets for kicked playersd5e96882
SPIGOT-4602: Cache reflection in decompile error workaround Spigot Changes: b0f4c22b SPIGOT-4605: Catch more physics problems
38 lines
1.9 KiB
Diff
38 lines
1.9 KiB
Diff
From 5998e59699d7927e6937cc3df8d056504fa7f2c0 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 21ee154a5..a144118f6 100644
|
|
--- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
+++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java
|
|
@@ -1041,7 +1041,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 06991baca..56676f34b 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.1
|
|
|