Skip to content

Commit

Permalink
Fix Delete Timings
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yh-china committed Nov 7, 2023
1 parent d7e4fbc commit dada85d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 7 deletions.
36 changes: 33 additions & 3 deletions patches/server/0002-Delete-Timings.patch
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,7 @@ index 749087baa24d6c07d09ef0f93fa6bde694d72a93..8dbe0d3e867b3fa2478f2ad1e74e4763
// Paper start
if (waitableArray[0] != null) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index caa73632aee15583c6b6ed12a668c8f49b794708..f0d4e84f7ba4e2b669ec0f748a7ab50eac90fdfe 100644
index caa73632aee15583c6b6ed12a668c8f49b794708..d9a33968fa0f1aa5def297f34ba1dbf229ee7c32 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1,13 +1,10 @@
Expand Down Expand Up @@ -1265,15 +1265,45 @@ index caa73632aee15583c6b6ed12a668c8f49b794708..f0d4e84f7ba4e2b669ec0f748a7ab50e
}

gameprofilerfiller.pop();
@@ -1188,7 +1169,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1156,24 +1137,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider

// Paper start - optimised tracker
private final void processTrackQueue() {
- this.level.timings.tracker1.startTiming();
- try {
- for (TrackedEntity tracker : this.entityMap.values()) {
- // update tracker entry
- tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
- }
- } finally {
- this.level.timings.tracker1.stopTiming();
+ for (TrackedEntity tracker : this.entityMap.values()) {
+ // update tracker entry
+ tracker.updatePlayers(tracker.entity.getPlayersInTrackRange());
}


- this.level.timings.tracker2.startTiming();
- try {
- for (TrackedEntity tracker : this.entityMap.values()) {
- tracker.serverEntity.sendChanges();
- }
- } finally {
- this.level.timings.tracker2.stopTiming();
+ for (TrackedEntity tracker : this.entityMap.values()) {
+ tracker.serverEntity.sendChanges();
}
}
// Paper end - optimised tracker
@@ -1188,7 +1159,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
List<ServerPlayer> list = Lists.newArrayList();
List<ServerPlayer> list1 = this.level.players();
ObjectIterator objectiterator = this.entityMap.values().iterator();
- level.timings.tracker1.startTiming(); // Paper

ChunkMap.TrackedEntity playerchunkmap_entitytracker;

@@ -1213,17 +1193,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1213,17 +1183,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
playerchunkmap_entitytracker.serverEntity.sendChanges();
}
}
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0010-Fakeplayer-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ index e38e2e5a7ddba9c140f362021b6be0b0974f7cd1..870a9c94885c983cd7a557b76cb4dbac
AdvancementProgress advancementprogress = this.getOrStartProgress(advancement);
boolean flag1 = advancementprogress.isDone();
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index f0d4e84f7ba4e2b669ec0f748a7ab50eac90fdfe..77cb44dd37229045981b687d5c5bd08e43e82294 100644
index d9a33968fa0f1aa5def297f34ba1dbf229ee7c32..a54e9a6a35760eae2c70eb6b9d4881ec6bbb42de 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1432,6 +1432,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1422,6 +1422,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
// Paper end
this.serverEntity.removePairing(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Subject: [PATCH] Remove streams and iterators from range check
This patch is Powered by Pufferfish(https://github.com/pufferfish-gg/Pufferfish)

diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 77cb44dd37229045981b687d5c5bd08e43e82294..255c6508d7b507dc9b23c5910f872c2fa97c7c50 100644
index a54e9a6a35760eae2c70eb6b9d4881ec6bbb42de..e82fd89dc613381e5ed8079b96901b338a8b5aa5 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1448,19 +1448,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1438,19 +1438,45 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
}

Expand Down

0 comments on commit dada85d

Please sign in to comment.