Updated Upstream (CraftBukkit)

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

CraftBukkit Changes:
bb6f384a SPIGOT-4534: Only call event for new chunks
This commit is contained in:
Shane Freeder 2018-12-17 23:51:44 +00:00
parent 3496f2d7e4
commit 1f59f78c6f
No known key found for this signature in database
GPG key ID: A3F61EA5A085289C
3 changed files with 17 additions and 10 deletions

View file

@ -1,4 +1,4 @@
From f91d23d40efa6bb6385549a9dd7a69a2c42fceed Mon Sep 17 00:00:00 2001
From 9371f9dbc894ceb59d0a7fc7ac0df987c8c8b520 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 3 Aug 2018 22:47:46 -0400
Subject: [PATCH] Entity add to world fixes
@ -14,7 +14,7 @@ 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 4f01140e7..57e35564a 100644
index 37bb6f40c..ee4332eda 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -916,6 +916,7 @@ public class Chunk implements IChunkAccess {
@ -25,14 +25,14 @@ index 4f01140e7..57e35564a 100644
for (int j = 0; j < i; ++j) {
// CraftBukkit start
@@ -964,18 +965,11 @@ public class Chunk implements IChunkAccess {
@@ -964,18 +965,18 @@ public class Chunk implements IChunkAccess {
}
}
// Paper end
-
- List<Entity> toRemove = new LinkedList<>();
- this.world.a(entityslice.stream().filter((entity) -> {
- if (!CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) {
- if (this.needsDecoration && !CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) { // Only call for new chunks
- toRemove.add(entity);
- return false;
- }
@ -42,7 +42,14 @@ index 4f01140e7..57e35564a 100644
// CraftBukkit end
}
+ 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)
+ .filter((entity) -> CraftEventFactory.doEntityAddEventCalling(this.world, entity, CreatureSpawnEvent.SpawnReason.CHUNK_GEN)) // Paper - Inline into stream
+ // 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

View file

@ -1,4 +1,4 @@
From 201ce3d451f0e6fb3a7ee86019926e044b3f9512 Mon Sep 17 00:00:00 2001
From 10a0113e0c7b2dfccbe5c385b2e9d76b7cf06786 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 29 Sep 2018 01:18:16 -0400
Subject: [PATCH] Fix Sending Chunks to Client
@ -14,10 +14,10 @@ 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 aa7f01f19..e3d97757f 100644
index 7972e6955..7851ede7a 100644
--- a/src/main/java/net/minecraft/server/Chunk.java
+++ b/src/main/java/net/minecraft/server/Chunk.java
@@ -1191,7 +1191,7 @@ public class Chunk implements IChunkAccess {
@@ -1198,7 +1198,7 @@ public class Chunk implements IChunkAccess {
}
public boolean isReady() {
@ -26,7 +26,7 @@ index aa7f01f19..e3d97757f 100644
}
public boolean v() {
@@ -1429,6 +1429,13 @@ public class Chunk implements IChunkAccess {
@@ -1436,6 +1436,13 @@ public class Chunk implements IChunkAccess {
this.h.clear();
this.a(ChunkStatus.POSTPROCESSED);
this.m.a(this);

@ -1 +1 @@
Subproject commit 38cf676e328d869f8d5cded4d9e9ad3d75afb760
Subproject commit bb6f384a830548def9c73264dab1a4d06fc2bdf4