diff --git a/Spigot-Server-Patches/Anti-Xray.patch b/Spigot-Server-Patches/Anti-Xray.patch index 061b72179c..46aac6c30c 100644 --- a/Spigot-Server-Patches/Anti-Xray.patch +++ b/Spigot-Server-Patches/Anti-Xray.patch @@ -1049,7 +1049,7 @@ index 000000000..37093419c + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 57e35564a..890715ff8 100644 +index 414c27516..c3a54576f 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch index b0a917efa9..c8c6c996a2 100644 --- a/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch +++ b/Spigot-Server-Patches/Async-Chunk-Loading-and-Generation.patch @@ -458,7 +458,7 @@ index 000000000..8f18c2869 + +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 890715ff8..654cf763b 100644 +index c3a54576f..6255aa285 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch b/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch index 4f13ce1922..9e334dc3f2 100644 --- a/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch +++ b/Spigot-Server-Patches/Don-t-recheck-type-after-setting-a-block.patch @@ -16,7 +16,7 @@ be having data corruption issues anyways. This provides a small boost to all setType calls. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 516656f8f..aa7f01f19 100644 +index 9695af028..ccdc171d4 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch index d00a8a8532..8596333e56 100644 --- a/Spigot-Server-Patches/Entity-add-to-world-fixes.patch +++ b/Spigot-Server-Patches/Entity-add-to-world-fixes.patch @@ -14,9 +14,18 @@ Fix this by differing entity add to world for all entities at the same time the original entity is dead, overwrite it as the logic does for unloaod queued entities. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 37bb6f40c..ee4332eda 100644 +index 37bb6f40c..414c27516 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java +@@ -0,0 +0,0 @@ package net.minecraft.server; + + // Paper start + import com.destroystokyo.paper.PaperWorldConfig.DuplicateUUIDMode; ++ ++import java.util.Arrays; + import java.util.HashMap; + import java.util.UUID; + // Paper end @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { this.world.a(this.tileEntities.values()); List[] aentityslice = this.entitySlices; // Spigot @@ -40,20 +49,19 @@ index 37bb6f40c..ee4332eda 100644 - })); - entityslice.removeAll(toRemove); // CraftBukkit end ++ this.world.addChunkEntities(entityslice.stream() // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) ++ // Paper start - Inline event into stream ++ .filter((entity) -> { ++ if (!this.needsDecoration) { ++ return true; ++ } ++ return CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN); ++ }) ++ // Paper end - Inline event into stream ++ .filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) } -+ this.world.addChunkEntities(toAdd.stream() // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) -+ // Paper start - Inline event into stream -+ .filter((entity) -> { -+ if (!this.needsDecoration) { -+ return true; -+ } -+ return CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN); -+ }) -+ // Paper end - Inline event into stream -+ .filter((entity) -> !(entity instanceof EntityHuman || entity.valid))); // Paper - add all at same time to avoid entities adding to world modifying slice state, skip already added entities (not normal, but can happen) // CraftBukkit start - org.bukkit.Server server = this.world.getServer(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 5e61826f6..bd6f64e52 100644 --- a/src/main/java/net/minecraft/server/World.java diff --git a/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch b/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch index 91730aa252..a625a29f2c 100644 --- a/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch +++ b/Spigot-Server-Patches/Fix-Sending-Chunks-to-Client.patch @@ -14,7 +14,7 @@ This fix always sends chunks to the client, and simply updates the client anytime post processing is triggered with the new chunk data. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7972e6955..7851ede7a 100644 +index ccdc171d4..7751ae444 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch index be60dd63bc..2266f6893f 100644 --- a/Spigot-Server-Patches/Optimize-Light-Recalculations.patch +++ b/Spigot-Server-Patches/Optimize-Light-Recalculations.patch @@ -14,7 +14,7 @@ Also optimizes to not repeatedly look up the same chunk for light lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 654cf763b..516656f8f 100644 +index 6255aa285..9695af028 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {