Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
4768e3c4ed
Reduces number of instructions a chunk lookup does when accessing the last chunk cache. This reduces amount of work and opcodes and allows better inlining. In lots of profiling comparisons, this optimization was able to reduce the cost of repeated chunk lookups that hit the cache pretty significantly.
28 Zeilen
1.1 KiB
Diff
28 Zeilen
1.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index 8dd560c8207f14123ab9c9820d8ce7333775db35..90b2a891c5bfa26ab1ff6738f58719a10d5cbed6 100644
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
@@ -523,6 +523,7 @@ public class Chunk implements IChunkAccess {
|
|
entity.chunkZ = this.loc.z;
|
|
this.entities.add(entity); // Paper - per chunk entity list
|
|
this.entitySlices[k].add(entity);
|
|
+ this.markDirty(); // Paper
|
|
}
|
|
|
|
@Override
|
|
@@ -550,6 +551,7 @@ public class Chunk implements IChunkAccess {
|
|
return;
|
|
}
|
|
entityCounts.decrement(entity.getMinecraftKeyString());
|
|
+ this.markDirty(); // Paper
|
|
// Paper end
|
|
this.entities.remove(entity); // Paper
|
|
}
|