mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-21 16:09:30 +00:00
38 lines
2.3 KiB
Diff
38 lines
2.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: MrPowerGamerBR <git@mrpowergamerbr.com>
|
|
Date: Sun, 18 Feb 2024 14:22:37 -0300
|
|
Subject: [PATCH] Revert "Fix MC-117075: Block entity unload lag spike"
|
|
|
|
This reverts commit f3453b204569ea865cc1d1302edb6d125e7f0cb3.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
|
index e086114c3d4b1d8ed46eec98e4b66cfc21451139..2d44c17a63b12df0e3c5b39cb9a80924470a8428 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -1387,8 +1387,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
int tickedEntities = 0; // Paper - rewrite chunk system
|
|
|
|
int tilesThisCycle = 0;
|
|
- var toRemove = new it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<TickingBlockEntity>(); // Paper - Fix MC-117075; use removeAll
|
|
- toRemove.add(null); // Paper - Fix MC-117075
|
|
for (tileTickPosition = 0; tileTickPosition < this.blockEntityTickers.size(); tileTickPosition++) { // Paper - Disable tick limiters
|
|
this.tileTickPosition = (this.tileTickPosition < this.blockEntityTickers.size()) ? this.tileTickPosition : 0;
|
|
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
|
|
@@ -1397,7 +1395,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
if (tickingblockentity.isRemoved()) {
|
|
// Spigot start
|
|
tilesThisCycle--;
|
|
- toRemove.add(tickingblockentity); // Paper - Fix MC-117075; use removeAll
|
|
+ this.blockEntityTickers.remove(this.tileTickPosition--);
|
|
// Spigot end
|
|
} else if (flag && this.shouldTickBlocksAt(tickingblockentity.getPos())) {
|
|
tickingblockentity.tick();
|
|
@@ -1408,7 +1406,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
// Paper end - rewrite chunk system
|
|
}
|
|
}
|
|
- this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
this.timings.tileEntityTick.stopTiming(); // Spigot
|
|
this.tickingBlockEntities = false;
|