mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-14 13:43:55 +01:00
add more patches back
This commit is contained in:
parent
e14e8ce3bc
commit
61236ef43b
2 changed files with 45 additions and 0 deletions
|
@ -177,3 +177,6 @@ public net.minecraft.util.thread.BlockableEventLoop runAllTasks()V
|
|||
# Chunk debug command
|
||||
public net.minecraft.server.level.ChunkMap entitiesInLevel
|
||||
public net.minecraft.server.level.ServerLevel players
|
||||
|
||||
# Improve block entity unload performance
|
||||
public net.minecraft.Util$IdentityStrategy
|
||||
|
|
42
patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch
Normal file
42
patches/server/Fix-MC-117075-TE-Unload-Lag-Spike.patch
Normal file
|
@ -0,0 +1,42 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: mezz <tehgeek@gmail.com>
|
||||
Date: Wed, 9 Aug 2017 17:51:22 -0500
|
||||
Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
// Spigot start
|
||||
// Iterator iterator = this.blockEntityTickers.iterator();
|
||||
int tilesThisCycle = 0;
|
||||
+ it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet<TickingBlockEntity> toRemove = new it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet(net.minecraft.Util.IdentityStrategy.INSTANCE); // Paper - use removeAll
|
||||
+ toRemove.add(null);
|
||||
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(tileTickPosition);
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (tickingblockentity == null) {
|
||||
this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
|
||||
tilesThisCycle--;
|
||||
- this.blockEntityTickers.remove(this.tileTickPosition--);
|
||||
continue;
|
||||
}
|
||||
// Spigot end
|
||||
@@ -0,0 +0,0 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
if (tickingblockentity.isRemoved()) {
|
||||
// Spigot start
|
||||
tilesThisCycle--;
|
||||
- this.blockEntityTickers.remove(this.tileTickPosition--);
|
||||
+ toRemove.add(tickingblockentity); // Paper - use removeAll
|
||||
// Spigot end
|
||||
} else {
|
||||
tickingblockentity.tick();
|
||||
}
|
||||
}
|
||||
+ this.blockEntityTickers.removeAll(toRemove);
|
||||
|
||||
timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
Loading…
Reference in a new issue