|
|
|
|
@@ -169,7 +169,7 @@ index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..e30bb9c4046200c1a6e4e917d15b205f
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce3363e09a 100644
|
|
|
|
|
index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..2505000585f6b726914861faf8f731bd7e83a34a 100644
|
|
|
|
|
--- a/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
+++ b/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
@@ -113,19 +113,8 @@ import net.minecraft.util.TimeUtil;
|
|
|
|
|
@@ -263,7 +263,20 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
super.doRunTask(task);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1558,7 +1524,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1535,12 +1501,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
this.ticksUntilAutosave--;
|
|
|
|
|
// Paper start - Incremental chunk and player saving
|
|
|
|
|
- final ProfilerFiller profiler = Profiler.get();
|
|
|
|
|
int playerSaveInterval = io.papermc.paper.configuration.GlobalConfiguration.get().playerAutoSave.rate;
|
|
|
|
|
if (playerSaveInterval < 0) {
|
|
|
|
|
playerSaveInterval = autosavePeriod;
|
|
|
|
|
}
|
|
|
|
|
- profiler.push("save");
|
|
|
|
|
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
|
|
|
|
|
try {
|
|
|
|
|
this.isSaving = true;
|
|
|
|
|
@@ -1558,7 +1522,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
profiler.pop();
|
|
|
|
|
// Paper end - Incremental chunk and player saving
|
|
|
|
|
|
|
|
|
|
@@ -271,7 +284,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
this.runAllTasks(); // Paper - move runAllTasks() into full server tick (previously for timings)
|
|
|
|
|
this.server.spark.executeMainThreadTasks(); // Paper - spark
|
|
|
|
|
// Paper start - Server Tick Events
|
|
|
|
|
@@ -1567,7 +1532,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1567,7 +1530,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
|
|
|
|
|
// Paper end - Server Tick Events
|
|
|
|
|
this.server.spark.tickEnd(((double)(endTime - lastTick) / 1000000D)); // Paper - spark
|
|
|
|
|
@@ -279,7 +292,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
long l = Util.getNanos() - nanos;
|
|
|
|
|
int i1 = this.tickCount % 100;
|
|
|
|
|
this.aggregatedTickTimesNanos = this.aggregatedTickTimesNanos - this.tickTimesNanos[i1];
|
|
|
|
|
@@ -1580,16 +1544,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1580,16 +1542,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.tickTimes60s.add(this.tickCount, l);
|
|
|
|
|
// Paper end - Add tick times API and /mspt command
|
|
|
|
|
this.logTickMethodTime(nanos);
|
|
|
|
|
@@ -296,7 +309,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
LOGGER.debug("Autosave finished");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1655,7 +1615,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1655,7 +1613,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void tickChildren(BooleanSupplier hasTimeLeft) {
|
|
|
|
|
@@ -304,7 +317,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
this.getPlayerList().getPlayers().forEach(serverPlayer1 -> serverPlayer1.connection.suspendFlushing());
|
|
|
|
|
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
|
|
|
|
|
// Paper start - Folia scheduler API
|
|
|
|
|
@@ -1673,9 +1632,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1673,9 +1630,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
});
|
|
|
|
|
// Paper end - Folia scheduler API
|
|
|
|
|
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
|
|
|
|
@@ -314,7 +327,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
// Run tasks that are waiting on processing
|
|
|
|
|
@@ -1710,7 +1667,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1710,7 +1665,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
serverLevel.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
|
|
|
|
|
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
|
|
|
|
|
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
|
|
|
|
|
@@ -322,7 +335,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
/* Drop global time updates
|
|
|
|
|
if (this.tickCount % 20 == 0) {
|
|
|
|
|
profilerFiller.push("timeSync");
|
|
|
|
|
@@ -1719,8 +1675,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1719,8 +1673,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end */
|
|
|
|
|
|
|
|
|
|
@@ -331,7 +344,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
try {
|
|
|
|
|
serverLevel.tick(hasTimeLeft);
|
|
|
|
|
} catch (Throwable var7) {
|
|
|
|
|
@@ -1729,34 +1683,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1729,34 +1681,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
throw new ReportedException(crashReport);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -366,7 +379,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void tickConnection() {
|
|
|
|
|
@@ -1772,14 +1716,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1772,14 +1714,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void forceTimeSynchronization() {
|
|
|
|
|
@@ -381,7 +394,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean isLevelEnabled(Level level) {
|
|
|
|
|
@@ -2595,55 +2534,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2595,55 +2532,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
|
@@ -437,7 +450,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
public Path getWorldPath(LevelResource levelResource) {
|
|
|
|
|
return this.storageSource.getLevelPath(levelResource);
|
|
|
|
|
}
|
|
|
|
|
@@ -2693,24 +2583,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2693,24 +2581,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
return this.isSaving;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -462,7 +475,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..20fd5ea3922b93a00e4f55cfd33af1ce
|
|
|
|
|
public int getMaxChainedNeighborUpdates() {
|
|
|
|
|
return 1000000;
|
|
|
|
|
}
|
|
|
|
|
@@ -2816,55 +2688,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2816,55 +2686,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -2057,7 +2070,7 @@ index e0e0d2ea7fc60e3142c675404d152eca60263240..09d559adb603e3d34bb82b944a2a3e8c
|
|
|
|
|
this.assignProfessionWhenSpawned = false;
|
|
|
|
|
}
|
|
|
|
|
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
|
|
|
|
|
index e2829222337ed5a5061b60a153c8224eb53de9e8..78b368886648f034b7f1a97a922b97cc62b2fa02 100644
|
|
|
|
|
index e2829222337ed5a5061b60a153c8224eb53de9e8..9a5447dfa8cba271fdb205d21e4236c94074a7da 100644
|
|
|
|
|
--- a/net/minecraft/world/level/Level.java
|
|
|
|
|
+++ b/net/minecraft/world/level/Level.java
|
|
|
|
|
@@ -35,8 +35,6 @@ import net.minecraft.util.AbortableIterationConsumer;
|
|
|
|
|
@@ -2069,7 +2082,23 @@ index e2829222337ed5a5061b60a153c8224eb53de9e8..78b368886648f034b7f1a97a922b97cc
|
|
|
|
|
import net.minecraft.world.DifficultyInstance;
|
|
|
|
|
import net.minecraft.world.TickRateManager;
|
|
|
|
|
import net.minecraft.world.damagesource.DamageSource;
|
|
|
|
|
@@ -1452,8 +1450,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
@@ -215,7 +213,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public final <T extends Entity> List<T> getEntitiesOfClass(final Class<T> entityClass, final AABB boundingBox, final Predicate<? super T> predicate) {
|
|
|
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
|
|
|
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);
|
|
|
|
|
@@ -225,7 +222,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public final List<Entity> moonrise$getHardCollidingEntities(final Entity entity, final AABB box, final Predicate<? super Entity> predicate) {
|
|
|
|
|
- Profiler.get().incrementCounter("getEntities");
|
|
|
|
|
final List<Entity> ret = new java.util.ArrayList<>();
|
|
|
|
|
|
|
|
|
|
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
|
|
|
|
|
@@ -1452,8 +1448,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void tickBlockEntities() {
|
|
|
|
|
@@ -2078,7 +2107,7 @@ index e2829222337ed5a5061b60a153c8224eb53de9e8..78b368886648f034b7f1a97a922b97cc
|
|
|
|
|
this.tickingBlockEntities = true;
|
|
|
|
|
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
|
|
|
|
this.blockEntityTickers.addAll(this.pendingBlockEntityTickers);
|
|
|
|
|
@@ -1483,7 +1479,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
@@ -1483,7 +1477,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
|
|
|
|
|
|
|
|
|
this.tickingBlockEntities = false;
|
|
|
|
|
@@ -2086,7 +2115,7 @@ index e2829222337ed5a5061b60a153c8224eb53de9e8..78b368886648f034b7f1a97a922b97cc
|
|
|
|
|
this.spigotConfig.currentPrimedTnt = 0; // Spigot
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1742,7 +1737,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
@@ -1742,7 +1735,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<Entity> getEntities(@Nullable Entity entity, AABB boundingBox, Predicate<? super Entity> predicate) {
|
|
|
|
|
@@ -2094,7 +2123,7 @@ index e2829222337ed5a5061b60a153c8224eb53de9e8..78b368886648f034b7f1a97a922b97cc
|
|
|
|
|
List<Entity> list = Lists.newArrayList();
|
|
|
|
|
|
|
|
|
|
// Paper start - rewrite chunk system
|
|
|
|
|
@@ -1771,8 +1765,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
@@ -1771,8 +1763,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup<Entity>, AutoCl
|
|
|
|
|
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) {
|
|
|
|
|
|