Fix chat messages being logged without formatting to console (#9058)

This commit is contained in:
Jason 2023-03-27 10:19:23 -07:00 committed by GitHub
parent fbf74ba0ac
commit bd62f2c2dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 183 additions and 158 deletions

View File

@ -2114,10 +2114,18 @@ index 5f051cb22ae77f4d8994b07ac5b963bd0ff05673..7952635a963e28cb670c8f4869664103
list.forEach((loader) -> { list.forEach((loader) -> {
Registry<?> registry = loader.getFirst(); Registry<?> registry = loader.getFirst();
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 5725631835ea68802c75934cd85d5c1b1a78d358..0b859ebcc2c53e74615feca5c864136586c1523b 100644 index 5725631835ea68802c75934cd85d5c1b1a78d358..b130edcdc4a91e6d1cfc59d80223edf937673ba4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -244,6 +244,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -194,6 +194,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
public static final Logger LOGGER = LogUtils.getLogger();
+ public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
public static final String VANILLA_BRAND = "vanilla";
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F;
private static final int TICK_STATS_SPAN = 100;
@@ -244,6 +245,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean allowFlight; private boolean allowFlight;
@Nullable @Nullable
private String motd; private String motd;
@ -2125,7 +2133,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..0b859ebcc2c53e74615feca5c8641365
private int playerIdleTimeout; private int playerIdleTimeout;
public final long[] tickTimes; public final long[] tickTimes;
@Nullable @Nullable
@@ -1263,6 +1264,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1263,6 +1265,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
SpigotTimings.schedulerTimer.startTiming(); // Spigot SpigotTimings.schedulerTimer.startTiming(); // Spigot
this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit
SpigotTimings.schedulerTimer.stopTiming(); // Spigot SpigotTimings.schedulerTimer.stopTiming(); // Spigot
@ -2133,7 +2141,7 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..0b859ebcc2c53e74615feca5c8641365
this.profiler.push("commandFunctions"); this.profiler.push("commandFunctions");
SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot
this.getFunctions().tick(); this.getFunctions().tick();
@@ -1631,8 +1633,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1631,8 +1634,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.motd; return this.motd;
} }
@ -2152,7 +2160,24 @@ index 5725631835ea68802c75934cd85d5c1b1a78d358..0b859ebcc2c53e74615feca5c8641365
} }
public boolean isStopped() { public boolean isStopped() {
@@ -2363,27 +2375,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2351,39 +2364,29 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) {
- String s1 = params.decorate(message).getString();
+ // Paper start
+ net.kyori.adventure.text.Component s1 = io.papermc.paper.adventure.PaperAdventure.asAdventure(params.decorate(message));
if (prefix != null) {
- MinecraftServer.LOGGER.info("[{}] {}", prefix, s1);
+ MinecraftServer.COMPONENT_LOGGER.info("[{}] {}", prefix, s1);
} else {
- MinecraftServer.LOGGER.info("{}", s1);
+ MinecraftServer.COMPONENT_LOGGER.info("{}", s1);
+ // Paper end
}
}
// CraftBukkit start // CraftBukkit start
public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool( public final java.util.concurrent.ExecutorService chatExecutor = java.util.concurrent.Executors.newCachedThreadPool(

View File

@ -729,7 +729,7 @@ index fc4dcd801480fe6d89a985de411baa9a3a66f6ef..4a1148a76020089caf01f888f87afdbb
} catch (Exception exception) { } catch (Exception exception) {
if (listener.shouldPropagateHandlingExceptions()) { if (listener.shouldPropagateHandlingExceptions()) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0dbdf1d9a 100644 index b130edcdc4a91e6d1cfc59d80223edf937673ba4..8b4933653ca2a40d171ae34f7d79022db631a903 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -189,7 +189,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent; @@ -189,7 +189,7 @@ import org.bukkit.event.player.AsyncPlayerChatPreviewEvent;
@ -741,7 +741,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable { public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements CommandSource, AutoCloseable {
@@ -864,6 +864,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -865,6 +865,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");
@ -749,7 +749,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@@ -1102,9 +1103,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1103,9 +1104,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean haveTime() { private boolean haveTime() {
// CraftBukkit start // CraftBukkit start
@ -771,7 +771,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
private void executeModerately() { private void executeModerately() {
this.runAllTasks(); this.runAllTasks();
java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L);
@@ -1112,9 +1125,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1113,9 +1126,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit end // CraftBukkit end
protected void waitUntilNextTick() { protected void waitUntilNextTick() {
@ -783,7 +783,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
}); });
} }
@@ -1199,9 +1212,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1200,9 +1213,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public void onServerExit() {} public void onServerExit() {}
public void tickServer(BooleanSupplier shouldKeepTicking) { public void tickServer(BooleanSupplier shouldKeepTicking) {
@ -802,7 +802,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
++this.tickCount; ++this.tickCount;
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
if (i - this.lastServerStatus >= 5000000000L) { if (i - this.lastServerStatus >= 5000000000L) {
@@ -1210,15 +1231,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1211,15 +1232,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit if (this.autosavePeriod > 0 && this.tickCount % this.autosavePeriod == 0) { // CraftBukkit
@ -823,7 +823,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
this.profiler.push("tallying"); this.profiler.push("tallying");
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i; long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
@@ -1228,8 +1252,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1229,8 +1253,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.frameTimer.logFrameDuration(k - i); this.frameTimer.logFrameDuration(k - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@ -833,7 +833,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
} }
private ServerStatus buildServerStatus() { private ServerStatus buildServerStatus() {
@@ -1261,26 +1284,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1262,26 +1285,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void tickChildren(BooleanSupplier shouldKeepTicking) { public void tickChildren(BooleanSupplier shouldKeepTicking) {
@ -867,7 +867,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.
if (this.tickCount % 20 == 0) { if (this.tickCount % 20 == 0) {
for (int i = 0; i < this.getPlayerList().players.size(); ++i) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) {
@@ -1288,7 +1311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1289,7 +1312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level.getGameTime(), entityplayer.getPlayerTime(), entityplayer.level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time
} }
} }
@ -876,7 +876,7 @@ index 0b859ebcc2c53e74615feca5c864136586c1523b..027200b4702d3379ae2f987b69f390c0
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
@@ -1334,24 +1357,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1335,24 +1358,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
this.profiler.popPush("connection"); this.profiler.popPush("connection");

View File

@ -12723,10 +12723,10 @@ index d9f2518a08bc4ae978051be51e467597f9325ecb..26fa789a44a1d934944e78eae21f4892
DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff3c57c2d8 100644 index 8b4933653ca2a40d171ae34f7d79022db631a903..6251d93c2ea61c471b4e1069048327782acc78e7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -301,7 +301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -302,7 +302,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@ -12735,7 +12735,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
((MinecraftServer) atomicreference.get()).runServer(); ((MinecraftServer) atomicreference.get()).runServer();
}, "Server thread"); }, "Server thread");
@@ -584,7 +584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -585,7 +585,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.forceDifficulty(); this.forceDifficulty();
for (ServerLevel worldserver : this.getAllLevels()) { for (ServerLevel worldserver : this.getAllLevels()) {
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver); this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
@ -12744,7 +12744,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
} }
@@ -786,6 +786,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -787,6 +787,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public abstract boolean shouldRconBroadcast(); public abstract boolean shouldRconBroadcast();
public boolean saveAllChunks(boolean suppressLogs, boolean flush, boolean force) { public boolean saveAllChunks(boolean suppressLogs, boolean flush, boolean force) {
@ -12757,7 +12757,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
boolean flag3 = false; boolean flag3 = false;
for (Iterator iterator = this.getAllLevels().iterator(); iterator.hasNext(); flag3 = true) { for (Iterator iterator = this.getAllLevels().iterator(); iterator.hasNext(); flag3 = true) {
@@ -794,8 +800,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -795,8 +801,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (!suppressLogs) { if (!suppressLogs) {
MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location()); MinecraftServer.LOGGER.info("Saving chunks for level '{}'/{}", worldserver, worldserver.dimension().location());
} }
@ -12772,7 +12772,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
} }
// CraftBukkit start - moved to WorldServer.save // CraftBukkit start - moved to WorldServer.save
@@ -814,7 +824,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -815,7 +825,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator1.hasNext()) { while (iterator1.hasNext()) {
ServerLevel worldserver2 = (ServerLevel) iterator1.next(); ServerLevel worldserver2 = (ServerLevel) iterator1.next();
@ -12781,7 +12781,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
} }
MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved"); MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage: All dimensions are saved");
@@ -894,36 +904,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -895,36 +905,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
@ -12819,7 +12819,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
this.isSaving = false; this.isSaving = false;
this.resources.close(); this.resources.close();
@@ -942,7 +923,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -943,7 +924,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getProfileCache().save(); this.getProfileCache().save();
} }
// Spigot end // Spigot end
@ -12828,7 +12828,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
} }
public String getLocalIp() { public String getLocalIp() {
@@ -976,6 +957,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -977,6 +958,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
// Spigot End // Spigot End
@ -12837,7 +12837,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
protected void runServer() { protected void runServer() {
try { try {
if (!this.initServer()) { if (!this.initServer()) {
@@ -990,6 +973,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -991,6 +974,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Arrays.fill( recentTps, 20 ); Arrays.fill( recentTps, 20 );
long curTime, tickSection = Util.getMillis(), tickCount = 1; long curTime, tickSection = Util.getMillis(), tickCount = 1;
while (this.running) { while (this.running) {
@ -12850,7 +12850,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
long i = (curTime = Util.getMillis()) - this.nextTickTime; long i = (curTime = Util.getMillis()) - this.nextTickTime;
if (i > 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit if (i > 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit
@@ -1102,6 +1091,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1103,6 +1092,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
private boolean haveTime() { private boolean haveTime() {
@ -12862,7 +12862,7 @@ index 027200b4702d3379ae2f987b69f390c0dbdf1d9a..8c85251685c44cd005b72dd31129a9ff
// CraftBukkit start // CraftBukkit start
if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken
return this.forceTicks || this.runningTask() || Util.getMillis() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTime : this.nextTickTime); return this.forceTicks || this.runningTask() || Util.getMillis() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTime : this.nextTickTime);
@@ -2257,7 +2251,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2258,7 +2252,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
@Override @Override
public boolean isSameThread() { public boolean isSameThread() {
@ -17996,7 +17996,7 @@ index 253f965e52cd488af88d55cdd09f1bad0ddbeb56..30137f60a3796cf845e8fd7bd3c291be
// Spigot start // Spigot start
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot() private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 7c9f1b998ea5447d6ff29cdbb9e3cee0ba1c7c99..7b57298ee6c9422fa10dde9cf9441ea10b3443e4 100644 index a983573269d5e575c845df3a566d147668ccd86b..feb848813b80acb527e981b653208350639c97cc 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -177,6 +177,81 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -177,6 +177,81 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8c85251685c44cd005b72dd31129a9ff3c57c2d8..8cd3ad2601df5a604de904304ae3f603a471dfee 100644 index 6251d93c2ea61c471b4e1069048327782acc78e7..d3cd196e1a6f707ed5e0008123cc65df80422859 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1461,7 +1461,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1462,7 +1462,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate @DontObfuscate
public String getServerModName() { public String getServerModName() {

View File

@ -12,10 +12,10 @@ Previous implementation did not calculate TPS correctly.
Switch to a realistic rolling average and factor in std deviation as an extra reporting variable Switch to a realistic rolling average and factor in std deviation as an extra reporting variable
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c0803c0ad39 100644 index d3cd196e1a6f707ed5e0008123cc65df80422859..a7f9a3e57c7736b065b8dc4dba6e018ce73e5157 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -284,7 +284,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -285,7 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
public ConsoleReader reader; public ConsoleReader reader;
@ -24,7 +24,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
public Commands vanillaCommandDispatcher; public Commands vanillaCommandDispatcher;
@@ -293,7 +293,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start // Spigot start
public static final int TPS = 20; public static final int TPS = 20;
public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS; public static final int TICK_TIME = 1000000000 / MinecraftServer.TPS;
@ -33,7 +33,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
public final double[] recentTps = new double[ 3 ]; public final double[] recentTps = new double[ 3 ];
// Spigot end // Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
@@ -955,6 +955,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -956,6 +956,57 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
{ {
return ( avg * exp ) + ( tps * ( 1 - exp ) ); return ( avg * exp ) + ( tps * ( 1 - exp ) );
} }
@ -91,7 +91,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
// Spigot End // Spigot End
public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system
@@ -971,7 +1022,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -972,7 +1023,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Spigot start // Spigot start
Arrays.fill( recentTps, 20 ); Arrays.fill( recentTps, 20 );
@ -101,7 +101,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
while (this.running) { while (this.running) {
// Paper start - rewrite chunk system // Paper start - rewrite chunk system
// guarantee that nothing can stop the server from halting if it can at least still tick // guarantee that nothing can stop the server from halting if it can at least still tick
@@ -979,7 +1031,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -980,7 +1032,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw this.chunkSystemCrash; throw this.chunkSystemCrash;
} }
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
@ -110,7 +110,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
if (i > 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit if (i > 5000L && this.nextTickTime - this.lastOverloadWarning >= 30000L) { // CraftBukkit
long j = i / 50L; long j = i / 50L;
@@ -991,12 +1043,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -992,12 +1044,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
++MinecraftServer.currentTickLong; // Paper ++MinecraftServer.currentTickLong; // Paper
@ -134,7 +134,7 @@ index 8cd3ad2601df5a604de904304ae3f603a471dfee..846dc9b607f40f1af3b4b7c7bbfe3c08
tickSection = curTime; tickSection = curTime;
} }
// Spigot end // Spigot end
@@ -1006,7 +1064,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1007,7 +1065,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount); this.debugCommandProfiler = new MinecraftServer.TimeProfiler(Util.getNanos(), this.tickCount);
} }

View File

@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving
an entity's exposure during an explosion. an entity's exposure during an explosion.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 846dc9b607f40f1af3b4b7c7bbfe3c0803c0ad39..085943e5948c334792be1ad95e7ba4aa88ffe927 100644 index a7f9a3e57c7736b065b8dc4dba6e018ce73e5157..1554f8847e42cdd584b16c0648c21c4071aea6de 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1407,6 +1407,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1408,6 +1408,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
this.profiler.pop(); this.profiler.pop();

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener
Saves on some object allocation and processing when no plugin listens to this Saves on some object allocation and processing when no plugin listens to this
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 085943e5948c334792be1ad95e7ba4aa88ffe927..c25e654497417c1c3345b7c0654cf8ef901e6a50 100644 index 1554f8847e42cdd584b16c0648c21c4071aea6de..f48d3bbbfd5b4ebb9c22c6dc2a17a9030af2edf5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1368,6 +1368,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1369,6 +1369,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();

View File

@ -18,10 +18,10 @@ index 1294b38262505b0d54089e428df9b363219de1f0..ee37ec0de1ca969144824427ae42b0c8
buf.writeComponent(this.playerPrefix); buf.writeComponent(this.playerPrefix);
buf.writeComponent(this.playerSuffix); buf.writeComponent(this.playerSuffix);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1b153a4f323635f1f48ef49a95103e25d5b6ce21..3068831dbfbda5fc4dea5f0fb6eb48636fba4052 100644 index f48d3bbbfd5b4ebb9c22c6dc2a17a9030af2edf5..2ea0cb1f9bfc5ef7bd8c78cf259da13b11fe4023 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -588,6 +588,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -589,6 +589,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
} }

View File

@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton
to stop IDE complaining about potential NPE to stop IDE complaining about potential NPE
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 18499be3d671987a743e6001347fb7ffb023039c..0cb581700dd994a0585e5f8f73489d90f2c0ac0d 100644 index 2ea0cb1f9bfc5ef7bd8c78cf259da13b11fe4023..e2744847c5decc65be2f8d268457ba80633b8e29 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -193,6 +193,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -193,6 +193,7 @@ import co.aikar.timings.MinecraftTimings; // Paper
@ -15,9 +15,9 @@ index 18499be3d671987a743e6001347fb7ffb023039c..0cb581700dd994a0585e5f8f73489d90
+ private static MinecraftServer SERVER; // Paper + private static MinecraftServer SERVER; // Paper
public static final Logger LOGGER = LogUtils.getLogger(); public static final Logger LOGGER = LogUtils.getLogger();
public static final net.kyori.adventure.text.logger.slf4j.ComponentLogger COMPONENT_LOGGER = net.kyori.adventure.text.logger.slf4j.ComponentLogger.logger(LOGGER.getName()); // Paper
public static final String VANILLA_BRAND = "vanilla"; public static final String VANILLA_BRAND = "vanilla";
private static final float AVERAGE_TICK_TIME_SMOOTHING = 0.8F; @@ -322,6 +323,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -321,6 +322,7 @@ 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) { 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"); super("Server");
@ -25,7 +25,7 @@ index 18499be3d671987a743e6001347fb7ffb023039c..0cb581700dd994a0585e5f8f73489d90
this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.metricsRecorder = InactiveMetricsRecorder.INSTANCE;
this.profiler = this.metricsRecorder.getProfiler(); this.profiler = this.metricsRecorder.getProfiler();
this.onMetricsRecordingStopped = (methodprofilerresults) -> { this.onMetricsRecordingStopped = (methodprofilerresults) -> {
@@ -2333,9 +2335,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2334,9 +2336,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return false; return false;
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Async GameProfileCache saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 12d0bddfdb156c07fdba87e960d0cbf0639b26a5..e7b8e53a8709babb147a1ee3f375e96638f425a4 100644 index e2744847c5decc65be2f8d268457ba80633b8e29..e845baf287da216bc5c1d2588b8e720212318266 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -936,7 +936,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -937,7 +937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} catch (java.lang.InterruptedException ignored) {} // Paper } catch (java.lang.InterruptedException ignored) {} // Paper
if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) {
MinecraftServer.LOGGER.info("Saving usercache.json"); MinecraftServer.LOGGER.info("Saving usercache.json");

View File

@ -30,10 +30,10 @@ will have plugins and worlds saving to the disk has a high potential to result
in corruption/dataloss. in corruption/dataloss.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 776f7a27c4e85e713863f8fd0d37fc61e2bb0e49..b248a4ab47728c078dbc922896964e0e893fc255 100644 index e845baf287da216bc5c1d2588b8e720212318266..d9ceef3d9694ab85f807a732789b2871bb734e50 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -236,6 +236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -237,6 +237,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private Map<ResourceKey<Level>, ServerLevel> levels; private Map<ResourceKey<Level>, ServerLevel> levels;
private PlayerList playerList; private PlayerList playerList;
private volatile boolean running; private volatile boolean running;
@ -41,7 +41,7 @@ index 776f7a27c4e85e713863f8fd0d37fc61e2bb0e49..b248a4ab47728c078dbc922896964e0e
private boolean stopped; private boolean stopped;
private int tickCount; private int tickCount;
protected final Proxy proxy; protected final Proxy proxy;
@@ -904,7 +905,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -905,7 +906,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.playerList != null) { if (this.playerList != null) {
MinecraftServer.LOGGER.info("Saving players"); MinecraftServer.LOGGER.info("Saving players");
this.playerList.saveAll(); this.playerList.saveAll();
@ -50,7 +50,7 @@ index 776f7a27c4e85e713863f8fd0d37fc61e2bb0e49..b248a4ab47728c078dbc922896964e0e
try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets
} }
@@ -955,6 +956,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -956,6 +957,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void halt(boolean waitForShutdown) { public void halt(boolean waitForShutdown) {

View File

@ -112,7 +112,7 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0aa0606ce3 100644 index d9ceef3d9694ab85f807a732789b2871bb734e50..4e263a0ca438ffd1253cda577689a1b6d2d55992 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -168,7 +168,7 @@ import com.mojang.datafixers.util.Pair; @@ -168,7 +168,7 @@ import com.mojang.datafixers.util.Pair;
@ -124,7 +124,7 @@ index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0a
import joptsimple.OptionSet; import joptsimple.OptionSet;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.resources.RegistryOps; import net.minecraft.resources.RegistryOps;
@@ -285,7 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -286,7 +286,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public OptionSet options; public OptionSet options;
public org.bukkit.command.ConsoleCommandSender console; public org.bukkit.command.ConsoleCommandSender console;
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole; public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
@ -133,7 +133,7 @@ index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0a
public static int currentTick = 0; // Paper - Further improve tick loop public static int currentTick = 0; // Paper - Further improve tick loop
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
@@ -369,7 +369,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -370,7 +370,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.options = options; this.options = options;
this.worldLoader = worldLoader; this.worldLoader = worldLoader;
this.vanillaCommandDispatcher = worldstem.dataPackResources().commands; // CraftBukkit this.vanillaCommandDispatcher = worldstem.dataPackResources().commands; // CraftBukkit
@ -143,7 +143,7 @@ index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0a
if (System.console() == null && System.getProperty("jline.terminal") == null) { if (System.console() == null && System.getProperty("jline.terminal") == null) {
System.setProperty("jline.terminal", "jline.UnsupportedTerminal"); System.setProperty("jline.terminal", "jline.UnsupportedTerminal");
Main.useJline = false; Main.useJline = false;
@@ -390,6 +392,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -391,6 +393,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftServer.LOGGER.warn((String) null, ex); MinecraftServer.LOGGER.warn((String) null, ex);
} }
} }
@ -152,7 +152,7 @@ index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0a
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
this.paperConfigurations = services.paperConfigurations(); // Paper this.paperConfigurations = services.paperConfigurations(); // Paper
} }
@@ -1136,7 +1140,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1137,7 +1141,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
org.spigotmc.WatchdogThread.doStop(); // Spigot org.spigotmc.WatchdogThread.doStop(); // Spigot
// CraftBukkit start - Restore terminal to original settings // CraftBukkit start - Restore terminal to original settings
try { try {
@ -161,7 +161,7 @@ index b248a4ab47728c078dbc922896964e0e893fc255..7a0bbaf7cb929b42f10fa7e04ad73c0a
} catch (Exception ignored) { } catch (Exception ignored) {
} }
// CraftBukkit end // CraftBukkit end
@@ -1590,7 +1594,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1591,7 +1595,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public void sendSystemMessage(Component message) { public void sendSystemMessage(Component message) {

View File

@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 44c9135e8d63df11009d5eea509c6c57e8d841c4..163993cd4fe52c5bd89db656d61ff795b6ddc896 100644 index 4e263a0ca438ffd1253cda577689a1b6d2d55992..274f3a213e60c9b67dbc43c8b53efb676b8bd41e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,6 +3,9 @@ package net.minecraft.server; @@ -3,6 +3,9 @@ package net.minecraft.server;
@ -194,7 +194,7 @@ index 44c9135e8d63df11009d5eea509c6c57e8d841c4..163993cd4fe52c5bd89db656d61ff795
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
@@ -1348,7 +1351,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1349,7 +1352,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hidesOnlinePlayers()) { if (this.hidesOnlinePlayers()) {
return new ServerStatus.Players(i, list.size(), List.of()); return new ServerStatus.Players(i, list.size(), List.of());
} else { } else {

View File

@ -9,10 +9,10 @@ thread dumps at an interval until the point of crash.
This will help diagnose what was going on in that time before the crash. This will help diagnose what was going on in that time before the crash.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 163993cd4fe52c5bd89db656d61ff795b6ddc896..8c64c3c1e33cb289ac2eb1b55e1febf6920fd4c6 100644 index 274f3a213e60c9b67dbc43c8b53efb676b8bd41e..387c423dfe69a3310f8e7aa3dbb7faafc9501e50 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1051,6 +1051,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1052,6 +1052,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus(); this.status = this.buildServerStatus();
// Spigot start // Spigot start
@ -33,7 +33,7 @@ index e6826cd0a596f063e8737dcde3c8c6c5b3f71970..1a2607d1b257cea65c82c661a6b3d46c
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d770063b7e17c55b7e13e9ea44c05870cadb9fe7..bd2cc69ff6c15615dfedcb3c88e6bf2d36fd9370 100644 index 8d1dc213ee5acaefd02c1a35140befba5e790d02..2cfcfc256acf322c5279fe967f33705fcd958623 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -901,6 +901,7 @@ public final class CraftServer implements Server { @@ -901,6 +901,7 @@ public final class CraftServer implements Server {

View File

@ -79,10 +79,10 @@ index 33ec55ed1f7d10a5235330ad082e7c7b54c42368..d5b37301d4e860c019105445001ed7a9
return executorService; return executorService;
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8c64c3c1e33cb289ac2eb1b55e1febf6920fd4c6..52d602fdaad361deb3b3e0ff2b99b7808e4a32cf 100644 index 387c423dfe69a3310f8e7aa3dbb7faafc9501e50..852b148a37a8ef632a02a2c264f2b3a8fa4175ac 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -320,6 +320,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -321,6 +321,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error
atomicreference.set(s0); atomicreference.set(s0);

View File

@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet
object for every player unless they have per-player time enabled. object for every player unless they have per-player time enabled.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f116b8600f5b7c0f372585cc1edc68160299bfa1..d6bf9a1e6561de911783c157b3875a9e647b00c7 100644 index 852b148a37a8ef632a02a2c264f2b3a8fa4175ac..d95a618dfdb50a6c6a5fc086cb5e88e0b0a91b71 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1390,12 +1390,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1391,12 +1391,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
// Send time updates to everyone, it will get the right time from the world the player is in. // Send time updates to everyone, it will get the right time from the world the player is in.

View File

@ -53,10 +53,10 @@ index 7f561ab6e56cd1749da8eff950080d3ae3f5e028..286dab2ed3c6b962c9702b8b10105e14
event.getPlayer().getServer().getPluginManager().callEvent(event); event.getPlayer().getServer().getPluginManager().callEvent(event);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fc76ec97536e5f520b556453f7fcb7aa7572cb19..ca2a2b1f54f06f9035be8b379fad580128811fc2 100644 index d95a618dfdb50a6c6a5fc086cb5e88e0b0a91b71..d11ba8d081861b852bf74662d5e963ac89c226ca 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -899,6 +899,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -900,6 +900,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
MinecraftServer.LOGGER.info("Stopping server"); MinecraftServer.LOGGER.info("Stopping server");

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events
Fires event at start and end of a server tick Fires event at start and end of a server tick
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ca2a2b1f54f06f9035be8b379fad580128811fc2..9d2186655ae03022ddeaf078028570ef9118fb06 100644 index d11ba8d081861b852bf74662d5e963ac89c226ca..b647007dc94e2ea416ce4dc659c8b2d623426979 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1308,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1309,6 +1309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}); });
isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
// Paper end // Paper end
@ -17,7 +17,7 @@ index ca2a2b1f54f06f9035be8b379fad580128811fc2..9d2186655ae03022ddeaf078028570ef
++this.tickCount; ++this.tickCount;
this.tickChildren(shouldKeepTicking); this.tickChildren(shouldKeepTicking);
@@ -1329,6 +1330,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1330,6 +1331,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.runAllTasks(); this.runAllTasks();
} }
// Paper end // Paper end

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world
This lets you disable it for some worlds and lower it for others. This lets you disable it for some worlds and lower it for others.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index cbac51a99885f963feede3563b6b2714a4096022..f62cbd8eddee7ea6997797271ce37d31b8dd3aaa 100644 index b647007dc94e2ea416ce4dc659c8b2d623426979..9367b999e91d53b742fb161fd9131a2c99e35c6d 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -739,31 +739,34 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -740,31 +740,34 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
public void prepareLevels(ChunkProgressListener worldloadlistener, ServerLevel worldserver) { public void prepareLevels(ChunkProgressListener worldloadlistener, ServerLevel worldserver) {
@ -54,7 +54,7 @@ index cbac51a99885f963feede3563b6b2714a4096022..f62cbd8eddee7ea6997797271ce37d31
if (true) { if (true) {
ServerLevel worldserver1 = worldserver; ServerLevel worldserver1 = worldserver;
@@ -786,7 +789,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -787,7 +790,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// this.nextTickTime = SystemUtils.getMillis() + 10L; // this.nextTickTime = SystemUtils.getMillis() + 10L;
this.executeModerately(); this.executeModerately();
// CraftBukkit end // CraftBukkit end

View File

@ -14,10 +14,10 @@ light engine on shutdown...
The queue size only puts a cap on max loss, doesn't solve that problem. The queue size only puts a cap on max loss, doesn't solve that problem.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fe8c0ba8864afd582c5e1c9d310cff99ef4dbff6..cb76b912ebb5ac4e53588c82cf35ac98bdf7d1e2 100644 index 9367b999e91d53b742fb161fd9131a2c99e35c6d..2e29d1c3e5faf970bfaf3a545ef3553f284d68ef 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -790,7 +790,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -791,7 +791,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.executeModerately(); this.executeModerately();
// CraftBukkit end // CraftBukkit end
if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper

View File

@ -125,10 +125,10 @@ index d44d0074446c1c54e87dc8078dff7fef1d92f343..bbb8b1933ef33a3b91f69545f69dd3cf
public static void registerCommands(final MinecraftServer server) { public static void registerCommands(final MinecraftServer server) {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7c7fefa91497248a64046217a37e525bf3697bad..f79497ca8ab725ddd851ec89238db93c79ad92b7 100644 index 2e29d1c3e5faf970bfaf3a545ef3553f284d68ef..d00545c31de383470bcb8e4d9c6edad2f39c864c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -252,6 +252,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -253,6 +253,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Nullable private net.kyori.adventure.text.Component cachedMotd; // Paper @Nullable private net.kyori.adventure.text.Component cachedMotd; // Paper
private int playerIdleTimeout; private int playerIdleTimeout;
public final long[] tickTimes; public final long[] tickTimes;
@ -140,7 +140,7 @@ index 7c7fefa91497248a64046217a37e525bf3697bad..f79497ca8ab725ddd851ec89238db93c
@Nullable @Nullable
private KeyPair keyPair; private KeyPair keyPair;
@Nullable @Nullable
@@ -1344,6 +1349,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1345,6 +1350,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F; this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F;
long k = Util.getNanos(); long k = Util.getNanos();
@ -152,7 +152,7 @@ index 7c7fefa91497248a64046217a37e525bf3697bad..f79497ca8ab725ddd851ec89238db93c
this.frameTimer.logFrameDuration(k - i); this.frameTimer.logFrameDuration(k - i);
this.profiler.pop(); this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot org.spigotmc.WatchdogThread.tick(); // Spigot
@@ -2578,4 +2588,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2581,4 +2591,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static record ServerResourcePackInfo(String url, String hash, boolean isRequired, @Nullable Component prompt) { public static record ServerResourcePackInfo(String url, String hash, boolean isRequired, @Nullable Component prompt) {
} }

View File

@ -71,10 +71,10 @@ index 336795dff742b7c6957fbd3476aff31d25a5e659..30a58229aa6dac5039511d0c0df5f291
cause = cause.getCause(); cause = cause.getCause();
} }
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b321b50a5 100644 index d00545c31de383470bcb8e4d9c6edad2f39c864c..ebc8446631a4c4abccd2292ec52b69a0b6685199 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -298,7 +298,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -299,7 +299,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>(); public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
public int autosavePeriod; public int autosavePeriod;
public Commands vanillaCommandDispatcher; public Commands vanillaCommandDispatcher;
@ -83,7 +83,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
// CraftBukkit end // CraftBukkit end
// Spigot start // Spigot start
public static final int TPS = 20; public static final int TPS = 20;
@@ -309,6 +309,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -310,6 +310,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
public static long currentTickLong = 0L; // Paper public static long currentTickLong = 0L; // Paper
@ -93,7 +93,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
@@ -887,6 +890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -888,6 +891,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
private boolean hasStopped = false; private boolean hasStopped = false;
@ -101,7 +101,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
private final Object stopLock = new Object(); private final Object stopLock = new Object();
public final boolean hasStopped() { public final boolean hasStopped() {
synchronized (this.stopLock) { synchronized (this.stopLock) {
@@ -901,6 +905,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -902,6 +906,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hasStopped) return; if (this.hasStopped) return;
this.hasStopped = true; this.hasStopped = true;
} }
@ -121,7 +121,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
// CraftBukkit end // CraftBukkit end
if (this.metricsRecorder.isRecording()) { if (this.metricsRecorder.isRecording()) {
this.cancelRecordingMetrics(); this.cancelRecordingMetrics();
@@ -957,7 +974,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -958,7 +975,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getProfileCache().save(false); // Paper this.getProfileCache().save(false); // Paper
} }
// Spigot end // Spigot end
@ -140,7 +140,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
} }
public String getLocalIp() { public String getLocalIp() {
@@ -1052,6 +1080,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1053,6 +1081,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void runServer() { protected void runServer() {
try { try {
@ -148,7 +148,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
if (!this.initServer()) { if (!this.initServer()) {
throw new IllegalStateException("Failed to initialize server"); throw new IllegalStateException("Failed to initialize server");
} }
@@ -1061,6 +1090,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1062,6 +1091,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus(); this.status = this.buildServerStatus();
// Spigot start // Spigot start
@ -167,7 +167,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
org.spigotmc.WatchdogThread.hasStarted = true; // Paper org.spigotmc.WatchdogThread.hasStarted = true; // Paper
Arrays.fill( recentTps, 20 ); Arrays.fill( recentTps, 20 );
long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop
@@ -1121,6 +1162,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1122,6 +1163,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
JvmProfiler.INSTANCE.onServerTick(this.averageTickTime); JvmProfiler.INSTANCE.onServerTick(this.averageTickTime);
} }
} catch (Throwable throwable) { } catch (Throwable throwable) {
@ -180,7 +180,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable);
// Spigot Start // Spigot Start
if ( throwable.getCause() != null ) if ( throwable.getCause() != null )
@@ -1151,14 +1198,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1152,14 +1199,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.services.profileCache().clearExecutor(); this.services.profileCache().clearExecutor();
} }
@ -198,7 +198,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
} }
} }
@@ -1227,6 +1274,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1228,6 +1275,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public TickTask wrapRunnable(Runnable runnable) { public TickTask wrapRunnable(Runnable runnable) {
@ -211,7 +211,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
return new TickTask(this.tickCount, runnable); return new TickTask(this.tickCount, runnable);
} }
@@ -1462,6 +1515,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1463,6 +1516,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
} catch (Throwable t) { } catch (Throwable t) {
@ -219,7 +219,7 @@ index f79497ca8ab725ddd851ec89238db93c79ad92b7..7eb5a713dbb0e1e54f44ff16a4d7784b
throw new RuntimeException("Error generating crash report", t); throw new RuntimeException("Error generating crash report", t);
} }
// Spigot End // Spigot End
@@ -1960,7 +2014,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1961,7 +2015,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration); this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess()); this.resources.managers.updateRegistryTags(this.registryAccess());

View File

@ -29,10 +29,10 @@ index 0000000000000000000000000000000000000000..2d5494d2813b773e60ddba6790b750a9
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 155a9a5def5ff599ecf862782fa19fcc595e6789..8251db0d176ce55426cea6e0e355151c59eb7cc7 100644 index ebc8446631a4c4abccd2292ec52b69a0b6685199..e189de6d2aa94e9bbb20f1477ee2e34431adb324 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -891,6 +891,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -892,6 +892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
private boolean hasStopped = false; private boolean hasStopped = false;
public volatile boolean hasFullyShutdown = false; // Paper public volatile boolean hasFullyShutdown = false; // Paper
@ -40,7 +40,7 @@ index 155a9a5def5ff599ecf862782fa19fcc595e6789..8251db0d176ce55426cea6e0e355151c
private final Object stopLock = new Object(); private final Object stopLock = new Object();
public final boolean hasStopped() { public final boolean hasStopped() {
synchronized (this.stopLock) { synchronized (this.stopLock) {
@@ -905,6 +906,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -906,6 +907,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.hasStopped) return; if (this.hasStopped) return;
this.hasStopped = true; this.hasStopped = true;
} }
@ -48,7 +48,7 @@ index 155a9a5def5ff599ecf862782fa19fcc595e6789..8251db0d176ce55426cea6e0e355151c
// Paper start - kill main thread, and kill it hard // Paper start - kill main thread, and kill it hard
shutdownThread = Thread.currentThread(); shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper org.spigotmc.WatchdogThread.doStop(); // Paper
@@ -1006,6 +1008,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1007,6 +1009,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
public void safeShutdown(boolean waitForShutdown, boolean isRestarting) { public void safeShutdown(boolean waitForShutdown, boolean isRestarting) {
this.isRestarting = isRestarting; this.isRestarting = isRestarting;
@ -74,7 +74,7 @@ index 0c7f280bae81bbb492d5780a43e5ffda0f58756a..238a7bc87ab49da1f0fa3c733dd512fd
this.connection.send(new ClientboundDisconnectPacket(ichatmutablecomponent)); this.connection.send(new ClientboundDisconnectPacket(ichatmutablecomponent));
this.connection.disconnect(ichatmutablecomponent); this.connection.disconnect(ichatmutablecomponent);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index bb467c24daedeaef5509cd62ffed959eedcc0caa..ff5bfbc200d75ac10e9b8d8d30a963a406db3275 100644 index 530b22cbeca53755629d82ee64a795e569f2737e..e6c089f45d3b205eeaa1e52a15bc0aa055773a2d 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -992,6 +992,7 @@ public final class CraftServer implements Server { @@ -992,6 +992,7 @@ public final class CraftServer implements Server {

View File

@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns
if any are still running after that delay just as reload does. if any are still running after that delay just as reload does.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8251db0d176ce55426cea6e0e355151c59eb7cc7..6da8e9530c0112b1d9119c6ff722a277e5826241 100644 index e189de6d2aa94e9bbb20f1477ee2e34431adb324..4a58843f7ce2dd9e50f9daf3065d056a28910e5a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -931,6 +931,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -932,6 +932,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// CraftBukkit start // CraftBukkit start
if (this.server != null) { if (this.server != null) {
this.server.disablePlugins(); this.server.disablePlugins();
@ -22,7 +22,7 @@ index 8251db0d176ce55426cea6e0e355151c59eb7cc7..6da8e9530c0112b1d9119c6ff722a277
// CraftBukkit end // CraftBukkit end
if (this.getConnection() != null) { if (this.getConnection() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 17cfd84e67682a95f19930964f9a5c9c44ada3b8..2b668a9e1e7d4c719602e1c006e2154a94d00a72 100644 index bec471a617780e4fa88d4c559c42175370687d7b..9e278a740cf7cb7a593d76f01d6aa590407b087b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1002,6 +1002,35 @@ public final class CraftServer implements Server { @@ -1002,6 +1002,35 @@ public final class CraftServer implements Server {

View File

@ -8,10 +8,10 @@ makes it so that the server keeps the last difficulty used instead
of restoring the server.properties every single load. of restoring the server.properties every single load.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8cdc559a0e45744e041ef94f1af05d61ffb06b68..c4c1201a2f7904b2044e163393722227d159453b 100644 index 4a58843f7ce2dd9e50f9daf3065d056a28910e5a..55625495437e94d5dc98fabe68550f68b318381f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -801,7 +801,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -802,7 +802,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size
// CraftBukkit start // CraftBukkit start
// this.updateMobSpawningFlags(); // this.updateMobSpawningFlags();
@ -20,7 +20,7 @@ index 8cdc559a0e45744e041ef94f1af05d61ffb06b68..c4c1201a2f7904b2044e163393722227
this.forceTicks = false; this.forceTicks = false;
// CraftBukkit end // CraftBukkit end
@@ -1728,11 +1728,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1729,11 +1729,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
@ -40,7 +40,7 @@ index 8cdc559a0e45744e041ef94f1af05d61ffb06b68..c4c1201a2f7904b2044e163393722227
} }
} }
@@ -1746,7 +1749,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1747,7 +1750,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk and player saving
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index c4c1201a2f7904b2044e163393722227d159453b..173b3852ae55cd1204e8e493bfdf434e9dda9f3b 100644 index 55625495437e94d5dc98fabe68550f68b318381f..4fec26c84cb435756fe4b2dcdfc90716f342f9f1 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -874,7 +874,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -875,7 +875,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
try { try {
this.isSaving = true; this.isSaving = true;
@ -17,7 +17,7 @@ index c4c1201a2f7904b2044e163393722227d159453b..173b3852ae55cd1204e8e493bfdf434e
flag3 = this.saveAllChunks(suppressLogs, flush, force); flag3 = this.saveAllChunks(suppressLogs, flush, force);
} finally { } finally {
this.isSaving = false; this.isSaving = false;
@@ -1383,13 +1383,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1384,13 +1384,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.status = this.buildServerStatus(); this.status = this.buildServerStatus();
} }

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 173b3852ae55cd1204e8e493bfdf434e9dda9f3b..a8d1a5c74aa44a7155a11967ccb62810042859ea 100644 index 4fec26c84cb435756fe4b2dcdfc90716f342f9f1..e2ed1ab01ac95d18aa2d3553ccbc5aabdccfb45e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2049,6 +2049,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2050,6 +2050,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getPlayerList().reloadResources(); this.getPlayerList().reloadResources();
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
@ -17,7 +17,7 @@ index 173b3852ae55cd1204e8e493bfdf434e9dda9f3b..a8d1a5c74aa44a7155a11967ccb62810
if (this.isSameThread()) { if (this.isSameThread()) {
diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
index ffdd7638d0b88f79ae981924d1c42d2fda2b284e..780cd4f5fb4bb2ed42b0a168d94f0adde8fd0fc3 100644 index 6dbc8b6b39b8d4e3c7645e6b982e97a885ee2438..2f9045d216d52fba11d1d1d1ba6a90c1c2eea3d5 100644
--- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
+++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java
@@ -517,9 +517,39 @@ public class CraftBlockData implements BlockData { @@ -517,9 +517,39 @@ public class CraftBlockData implements BlockData {

View File

@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index a8d1a5c74aa44a7155a11967ccb62810042859ea..7fe23adc486e33e70d02e3855d8080a31a0eeeb5 100644 index e2ed1ab01ac95d18aa2d3553ccbc5aabdccfb45e..e7ee655a87358cbe9a7a21475ef67bfb7956cd65 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2132,13 +2132,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2133,13 +2133,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (this.isEnforceWhitelist()) { if (this.isEnforceWhitelist()) {
PlayerList playerlist = source.getServer().getPlayerList(); PlayerList playerlist = source.getServer().getPlayerList();
UserWhiteList whitelist = playerlist.getWhiteList(); UserWhiteList whitelist = playerlist.getWhiteList();

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..38b6de0d150f62fbc68b10680752347a05bb7301 100644 index e7ee655a87358cbe9a7a21475ef67bfb7956cd65..9e3dc2ba64b146d1715b81be7202ddbd0122382e 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2009,7 +2009,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2010,7 +2010,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.functionManager; return this.functionManager;
} }
@ -22,7 +22,7 @@ index 7fe23adc486e33e70d02e3855d8080a31a0eeeb5..38b6de0d150f62fbc68b10680752347a
RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE); RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE);
CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> { CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> {
Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error
@@ -2050,6 +2056,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2051,6 +2057,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager);
org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings, they can be defined by datapacks so refresh it here org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings, they can be defined by datapacks so refresh it here

View File

@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index eb365f8166a233e3e636722072c7130e9cafc1fb..3c30d51cc497f2aa4071fed1ef9a5c93ddd358ab 100644 index 9e3dc2ba64b146d1715b81be7202ddbd0122382e..7ad22703d50667849e195d3e7b6792078104425c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1506,6 +1506,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1507,6 +1507,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper

View File

@ -283,10 +283,10 @@ index 0000000000000000000000000000000000000000..b9922b07cb105618390187d98acdf89e
+ +
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3c30d51cc497f2aa4071fed1ef9a5c93ddd358ab..ed3ec53f11cf2be94b82a779d89e8d4b7819172f 100644 index 7ad22703d50667849e195d3e7b6792078104425c..97ebd8d4bb8f0558d8b74782c810c5db0485d802 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1706,7 +1706,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1707,7 +1707,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Override @Override
public void sendSystemMessage(Component message) { public void sendSystemMessage(Component message) {

View File

@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index ed3ec53f11cf2be94b82a779d89e8d4b7819172f..3587d9a74ecd622789b16752ec87391ad7d68053 100644 index 97ebd8d4bb8f0558d8b74782c810c5db0485d802..fd9790dfd445481ed245b82255e05f5bc1459eae 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2148,7 +2148,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2149,7 +2149,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next(); ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)

View File

@ -275,10 +275,10 @@ index 13e5362e12eb857b0cc27277c95efe085e77348d..1619da8a904785e0cc00ddbcfba1c3fa
Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit Main.LOGGER.info("Forcing world upgrade! {}", session.getLevelId()); // CraftBukkit
WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache); WorldUpgrader worldupgrader = new WorldUpgrader(session, dataFixer, dimensionOptionsRegistry, eraseCache);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 3587d9a74ecd622789b16752ec87391ad7d68053..b9ef06e2ba2e9842a0b4d66976b703918f585752 100644 index fd9790dfd445481ed245b82255e05f5bc1459eae..027f49e9b42564b276a6dea7106e6ffbcc1e4d7f 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -553,11 +553,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -554,11 +554,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
worlddata = new PrimaryLevelData(worldsettings, worldoptions, worlddimensions_b.specialWorldProperty(), lifecycle); worlddata = new PrimaryLevelData(worldsettings, worldoptions, worlddimensions_b.specialWorldProperty(), lifecycle);
} }
worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end) worlddata.checkName(name); // CraftBukkit - Migration did not rewrite the level.dat; This forces 1.8 to take the last loaded world as respawn (in this case the end)
@ -291,7 +291,7 @@ index 3587d9a74ecd622789b16752ec87391ad7d68053..b9ef06e2ba2e9842a0b4d66976b70391
PrimaryLevelData iworlddataserver = worlddata; PrimaryLevelData iworlddataserver = worlddata;
boolean flag = worlddata.isDebugWorld(); boolean flag = worlddata.isDebugWorld();
@@ -572,6 +568,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -573,6 +569,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
biomeProvider = gen.getDefaultBiomeProvider(worldInfo); biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
} }

View File

@ -36,10 +36,10 @@ index b5f54ee82905e3e6ab5bfde35ab625f5feeb1393..c0a80824a0307ea673805015119cc834
public boolean shouldDisconnect() { public boolean shouldDisconnect() {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 1874354a04a1e7ad86f2c438c7526da94b9b9e6a..abd2ca040779e651ba01cbb6426b8c997303ccf3 100644 index 027f49e9b42564b276a6dea7106e6ffbcc1e4d7f..416bfdeb0ce8ec1828288a7d84990ed3f027e1fa 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2151,7 +2151,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2152,7 +2152,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerPlayer entityplayer = (ServerPlayer) iterator.next(); ServerPlayer entityplayer = (ServerPlayer) iterator.next();
if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420)
@ -491,7 +491,7 @@ index a24e7a66d52eddbdad8db71cf5e45f1a458c389f..e1c13ac7b11fb0080435fc34502208c8
} }
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 10656ace14424000b9a60ef4af1fd494a21ded33..8a0c0c9298f6505bca4d996621fc3899ee6123ae 100644 index 86276267f68d68c50184343186fd8d8867b1dc3f..d79c2ce6acc9a5b1239349ad5e1438cb035a9401 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -600,7 +600,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -600,7 +600,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {

View File

@ -19,10 +19,10 @@ index 23e564b05ba438924180c91f9b19a60731eedd1b..5ec241d49ff5e3a161a39006f05823a5
private MinecraftTimings() {} private MinecraftTimings() {}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 4c61e7c5e38f6d1e4e1301a5d65b57c19a3b3a58..0b8ec2790fda4df9f3d42449c319ff3ca1480418 100644 index 416bfdeb0ce8ec1828288a7d84990ed3f027e1fa..24c88555ea85dd2a0656e1f67a4828a5137157b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1305,6 +1305,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1306,6 +1306,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private boolean pollTaskInternal() { private boolean pollTaskInternal() {
if (super.pollTask()) { if (super.pollTask()) {
@ -30,7 +30,7 @@ index 4c61e7c5e38f6d1e4e1301a5d65b57c19a3b3a58..0b8ec2790fda4df9f3d42449c319ff3c
return true; return true;
} else { } else {
if (this.haveTime()) { if (this.haveTime()) {
@@ -2712,4 +2713,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2715,4 +2716,74 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
} }
// Paper end // Paper end

View File

@ -5,10 +5,10 @@ Subject: [PATCH] Expose vanilla BiomeProvider from WorldInfo
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 87e5959a495eaccf3e6ec1102fb8a3f3edcc0cfe..b5967ac7772d1bc0768a816820375d80e249bf8f 100644 index 24c88555ea85dd2a0656e1f67a4828a5137157b8..cbbb0ff40488c430d15c2ed054d1b2880c9e92b7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -563,7 +563,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -564,7 +564,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver)); List<CustomSpawner> list = ImmutableList.of(new PhantomSpawner(), new PatrolSpawner(), new CatSpawner(), new VillageSiege(), new WanderingTraderSpawner(iworlddataserver));
LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey); LevelStem worlddimension = (LevelStem) dimensions.get(dimensionKey);
@ -18,7 +18,7 @@ index 87e5959a495eaccf3e6ec1102fb8a3f3edcc0cfe..b5967ac7772d1bc0768a816820375d80
biomeProvider = gen.getDefaultBiomeProvider(worldInfo); biomeProvider = gen.getDefaultBiomeProvider(worldInfo);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1e54fc63253a12f2dbc248965d0027e526a3cc86..39c0300d84e44d499b26ea365fc2e038fda58196 100644 index 8543dd8e933364befa5d29f80f53408a2cd2606b..532ea1dd6548264f4ccc639d7cccab39a851a1ad 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1217,7 +1217,7 @@ public final class CraftServer implements Server { @@ -1217,7 +1217,7 @@ public final class CraftServer implements Server {
@ -31,7 +31,7 @@ index 1e54fc63253a12f2dbc248965d0027e526a3cc86..39c0300d84e44d499b26ea365fc2e038
biomeProvider = generator.getDefaultBiomeProvider(worldInfo); biomeProvider = generator.getDefaultBiomeProvider(worldInfo);
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 3ec2674a3ebc2540b9832e7bd3c99d5c1373f47d..5086fcbbd908f5759653ce44b8524345b479d2b8 100644 index e955b72d6a26224c39059fa56874b5e47384b5f4..8fcc553b6f1bf62fb9febb46402940039c37606a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -199,6 +199,30 @@ public class CraftWorld extends CraftRegionAccessor implements World {

View File

@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether,
for example. for example.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b5967ac7772d1bc0768a816820375d80e249bf8f..6e6cec6f6dd0c6e3504d43cbe73310e57f42eb31 100644 index cbbb0ff40488c430d15c2ed054d1b2880c9e92b7..c2ad62deea2a076aae53f17cbdacda1f5a92d2be 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1308,6 +1308,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1309,6 +1309,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
return true; return true;
} else { } else {
@ -20,7 +20,7 @@ index b5967ac7772d1bc0768a816820375d80e249bf8f..6e6cec6f6dd0c6e3504d43cbe73310e5
if (this.haveTime()) { if (this.haveTime()) {
Iterator iterator = this.getAllLevels().iterator(); Iterator iterator = this.getAllLevels().iterator();
@@ -1315,12 +1316,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1316,12 +1317,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
if (worldserver.getChunkSource().pollTask()) { if (worldserver.getChunkSource().pollTask()) {

View File

@ -10,10 +10,10 @@ just looking at the LevelStem key, look at the DimensionType key which
is one level below that. Defaults to off to keep vanilla behavior. is one level below that. Defaults to off to keep vanilla behavior.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6e6cec6f6dd0c6e3504d43cbe73310e57f42eb31..e3f1128bd1c3c179c9bab9b42d18f8376cc005ec 100644 index c2ad62deea2a076aae53f17cbdacda1f5a92d2be..23fce58a5909c5b01a5f0ef6912f90858cd3302c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -590,7 +590,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -591,7 +591,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.commandStorage = new CommandStorage(worldpersistentdata); this.commandStorage = new CommandStorage(worldpersistentdata);
} else { } else {
ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11); ChunkProgressListener worldloadlistener = this.progressListenerFactory.create(11);

View File

@ -7,10 +7,10 @@ Some parts of legacy conversion will need the overworld
to get the legacy structure data storage to get the legacy structure data storage
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e3f1128bd1c3c179c9bab9b42d18f8376cc005ec..8a51927582713a36d5cc6da9e3dae7b661c49b9b 100644 index 23fce58a5909c5b01a5f0ef6912f90858cd3302c..a30c61e176501d1cbd2e330f85d5d258cc030180 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -602,9 +602,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -603,9 +603,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} }
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified()); worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
@ -23,7 +23,7 @@ index e3f1128bd1c3c179c9bab9b42d18f8376cc005ec..8a51927582713a36d5cc6da9e3dae7b6
if (worlddata.getCustomBossEvents() != null) { if (worlddata.getCustomBossEvents() != null) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 70cbdf557b81f9e7e5d744c31ea6972f96de55a3..48ff69f581256a7b5dd210781bf8f519c349030b 100644 index 4e8c8d5c40f50899517de585696e5a27ce69de1d..dc460b30c46e33fb0303d5f18d2f80a93a2ca916 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1246,10 +1246,11 @@ public final class CraftServer implements Server { @@ -1246,10 +1246,11 @@ public final class CraftServer implements Server {

View File

@ -24,10 +24,10 @@ index 0000000000000000000000000000000000000000..6b0bed550763f34e18c9e92f9a47ec0c
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e0a5b8d736446430433f95ade24a35e47fca889e..a212955bc8aafa1232a11ae2aa7d5fc84b9f9691 100644 index a30c61e176501d1cbd2e330f85d5d258cc030180..3e59620c84b3aa93d8ce41b0e9901a1621bb48df 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -2058,6 +2058,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -2059,6 +2059,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.worldData.setDataConfiguration(worlddataconfiguration); this.worldData.setDataConfiguration(worlddataconfiguration);
this.resources.managers.updateRegistryTags(this.registryAccess()); this.resources.managers.updateRegistryTags(this.registryAccess());

View File

@ -7,10 +7,10 @@ There are no plans to support creating worlds while worlds are
being ticked themselvess. being ticked themselvess.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 0182d477dde8ed54bb6b0093a5040f38441231b4..ecef0b8e3908544a46ecd8e1df6a2b2f56f0d78d 100644 index 3e59620c84b3aa93d8ce41b0e9901a1621bb48df..682005e4b19ba3959d4e3a66475487daf534a003 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -311,6 +311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -312,6 +312,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public volatile Thread shutdownThread; // Paper public volatile Thread shutdownThread; // Paper
public volatile boolean abnormalExit = false; // Paper public volatile boolean abnormalExit = false; // Paper
@ -18,7 +18,7 @@ index 0182d477dde8ed54bb6b0093a5040f38441231b4..ecef0b8e3908544a46ecd8e1df6a2b2f
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
AtomicReference<S> atomicreference = new AtomicReference(); AtomicReference<S> atomicreference = new AtomicReference();
@@ -1485,7 +1486,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1486,7 +1487,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.getFunctions().tick(); this.getFunctions().tick();
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
this.profiler.popPush("levels"); this.profiler.popPush("levels");
@ -27,7 +27,7 @@ index 0182d477dde8ed54bb6b0093a5040f38441231b4..ecef0b8e3908544a46ecd8e1df6a2b2f
// CraftBukkit start // CraftBukkit start
// Run tasks that are waiting on processing // Run tasks that are waiting on processing
@@ -1517,6 +1518,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1518,6 +1519,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper end // Paper end
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
@ -36,7 +36,7 @@ index 0182d477dde8ed54bb6b0093a5040f38441231b4..ecef0b8e3908544a46ecd8e1df6a2b2f
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
@@ -1563,6 +1566,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1564,6 +1567,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.profiler.pop(); this.profiler.pop();
worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions
} }

View File

@ -37,10 +37,10 @@ index 0000000000000000000000000000000000000000..c1d3bac79bb8b4796c013ff4472f75dc
+ } + }
+} +}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 9f6ae28c7d10d67d73745c535c976954bcf61c11..674e76968e05c487e5271f76b45ba2d13b1412a0 100644 index 682005e4b19ba3959d4e3a66475487daf534a003..fbc06f45926e9073c95c97423f92a213898fcd48 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1000,6 +1000,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1001,6 +1001,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender net.minecrell.terminalconsole.TerminalConsoleAppender.close(); // Paper - Use TerminalConsoleAppender
} catch (Exception e) { } catch (Exception e) {
} }
@ -49,7 +49,7 @@ index 9f6ae28c7d10d67d73745c535c976954bcf61c11..674e76968e05c487e5271f76b45ba2d1
// Paper end // Paper end
} }
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index e7b088a6ffed52d2dc9d6528d827997d68fcc84c..d51650d3e37eb76a0cf991e95d28a552aa567af9 100644 index 75a37fe0b97311ee64fb0ea87b9574879d67e8d3..4966a1e3dd35357a8ea6a7d2944c84c9c3e9058e 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -18,6 +18,12 @@ public class Main { @@ -18,6 +18,12 @@ public class Main {

View File

@ -13,10 +13,10 @@ Subject: [PATCH] Optimize Hoppers
* Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins) * Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins)
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 2e2cc6647a4c5acc8495b1c7ad6df3a49c94ac6d..4450d825a5474da211f0e83f845d8c7129fa08aa 100644 index fbc06f45926e9073c95c97423f92a213898fcd48..9f15d9dbdfa74a0640b1a2b4ff695609d4758a4c 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1524,6 +1524,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -1525,6 +1525,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
while (iterator.hasNext()) { while (iterator.hasNext()) {
ServerLevel worldserver = (ServerLevel) iterator.next(); ServerLevel worldserver = (ServerLevel) iterator.next();
worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper