mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-21 10:27:44 +01:00
Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@b45d9b6 Fix summon_entity effect attempting to add incorrect entity (#11004) PaperMC/Paper@7eec21e [ci skip] add adventure-key javadoc (#11014) PaperMC/Paper@8c8b227 Execute chunk tasks mid-tick
This commit is contained in:
@@ -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 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb87073f8af682 100644
|
||||
index 5702660ef5769ab44278f30eafb517acdd358be9..6791cdae222c0156df8defbec78a221ff90945e4 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -359,13 +359,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -421,13 +421,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 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
this.random = RandomSource.create();
|
||||
this.port = -1;
|
||||
this.levels = Maps.newLinkedHashMap();
|
||||
@@ -979,9 +979,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1041,9 +1041,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// Paper end
|
||||
// CraftBukkit end
|
||||
@@ -118,7 +118,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
@@ -1252,16 +1252,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1314,16 +1314,16 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
boolean flag = i == 0L;
|
||||
|
||||
@@ -139,7 +139,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
this.tickServer(flag ? () -> {
|
||||
return false;
|
||||
} : this::haveTime);
|
||||
@@ -1272,7 +1272,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1334,7 +1334,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 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
this.mayHaveDelayedTasks = true;
|
||||
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
|
||||
// Purpur start
|
||||
@@ -1288,9 +1288,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1350,9 +1350,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.tickRateManager.endTickWork();
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
this.isReady = true;
|
||||
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
|
||||
}
|
||||
@@ -1499,7 +1499,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1562,7 +1562,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
||||
@@ -170,7 +170,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
super.doRunTask(ticktask);
|
||||
}
|
||||
|
||||
@@ -1572,9 +1572,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1635,9 +1635,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.ticksUntilAutosave = this.autosavePeriod;
|
||||
// CraftBukkit end
|
||||
MinecraftServer.LOGGER.debug("Autosave started");
|
||||
@@ -182,7 +182,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
MinecraftServer.LOGGER.debug("Autosave finished");
|
||||
}
|
||||
io.papermc.paper.util.CachedLists.reset(); // Paper
|
||||
@@ -1588,7 +1588,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1651,7 +1651,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 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
long j = Util.getNanos() - i;
|
||||
int k = this.tickCount % 100;
|
||||
|
||||
@@ -1602,7 +1602,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1665,7 +1665,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 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
//co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTiming(); // Paper // Purpur
|
||||
}
|
||||
@@ -1693,11 +1693,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1756,11 +1756,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,7 +214,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -1739,20 +1739,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -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
|
||||
worldserver.hasRidableMoveEvent = org.purpurmc.purpur.event.entity.RidableMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
|
||||
@@ -240,7 +240,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
|
||||
try {
|
||||
//worldserver.timings.doTick.startTiming(); // Spigot // Purpur
|
||||
@@ -1765,17 +1765,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1828,17 +1828,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
throw new ReportedException(crashreport);
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
//MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper // Purpur
|
||||
this.playerList.tick();
|
||||
//MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
@@ -1783,7 +1783,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1846,7 +1846,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
|
||||
//MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper // Purpur
|
||||
for (int i = 0; i < this.tickables.size(); ++i) {
|
||||
@@ -1791,7 +1791,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1854,7 +1854,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
//MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper // Purpur
|
||||
|
||||
@@ -280,7 +280,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
iterator = this.playerList.getPlayers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1801,7 +1801,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1864,7 +1864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
entityplayer.connection.resumeFlushing();
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
}
|
||||
|
||||
private void synchronizeTime(ServerLevel world) {
|
||||
@@ -1809,7 +1809,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1872,7 +1872,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void forceTimeSynchronization() {
|
||||
@@ -298,7 +298,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
Iterator iterator = this.getAllLevels().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1818,7 +1818,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1881,7 +1881,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.synchronizeTime(worldserver);
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
}
|
||||
|
||||
public boolean isLevelEnabled(Level world) {
|
||||
@@ -2530,6 +2530,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2593,6 +2593,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
@@ -315,7 +315,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
return this.profiler;
|
||||
}
|
||||
|
||||
@@ -2776,7 +2777,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2839,7 +2840,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end
|
||||
|
||||
private void startMetricsRecordingTick() {
|
||||
@@ -324,7 +324,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
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"));
|
||||
@@ -2786,40 +2787,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2849,40 +2850,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.willStartRecordingMetrics = false;
|
||||
}
|
||||
|
||||
@@ -377,7 +377,7 @@ index 6753ea878a19a8cb883db783664929a8927799ac..f00825d506242bc3ab3aef6b48cb8707
|
||||
}
|
||||
|
||||
public Path getWorldPath(LevelResource worldSavePath) {
|
||||
@@ -2872,15 +2873,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2935,15 +2936,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public boolean isTimeProfilerRunning() {
|
||||
@@ -468,7 +468,7 @@ index 1b6c5a36e96a3845d55b0b798a8cffdc7a4ffd93..ecd02b10c4120a7d7342b12ec95be0ee
|
||||
|
||||
public boolean hasWork() {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e81b69b02 100644
|
||||
index be22cbe607876fdf39120d6957db541146e6e589..63b03939a15150eeafc0498a6c810153bcc0e271 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -374,26 +374,26 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -516,7 +516,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -416,10 +416,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -417,10 +417,10 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
this.lastInhabitedUpdate = i;
|
||||
if (!this.level.isDebug()) {
|
||||
@@ -530,7 +530,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
List<ServerChunkCache.ChunkAndHolder> list = Lists.newArrayListWithCapacity(this.chunkMap.size());
|
||||
Iterator iterator = this.chunkMap.getChunks().iterator();
|
||||
//if (this.level.getServer().tickRateManager().runsNormally()) this.level.timings.chunkTicks.startTiming(); // Paper // Purpur
|
||||
@@ -434,7 +434,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -435,7 +435,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
|
||||
if (this.level.tickRateManager().runsNormally()) {
|
||||
@@ -539,7 +539,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
//this.level.timings.countNaturalMobs.startTiming(); // Paper - timings // Purpur
|
||||
int k = this.distanceManager.getNaturalSpawnChunkCount();
|
||||
// Paper start - Optional per player mob spawns
|
||||
@@ -463,7 +463,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -464,7 +464,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
// this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings // Purpur
|
||||
|
||||
this.lastSpawnState = spawnercreature_d;
|
||||
@@ -548,7 +548,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
|
||||
|
||||
Util.shuffle(list, this.level.random);
|
||||
@@ -498,7 +498,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -504,7 +504,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
//this.level.timings.chunkTicks.stopTiming(); // Paper // Purpur
|
||||
|
||||
@@ -557,7 +557,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
if (flag) {
|
||||
//try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings // Purpur
|
||||
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
|
||||
@@ -506,14 +506,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -512,14 +512,14 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
}
|
||||
}
|
||||
|
||||
@@ -575,7 +575,7 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
@@ -700,7 +700,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
|
||||
|
||||
@Override
|
||||
protected void doRunTask(Runnable task) {
|
||||
@@ -585,10 +585,10 @@ index 779b7ec2f243f4a8868d78e7fe5b5c57446d60aa..c50e1dee1a32ea7a8fd412f98e944a0e
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791d22f06fb 100644
|
||||
index c2aaca3cdc77f14e1d19eb4ac8cbf10a3ae0b6d3..72f529cbe455377c2a2b4938693fa7858fc2ce9c 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -644,16 +644,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -661,16 +661,16 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
public void tick(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -608,7 +608,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
this.advanceWeatherCycle();
|
||||
}
|
||||
|
||||
@@ -685,30 +685,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -702,30 +702,30 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
this.tickTime();
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
if (flag) {
|
||||
// this.timings.doSounds.startTiming(); // Spigot // Purpur
|
||||
this.runBlockEvents();
|
||||
@@ -716,7 +716,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -733,7 +733,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
this.handlingTick = false;
|
||||
@@ -655,7 +655,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
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) {
|
||||
@@ -724,12 +724,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -741,12 +741,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
|
||||
if (flag1 || this.emptyTime++ < 300) {
|
||||
@@ -671,7 +671,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
}
|
||||
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
@@ -739,9 +739,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -756,9 +756,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 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - rewrite chunk system
|
||||
Entity entity1 = entity.getVehicle();
|
||||
|
||||
@@ -753,22 +753,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -770,22 +770,22 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
entity.stopRiding();
|
||||
}
|
||||
|
||||
@@ -711,7 +711,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -844,9 +844,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -861,9 +861,9 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
boolean flag = this.isRaining();
|
||||
int j = chunkcoordintpair.getMinBlockX();
|
||||
int k = chunkcoordintpair.getMinBlockZ();
|
||||
@@ -723,7 +723,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
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
|
||||
BlockPos blockposition = this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15));
|
||||
|
||||
@@ -883,7 +883,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -900,7 +900,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -732,7 +732,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
|
||||
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
|
||||
for (int l = 0; l < randomTickSpeed; ++l) {
|
||||
@@ -893,7 +893,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -910,7 +910,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
}
|
||||
} // Paper - Option to disable ice and snow
|
||||
|
||||
@@ -741,7 +741,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
//timings.chunkTicksBlocks.startTiming(); // Paper // Purpur
|
||||
if (randomTickSpeed > 0) {
|
||||
LevelChunkSection[] achunksection = chunk.getSections();
|
||||
@@ -908,7 +908,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -925,7 +925,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);
|
||||
|
||||
@@ -750,7 +750,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
BlockState iblockdata = chunksection.getBlockState(blockposition1.getX() - j, blockposition1.getY() - k1, blockposition1.getZ() - k);
|
||||
|
||||
if (iblockdata.isRandomlyTicking()) {
|
||||
@@ -921,14 +921,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -938,14 +938,14 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
fluid.randomTick(this, blockposition1, this.random);
|
||||
}
|
||||
|
||||
@@ -767,7 +767,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -1245,19 +1245,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1272,19 +1272,19 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
//try { // Purpur
|
||||
// Paper end - timings
|
||||
entity.setOldPosAndRot();
|
||||
@@ -792,7 +792,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
//} finally { timer.stopTiming(); } // Paper - timings // Purpur
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
@@ -1280,12 +1280,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1307,12 +1307,12 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
// Paper end
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
@@ -809,7 +809,7 @@ index 2c622aaa370bb8cf3b6d68bc6533abe318992d6a..fa652c9cea66b31c2452ed77cf251791
|
||||
// Paper start - EAR 2
|
||||
if (isActive) {
|
||||
passenger.rideTick();
|
||||
@@ -1297,7 +1297,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1324,7 +1324,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
vehicle.positionRider(passenger);
|
||||
}
|
||||
// Paper end - EAR 2
|
||||
@@ -1078,7 +1078,7 @@ 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 5c0157a5f54e9de21398ccb3421850b356d1751e..541fbd5b90cc6a2dd98733bc90602256d2ef59ed 100644
|
||||
index ef24ef826ab825ce0a22ff3c5ad84d9494d63aef..8b234996acfcb9f22e32ce94984ae4afd7ad8142 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -859,7 +859,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
@@ -1806,7 +1806,7 @@ 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 e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c559945f3 100644
|
||||
index 1b85d31a81404ea817c892ac0bd055058fe8f079..9b7831f326e6cf8f84e5c420749b43cd7edcfd87 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
|
||||
@@ -1827,7 +1827,7 @@ index e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c
|
||||
final List<Entity> ret = new java.util.ArrayList<>();
|
||||
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.level.ChunkSystemLevel)this).moonrise$getEntityLookup().getHardCollidingEntities(entity, box, ret, predicate);
|
||||
@@ -982,9 +982,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -987,9 +987,9 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1839,7 +1839,7 @@ index e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c
|
||||
//this.timings.tileEntityPending.startTiming(); // Spigot // Purpur
|
||||
this.tickingBlockEntities = true;
|
||||
if (!this.pendingBlockEntityTickers.isEmpty()) {
|
||||
@@ -1020,7 +1020,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1030,7 +1030,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
|
||||
@@ -1848,7 +1848,7 @@ index e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c
|
||||
this.spigotConfig.currentPrimedTnt = 0; // Spigot
|
||||
}
|
||||
|
||||
@@ -1224,7 +1224,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1235,7 +1235,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
|
||||
@Override
|
||||
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
|
||||
@@ -1857,7 +1857,7 @@ index e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c
|
||||
// Paper start - rewrite chunk system
|
||||
final List<Entity> ret = new java.util.ArrayList<>();
|
||||
|
||||
@@ -1250,7 +1250,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1261,7 +1261,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) {
|
||||
@@ -1866,7 +1866,7 @@ index e353384abb69aa4cee6fb20277df874b40466ace..a5dab1252bec8f0ba5e40313e329731c
|
||||
|
||||
if (entityTypeTest instanceof net.minecraft.world.entity.EntityType<T> byType) {
|
||||
if (maxCount != Integer.MAX_VALUE) {
|
||||
@@ -1545,6 +1545,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
@@ -1556,6 +1556,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
|
||||
}
|
||||
|
||||
public ProfilerFiller getProfiler() {
|
||||
|
||||
Reference in New Issue
Block a user