|
|
|
@ -11691,10 +11691,10 @@ index d2f0a0755317f5fa9a1ccf7db346aa77fd287d80..b07df826a3028c14b48b09dbaeccc907
|
|
|
|
|
// CraftBukkit start - SPIGOT-5477, MC-142590
|
|
|
|
|
} else if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) {
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2be06fd587 100644
|
|
|
|
|
index 3219482b96cab8262e393a790c88d903d7de5166..f5977082a31d44088ab5ba31fad88e823cfe56e0 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
|
|
|
|
@@ -294,7 +294,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -295,7 +295,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public org.bukkit.command.ConsoleCommandSender console;
|
|
|
|
|
public org.bukkit.command.RemoteConsoleCommandSender remoteConsole;
|
|
|
|
|
//public ConsoleReader reader; // Paper
|
|
|
|
@ -11703,7 +11703,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
public java.util.Queue<Runnable> processQueue = new java.util.concurrent.ConcurrentLinkedQueue<Runnable>();
|
|
|
|
|
public int autosavePeriod;
|
|
|
|
|
public Commands vanillaCommandDispatcher;
|
|
|
|
|
@@ -307,12 +307,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -308,12 +308,40 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
public final double[] recentTps = new double[ 3 ];
|
|
|
|
|
// Spigot end
|
|
|
|
|
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations;
|
|
|
|
@ -11745,7 +11745,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) {
|
|
|
|
|
AtomicReference<S> atomicreference = new AtomicReference();
|
|
|
|
|
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
|
|
|
|
@@ -604,7 +632,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -605,7 +633,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
worlddata.setModdedInfo(this.getServerModName(), this.getModdedStatus().shouldReportAsModified());
|
|
|
|
|
this.addLevel(world); // Paper - move up
|
|
|
|
@ -11768,7 +11768,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
|
|
|
|
|
// Paper - move up
|
|
|
|
|
this.getPlayerList().addWorldborderListener(world);
|
|
|
|
|
@@ -616,6 +658,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -617,6 +659,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.forceDifficulty();
|
|
|
|
|
for (ServerLevel worldserver : this.getAllLevels()) {
|
|
|
|
|
this.prepareLevels(worldserver.getChunkSource().chunkMap.progressListener, worldserver);
|
|
|
|
@ -11776,7 +11776,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
//worldserver.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API // Paper - rewrite chunk system, not required to "tick" anything
|
|
|
|
|
this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld()));
|
|
|
|
|
}
|
|
|
|
|
@@ -683,7 +726,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -684,7 +727,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
worldProperties.setSpawn(BlockPos.ZERO.above(80), 0.0F);
|
|
|
|
|
} else {
|
|
|
|
|
ServerChunkCache chunkproviderserver = world.getChunkSource();
|
|
|
|
@ -11785,7 +11785,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
if (world.generator != null) {
|
|
|
|
|
Random rand = new Random(world.getSeed());
|
|
|
|
|
@@ -704,6 +747,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -705,6 +748,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
if (i < world.getMinBuildHeight()) {
|
|
|
|
|
BlockPos blockposition = chunkcoordintpair.getWorldPosition();
|
|
|
|
|
|
|
|
|
@ -11793,7 +11793,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
i = world.getHeight(Heightmap.Types.WORLD_SURFACE, blockposition.getX() + 8, blockposition.getZ() + 8);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -785,7 +829,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -786,7 +830,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
|
|
// this.nextTickTime = SystemUtils.getMillis() + 10L;
|
|
|
|
@ -11802,7 +11802,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// Iterator iterator = this.levels.values().iterator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -808,7 +852,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -809,7 +853,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
// this.nextTickTime = SystemUtils.getMillis() + 10L;
|
|
|
|
@ -11811,7 +11811,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
if (worldserver.getWorld().getKeepSpawnInMemory()) worldloadlistener.stop(); // Paper
|
|
|
|
|
chunkproviderserver.getLightEngine().setTaskPerBatch(worldserver.paperConfig().misc.lightQueueSize); // Paper - increase light queue size
|
|
|
|
|
@@ -913,7 +957,37 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -914,7 +958,37 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
@ -11849,7 +11849,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// CraftBukkit start - prevent double stopping on multiple threads
|
|
|
|
|
synchronized(this.stopLock) {
|
|
|
|
|
if (this.hasStopped) return;
|
|
|
|
|
@@ -923,7 +997,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -924,7 +998,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper start - kill main thread, and kill it hard
|
|
|
|
|
shutdownThread = Thread.currentThread();
|
|
|
|
|
org.spigotmc.WatchdogThread.doStop(); // Paper
|
|
|
|
@ -11858,7 +11858,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
|
|
|
|
|
while (this.getRunningThread().isAlive()) {
|
|
|
|
|
this.getRunningThread().stop();
|
|
|
|
|
@@ -953,12 +1027,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -954,12 +1028,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
this.isSaving = true;
|
|
|
|
|
if (this.playerList != null) {
|
|
|
|
@ -11880,7 +11880,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
MinecraftServer.LOGGER.info("Saving worlds");
|
|
|
|
|
Iterator iterator = this.getAllLevels().iterator();
|
|
|
|
|
|
|
|
|
|
@@ -974,6 +1055,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -975,6 +1056,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.saveAllChunks(false, true, false, true); // Paper - rewrite chunk system - move closing into here
|
|
|
|
|
|
|
|
|
|
this.isSaving = false;
|
|
|
|
@ -11892,7 +11892,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.resources.close();
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
@@ -1027,6 +1113,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1028,6 +1114,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
if (isDebugging()) io.papermc.paper.util.TraceUtil.dumpTraceForThread("Server stopped"); // Paper
|
|
|
|
|
// Paper end
|
|
|
|
|
this.running = false;
|
|
|
|
@ -11900,7 +11900,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
if (waitForShutdown) {
|
|
|
|
|
try {
|
|
|
|
|
this.serverThread.join();
|
|
|
|
|
@@ -1108,6 +1195,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1109,6 +1196,19 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.statusIcon = (ServerStatus.Favicon) this.loadStatusIcon().orElse(null); // CraftBukkit - decompile error
|
|
|
|
|
this.status = this.buildServerStatus();
|
|
|
|
|
|
|
|
|
@ -11920,7 +11920,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// Spigot start
|
|
|
|
|
// Paper start - move done tracking
|
|
|
|
|
LOGGER.info("Running delayed init tasks");
|
|
|
|
|
@@ -1143,8 +1243,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1144,8 +1244,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.lastOverloadWarning = this.nextTickTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -11931,7 +11931,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
{
|
|
|
|
|
final long diff = curTime - tickSection;
|
|
|
|
|
java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
|
|
|
|
|
@@ -1170,7 +1270,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1171,7 +1271,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.nextTickTime += 50L;
|
|
|
|
|
this.startMetricsRecordingTick();
|
|
|
|
|
this.profiler.push("tick");
|
|
|
|
@ -11940,7 +11940,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.profiler.popPush("nextTickWait");
|
|
|
|
|
this.mayHaveDelayedTasks = true;
|
|
|
|
|
this.delayedTasksMaxNextTickTime = Math.max(Util.getMillis() + 50L, this.nextTickTime);
|
|
|
|
|
@@ -1308,6 +1408,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1309,6 +1409,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean pollTask() {
|
|
|
|
@ -11948,7 +11948,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
boolean flag = this.pollTaskInternal();
|
|
|
|
|
|
|
|
|
|
this.mayHaveDelayedTasks = flag;
|
|
|
|
|
@@ -1315,6 +1416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1316,6 +1417,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean pollTaskInternal() {
|
|
|
|
@ -11956,7 +11956,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
if (super.pollTask()) {
|
|
|
|
|
this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick
|
|
|
|
|
return true;
|
|
|
|
|
@@ -1337,6 +1439,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1338,6 +1440,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
|
|
|
|
@ -11964,7 +11964,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.getProfiler().incrementCounter("runTask");
|
|
|
|
|
super.doRunTask(ticktask);
|
|
|
|
|
}
|
|
|
|
|
@@ -1379,22 +1482,64 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1380,22 +1483,64 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
public void onServerExit() {}
|
|
|
|
|
|
|
|
|
@ -12034,7 +12034,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.lastServerStatus = i;
|
|
|
|
|
this.status = this.buildServerStatus();
|
|
|
|
|
}
|
|
|
|
|
@@ -1411,9 +1556,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1412,9 +1557,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
if (playerSaveInterval > 0) {
|
|
|
|
|
this.playerList.saveAll(playerSaveInterval);
|
|
|
|
|
}
|
|
|
|
@ -12046,7 +12046,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
@@ -1423,16 +1568,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1424,16 +1569,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end
|
|
|
|
|
io.papermc.paper.util.CachedLists.reset(); // Paper
|
|
|
|
|
// Paper start - move executeAll() into full server tick timing
|
|
|
|
@ -12067,7 +12067,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
long j = this.tickTimes[this.tickCount % 100] = Util.getNanos() - i;
|
|
|
|
|
|
|
|
|
|
this.averageTickTime = this.averageTickTime * 0.8F + (float) j / 1000000.0F * 0.19999999F;
|
|
|
|
|
@@ -1444,11 +1590,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1445,11 +1591,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
tickTimes60s.add(this.tickCount, j);
|
|
|
|
|
// Paper end
|
|
|
|
|
this.frameTimer.logFrameDuration(k - i);
|
|
|
|
@ -12086,7 +12086,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
private ServerStatus buildServerStatus() {
|
|
|
|
|
ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus();
|
|
|
|
|
|
|
|
|
|
@@ -1456,7 +1609,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1457,7 +1610,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private ServerStatus.Players buildPlayerStatus() {
|
|
|
|
@ -12095,7 +12095,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
int i = this.getMaxPlayers();
|
|
|
|
|
|
|
|
|
|
if (this.hidesOnlinePlayers()) {
|
|
|
|
|
@@ -1477,14 +1630,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1478,14 +1631,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -12114,7 +12114,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper
|
|
|
|
|
this.profiler.popPush("levels");
|
|
|
|
|
//Iterator iterator = this.getAllLevels().iterator(); // Paper - moved down
|
|
|
|
|
@@ -1492,7 +1645,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1493,7 +1646,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
// Run tasks that are waiting on processing
|
|
|
|
|
MinecraftTimings.processQueueTimer.startTiming(); // Spigot
|
|
|
|
@ -12123,7 +12123,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.processQueue.remove().run();
|
|
|
|
|
}
|
|
|
|
|
MinecraftTimings.processQueueTimer.stopTiming(); // Spigot
|
|
|
|
|
@@ -1500,13 +1653,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1501,13 +1654,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
|
|
|
|
|
// Send time updates to everyone, it will get the right time from the world the player is in.
|
|
|
|
|
// Paper start - optimize time updates
|
|
|
|
@ -12140,7 +12140,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
ServerPlayer entityplayer = (ServerPlayer) entityhuman;
|
|
|
|
|
@@ -1519,13 +1672,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1520,13 +1673,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
// Paper end
|
|
|
|
|
MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
|
|
|
|
|
|
|
|
|
@ -12157,7 +12157,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
|
|
|
|
|
this.profiler.push(() -> {
|
|
|
|
|
return worldserver + " " + worldserver.dimension().location();
|
|
|
|
|
@@ -1542,7 +1693,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1543,7 +1694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
worldserver.timings.doTick.startTiming(); // Spigot
|
|
|
|
@ -12166,7 +12166,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// Paper start
|
|
|
|
|
for (final io.papermc.paper.chunk.SingleThreadChunkRegionManager regionManager : worldserver.getChunkSource().chunkMap.regionManagers) {
|
|
|
|
|
regionManager.recalculateRegions();
|
|
|
|
|
@@ -1566,17 +1717,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1567,17 +1718,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
this.profiler.pop();
|
|
|
|
|
this.profiler.pop();
|
|
|
|
@ -12188,7 +12188,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
|
|
|
|
|
if (SharedConstants.IS_RUNNING_IN_IDE) {
|
|
|
|
|
GameTestTicker.SINGLETON.tick();
|
|
|
|
|
@@ -1585,7 +1736,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1586,7 +1737,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
this.profiler.popPush("server gui refresh");
|
|
|
|
|
|
|
|
|
|
MinecraftTimings.tickablesTimer.startTiming(); // Spigot // Paper
|
|
|
|
@ -12197,7 +12197,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
((Runnable) this.tickables.get(i)).run();
|
|
|
|
|
}
|
|
|
|
|
MinecraftTimings.tickablesTimer.stopTiming(); // Spigot // Paper
|
|
|
|
|
@@ -1976,6 +2127,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1977,6 +2128,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void invalidateStatus() {
|
|
|
|
@ -12213,7 +12213,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
this.lastServerStatus = 0L;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1990,6 +2150,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -1991,6 +2151,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void executeIfPossible(Runnable runnable) {
|
|
|
|
@ -12221,7 +12221,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
if (this.isStopped()) {
|
|
|
|
|
throw new RejectedExecutionException("Server already shutting down");
|
|
|
|
|
} else {
|
|
|
|
|
@@ -2737,33 +2898,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2740,33 +2901,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
|
|
|
|
|
static final long TASK_EXECUTION_FAILURE_BACKOFF = 5L * 1000L; // 5us
|
|
|
|
|
|
|
|
|
@ -12261,7 +12261,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
// it's shown to be bad to constantly hit the queue (chunk loads slow to a crawl), even if no tasks are executed.
|
|
|
|
|
// so, backoff to prevent this
|
|
|
|
|
return;
|
|
|
|
|
@@ -2772,13 +2918,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2775,13 +2921,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
co.aikar.timings.MinecraftTimings.midTickChunkTasks.startTiming();
|
|
|
|
|
try {
|
|
|
|
|
for (;;) {
|
|
|
|
@ -12277,7 +12277,7 @@ index 8ccc92836bfda8e00eea649430174dcd5664af70..26350a185cadbb64696b2a1ac88b1a2b
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// note: negative values reduce the time
|
|
|
|
|
@@ -2791,7 +2937,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
@@ -2794,7 +2940,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
|
|
|
|
double overuseCount = (double)overuse/(double)MAX_CHUNK_EXEC_TIME;
|
|
|
|
|
long extraSleep = (long)Math.round(overuseCount*CHUNK_TASK_QUEUE_BACKOFF_MIN_TIME);
|
|
|
|
|
|
|
|
|
@ -15889,10 +15889,10 @@ index bf1a77cf9bbea4e2104b2a8c61309e740f28d51b..acc8af33ad8534d812908b0feb9a1963
|
|
|
|
|
for (ServerPlayer player : ServerLevel.this.players) {
|
|
|
|
|
player.getBukkitEntity().onEntityRemove(entity);
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954ee22baf9c 100644
|
|
|
|
|
index 4231c3fe14a621d237bdc3d56c593f0adc0a7bc6..7935fccf078ba92b3bafde7eb3cd146f57af37c2 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
|
|
|
|
@@ -187,7 +187,7 @@ import org.bukkit.inventory.MainHand;
|
|
|
|
|
@@ -188,7 +188,7 @@ import org.bukkit.inventory.MainHand;
|
|
|
|
|
public class ServerPlayer extends Player {
|
|
|
|
|
|
|
|
|
|
private static final Logger LOGGER = LogUtils.getLogger();
|
|
|
|
@ -15901,7 +15901,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_XZ = 32;
|
|
|
|
|
private static final int NEUTRAL_MOB_DEATH_NOTIFICATION_RADII_Y = 10;
|
|
|
|
|
public ServerGamePacketListenerImpl connection;
|
|
|
|
|
@@ -248,11 +248,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -249,11 +249,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
public boolean queueHealthUpdatePacket = false;
|
|
|
|
|
public net.minecraft.network.protocol.game.ClientboundSetHealthPacket queuedHealthUpdatePacket;
|
|
|
|
|
// Paper end
|
|
|
|
@ -15914,7 +15914,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
public String displayName;
|
|
|
|
|
@@ -414,7 +410,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -415,7 +411,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
this.adventure$displayName = net.kyori.adventure.text.Component.text(this.getScoreboardName()); // Paper
|
|
|
|
|
this.bukkitPickUpLoot = true;
|
|
|
|
|
this.maxHealthCache = this.getMaxHealth();
|
|
|
|
@ -15923,7 +15923,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Yes, this doesn't match Vanilla, but it's the best we can do for now.
|
|
|
|
|
@@ -456,11 +452,11 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -457,11 +453,11 @@ public class ServerPlayer extends Player {
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
|
|
|
|
@ -15938,7 +15938,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
int j = Mth.floor(world.getWorldBorder().getDistanceToBorder((double) blockposition.getX(), (double) blockposition.getZ()));
|
|
|
|
|
|
|
|
|
|
if (j < i) {
|
|
|
|
|
@@ -474,33 +470,76 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -475,33 +471,76 @@ public class ServerPlayer extends Player {
|
|
|
|
|
long k = (long) (i * 2 + 1);
|
|
|
|
|
long l = k * k;
|
|
|
|
|
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
|
|
|
|
@ -16034,7 +16034,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
return horizontalSpawnArea <= 16 ? horizontalSpawnArea - 1 : 17;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -1159,6 +1198,343 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1160,6 +1199,343 @@ public class ServerPlayer extends Player {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -16378,7 +16378,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
@Nullable
|
|
|
|
|
@Override
|
|
|
|
|
public Entity changeDimension(ServerLevel destination) {
|
|
|
|
|
@@ -1168,6 +1544,11 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -1169,6 +1545,11 @@ public class ServerPlayer extends Player {
|
|
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
|
public Entity changeDimension(ServerLevel worldserver, PlayerTeleportEvent.TeleportCause cause) {
|
|
|
|
@ -16390,7 +16390,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
if (this.isSleeping()) return this; // CraftBukkit - SPIGOT-3154
|
|
|
|
|
// this.isChangingDimension = true; // CraftBukkit - Moved down and into PlayerList#changeDimension
|
|
|
|
|
@@ -2098,6 +2479,12 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -2109,6 +2490,12 @@ public class ServerPlayer extends Player {
|
|
|
|
|
public void setCamera(@Nullable Entity entity) {
|
|
|
|
|
Entity entity1 = this.getCamera();
|
|
|
|
|
|
|
|
|
@ -16403,7 +16403,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
this.camera = (Entity) (entity == null ? this : entity);
|
|
|
|
|
if (entity1 != this.camera) {
|
|
|
|
|
// Paper start - Add PlayerStartSpectatingEntityEvent and PlayerStopSpectatingEntity Event
|
|
|
|
|
@@ -2559,7 +2946,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
@@ -2570,7 +2957,7 @@ public class ServerPlayer extends Player {
|
|
|
|
|
this.experienceLevel = this.newLevel;
|
|
|
|
|
this.totalExperience = this.newTotalExp;
|
|
|
|
|
this.experienceProgress = 0;
|
|
|
|
@ -16413,7 +16413,7 @@ index a3cef477646abf6172d4e50a28ed30f04c30d667..d2ba72653cad27380600f0e013d0954e
|
|
|
|
|
this.removeAllEffects(org.bukkit.event.entity.EntityPotionEffectEvent.Cause.DEATH);
|
|
|
|
|
this.effectsDirty = true;
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a34f448a2 100644
|
|
|
|
|
index 1d33c02088c150189d7f4b0aa27f6a1de96b11cf..59a9a9633ac924c606564b75298fae22f1ffd4ec 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
|
|
|
|
@@ -123,11 +123,11 @@ public class ServerPlayerGameMode {
|
|
|
|
@ -16439,7 +16439,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a
|
|
|
|
|
if (iblockdata == null) {
|
|
|
|
|
this.isDestroyingBlock = false;
|
|
|
|
|
return;
|
|
|
|
|
@@ -408,7 +408,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -416,7 +416,7 @@ public class ServerPlayerGameMode {
|
|
|
|
|
} else {
|
|
|
|
|
// CraftBukkit start
|
|
|
|
|
org.bukkit.block.BlockState state = bblock.getState();
|
|
|
|
@ -16448,7 +16448,7 @@ index 0a3eb5e929c605d9eb7369de8ade8b49951f5d37..6b7b44ad8cb7ece5cfbf69bc54ed589a
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
block.playerWillDestroy(this.level, pos, iblockdata, this.player);
|
|
|
|
|
boolean flag = this.level.removeBlock(pos, false);
|
|
|
|
|
@@ -436,8 +436,8 @@ public class ServerPlayerGameMode {
|
|
|
|
|
@@ -444,8 +444,8 @@ public class ServerPlayerGameMode {
|
|
|
|
|
// return true; // CraftBukkit
|
|
|
|
|
}
|
|
|
|
|
// CraftBukkit start
|
|
|
|
@ -17710,7 +17710,7 @@ index 93a1e990b0a6caae4143c2f9d09bfb368fa1d6db..ad3166481dd37f4b5380f8bf28653bb4
|
|
|
|
|
|
|
|
|
|
itemstack = entityliving2.getMainHandItem();
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191405ee7bb 100644
|
|
|
|
|
index 4705d7066207250c03a5f98eef61554c901f2e35..17b3c16008d801fa61cb3e7d89f31a4e0c166ac7 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
|
|
|
@@ -165,7 +165,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
@ -18657,7 +18657,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
|
|
|
|
|
// CraftBukkit end
|
|
|
|
|
// Paper start - fix bad state entities causing dupes
|
|
|
|
|
if (!isAlive() || !valid) {
|
|
|
|
|
@@ -3904,17 +4680,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -3910,17 +4686,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
|
|
|
|
|
// Paper start
|
|
|
|
|
public void startSeenByPlayer(ServerPlayer player) {
|
|
|
|
@ -18677,7 +18677,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
|
|
@@ -4405,7 +5177,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4411,7 +5183,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Paper end - fix MC-4
|
|
|
|
@ -18687,7 +18687,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
|
|
|
|
|
synchronized (this.posLock) { // Paper
|
|
|
|
|
this.position = new Vec3(x, y, z);
|
|
|
|
|
} // Paper
|
|
|
|
|
@@ -4426,7 +5199,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4432,7 +5205,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
|
|
|
|
|
// Paper start - never allow AABB to become desynced from position
|
|
|
|
|
// hanging has its own special logic
|
|
|
|
@ -18696,7 +18696,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
|
|
|
|
|
this.setBoundingBox(this.makeBoundingBox());
|
|
|
|
|
}
|
|
|
|
|
// Paper end
|
|
|
|
|
@@ -4513,6 +5286,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4519,6 +5292,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
return this.removalReason != null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -18709,7 +18709,7 @@ index 9a1e8589e6b371869b2199650172d61ae186c907..f038f6d4e9fc4b76d5774fc637171191
|
|
|
|
|
@Nullable
|
|
|
|
|
public Entity.RemovalReason getRemovalReason() {
|
|
|
|
|
return this.removalReason;
|
|
|
|
|
@@ -4537,7 +5316,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
@@ -4543,7 +5322,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
|
|
|
|
|
|
|
|
|
if (reason != RemovalReason.UNLOADED_TO_CHUNK) this.getPassengers().forEach(Entity::stopRiding); // Paper - chunk system - don't adjust passenger state when unloading, it's just not safe (and messes with our logic in entity chunk unload)
|
|
|
|
|
this.levelCallback.onRemove(reason);
|
|
|
|
@ -19492,7 +19492,7 @@ index 6023b9eb3001e1a98ab8b970d853c4e7c7603f4d..0d16b7ea1e2c7d430b09721d50ea199a
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
|
|
|
|
index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba8566547e5766af 100644
|
|
|
|
|
index 5d199fe497bd852827d3d18fb7566a09e70331a3..db6139c04ce9a1bc17e4305f5644c0e1ff9bf02e 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
|
|
|
|
|
@@ -32,16 +32,14 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
@ -19515,7 +19515,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
|
|
|
|
|
//this.spawnDelay = properties.getWanderingTraderSpawnDelay(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value
|
|
|
|
|
//this.spawnChance = properties.getWanderingTraderSpawnChance(); // Paper - This value is read from the world file only for the first spawn, after which vanilla uses a hardcoded value
|
|
|
|
|
//if (this.spawnDelay == 0 && this.spawnChance == 0) {
|
|
|
|
|
@@ -56,37 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
@@ -56,36 +54,37 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) {
|
|
|
|
@ -19555,10 +19555,9 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
|
|
|
|
|
- int i = this.spawnChance;
|
|
|
|
|
+ int i = worldData.wanderingTraderSpawnChance; // Folia - region threading
|
|
|
|
|
|
|
|
|
|
- this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance);
|
|
|
|
|
// this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways
|
|
|
|
|
- this.spawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax);
|
|
|
|
|
+ worldData.wanderingTraderSpawnChance = Mth.clamp(i + world.paperConfig().entities.spawning.wanderingTrader.spawnChanceFailureIncrement, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMin, world.paperConfig().entities.spawning.wanderingTrader.spawnChanceMax); // Folia - region threading
|
|
|
|
|
//this.serverLevelData.setWanderingTraderSpawnChance(this.spawnChance); // Paper - We don't need to save this value to disk if it gets set back to a hardcoded value anyways
|
|
|
|
|
if (this.random.nextInt(100) > i) {
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (this.spawn(world)) {
|
|
|
|
@ -19567,7 +19566,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
|
|
|
|
|
// Paper end
|
|
|
|
|
return 1;
|
|
|
|
|
} else {
|
|
|
|
|
@@ -98,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
@@ -97,7 +96,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private boolean spawn(ServerLevel world) {
|
|
|
|
@ -19576,7 +19575,7 @@ index ae9f9112ce9bec82e7571f679017f1723d9eb982..509718d30800f94ea7d3233aba856654
|
|
|
|
|
|
|
|
|
|
if (entityplayer == null) {
|
|
|
|
|
return true;
|
|
|
|
|
@@ -128,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
@@ -127,7 +126,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
|
|
|
|
|
this.tryToSpawnLlamaFor(world, entityvillagertrader, 4);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -20082,7 +20081,7 @@ index d7a0cbde8f8c99276307502674c71463fbe7e89c..2a501b3fa8d69f627b279fd035fd2cb1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5b2aaa3f0 100644
|
|
|
|
|
index d690b8d0c1da1f56b226376df8c76c34375e3c73..6e6f73d50725057bc713bc6ae3a31b77ee97d415 100644
|
|
|
|
|
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
|
|
|
|
@@ -334,6 +334,7 @@ public final class ItemStack {
|
|
|
|
@ -20131,7 +20130,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
|
|
|
|
|
StructureGrowEvent structureEvent = null;
|
|
|
|
|
if (treeType != null) {
|
|
|
|
|
boolean isBonemeal = this.getItem() == Items.BONE_MEAL;
|
|
|
|
|
@@ -393,12 +395,12 @@ public final class ItemStack {
|
|
|
|
|
@@ -394,12 +396,12 @@ public final class ItemStack {
|
|
|
|
|
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
|
|
|
|
|
return enuminteractionresult;
|
|
|
|
|
}
|
|
|
|
@ -20147,7 +20146,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
|
|
|
|
|
if (blocks.size() > 1) {
|
|
|
|
|
placeEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callBlockMultiPlaceEvent(world, entityhuman, enumhand, blocks, blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
|
|
|
|
} else if (blocks.size() == 1 && item != Items.POWDER_SNOW_BUCKET) { // Paper - don't call event twice for snow buckets
|
|
|
|
|
@@ -409,13 +411,13 @@ public final class ItemStack {
|
|
|
|
|
@@ -410,13 +412,13 @@ public final class ItemStack {
|
|
|
|
|
enuminteractionresult = InteractionResult.FAIL; // cancel placement
|
|
|
|
|
// PAIL: Remove this when MC-99075 fixed
|
|
|
|
|
placeEvent.getPlayer().updateInventory();
|
|
|
|
@ -20164,7 +20163,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
|
|
|
|
|
|
|
|
|
|
// Brute force all possible updates
|
|
|
|
|
BlockPos placedPos = ((CraftBlock) placeEvent.getBlock()).getPosition();
|
|
|
|
|
@@ -430,7 +432,7 @@ public final class ItemStack {
|
|
|
|
|
@@ -431,7 +433,7 @@ public final class ItemStack {
|
|
|
|
|
this.setCount(newCount);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -20173,7 +20172,7 @@ index a6253272205337b3b855679b3057c2519a807a4c..c867737f839598b996b58942017ff6f5
|
|
|
|
|
world.setBlockEntity(e.getValue());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -504,8 +506,8 @@ public final class ItemStack {
|
|
|
|
|
@@ -505,8 +507,8 @@ public final class ItemStack {
|
|
|
|
|
entityhuman.awardStat(Stats.ITEM_USED.get(item));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -23751,10 +23750,10 @@ index ff6559bf563f2fdcc0f2843d4f4aa24d7ddfb6db..2ead9af36c4d41c61b68a960ff17e258
|
|
|
|
|
if (chunk != null) addTicket(x, z); // Paper
|
|
|
|
|
ret.complete(chunk == null ? null : chunk.getBukkitChunk());
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
|
|
|
|
|
index fb6454cc64ebc549f61ad7d51efb16ef15f8384d..903408d4d8f9ce5c9566ec96312281ab15f16c2f 100644
|
|
|
|
|
index a3d5e319473e2f6316b3ef8edf719296e02d85a1..55abed5fdf8dc699ade5b25b1f1949417dbf7a69 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java
|
|
|
|
|
@@ -40,6 +40,7 @@ public final class CapturedBlockState extends CraftBlockState {
|
|
|
|
|
@@ -46,6 +46,7 @@ public final class CapturedBlockState extends CraftBlockState {
|
|
|
|
|
|
|
|
|
|
for (int k = 0; k < j; ++k) {
|
|
|
|
|
Bee entitybee = new Bee(EntityType.BEE, generatoraccessseed.getMinecraftWorld());
|
|
|
|
@ -24117,7 +24116,7 @@ index 57a0dbb23a32123d30c3b3572f4d129be9d97847..3f46d9398add0e97a2b8b072f66b48b0
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3c34f3fbe 100644
|
|
|
|
|
index fec408416aa63e1022802a644bb95131601f0c3b..c6e6ce4a077550e8e86995f18a4deda4b7b369eb 100644
|
|
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
|
@@ -564,7 +564,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
@ -24150,7 +24149,7 @@ index e769c1c2a99a13941124c7442d44a509e7859666..aac6d175e17b8419f7938c432a8fbbf3
|
|
|
|
|
if (entry != null) {
|
|
|
|
|
entry.removePlayer(this.getHandle());
|
|
|
|
|
}
|
|
|
|
|
@@ -1858,7 +1863,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
@@ -1863,7 +1868,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|
|
|
|
this.getHandle().connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(otherPlayer)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|