2018-10-06 06:56:20 +02:00
|
|
|
From afaa779901a84d3127d03771f6d497dc6003937e Mon Sep 17 00:00:00 2001
|
2018-07-24 04:54:52 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Mon, 23 Jul 2018 22:18:31 -0400
|
|
|
|
Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it
|
|
|
|
saves
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
2018-10-06 06:56:20 +02:00
|
|
|
index 60829fded7..4e6ed1e349 100644
|
2018-07-24 04:54:52 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2018-10-06 06:56:20 +02:00
|
|
|
@@ -711,6 +711,7 @@ public class Chunk implements IChunkAccess {
|
2018-07-24 05:20:41 +02:00
|
|
|
entity.ag = this.locZ;
|
2018-07-24 04:54:52 +02:00
|
|
|
this.entitySlices[k].add(entity);
|
|
|
|
// Paper start
|
|
|
|
+ this.markDirty();
|
|
|
|
if (entity instanceof EntityItem) {
|
2018-07-24 05:20:41 +02:00
|
|
|
itemCounts[k]++;
|
|
|
|
} else if (entity instanceof IInventory) {
|
2018-10-06 06:56:20 +02:00
|
|
|
@@ -742,6 +743,7 @@ public class Chunk implements IChunkAccess {
|
2018-07-24 05:20:41 +02:00
|
|
|
if (!this.entitySlices[i].remove(entity)) {
|
|
|
|
return;
|
|
|
|
}
|
2018-07-24 04:54:52 +02:00
|
|
|
+ this.markDirty();
|
|
|
|
if (entity instanceof EntityItem) {
|
2018-07-24 05:20:41 +02:00
|
|
|
itemCounts[i]--;
|
|
|
|
} else if (entity instanceof IInventory) {
|
2018-07-24 04:54:52 +02:00
|
|
|
--
|
Improve Light Queue and force enable it for all
There is no reason for the light queue to even be an option. This
enables the light queue for everyone.
This also improves the "can we still tick" time logic to always
check before running a light operation.
previously, we always executed at least 10 on the first world
(but not other worlds...), but we are seeing light take up some
heavy time, so improving that for now.
I've now also improved recheck gaps logic to happen at the end of all single block updates
This also prevents multiple gap checks, as previously if a tick skipped
the gaps check, the next tick would end up re-adding the entry again,
resulting in multiple gap checks.
This now just sets a marker "We need to recheck gaps" and will only occur
once.
This also should reduce chunk loads, as previously, we checked if
the neighbor chunks were loaded for the gap check, however those
neighbor chunks might of unloaded before the light queue operation
actually ran. Now, the neighbor chunk is done when the gap check
is being done, so it should avoid loading chunks.
Fixes #1466
Fixes #1431
2018-09-22 17:46:31 +02:00
|
|
|
2.19.0
|
2018-07-24 04:54:52 +02:00
|
|
|
|