mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@6d63005 Fix setEggCount method from TurtleLayEggEvent (#8385) PaperMC/Paper@abe53a7 Fix typos in isTickingWorlds API javadocs (#8382) PaperMC/Paper@01a1387 Rewrite chunk system (#8177)
This commit is contained in:
@@ -39,7 +39,7 @@ index edd378813873ed367784379b0f1666d1ccf2194d..eb4dac2239592d680ef31edf47f1ab66
|
||||
|
||||
return b0;
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1ad3ee0d7c 100644
|
||||
index 7063ef7d547714d6647290e36da3a07b3b946871..60bed3f87016b29508ea1a94db65a1f60d960de1 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -328,13 +328,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -62,7 +62,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
this.status = new ServerStatus();
|
||||
this.random = RandomSource.create();
|
||||
this.port = -1;
|
||||
@@ -926,9 +926,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -936,9 +936,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end
|
||||
// CraftBukkit end
|
||||
@@ -74,7 +74,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
|
||||
@@ -1201,18 +1201,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1181,18 +1181,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Spigot end
|
||||
|
||||
@@ -98,7 +98,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
this.mayHaveDelayedTasks = true;
|
||||
// Purpur start - tps catchup
|
||||
if (org.purpurmc.purpur.PurpurConfig.tpsCatchup) {
|
||||
@@ -1222,8 +1222,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1202,8 +1202,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Purpur end - tps catchup
|
||||
this.waitUntilNextTick();
|
||||
@@ -109,7 +109,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
this.isReady = true;
|
||||
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
|
||||
}
|
||||
@@ -1384,7 +1384,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1364,7 +1364,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
||||
@@ -118,7 +118,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
super.doRunTask(ticktask);
|
||||
}
|
||||
|
||||
@@ -1469,7 +1469,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1449,7 +1449,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
if (playerSaveInterval < 0) {
|
||||
playerSaveInterval = autosavePeriod;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
||||
try {
|
||||
this.isSaving = true;
|
||||
@@ -1484,7 +1484,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1464,7 +1464,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
} finally {
|
||||
this.isSaving = false;
|
||||
}
|
||||
@@ -136,7 +136,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
// Paper end
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
// Paper start - move executeAll() into full server tick timing
|
||||
@@ -1497,7 +1497,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1477,7 +1477,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
||||
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
||||
// Paper end
|
||||
@@ -145,7 +145,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
long l = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
|
||||
|
||||
this.averageTickTime = this.averageTickTime * 0.8F + (float) l / 1000000.0F * 0.19999999F;
|
||||
@@ -1510,7 +1510,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1490,7 +1490,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end
|
||||
|
||||
this.frameTimer.logFrameDuration(i1 - i);
|
||||
@@ -154,7 +154,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
|
||||
}
|
||||
@@ -1519,11 +1519,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1499,11 +1499,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper // Purpur
|
||||
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
|
||||
//MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
@@ -168,7 +168,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1565,18 +1565,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1545,18 +1545,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper
|
||||
|
||||
@@ -192,7 +192,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
|
||||
try {
|
||||
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
||||
@@ -1602,17 +1602,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1582,17 +1582,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
|
||||
this.playerList.tick();
|
||||
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
@@ -1620,7 +1620,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1600,7 +1600,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
|
||||
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
|
||||
for (int i = 0; i < this.tickables.size(); ++i) {
|
||||
@@ -1628,7 +1628,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1608,7 +1608,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
|
||||
@@ -232,7 +232,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
}
|
||||
|
||||
public boolean isNetherEnabled() {
|
||||
@@ -2276,7 +2276,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2256,7 +2256,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -241,7 +241,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
return this.profiler;
|
||||
}
|
||||
|
||||
@@ -2516,7 +2516,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2496,7 +2496,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end
|
||||
|
||||
private void startMetricsRecordingTick() {
|
||||
@@ -250,7 +250,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
|
||||
this.executeBlocking(() -> {
|
||||
this.saveDebugReport(path.resolve("server"));
|
||||
@@ -2526,40 +2526,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2506,40 +2506,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.willStartRecordingMetrics = false;
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ index d1987cfa0b1bd60cb6d3145d9522216d72f253cc..d7c77908ba7f0a0c00c06744d1ee0c1a
|
||||
}
|
||||
|
||||
public Path getWorldPath(LevelResource worldSavePath) {
|
||||
@@ -2604,15 +2604,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2584,15 +2584,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public boolean isTimeProfilerRunning() {
|
||||
@@ -371,10 +371,10 @@ index 30093cd8bd35f0bbc8f26eca370622ee12a046b6..2986f110348b376bcdc64fa39b688855
|
||||
|
||||
++j;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 56ec684bac1c29c99bac117e38d82db2b4dc20e8..e4cec79dc5911e1f000c63fe333eea04050aa542 100644
|
||||
index a57567679e01ae9a636d51fe53cda4abbca69f13..9c48b7fb10ba88e18d473d674fc1f50fb65cc633 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -998,20 +998,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -606,20 +606,20 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -399,41 +399,11 @@ index 56ec684bac1c29c99bac117e38d82db2b4dc20e8..e4cec79dc5911e1f000c63fe333eea04
|
||||
}
|
||||
|
||||
public boolean hasWork() {
|
||||
@@ -1162,7 +1162,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper start - Async chunk io
|
||||
final java.util.function.BiFunction<ChunkSerializer.InProgressChunkHolder, Throwable, Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> syncLoadComplete = (chunkHolder, ioThrowable) -> {
|
||||
try /*(Timing ignored = this.level.timings.chunkLoad.startTimingIfSync())*/ { // Paper // Purpur
|
||||
- this.level.getProfiler().incrementCounter("chunkLoad");
|
||||
+ //this.level.getProfiler().incrementCounter("chunkLoad"); // Purpur
|
||||
if (ioThrowable != null) {
|
||||
return this.handleChunkLoadFailure(ioThrowable, pos);
|
||||
}
|
||||
@@ -1258,9 +1258,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
return this.getDependencyStatus(requiredStatus, i);
|
||||
});
|
||||
|
||||
- this.level.getProfiler().incrementCounter(() -> {
|
||||
+ /*this.level.getProfiler().incrementCounter(() -> { // Purpur
|
||||
return "chunkGenerate " + requiredStatus.getName();
|
||||
- });
|
||||
+ });*/ // Purpur
|
||||
Executor executor = (runnable) -> {
|
||||
// Paper start - optimize chunk status progression without jumping through thread pool
|
||||
if (holder.canAdvanceStatus()) {
|
||||
@@ -1566,7 +1566,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
}
|
||||
|
||||
- this.level.getProfiler().incrementCounter("chunkSave");
|
||||
+ //this.level.getProfiler().incrementCounter("chunkSave"); // Purpur
|
||||
CompoundTag nbttagcompound;
|
||||
//try (co.aikar.timings.Timing ignored1 = this.level.timings.chunkSaveDataSerialization.startTiming()) { // Paper // Purpur
|
||||
nbttagcompound = ChunkSerializer.write(this.level, chunk);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd83e07bbc1 100644
|
||||
index 157efbbc57f1b5d92f296a70823c75b6d01ac065..cd5533c3c53215c9cc4be0b9097d76efbf5bd0c1 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -454,9 +454,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -430,16 +430,16 @@ public class ServerChunkCache extends ChunkSource {
|
||||
return ifLoaded;
|
||||
}
|
||||
// Paper end
|
||||
@@ -445,33 +415,15 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
long k = ChunkPos.asLong(x, z);
|
||||
|
||||
ChunkAccess ichunkaccess;
|
||||
@@ -470,7 +470,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
|
||||
// Paper - rewrite chunk system - there are no correct callbacks to remove items from cache in the new chunk system
|
||||
|
||||
- gameprofilerfiller.incrementCounter("getChunkCacheMiss");
|
||||
+ //gameprofilerfiller.incrementCounter("getChunkCacheMiss"); // Purpur
|
||||
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper
|
||||
ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor;
|
||||
|
||||
@@ -569,13 +569,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
this.distanceManager.addTicket(TicketType.REQUIRED_LOAD, chunkcoordintpair, l, identifier); // Paper - prevent plugin unloads from removing our ticket
|
||||
if (isUrgent) this.distanceManager.markUrgent(chunkcoordintpair); // Paper - Chunk priority
|
||||
if (this.chunkAbsent(playerchunk, l)) {
|
||||
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
|
||||
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Purpur
|
||||
|
||||
- gameprofilerfiller.push("chunkLoad");
|
||||
+ //gameprofilerfiller.push("chunkLoad"); // Purpur
|
||||
distanceManager.delayDistanceManagerTick = false; // Paper - Chunk priority - ensure this is never false
|
||||
this.runDistanceManagerUpdates();
|
||||
playerchunk = this.getVisibleChunkIfPresent(k);
|
||||
- gameprofilerfiller.pop();
|
||||
+ //gameprofilerfiller.pop(); // Purpur
|
||||
if (this.chunkAbsent(playerchunk, l)) {
|
||||
this.distanceManager.removeTicket(TicketType.REQUIRED_LOAD, chunkcoordintpair, l, identifier); // Paper
|
||||
throw (IllegalStateException) Util.pauseInIde(new IllegalStateException("No chunk holder after ticket has been added"));
|
||||
@@ -710,24 +710,24 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -627,24 +627,24 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// CraftBukkit start - modelled on below
|
||||
public void purgeUnload() {
|
||||
if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system
|
||||
@@ -501,7 +453,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
if (tickChunks) {
|
||||
//this.level.timings.chunks.startTiming(); // Paper - timings // Purpur
|
||||
this.chunkMap.playerChunkManager.tick(); // Paper - this is mostly is to account for view distance changes
|
||||
@@ -736,10 +736,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -653,10 +653,10 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
|
||||
//this.level.timings.doChunkUnload.startTiming(); // Spigot // Purpur
|
||||
@@ -514,7 +466,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -785,14 +785,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -702,14 +702,14 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - optimize isOutisdeRange
|
||||
LevelData worlddata = this.level.getLevelData();
|
||||
@@ -532,7 +484,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
|
||||
int l = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - per player mob spawning
|
||||
@@ -817,13 +817,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -734,13 +734,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
//this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
||||
|
||||
//this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
|
||||
@@ -548,7 +500,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
boolean flag2 = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||
|
||||
// Paper - only shuffle if per-player mob spawning is disabled
|
||||
@@ -874,15 +874,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -791,15 +791,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
||||
@@ -567,7 +519,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
//this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing // Purpur
|
||||
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
||||
ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
||||
@@ -896,7 +896,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -813,7 +813,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
//this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing // Purpur
|
||||
@@ -576,7 +528,7 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
// Paper end - use set of chunks requiring updates, rather than iterating every single one loaded
|
||||
// Paper start - controlled flush for entity tracker packets
|
||||
List<net.minecraft.network.Connection> disabledFlushes = new java.util.ArrayList<>(this.level.players.size());
|
||||
@@ -1102,7 +1102,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -1024,7 +1024,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
@Override
|
||||
protected void doRunTask(Runnable task) {
|
||||
@@ -586,10 +538,10 @@ index 9e796ab10152d630fe78ec247d6b0c2689ae00ab..7d8f7ecad22cdcd39270af79af8e0cd8
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30defa47a6 100644
|
||||
index d3b93712cd999d61f66a8ffefd9122ffc1596ba1..9f8d89e45c9d15f07e9b5c27451816ae06819f68 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -621,12 +621,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -651,12 +651,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
// Paper end - optimise checkDespawn
|
||||
@@ -605,7 +557,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
this.advanceWeatherCycle();
|
||||
int i = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
|
||||
long j;
|
||||
@@ -653,32 +653,32 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -683,32 +683,32 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
this.updateSkyBrightness();
|
||||
this.tickTime();
|
||||
@@ -646,7 +598,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
boolean flag = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
|
||||
|
||||
if (flag) {
|
||||
@@ -686,12 +686,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -716,12 +716,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
if (flag || this.emptyTime++ < 300) {
|
||||
@@ -662,7 +614,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
}
|
||||
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
@@ -701,9 +701,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -731,9 +731,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
} else {
|
||||
@@ -674,7 +626,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - now always true if in the ticking list
|
||||
Entity entity1 = entity.getVehicle();
|
||||
|
||||
@@ -715,7 +715,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -745,7 +745,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
entity.stopRiding();
|
||||
}
|
||||
|
||||
@@ -683,7 +635,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
// Pufferfish start - copied from this.guardEntityTick
|
||||
try {
|
||||
this.tickNonPassenger(entity); // Pufferfish - changed
|
||||
@@ -730,22 +730,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -760,22 +760,22 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Paper end
|
||||
}
|
||||
// Pufferfish end
|
||||
@@ -702,7 +654,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
|
||||
- gameprofilerfiller.push("entityManagement");
|
||||
+ //gameprofilerfiller.push("entityManagement"); // Purpur
|
||||
this.entityManager.tick();
|
||||
//this.entityManager.tick(); // Paper - rewrite chunk system
|
||||
- gameprofilerfiller.popPush("gameEvents");
|
||||
+ //gameprofilerfiller.popPush("gameEvents"); // Purpur
|
||||
this.sendGameEvents();
|
||||
@@ -711,7 +663,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -827,9 +827,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -857,9 +857,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
boolean flag = this.isRaining();
|
||||
int j = chunkcoordintpair.getMinBlockX();
|
||||
int k = chunkcoordintpair.getMinBlockZ();
|
||||
@@ -723,7 +675,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
|
||||
|
||||
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - disable thunder // Pufferfish - replace random with shouldDoLightning
|
||||
@@ -861,7 +861,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -891,7 +891,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -732,7 +684,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Disable ice and snow // Paper - optimise random ticking // Pufferfish - optimize further random ticking
|
||||
// Paper start - optimise chunk ticking
|
||||
this.getRandomBlockPosition(j, 0, k, 15, blockposition);
|
||||
@@ -897,7 +897,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -927,7 +927,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
// Paper start - optimise random block ticking
|
||||
@@ -741,7 +693,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
|
||||
if (randomTickSpeed > 0) {
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -933,7 +933,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -963,7 +963,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
// Paper end - optimise random block ticking
|
||||
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
|
||||
@@ -750,7 +702,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
}
|
||||
|
||||
public Optional<BlockPos> findLightningRod(BlockPos pos) {
|
||||
@@ -1230,19 +1230,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1259,19 +1259,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
//try { // Purpur
|
||||
// Paper end - timings
|
||||
entity.setOldPosAndRot();
|
||||
@@ -775,7 +727,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
//} finally { timer.stopTiming(); } // Paper - timings // Purpur
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
@@ -1271,12 +1271,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1300,12 +1300,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// Paper end
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
@@ -792,7 +744,7 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
// Paper start - EAR 2
|
||||
if (isActive) {
|
||||
passenger.rideTick();
|
||||
@@ -1288,7 +1288,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1317,7 +1317,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
vehicle.positionRider(passenger);
|
||||
}
|
||||
// Paper end - EAR 2
|
||||
@@ -802,10 +754,10 @@ index 207f07dfd0d2fd0ff5fdb3952966d069ca184123..6859e2054e8eb4fc8ac005e0bf646a30
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 3b5b040cf3cdbb3798972f73b75e8ab4753987db..18068e33014936fd5471aad6b673c16982bd38fc 100644
|
||||
index 4abac5e3ba5dcf27248bda31d95c85bb5e23c19d..6979305279996be59756d0424e5bc16a19fde6b0 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -1153,7 +1153,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1138,7 +1138,7 @@ public class ServerPlayer extends Player {
|
||||
PortalInfo shapedetectorshape = this.findDimensionEntryPoint(worldserver);
|
||||
|
||||
if (shapedetectorshape != null) {
|
||||
@@ -814,7 +766,7 @@ index 3b5b040cf3cdbb3798972f73b75e8ab4753987db..18068e33014936fd5471aad6b673c169
|
||||
worldserver = shapedetectorshape.world; // CraftBukkit
|
||||
if (worldserver == null) { } else // CraftBukkit - empty to fall through to null to event
|
||||
if (resourcekey == LevelStem.OVERWORLD && worldserver.getTypeKey() == LevelStem.NETHER) { // CraftBukkit
|
||||
@@ -1176,8 +1176,8 @@ public class ServerPlayer extends Player {
|
||||
@@ -1161,8 +1161,8 @@ public class ServerPlayer extends Player {
|
||||
worldserver = ((CraftWorld) exit.getWorld()).getHandle();
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -825,7 +777,7 @@ index 3b5b040cf3cdbb3798972f73b75e8ab4753987db..18068e33014936fd5471aad6b673c169
|
||||
if (true) { // CraftBukkit
|
||||
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
|
||||
|
||||
@@ -1196,7 +1196,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -1181,7 +1181,7 @@ public class ServerPlayer extends Player {
|
||||
worldserver.addDuringPortalTeleport(this);
|
||||
this.connection.teleport(exit); // CraftBukkit - use internal teleport without event
|
||||
this.connection.resetPosition(); // CraftBukkit - sync position after changing it (from PortalTravelAgent#findAndteleport)
|
||||
@@ -1061,10 +1013,10 @@ index 5725c6593480fada65facc29664a00a8cc073512..ccb1f998ae3122d1856d77149ff7e7df
|
||||
};
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f126630a968f5e 100644
|
||||
index 4f5c3c4285dd3b7ac901fb55e1ebbfec37ca601f..efd84a22bc063fe6266be876a38186c08296caa2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -821,7 +821,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -822,7 +822,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
return;
|
||||
}
|
||||
// Pufferfish end - entity TTL
|
||||
@@ -1073,7 +1025,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Update last hurt when ticking
|
||||
this.feetBlockState = null;
|
||||
if (this.isPassenger() && this.getVehicle().isRemoved()) {
|
||||
@@ -882,7 +882,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -883,7 +883,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.firstTick = false;
|
||||
@@ -1082,7 +1034,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
}
|
||||
|
||||
public void setSharedFlagOnFire(boolean onFire) {
|
||||
@@ -1056,7 +1056,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1057,7 +1057,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1091,7 +1043,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) {
|
||||
movement = movement.multiply(this.stuckSpeedMultiplier);
|
||||
this.stuckSpeedMultiplier = Vec3.ZERO;
|
||||
@@ -1065,7 +1065,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1066,7 +1066,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
// Paper start - ignore movement changes while inactive.
|
||||
if (isTemporarilyActive && !(this instanceof ItemEntity || this instanceof net.minecraft.world.entity.vehicle.AbstractMinecart) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
|
||||
setDeltaMovement(Vec3.ZERO);
|
||||
@@ -1100,7 +1052,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
return;
|
||||
}
|
||||
// Paper end
|
||||
@@ -1086,8 +1086,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1087,8 +1087,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z);
|
||||
}
|
||||
|
||||
@@ -1111,7 +1063,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
boolean flag = !Mth.equal(movement.x, vec3d1.x);
|
||||
boolean flag1 = !Mth.equal(movement.z, vec3d1.z);
|
||||
|
||||
@@ -1106,7 +1106,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1107,7 +1107,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
|
||||
this.checkFallDamage(vec3d1.y, this.onGround, iblockdata, blockposition);
|
||||
if (this.isRemoved()) {
|
||||
@@ -1120,7 +1072,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
} else {
|
||||
if (this.horizontalCollision) {
|
||||
Vec3 vec3d2 = this.getDeltaMovement();
|
||||
@@ -1247,7 +1247,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -1248,7 +1248,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.setRemainingFireTicks(-this.getFireImmuneTicks());
|
||||
}
|
||||
|
||||
@@ -1129,7 +1081,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
}
|
||||
}
|
||||
// Paper start - detailed watchdog information
|
||||
@@ -2916,7 +2916,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2917,7 +2917,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey);
|
||||
|
||||
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
|
||||
@@ -1138,7 +1090,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
this.portalTime = i;
|
||||
// Paper start
|
||||
io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER);
|
||||
@@ -2934,7 +2934,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -2935,7 +2935,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
} // Paper
|
||||
// CraftBukkit end
|
||||
@@ -1147,7 +1099,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
}
|
||||
|
||||
this.isInsidePortal = false;
|
||||
@@ -3388,14 +3388,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3389,14 +3389,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
// Paper end
|
||||
if (this.level instanceof ServerLevel && !this.isRemoved()) {
|
||||
@@ -1164,7 +1116,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit
|
||||
|
||||
if (shapedetectorshape == null) {
|
||||
@@ -3429,7 +3429,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3430,7 +3430,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
this.unRide();
|
||||
// CraftBukkit end
|
||||
|
||||
@@ -1173,7 +1125,7 @@ index cc355ddb74568717f28c74ab31566cd09c1209d7..2c7554a1dd092aca9dd1988b99f12663
|
||||
// Paper start - Change lead drop timing to prevent dupe
|
||||
if (this instanceof Mob) {
|
||||
((Mob) this).dropLeash(true, true); // Paper drop lead
|
||||
@@ -3452,10 +3452,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -3453,10 +3453,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
}
|
||||
|
||||
this.removeAfterChangingDimensions();
|
||||
@@ -1456,10 +1408,10 @@ index 0cc0d719e95e108263683b7a40f4ce3a8ca9465b..872ec431ae6beb0ef603d833f38aedb9
|
||||
|
||||
public Set<WrappedGoal> getAvailableGoals() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
index cb4a162903207754be90ff8da0156f97791cccef..9e6c4c2935e0a2cadfbf3da73eb4fe1881078c5a 100644
|
||||
index c1781c92ff59f0c9eb47cbbef01e3252c5e1a1bf..c06057cf9609e001f4512c247f355ded0ff2e8ce 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
|
||||
@@ -173,12 +173,12 @@ public abstract class PathNavigation {
|
||||
@@ -170,12 +170,12 @@ public abstract class PathNavigation {
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
@@ -1471,9 +1423,9 @@ index cb4a162903207754be90ff8da0156f97791cccef..9e6c4c2935e0a2cadfbf3da73eb4fe18
|
||||
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier);
|
||||
- this.level.getProfiler().pop();
|
||||
+ //this.level.getProfiler().pop(); // Purpur
|
||||
|
||||
// Pufferfish start
|
||||
if (!gg.pufferfish.pufferfish.PufferfishConfig.enableAsyncPathfinding) {
|
||||
if (path != null && path.getTarget() != null) {
|
||||
this.targetPos = path.getTarget();
|
||||
this.reachRange = distance;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java
|
||||
index 288c6627906d07c0d223eacd84ae4eb31a349998..9babe636176da3c40598eb5bdac0919a1704eaa0 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensing.java
|
||||
@@ -1535,7 +1487,7 @@ index b543387da275a0b3675a968b6cebf05cc227af14..2e0f340f9b339b1d772c0676e97c12f3
|
||||
Optional<Integer> optional = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS);
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
index b84effd5e18fee155e731d1a80ba516b86431d3b..989af6f3e0604a342032b308f97c7b863b3b1e40 100644
|
||||
index e739416fa58b182d7bd311be094d6aab2a7f7133..22f8db91f31be6a6d981c70e2ab94d031723ac9c 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
|
||||
@@ -230,13 +230,13 @@ public class Frog extends Animal {
|
||||
@@ -1730,10 +1682,10 @@ index 01477e7240f9e33d08d416a7d40ee10f3e5d4abf..c9def2202d7c2a523858ec124df2beaf
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index bd89e00f707b6ba297081c9aacb3c5463e80063e..5e0fb02ccd1204a72b2d730a25e35844a07c5759 100644
|
||||
index 93711ef7df591ab0f50b8f0f7798f938eeb0f3b3..cf8693d02de53f1e02d55936f889c5724889e3f5 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -713,9 +713,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -712,9 +712,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
BlockState iblockdata2 = this.getBlockState(pos);
|
||||
|
||||
if ((flags & 128) == 0 && iblockdata2 != iblockdata1 && (iblockdata2.getLightBlock(this, pos) != iblockdata1.getLightBlock(this, pos) || iblockdata2.getLightEmission() != iblockdata1.getLightEmission() || iblockdata2.useShapeForLightOcclusion() || iblockdata1.useShapeForLightOcclusion())) {
|
||||
@@ -1745,7 +1697,7 @@ index bd89e00f707b6ba297081c9aacb3c5463e80063e..5e0fb02ccd1204a72b2d730a25e35844
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -992,9 +992,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -991,9 +991,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1757,7 +1709,7 @@ index bd89e00f707b6ba297081c9aacb3c5463e80063e..5e0fb02ccd1204a72b2d730a25e35844
|
||||
//timings.tileEntityPending.startTiming(); // Spigot // Purpur
|
||||
this.tickingBlockEntities = true;
|
||||
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
||||
@@ -1039,7 +1039,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1038,7 +1038,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
//timings.tileEntityTick.stopTiming(); // Spigot // Purpur
|
||||
this.tickingBlockEntities = false;
|
||||
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
|
||||
@@ -1766,16 +1718,16 @@ index bd89e00f707b6ba297081c9aacb3c5463e80063e..5e0fb02ccd1204a72b2d730a25e35844
|
||||
spigotConfig.currentPrimedTnt = 0; // Spigot
|
||||
}
|
||||
|
||||
@@ -1200,7 +1200,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1199,7 +1199,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||
- this.getProfiler().incrementCounter("getEntities");
|
||||
+ //this.getProfiler().incrementCounter("getEntities"); // Purpur
|
||||
List<Entity> list = Lists.newArrayList();
|
||||
this.entitySliceManager.getEntities(except, box, list, predicate); // Paper - optimise this call
|
||||
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
|
||||
return list;
|
||||
@@ -1208,7 +1208,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1207,7 +1207,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
@Override
|
||||
public <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate) {
|
||||
@@ -1784,7 +1736,7 @@ index bd89e00f707b6ba297081c9aacb3c5463e80063e..5e0fb02ccd1204a72b2d730a25e35844
|
||||
List<T> list = Lists.newArrayList();
|
||||
|
||||
// Paper start - optimise this call
|
||||
@@ -1539,7 +1539,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1538,7 +1538,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -1816,10 +1768,10 @@ index 5c6fde4baf27e7d8f027c138d843da39a4a2ed36..4a8998a98987985e259b0a2a29ee7c94
|
||||
|
||||
// Paper start
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
index ab024c5315c0a7cb2f80d5d7b251f6a3531879b3..12293740461b6cd965297543a1ae3bead83bd3a6 100644
|
||||
index b4460ed16ba30173ad4a5fe8e405e1c34251912f..6638a4fd77230ec9d5b5db097e9ee1a3cc92a726 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -1236,9 +1236,9 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1289,9 +1289,9 @@ public class LevelChunk extends ChunkAccess {
|
||||
|
||||
if (LevelChunk.this.isTicking(blockposition)) {
|
||||
try {
|
||||
@@ -1831,7 +1783,7 @@ index ab024c5315c0a7cb2f80d5d7b251f6a3531879b3..12293740461b6cd965297543a1ae3bea
|
||||
//this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
|
||||
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
|
||||
|
||||
@@ -1250,7 +1250,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1303,7 +1303,7 @@ public class LevelChunk extends ChunkAccess {
|
||||
LevelChunk.LOGGER.warn("Block entity {} @ {} state {} invalid for ticking:", new Object[]{LogUtils.defer(this::getType), LogUtils.defer(this::getPos), iblockdata});
|
||||
}
|
||||
|
||||
@@ -1841,20 +1793,20 @@ index ab024c5315c0a7cb2f80d5d7b251f6a3531879b3..12293740461b6cd965297543a1ae3bea
|
||||
if (throwable instanceof ThreadDeath) throw throwable; // Paper
|
||||
// Paper start - Prevent tile entity and entity crashes
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
index 0455c8a7da880da4f0b7ae9d57e83e281a55f0ae..23cb03d28c43729d5b5d450cd975456512477353 100644
|
||||
index d23481453717f715124156b5d83f6448f720d049..a8af51a25b0f99c3a64d9150fdfcd6b818aa7581 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
@@ -80,8 +80,8 @@ public class PathFinder {
|
||||
@@ -53,8 +53,8 @@ public class PathFinder {
|
||||
@Nullable
|
||||
// Paper start - optimize collection
|
||||
private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
|
||||
// readd the profiler code for sync
|
||||
- profiler.push("find_path");
|
||||
- profiler.markForCharting(MetricCategory.PATH_FINDING);
|
||||
+ //profiler.push("find_path"); // Purpur
|
||||
+ //profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
|
||||
|
||||
try {
|
||||
return this.processPath(this.nodeEvaluator, startNode, positions, followRange, distance, rangeMultiplier);
|
||||
// Set<Target> set = positions.keySet();
|
||||
startNode.g = 0.0F;
|
||||
startNode.h = this.getBestH(startNode, positions); // Paper - optimize collection
|
||||
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||
index 7f1ac2cb29eb84833c0895442d611dfa0504527e..5dea8414964e0d2d1fb15a6baa27227e9722bfc7 100644
|
||||
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
|
||||
|
||||
Reference in New Issue
Block a user