Updated Upstream (Paper)

Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@f7124df Fix recursive chunk loading in chunk unload event
PaperMC/Paper@8b558d9 Apply entity tracker desync patch
PaperMC/Paper@a594d18 Fix entities not being visible to clients when teleporting
PaperMC/Paper@f250ec0 Increment ChunkHolderManager current tick
PaperMC/Paper@7bd22b1 Optimise entity tracker
PaperMC/Paper@90ae1dc Port collision optimisation patch from Moonrise
PaperMC/Paper@821081d Drop unapplied patches
PaperMC/Paper@1d0fcb5 Port lag compensation patch
PaperMC/Paper@0e02aa5 Port watchdog detail patch
PaperMC/Paper@c6e9579 Fix explosions calculation getting stuck (#11061)
PaperMC/Paper@2773dc4 Add light block to indestructible block list
PaperMC/Paper@70ff1ec Only skip damage tick if damage is unmodified zero (#11058)
This commit is contained in:
granny
2024-07-12 03:56:05 -07:00
parent b3709b1f4d
commit 5e70800f80
49 changed files with 263 additions and 246 deletions

View File

@@ -83,10 +83,10 @@ index e9775b4506909bee65a74964f0d5391a0513de1d..684f7f202305c09b1037c5d38a52a5ea
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221ff90945e4 100644
index 22ed622f081a39bb4695e49b350e920848f288e7..67f4d022628029d777e0d8185d1e75b9fd2eaf27 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -421,13 +421,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -422,13 +422,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
SERVER = this; // Paper - better singleton
@@ -106,7 +106,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
this.random = RandomSource.create();
this.port = -1;
this.levels = Maps.newLinkedHashMap();
@@ -1041,9 +1041,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1042,9 +1042,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end
// CraftBukkit end
@@ -118,7 +118,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -1314,16 +1314,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1315,16 +1315,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
boolean flag = i == 0L;
@@ -139,7 +139,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
this.tickServer(flag ? () -> {
return false;
} : this::haveTime);
@@ -1334,7 +1334,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1335,7 +1335,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new RuntimeException("Chunk system crash propagated to tick()", crash);
}
// Paper end - rewrite chunk system
@@ -148,7 +148,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
// Purpur start
@@ -1350,9 +1350,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1351,9 +1351,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickRateManager.endTickWork();
}
@@ -161,7 +161,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
this.isReady = true;
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
}
@@ -1562,7 +1562,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1563,7 +1563,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
@@ -170,7 +170,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
super.doRunTask(ticktask);
}
@@ -1635,9 +1635,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1636,9 +1636,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.ticksUntilAutosave = this.autosavePeriod;
// CraftBukkit end
MinecraftServer.LOGGER.debug("Autosave started");
@@ -182,7 +182,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
MinecraftServer.LOGGER.debug("Autosave finished");
}
io.papermc.paper.util.CachedLists.reset(); // Paper
@@ -1651,7 +1651,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1652,7 +1652,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 - Server Tick Events
@@ -191,7 +191,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
@@ -1665,7 +1665,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1666,7 +1666,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickTimes60s.add(this.tickCount, j);
// Paper end - Add tick times API and /mspt command
this.logTickMethodTime(i);
@@ -200,7 +200,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
org.spigotmc.WatchdogThread.tick(); // Spigot
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
}
@@ -1756,11 +1756,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1757,11 +1757,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
@@ -214,8 +214,8 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
@@ -1802,20 +1802,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
@@ -1804,20 +1804,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worldserver.updateLagCompensationTick(); // Paper - lag compensation
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
- this.profiler.push(() -> {
@@ -240,7 +240,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
try {
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
@@ -1828,17 +1828,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1830,17 +1830,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
@@ -262,7 +262,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
this.playerList.tick();
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -1846,7 +1846,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1848,7 +1848,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -271,7 +271,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
for (int i = 0; i < this.tickables.size(); ++i) {
@@ -1854,7 +1854,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1856,7 +1856,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
@@ -280,7 +280,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1864,7 +1864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1866,7 +1866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
@@ -289,7 +289,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
}
private void synchronizeTime(ServerLevel world) {
@@ -1872,7 +1872,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1874,7 +1874,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
@@ -298,7 +298,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1881,7 +1881,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1883,7 +1883,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
@@ -307,7 +307,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
}
public boolean isLevelEnabled(Level world) {
@@ -2593,6 +2593,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2595,6 +2595,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
@@ -315,7 +315,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
return this.profiler;
}
@@ -2839,7 +2840,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2841,7 +2842,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end
private void startMetricsRecordingTick() {
@@ -324,7 +324,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
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"));
@@ -2849,40 +2850,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2851,40 +2852,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.willStartRecordingMetrics = false;
}
@@ -377,7 +377,7 @@ index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221f
}
public Path getWorldPath(LevelResource worldSavePath) {
@@ -2935,15 +2936,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2937,15 +2938,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public boolean isTimeProfilerRunning() {
@@ -443,7 +443,7 @@ index 9cd4f7c6910727c849ac7f5d675dc6105c4bbba2..4e4b7f2a6d7ed92a2ce06e566186027c
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 1b6c5a36e96a3845d55b0b798a8cffdc7a4ffd93..ecd02b10c4120a7d7342b12ec95be0ee56318333 100644
index 5d52df83c643845ffbeeba3bb640c9deeae11139..4f02f8b6003580fc178991cbece8ad438efd15cb 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -425,16 +425,16 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -585,10 +585,10 @@ index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0dc591c80 100644
index 4a748149d1cbf4e99be76e1d9eca410d65f86e8f..b3ddd5eba13f03d30104c9a163da835126b29115 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -661,16 +661,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -678,16 +678,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
public void tick(BooleanSupplier shouldKeepTicking) {
@@ -608,7 +608,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
this.advanceWeatherCycle();
}
@@ -702,30 +702,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -719,30 +719,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
this.tickTime();
}
@@ -646,7 +646,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
if (flag) {
// this.timings.doSounds.startTiming(); // Spigot // Purpur
this.runBlockEvents();
@@ -733,7 +733,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -750,7 +750,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
this.handlingTick = false;
@@ -655,7 +655,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
boolean flag1 = !paperConfig().unsupportedSettings.disableWorldTickingWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Paper - restore this
if (flag1) {
@@ -741,12 +741,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -758,12 +758,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
if (flag1 || this.emptyTime++ < 300) {
@@ -671,7 +671,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -756,9 +756,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -773,9 +773,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
} else if (!tickratemanager.isEntityFrozen(entity)) {
@@ -683,7 +683,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - rewrite chunk system
Entity entity1 = entity.getVehicle();
@@ -770,22 +770,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -787,22 +787,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
entity.stopRiding();
}
@@ -711,7 +711,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
}
@Override
@@ -865,9 +865,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -878,9 +878,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
@@ -720,10 +720,10 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
- gameprofilerfiller.push("thunder");
+ //gameprofilerfiller.push("thunder"); // Purpur
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) { // Spigot // Paper - Option to disable thunder
@@ -906,7 +906,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
@@ -917,7 +917,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
}
@@ -732,7 +732,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
for (int l = 0; l < randomTickSpeed; ++l) {
@@ -919,7 +919,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -927,7 +927,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
}
} // Paper - Option to disable ice and snow
@@ -740,9 +740,26 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
+ //gameprofilerfiller.popPush("tickBlocks"); // Purpur
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
if (randomTickSpeed > 0) {
// Paper start - optimize random block ticking
@@ -955,7 +955,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Paper end - optimise random block ticking
LevelChunkSection[] achunksection = chunk.getSections();
@@ -942,7 +942,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
for (int l1 = 0; l1 < randomTickSpeed; ++l1) {
BlockPos blockposition1 = this.getBlockRandomPos(j, k1, k, 15);
- gameprofilerfiller.push("randomTick");
+ //gameprofilerfiller.push("randomTick"); // Purpur
BlockState iblockdata = chunksection.getBlockState(blockposition1.getX() - j, blockposition1.getY() - k1, blockposition1.getZ() - k);
if (iblockdata.isRandomlyTicking()) {
@@ -955,14 +955,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
fluid.randomTick(this, blockposition1, this.random);
}
- gameprofilerfiller.pop();
+ //gameprofilerfiller.pop(); // Purpur
}
}
}
}
//timings.chunkTicksBlocks.stopTiming(); // Paper // Purpur
- gameprofilerfiller.pop();
@@ -750,7 +767,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
}
@VisibleForTesting
@@ -1291,19 +1291,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1308,19 +1308,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
//try { // Purpur
// Paper end - timings
entity.setOldPosAndRot();
@@ -775,7 +792,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
//} finally { timer.stopTiming(); } // Paper - timings // Purpur
Iterator iterator = entity.getPassengers().iterator();
@@ -1326,12 +1326,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1349,12 +1349,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -792,7 +809,7 @@ index c4dfa08163f563218eac34941abaff0159517dbe..099be5d1b510866fb7294b304ce294e0
// Paper start - EAR 2
if (isActive) {
passenger.rideTick();
@@ -1343,7 +1343,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
@@ -1366,7 +1366,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
vehicle.positionRider(passenger);
}
// Paper end - EAR 2
@@ -1061,10 +1078,10 @@ index a715ecf4a8ac91d3e5e5c6269d89e54b2c1cd279..223c3665126c576eddb1a8f7c9f5bc60
};
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7ada6c371 100644
index 9c294bb8ae3cb9ec18ed633821c64c38bad50e95..42ff02305e9eedb0a7c4a3b25106eb98776696a4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -860,7 +860,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -880,7 +880,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public void baseTick() {
@@ -1073,7 +1090,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
this.inBlockState = null;
if (this.isPassenger() && this.getVehicle().isRemoved()) {
@@ -925,7 +925,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -945,7 +945,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
Leashable.tickLeash((Entity & Leashable) this); // CraftBukkit - decompile error
}
@@ -1082,7 +1099,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
}
public void setSharedFlagOnFire(boolean onFire) {
@@ -1103,7 +1103,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1158,7 +1158,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -1091,7 +1108,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7D) {
movement = movement.multiply(this.stuckSpeedMultiplier);
this.stuckSpeedMultiplier = Vec3.ZERO;
@@ -1112,7 +1112,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1167,7 +1167,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && movementType == MoverType.SELF) {
setDeltaMovement(Vec3.ZERO);
@@ -1100,7 +1117,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
return;
}
// Paper end
@@ -1133,8 +1133,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1188,8 +1188,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setPos(this.getX() + vec3d1.x, this.getY() + vec3d1.y, this.getZ() + vec3d1.z);
}
@@ -1111,7 +1128,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
boolean flag = !Mth.equal(movement.x, vec3d1.x);
boolean flag1 = !Mth.equal(movement.z, vec3d1.z);
@@ -1153,7 +1153,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1208,7 +1208,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.checkFallDamage(vec3d1.y, this.onGround(), iblockdata, blockposition);
if (this.isRemoved()) {
@@ -1120,7 +1137,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
} else {
if (this.horizontalCollision) {
Vec3 vec3d2 = this.getDeltaMovement();
@@ -1256,7 +1256,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -1311,7 +1311,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.setRemainingFireTicks(-this.getFireImmuneTicks());
}
@@ -1128,8 +1145,8 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
+ //this.level().getProfiler().pop(); // Purpur
}
}
}
@@ -3143,7 +3143,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - detailed watchdog information
@@ -3303,7 +3303,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.processPortalCooldown();
if (this.portalProcess != null) {
if (this.portalProcess.processPortalTeleportation(worldserver, this, this.canUsePortal(false))) {
@@ -1138,7 +1155,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
this.setPortalCooldown();
DimensionTransition dimensiontransition = this.portalProcess.getPortalDestination(worldserver, this);
@@ -3155,7 +3155,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3315,7 +3315,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -1147,7 +1164,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
} else if (this.portalProcess.hasExpired()) {
this.portalProcess = null;
}
@@ -3656,7 +3656,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3816,7 +3816,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -1156,7 +1173,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
Entity entity2 = worldserver1.dimension() == worldserver.dimension() ? this : this.getType().create(worldserver1);
if (entity2 != null) {
@@ -3692,7 +3692,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -3852,7 +3852,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
teleportTarget.postDimensionTransition().onTransition(entity2);
}
@@ -1166,7 +1183,7 @@ index 126f0ddc96193d482ebe00ff157fe08b0a641a9d..badf612b7ef717996037b7eacecd74a7
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 30149ed40d34818bdbd9098298e8f4cf82116c4c..b4c325979107e0a731d1c955c53b1e76471871ad 100644
index 9582498c5cbcc859b942384e8e0e492cb2cdea03..94a1874576ed07bacdd399785666f69d4b4086c8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -445,7 +445,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1767,10 +1784,10 @@ index d4f64414a0351999a04308a3d26d15c9ddf266c7..88972d9f07eb9088c139d9dbc974b2e6
this.assignProfessionWhenSpawned = false;
}
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index bff83fe413c7baef4ba56a3270ea4463a58c792f..3ee7bf7e10f8120258baaae8f77cdcbb6a781f78 100644
index a248d859cbce48f4a34c4771a7acffc17d7edc84..4ce32603dcd691e018a3e1962311d2ac707439aa 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -350,7 +350,7 @@ public class Explosion {
@@ -646,7 +646,7 @@ public class Explosion {
}
if (flag1) {
@@ -1779,7 +1796,7 @@ index bff83fe413c7baef4ba56a3270ea4463a58c792f..3ee7bf7e10f8120258baaae8f77cdcbb
List<Pair<ItemStack, BlockPos>> list = new ArrayList();
Util.shuffle(this.toBlow, this.level.random);
@@ -428,7 +428,7 @@ public class Explosion {
@@ -724,7 +724,7 @@ public class Explosion {
Block.popResource(this.level, (BlockPos) pair.getSecond(), (ItemStack) pair.getFirst());
}
@@ -1789,10 +1806,10 @@ index bff83fe413c7baef4ba56a3270ea4463a58c792f..3ee7bf7e10f8120258baaae8f77cdcbb
if (this.fire) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a1cbf21f5 100644
index 56f25ccd82d53c1f7e260819b660b02c7f5e133f..9571f6fc685fff5f4be469099ce8e6c85292a53a 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -268,7 +268,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -269,7 +269,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final <T extends Entity> List<T> getEntitiesOfClass(final Class<T> entityClass, final AABB boundingBox, final Predicate<? super T> predicate) {
@@ -1801,7 +1818,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
final List<T> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getEntities(entityClass, null, boundingBox, ret, predicate);
@@ -278,7 +278,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public final List<Entity> moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate<? super Entity> predicate) {
@@ -1810,7 +1827,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
final List<Entity> ret = new java.util.ArrayList<>();
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
@@ -987,9 +987,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1368,9 +1368,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
protected void tickBlockEntities() {
@@ -1822,7 +1839,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
//this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1032,7 +1032,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1413,7 +1413,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
//this.timings.tileEntityTick.stopTiming(); // Spigot // Purpur
this.tickingBlockEntities = false;
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
@@ -1831,7 +1848,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1237,7 +1237,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1625,7 +1625,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
@@ -1840,7 +1857,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
// Paper start - rewrite chunk system
final List<Entity> ret = new java.util.ArrayList<>();
@@ -1263,7 +1263,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1651,7 +1651,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
public <T extends Entity> void getEntities(final EntityTypeTest<Entity, T> entityTypeTest,
final AABB boundingBox, final Predicate<? super T> predicate,
final List<? super T> into, final int maxCount) {
@@ -1849,7 +1866,7 @@ index ff97d43ca93dfd204d42be45233885312b9a6b93..743a3203b035846aecec1c329b66fe3a
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
if (maxCount != Integer.MAX_VALUE) {
@@ -1566,6 +1566,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@@ -1946,6 +1946,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
public ProfilerFiller getProfiler() {
@@ -1880,10 +1897,10 @@ index 2812505185df691e8f08932aa0bba162a7d9db86..35e94c06361795d032f995e8282f8b35
// Paper start - Add mobcaps commands
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 191a6bedcd31ec070dd4ad245722d0f016319d7a..7238f28b7d4b40359a28970a7a53018c242af6e2 100644
index 8d48dbd43f29c6ccf268ae2f52f2b75a559c108d..7411e3d132dddde4599c182384f317679de1f2bf 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -350,11 +350,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -372,11 +372,11 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
ProfilerFiller gameprofilerfiller = this.level.getProfiler();
@@ -1898,7 +1915,7 @@ index 191a6bedcd31ec070dd4ad245722d0f016319d7a..7238f28b7d4b40359a28970a7a53018c
}
boolean flag3 = iblockdata1.hasBlockEntity();
@@ -985,9 +985,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1007,9 +1007,9 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
if (LevelChunk.this.isTicking(blockposition)) {
try {
@@ -1910,7 +1927,7 @@ index 191a6bedcd31ec070dd4ad245722d0f016319d7a..7238f28b7d4b40359a28970a7a53018c
//this.blockEntity.tickTimer.startTiming(); // Spigot // Purpur
BlockState iblockdata = LevelChunk.this.getBlockState(blockposition);
@@ -1004,7 +1004,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@@ -1026,7 +1026,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
// Paper end - Remove the Block Entity if it's invalid
}