mirror of
https://github.com/SparklyPower/SparklyPaper.git
synced 2025-12-21 07:59:31 +00:00
36 lines
2.1 KiB
Diff
36 lines
2.1 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 7fc7419988491dc558c10016a58ebaae485b6cfc..913abd2ae85cb2c558ba953ea446aab939074f43 100644
|
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
|
@@ -957,8 +957,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
|
boolean flag = this.tickRateManager().runsNormally();
|
|
|
|
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);
|
|
@@ -967,13 +965,12 @@ 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();
|
|
}
|
|
}
|
|
- this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
this.timings.tileEntityTick.stopTiming(); // Spigot
|
|
this.tickingBlockEntities = false;
|