9
0
mirror of https://github.com/Dreeam-qwq/Gale.git synced 2025-12-21 07:49:22 +00:00

Updated Upstream (Paper)

This commit is contained in:
Dreeam
2024-01-27 17:28:39 -05:00
parent 469ba11801
commit 6ffb717c43
51 changed files with 349 additions and 361 deletions

View File

@@ -2,7 +2,7 @@ group=org.galemc.gale
version=1.20.4-R0.1-SNAPSHOT
mcVersion=1.20.4
paperRef=1c956abfbc3eac650ff9df99cd5918a8afba331b
paperRef=b3c81089ae26cc3ad2e7388c7b64457f3f83c98a
org.gradle.caching=true
org.gradle.parallel=true

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index ae61a39b25267b84fe0b8766e4b12d9b24b44ded..caa24af01ee57c8d1917818c1063d2fa75f1ae4a 100644
index 31aa6ef5fc2b3b88c72f5a15b8cc7a0e50c29f46..7b751fac9dcfab016f1ad7e799708110dd3c2724 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -1967,6 +1967,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2008,6 +2008,16 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
boolean listPlayer(@NotNull Player other);
// Paper end

View File

@@ -427,10 +427,10 @@ index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..e45e6b44b2a8f2cdae6e0048a812b921
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 712708f62fadb6698c4231f38deeb39bed91e529..bad84f8d6a9b4807af580efc3f082a6379962f9c 100644
index 90ae7e8c81f6a9ede8aeaeec3bf784023522cefc..8ad14057e891213d77c5bbd504e53c37ed045559 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -954,7 +954,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -952,7 +952,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
@@ -445,17 +445,17 @@ index 712708f62fadb6698c4231f38deeb39bed91e529..bad84f8d6a9b4807af580efc3f082a63
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
@@ -1852,7 +1858,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1855,7 +1861,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
- return "Paper"; // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Gale"; // Gale - branding changes - Gale > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
- return "Paper"; // Paper
+ return "Gale"; // Paper // Gale - branding changes
}
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index eb617d659c701e512aac8a1ff822c147b69d3a3b..2e6206bc868480cb1866e77421374c0b632e8c1d 100644
index 34cd96dba5f11e64d7c90f4246b513b0ea943aa6..e99f88383565a5498584a00d583d2a114dd087ed 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -264,7 +264,7 @@ import javax.annotation.Nullable; // Paper
@@ -468,10 +468,10 @@ index eb617d659c701e512aac8a1ff822c147b69d3a3b..2e6206bc868480cb1866e77421374c0b
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 700932b65e4fda560d684b0aa079bcee3923f73e..ddcc9f28cb9ca85e0875bacdfccb883cd1ce0aef 100644
index e85b9bb3f9c225d289a4959921970b9963881199..79192e3a0f27d48f35c0378b58e587212ed2c305 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
@@ -503,7 +503,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
@@ -481,7 +481,7 @@ index 700932b65e4fda560d684b0aa079bcee3923f73e..ddcc9f28cb9ca85e0875bacdfccb883c
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
index ec2396f0e5d62b10450eaa7239a8c5479638b3c3..8561bc5482574365d7cff3a4046afe11b00f6d1f 100644
index ca5312febcdd467889ad725c0263367bc5fe69f6..b1bd810d4a83086966da16f4b0327f67c794246a 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
@@ -482,7 +482,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
@@ -709,7 +709,7 @@ index 0000000000000000000000000000000000000000..3d674eca7d20202d8f811c5c3e3946a1
+
+}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..b50a626f85c19880789b1c9e7bbc3998323c2488 100644
index 9e638f72f180ff5ef63ec3dd6cf548c53f7bd4a5..7e3efdc59ce2c84403d0c2b77c1c48f3e28a28a2 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,20 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -736,7 +736,7 @@ index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..b50a626f85c19880789b1c9e7bbc3998
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -185,12 +191,18 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -184,12 +190,18 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
// Paper end
} else
{
@@ -754,10 +754,10 @@ index 40dcdf6885e99b26283a9ea2bd4d4bf6ec358e71..b50a626f85c19880789b1c9e7bbc3998
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Paper!):" ); // Paper
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Gale!):" ); // Paper // Gale - branding changes
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -206,7 +218,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
@@ -205,7 +217,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
WatchdogThread.dumpThread( thread, log );
}
} else {

View File

@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..1b9d997c31ab281ce9f4719f53b0ad78a430789d 100644
index 7620c72a4c243cbeea245203ce03a97cbfa7d922..29796a404e210f7864f4b33b3367e02531bca2a0 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -242,7 +242,10 @@ public class TimingsExport extends Thread {
@@ -240,7 +240,10 @@ public class TimingsExport extends Thread {
parent.put("config", createObject(
pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)),
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
@@ -28,7 +28,7 @@ index a2f71a6d1a9e98133dff6cd0f625da9435a8af14..1b9d997c31ab281ce9f4719f53b0ad78
));
new TimingsExport(listeners, parent, history).start();
@@ -283,7 +286,7 @@ public class TimingsExport extends Thread {
@@ -281,7 +284,7 @@ public class TimingsExport extends Thread {
return timingsCost;
}
@@ -188,7 +188,7 @@ index 8f23276796037d048eb114952891a01a40971b3e..ac9ceb54b894119cb30a22d37e035e2c
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index bad84f8d6a9b4807af580efc3f082a6379962f9c..7adffbc9e737354a2644a12bc9b067e57bec756a 100644
index 8ad14057e891213d77c5bbd504e53c37ed045559..a6c1bd3c37720ff692fb72c8648c3d2eb9247346 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -3,9 +3,6 @@ package net.minecraft.server;
@@ -233,9 +233,9 @@ index bad84f8d6a9b4807af580efc3f082a6379962f9c..7adffbc9e737354a2644a12bc9b067e5
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
+ public final GaleConfigurations galeConfigurations; // Gale - Gale configuration
public static long currentTickLong = 0L; // Paper - track current tick as a long
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
public volatile Thread shutdownThread; // Paper
@@ -414,6 +413,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -412,6 +411,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
@@ -288,7 +288,7 @@ index d89c624554ab08bd1b33a3f62b52aa57aaafb8b4..2f76d1be6b26e516d1ab13df8d05b1f5
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 00c47942a3690df565bd0ea76b8abbf2dc50c4e2..bb6246da25e756348d2dc0152d487f99054b5203 100644
index 6de6dad36203479677a29ad61e21bc369d4e5513..d994993057b042f95eb309eb9ba08f872d954cad 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -1,20 +1,15 @@
@@ -321,11 +321,11 @@ index 00c47942a3690df565bd0ea76b8abbf2dc50c4e2..bb6246da25e756348d2dc0152d487f99
+ galeConfigurations.initializeGlobalConfiguration(this.registryAccess());
+ galeConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
+ // Gale end - Gale configuration
// Paper start - convert old users earlier after PlayerList creation but before file load/save
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9b0b2510edb4984b0714244bbe513e077af7b455..ab0ab5574dc3a19b133262b9c17d62a36df15566 100644
index 6934e9dac0d69c043b73b7c46d59f2d39b37c67f..3267978df4039d7b5096eee486d56345d619606d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -134,12 +134,10 @@ import net.minecraft.world.level.chunk.storage.EntityStorage;
@@ -341,7 +341,7 @@ index 9b0b2510edb4984b0714244bbe513e077af7b455..ab0ab5574dc3a19b133262b9c17d62a3
import net.minecraft.world.level.gameevent.DynamicGameEventListener;
import net.minecraft.world.level.gameevent.GameEvent;
import net.minecraft.world.level.gameevent.GameEventDispatcher;
@@ -697,7 +695,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -692,7 +690,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@@ -351,7 +351,7 @@ index 9b0b2510edb4984b0714244bbe513e077af7b455..ab0ab5574dc3a19b133262b9c17d62a3
this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index dce7be16854faa3e297815e794cae6b0bd42bd4f..6a9ffef1b09b70e460fbd3aa90e34104057c0007 100644
index 8f437225d2a4e08ca47873cd42277d9f0f9f5529..ebe0bac2593e72b465f61643054f37f35d678672 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1,10 +1,7 @@
@@ -401,7 +401,7 @@ index dce7be16854faa3e297815e794cae6b0bd42bd4f..6a9ffef1b09b70e460fbd3aa90e34104
// CraftBukkit end
public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -177,6 +169,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -176,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return this.paperConfig;
}
// Paper end - add paper world config
@@ -414,7 +414,7 @@ index dce7be16854faa3e297815e794cae6b0bd42bd4f..6a9ffef1b09b70e460fbd3aa90e34104
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final co.aikar.timings.WorldTimingsHandler timings; // Paper
@@ -213,9 +211,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -212,9 +210,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
@@ -427,7 +427,7 @@ index dce7be16854faa3e297815e794cae6b0bd42bd4f..6a9ffef1b09b70e460fbd3aa90e34104
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2e6206bc868480cb1866e77421374c0b632e8c1d..8f234dfe047fe8f93f160c1b794b88b3357e1d93 100644
index e99f88383565a5498584a00d583d2a114dd087ed..8116b55cf34a97979d94494055bb67a651c9eeb3 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1037,6 +1037,7 @@ public final class CraftServer implements Server {
@@ -438,7 +438,7 @@ index 2e6206bc868480cb1866e77421374c0b632e8c1d..8f234dfe047fe8f93f160c1b794b88b3
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -3010,6 +3011,14 @@ public final class CraftServer implements Server {
@@ -2996,6 +2997,14 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
}

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 16e73128115ef92adefbd7818fef3a4b9bcebad2..f0953c110177a3000d857dea49cc1a4b88db1c2f 100644
index ce341f42b3a5e17fb6d1f7de8057e73137ae2a6e..4ef9e98891a85e4b81f7d3f011bee5ad0eaee4f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit;
@@ -45,7 +45,7 @@ index 16e73128115ef92adefbd7818fef3a4b9bcebad2..f0953c110177a3000d857dea49cc1a4b
public static void main(String[] args) {
// Paper start
final String warnWhenLegacyFormattingDetected = String.join(".", "net", "kyori", "adventure", "text", "warnWhenLegacyFormattingDetected");
@@ -315,13 +336,13 @@ public class Main {
@@ -315,14 +336,14 @@ public class Main {
String javaInfo = "Java " + runtimeMX.getSpecVersion() + " (" + runtimeMX.getVmName() + " " + runtimeMX.getVmVersion() + ")";
String osInfo = "Host: " + osMX.getName() + " " + osMX.getVersion() + " (" + osMX.getArch() + ")";
@@ -55,8 +55,9 @@ index 16e73128115ef92adefbd7818fef3a4b9bcebad2..f0953c110177a3000d857dea49cc1a4b
- System.out.println("Unable to read system info");
+ printlnStartupInfoToSystemOut("Unable to read system info"); // Gale - include time in startup logs
}
// Paper end
System.setProperty( "library.jansi.version", "Paper" ); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
// Paper end - Log Java and OS versioning to help with debugging plugin issues
System.setProperty("library.jansi.version", "Paper"); // Paper - set meaningless jansi version to prevent git builds from crashing on Windows
- System.out.println("Loading libraries, please wait...");
+ printlnStartupInfoToSystemOut("Loading libraries, please wait..."); // Gale - include time in startup logs
net.minecraft.server.Main.main(options);

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
index 1b9d997c31ab281ce9f4719f53b0ad78a430789d..758cb80e64520ff085c4ef5ca8b2ed77d4bc0162 100644
index 29796a404e210f7864f4b33b3367e02531bca2a0..73e503d0590964ac7f9ea15ac7ee7783f0801b2e 100644
--- a/src/main/java/co/aikar/timings/TimingsExport.java
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
@@ -35,6 +35,7 @@ import org.bukkit.Material;
@@ -18,7 +18,7 @@ index 1b9d997c31ab281ce9f4719f53b0ad78a430789d..758cb80e64520ff085c4ef5ca8b2ed77
import org.json.simple.JSONObject;
import org.json.simple.JSONValue;
import oshi.SystemInfo;
@@ -240,6 +241,7 @@ public class TimingsExport extends Thread {
@@ -238,6 +239,7 @@ public class TimingsExport extends Thread {
// Information on the users Config
parent.put("config", createObject(
@@ -27,7 +27,7 @@ index 1b9d997c31ab281ce9f4719f53b0ad78a430789d..758cb80e64520ff085c4ef5ca8b2ed77
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
// Gale start - Gale configuration - include in timings
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 1643186bcb2caf5d29fd551afd35830726dbb80a..96c79afbdc824257b4225a85ff9b2fe2d8310f57 100644
index bab2471616404821671264ccefd729cab8d0bf58..aa46e6e22998c62c89a56fbcabc13fdf58dd7dba 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -67,6 +67,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -53,7 +53,7 @@ index 1643186bcb2caf5d29fd551afd35830726dbb80a..96c79afbdc824257b4225a85ff9b2fe2
+ public final DedicatedServerProperties.WorldDimensionData worldDimensionData; // Gale - include server.properties in timings - private -> public
public final WorldOptions worldOptions;
public final String rconIp; // Paper - Add rcon ip
public final String rconIp; // Paper - Configurable rcon ip
@@ -157,6 +159,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.enforceSecureProfile = this.get("enforce-secure-profile", true);
this.logIPs = this.get("log-ips", true);

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 7adffbc9e737354a2644a12bc9b067e57bec756a..d57a3967f29f795cc6e1ee137d06c32e7833f31c 100644
index a6c1bd3c37720ff692fb72c8648c3d2eb9247346..216cbb87356fd98ec7015cd31b0fde860ea92672 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1501,7 +1501,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1504,7 +1504,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
@@ -19,7 +19,7 @@ index 7adffbc9e737354a2644a12bc9b067e57bec756a..d57a3967f29f795cc6e1ee137d06c32e
long i = Util.getNanos();
// Paper start - move oversleep into full server tick
@@ -1573,7 +1573,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1576,7 +1576,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.logTickTime(l - i);
this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index c1907c3095f095be0ee08681f5aed587c962328c..35c06a2b3f02e9d765e6336a05c059e75253a3fb 100644
index b7f338e982d0dcab99137ab6dc200b82ac6b7cba..7600991949de84b6667c0a80bfec4a13823ab9b8 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -54,7 +54,6 @@ import net.minecraft.server.commands.CloneCommands;
@@ -63,7 +63,7 @@ index c1907c3095f095be0ee08681f5aed587c962328c..35c06a2b3f02e9d765e6336a05c059e7
- commandlistenerwrapper.getServer().getProfiler().push(() -> {
- return "/" + s;
- });
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - make finishParsing not static
ContextChain contextchain = this.finishParsing(parseresults, s, commandlistenerwrapper, label); // CraftBukkit // Paper - Add UnknownCommandEvent
try {
@@ -356,8 +351,6 @@ public class Commands {
@@ -75,7 +75,7 @@ index c1907c3095f095be0ee08681f5aed587c962328c..35c06a2b3f02e9d765e6336a05c059e7
}
}
@@ -427,7 +420,7 @@ public class Commands {
@@ -426,7 +419,7 @@ public class Commands {
int j = minecraftserver.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
try {
@@ -167,7 +167,7 @@ index 821dc4aeaf48460000682604fba51b340b9738e7..4f4540ed9b3e603eec0d46fb5b58de24
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9f2412ece 100644
index 216cbb87356fd98ec7015cd31b0fde860ea92672..377cf883f6a78d3d2ccbbcae451d1358295b20c8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -106,18 +106,9 @@ import net.minecraft.util.RandomSource;
@@ -204,7 +204,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
private ServerConnectionListener connection;
public final ChunkProgressListenerFactory progressListenerFactory;
@Nullable
@@ -338,13 +321,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -336,13 +319,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public MinecraftServer(OptionSet options, WorldLoader.DataLoadContext worldLoader, Thread thread, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PackRepository resourcepackrepository, WorldStem worldstem, Proxy proxy, DataFixer datafixer, Services services, ChunkProgressListenerFactory worldloadlistenerfactory) {
super("Server");
SERVER = this; // Paper - better singleton
@@ -218,7 +218,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
this.random = RandomSource.create();
this.port = -1;
this.levels = Maps.newLinkedHashMap();
@@ -970,9 +946,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -968,9 +944,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// Paper end
// CraftBukkit end
@@ -227,8 +227,8 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
- }
MinecraftServer.LOGGER.info("Stopping server");
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
@@ -1207,20 +1180,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
@@ -1209,20 +1182,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
boolean flag = i == 0L;
@@ -238,7 +238,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
- }
-
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = curTime;
lastTick = currentTime;
this.nextTickTimeNanos += i;
- this.startMetricsRecordingTick();
- this.profiler.push("tick");
@@ -249,7 +249,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
this.waitUntilNextTick();
@@ -1228,8 +1193,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1230,8 +1195,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.tickRateManager.endTickWork();
}
@@ -258,7 +258,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
this.isReady = true;
JvmProfiler.INSTANCE.onServerTick(this.smoothedTickTimeMillis);
}
@@ -1454,7 +1417,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1457,7 +1420,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void doRunTask(TickTask ticktask) { // CraftBukkit - decompile error
@@ -266,7 +266,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
super.doRunTask(ticktask);
}
@@ -1527,7 +1489,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1530,7 +1492,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (playerSaveInterval < 0) {
playerSaveInterval = autosavePeriod;
}
@@ -274,31 +274,31 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
final boolean fullSave = autosavePeriod > 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
@@ -1542,7 +1503,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1545,7 +1506,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
} finally {
this.isSaving = false;
}
- this.profiler.pop();
// Paper end
// Paper end - Incremental chunk and player saving
io.papermc.paper.util.CachedLists.reset(); // Paper
// Paper start - move executeAll() into full server tick timing
@@ -1555,7 +1515,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1558,7 +1518,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
new com.destroystokyo.paper.event.server.ServerTickEndEvent(this.tickCount, ((double)(endTime - lastTick) / 1000000D), remaining).callEvent();
// Paper end
// Paper end - Server Tick Events
- this.profiler.push("tallying");
long j = Util.getNanos() - i;
int k = this.tickCount % 100;
@@ -1571,7 +1530,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1574,7 +1533,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
tickTimes60s.add(this.tickCount, j);
// Paper end
// Paper end - Add tick times API and /mspt command
this.logTickTime(l - i);
- this.profiler.pop();
org.spigotmc.WatchdogThread.tick(); // Spigot
co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTimingFullServerTick(); // Paper // Gale - final timings calls
}
@@ -1653,11 +1611,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1656,11 +1614,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
});
// Paper end - Folia scheduler API
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
@@ -310,9 +310,9 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
//Iterator iterator = this.getAllLevels().iterator(); // Paper - Throw exception on world create while being ticked; moved down
// CraftBukkit start
@@ -1699,19 +1655,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1702,19 +1658,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper
worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper - Add EntityMoveEvent
- this.profiler.push(() -> {
- return worldserver + " " + worldserver.dimension().location();
@@ -330,7 +330,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
try {
worldserver.timings.doTick.startTiming(); // Spigot
worldserver.tick(shouldKeepTicking);
@@ -1728,17 +1677,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1731,17 +1680,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
throw new ReportedException(crashreport);
}
@@ -348,7 +348,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
MinecraftTimings.playerListTimer.startTiming(); // Spigot // Paper
this.playerList.tick();
MinecraftTimings.playerListTimer.stopTiming(); // Spigot // Paper
@@ -1746,15 +1691,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1749,15 +1694,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
GameTestTicker.SINGLETON.tick();
}
@@ -364,7 +364,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
iterator = this.playerList.getPlayers().iterator();
while (iterator.hasNext()) {
@@ -1764,7 +1706,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1767,7 +1709,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
entityplayer.connection.resumeFlushing();
}
@@ -372,7 +372,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
}
private void synchronizeTime(ServerLevel world) {
@@ -1772,7 +1713,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1775,7 +1716,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void forceTimeSynchronization() {
@@ -380,7 +380,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
Iterator iterator = this.getAllLevels().iterator();
while (iterator.hasNext()) {
@@ -1780,8 +1720,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1783,8 +1723,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
this.synchronizeTime(worldserver);
}
@@ -389,7 +389,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
}
public boolean isNetherEnabled() {
@@ -2445,7 +2383,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2448,7 +2386,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public ProfilerFiller getProfiler() {
@@ -398,7 +398,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
}
public abstract boolean isSingleplayerOwner(GameProfile profile);
@@ -2683,53 +2621,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2686,53 +2624,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// CraftBukkit end
@@ -452,7 +452,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
public Path getWorldPath(LevelResource worldSavePath) {
return this.storageSource.getLevelPath(worldSavePath);
}
@@ -2775,25 +2666,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2778,25 +2669,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
return this.isSaving;
}
@@ -478,7 +478,7 @@ index d57a3967f29f795cc6e1ee137d06c32e7833f31c..36fc043b282f64f329e5fcf00c81f5d9
public int getMaxChainedNeighborUpdates() {
return 1000000;
}
@@ -2834,56 +2706,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -2837,56 +2709,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
@@ -599,7 +599,7 @@ index df0c15f6b5b2224d53e4f8fad42b9a1e5f33dc25..caa6dcfec13728863dcf21f9f778665b
}
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 2458bc75ece2d5eadc49df0f1c94702bd20e779f..4303f27c3fa59b9aacf955865885fcf1c3caea3e 100644
index 5a7278b093e37b95fb005ad5cc3cac90ac36f8fb..f07a0008387c18dae5b133b90ed291b364428d02 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -68,7 +68,6 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
@@ -610,7 +610,7 @@ index 2458bc75ece2d5eadc49df0f1c94702bd20e779f..4303f27c3fa59b9aacf955865885fcf1
import net.minecraft.util.thread.BlockableEventLoop;
import net.minecraft.util.thread.ProcessorHandle;
import net.minecraft.util.thread.ProcessorMailbox;
@@ -545,20 +544,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -538,20 +537,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
}
protected void tick(BooleanSupplier shouldKeepTicking) {
@@ -632,7 +632,7 @@ index 2458bc75ece2d5eadc49df0f1c94702bd20e779f..4303f27c3fa59b9aacf955865885fcf1
public boolean hasWork() {
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ecc4a5ca0a 100644
index 366c0c9b45a819f7f94ebe3e49b8ab7f9edf9ce7..20ec10b843f90d2077f49d293d65fa6ed4876961 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -23,7 +23,6 @@ import net.minecraft.core.SectionPos;
@@ -643,10 +643,10 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
import net.minecraft.util.thread.BlockableEventLoop;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.ai.village.poi.PoiManager;
@@ -274,16 +273,12 @@ public class ServerChunkCache extends ChunkSource {
@@ -261,16 +260,12 @@ public class ServerChunkCache extends ChunkSource {
return ifLoaded;
}
// Paper end
// Paper end - Perf: Optimise getChunkAt calls for loaded chunks
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
-
- gameprofilerfiller.incrementCounter("getChunk");
@@ -660,7 +660,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
CompletableFuture<Either<ChunkAccess, ChunkHolder.ChunkLoadingFailure>> completablefuture = this.getChunkFutureMainThread(x, z, leastStatus, create, true); // Paper
ServerChunkCache.MainThreadExecutor chunkproviderserver_b = this.mainThreadProcessor;
@@ -472,24 +467,19 @@ public class ServerChunkCache extends ChunkSource {
@@ -464,24 +459,19 @@ public class ServerChunkCache extends ChunkSource {
// CraftBukkit start - modelled on below
public void purgeUnload() {
if (true) return; // Paper - tickets will be removed later, this behavior isn't really well accounted for by the chunk system
@@ -685,7 +685,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
if (tickChunks) {
this.level.timings.chunks.startTiming(); // Paper - timings
this.chunkMap.level.playerChunkLoader.tick(); // Paper - replace player chunk loader - this is mostly required to account for view distance changes
@@ -499,10 +489,8 @@ public class ServerChunkCache extends ChunkSource {
@@ -491,10 +481,8 @@ public class ServerChunkCache extends ChunkSource {
}
this.level.timings.doChunkUnload.startTiming(); // Spigot
@@ -696,7 +696,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
this.clearCache();
}
@@ -512,17 +500,12 @@ public class ServerChunkCache extends ChunkSource {
@@ -504,17 +492,12 @@ public class ServerChunkCache extends ChunkSource {
this.lastInhabitedUpdate = i;
if (!this.level.isDebug()) {
@@ -713,8 +713,8 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
- gameprofilerfiller.popPush("naturalSpawnCount");
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - per player mob spawning
@@ -551,7 +534,6 @@ public class ServerChunkCache extends ChunkSource {
// Paper start - Optional per player mob spawns
@@ -543,7 +526,6 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
this.lastSpawnState = spawnercreature_d;
@@ -722,7 +722,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
// Paper start - optimise chunk tick iteration
@@ -659,7 +641,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -651,7 +633,6 @@ public class ServerChunkCache extends ChunkSource {
// Paper end - optimise chunk tick iteration
this.level.timings.chunkTicks.stopTiming(); // Paper
@@ -730,7 +730,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
if (flag) {
try (co.aikar.timings.Timing ignored = this.level.timings.miscMobSpawning.startTiming()) { // Paper - timings
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
@@ -667,7 +648,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -659,7 +640,6 @@ public class ServerChunkCache extends ChunkSource {
}
}
@@ -738,7 +738,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
// Paper - optimise chunk tick iteration
this.level.timings.broadcastChunkUpdates.startTiming(); // Paper - timing
// Paper start - optimise chunk tick iteration
@@ -685,8 +665,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -677,8 +657,6 @@ public class ServerChunkCache extends ChunkSource {
// Paper end - optimise chunk tick iteration
this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing
// Paper - optimise chunk tick iteration
@@ -747,7 +747,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
}
}
@@ -858,7 +836,6 @@ public class ServerChunkCache extends ChunkSource {
@@ -850,7 +828,6 @@ public class ServerChunkCache extends ChunkSource {
@Override
protected void doRunTask(Runnable task) {
@@ -756,7 +756,7 @@ index 44ada45d9bf2d9b48e5de1c3cb1a855902f3884b..7bde3392d46fb1be3d04db97a5ec02ec
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc469d8e21aa 100644
index 3267978df4039d7b5096eee486d56345d619606d..2de2c2c09a57f46a7c7ff9603f57c104d5a911d9 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -78,7 +78,6 @@ import net.minecraft.util.Mth;
@@ -767,7 +767,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
@@ -695,15 +694,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -690,15 +689,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
@@ -788,7 +788,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
this.navigatingMobs = new ObjectOpenHashSet();
this.blockEvents = new ObjectLinkedOpenHashSet();
this.blockEventsToReschedule = new ArrayList(64);
@@ -806,16 +807,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -801,16 +802,12 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
public void tick(BooleanSupplier shouldKeepTicking) {
@@ -805,7 +805,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
this.advanceWeatherCycle();
}
@@ -847,30 +844,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -842,30 +839,23 @@ public class ServerLevel extends Level implements WorldGenLevel {
this.tickTime();
}
@@ -836,7 +836,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
if (flag) {
this.timings.doSounds.startTiming(); // Spigot
this.runBlockEvents();
@@ -878,7 +868,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -873,7 +863,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
this.handlingTick = false;
@@ -844,7 +844,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
boolean flag1 = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
if (flag1) {
@@ -886,12 +875,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -881,12 +870,9 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
if (flag1 || this.emptyTime++ < 300) {
@@ -857,7 +857,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
}
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
@@ -901,9 +887,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -896,9 +882,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
entity.discard();
} else if (!tickratemanager.isEntityFrozen(entity)) {
@@ -867,7 +867,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
if (true || this.chunkSource.chunkMap.getDistanceManager().inEntityTickingRange(entity.chunkPosition().toLong())) { // Paper - now always true if in the ticking list
Entity entity1 = entity.getVehicle();
@@ -915,22 +899,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -910,22 +894,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
@@ -890,7 +890,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
}
@Override
@@ -989,9 +968,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -984,9 +963,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
boolean flag = this.isRaining();
int j = chunkcoordintpair.getMinBlockX();
int k = chunkcoordintpair.getMinBlockZ();
@@ -899,25 +899,25 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
- gameprofilerfiller.push("thunder");
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder
@@ -1022,8 +998,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
@@ -1017,8 +993,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
- gameprofilerfiller.popPush("iceandsnow");
-
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
for (int l = 0; l < randomTickSpeed; ++l) {
if (this.random.nextInt(48) == 0) {
@@ -1035,7 +1009,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1030,7 +1004,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
} // Paper
} // Paper - Option to disable ice and snow
- gameprofilerfiller.popPush("tickBlocks");
timings.chunkTicksBlocks.startTiming(); // Paper
if (randomTickSpeed > 0) {
// Paper start - optimize random block ticking
@@ -1071,7 +1044,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1066,7 +1039,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper end - optimise random block ticking
timings.chunkTicksBlocks.stopTiming(); // Paper
@@ -925,7 +925,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
}
@VisibleForTesting
@@ -1400,19 +1372,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1395,19 +1367,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
try {
// Paper end - timings
entity.setOldPosAndRot();
@@ -945,7 +945,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
} finally { timer.stopTiming(); } // Paper - timings
Iterator iterator = entity.getPassengers().iterator();
@@ -1441,12 +1407,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1436,12 +1402,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Paper end
passenger.setOldPosAndRot();
++passenger.tickCount;
@@ -958,7 +958,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
// Paper start - EAR 2
if (isActive) {
passenger.rideTick();
@@ -1458,7 +1418,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1453,7 +1413,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
vehicle.positionRider(passenger);
}
// Paper end - EAR 2
@@ -967,7 +967,7 @@ index ab0ab5574dc3a19b133262b9c17d62a36df15566..a692573423348db7a48e5cc79e1bcc46
while (iterator.hasNext()) {
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 6872e223ff4b450af89a838f4caf7cf2ebcb818e..3e8e5fe6a67af911847e7f4c3e2874a340d39016 100644
index 0dba30c41affafe7b1d585b515925043b37712fa..e8ebc8588642479f22c6971bb2ea8ba557d9596a 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -1213,7 +1213,6 @@ public class ServerPlayer extends Player {
@@ -996,7 +996,7 @@ index 6872e223ff4b450af89a838f4caf7cf2ebcb818e..3e8e5fe6a67af911847e7f4c3e2874a3
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
playerlist.sendLevelInfo(this, worldserver);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 134a84841a1e05b212794c00477f20eb30e53ec5..6ddb0abcc89af93e4cff5b0e461bc8490aacbbc3 100644
index 0306771b8f90dcdd77f151c19c6c2d75c41f8feb..e7583996cc6d750cbd72f749de39ecded56d7f7c 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -203,7 +203,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -1004,12 +1004,12 @@ index 134a84841a1e05b212794c00477f20eb30e53ec5..6ddb0abcc89af93e4cff5b0e461bc849
protected void keepConnectionAlive() {
- this.server.getProfiler().push("keepAlive");
// Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
long currentTime = Util.getMillis();
@@ -224,7 +223,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
// Paper end
// Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings
- this.server.getProfiler().pop();
}
@@ -1096,10 +1096,10 @@ index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..47e75ec4a01f8a456ec6ebc13031c1f0
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3ff6466b6c 100644
index 2c06f3ebf7e1069727387bfc60db30c958c14b5a..df915549b366d25727ac9c6ff4e9521927ad50c8 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -821,7 +821,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -820,7 +820,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit end
public void baseTick() {
@@ -1107,7 +1107,7 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
this.feetBlockState = null;
if (this.isPassenger() && this.getVehicle().isRemoved()) {
@@ -882,7 +881,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -881,7 +880,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
this.firstTick = false;
@@ -1160,7 +1160,7 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
}
}
// Paper start - detailed watchdog information
@@ -3142,7 +3132,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3139,7 +3129,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
ServerLevel worldserver1 = minecraftserver.getLevel(resourcekey);
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
@@ -1168,7 +1168,7 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
this.portalTime = i;
// Paper start - Add EntityPortalReadyEvent
io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER);
@@ -3160,7 +3149,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3157,7 +3146,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
} // Paper - Add EntityPortalReadyEvent
// CraftBukkit end
@@ -1176,9 +1176,9 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
}
this.isInsidePortal = false;
@@ -3635,14 +3623,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3632,14 +3620,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
// Paper end
// Paper end - Fix item duplication and teleport issues
if (this.level() instanceof ServerLevel && !this.isRemoved()) {
- this.level().getProfiler().push("changeDimension");
// CraftBukkit start
@@ -1191,15 +1191,15 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
PortalInfo shapedetectorshape = (location == null) ? this.findDimensionEntryPoint(worldserver) : new PortalInfo(new Vec3(location.x(), location.y(), location.z()), Vec3.ZERO, this.yRot, this.xRot, worldserver, null); // CraftBukkit
if (shapedetectorshape == null) {
@@ -3681,7 +3667,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3678,7 +3664,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.unRide();
// CraftBukkit end
- this.level().getProfiler().popPush("reloading");
// Paper start - Change lead drop timing to prevent dupe
// Paper start - Fix item duplication and teleport issues
if (this instanceof Mob) {
((Mob) this).dropLeash(true, true); // Paper drop lead
@@ -3708,10 +3693,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3705,10 +3690,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
this.removeAfterChangingDimensions();
@@ -1211,7 +1211,7 @@ index 8814ffc0f3ebe352cd72f50d9f68704e4ee0e88c..d1bdfda6f24d6c9a103e20eb36e6ca3f
}
} else {
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 353f8598ae940b15a71e71d7c6b80f9d063decb6..d8c899566533dda4cf5e700769c842f93e5c0b49 100644
index 6071451339080bbdd98fb634791a56988984c8bc..0c82be4f9dc6886c19b0f2edca019f7e6ffff6c2 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -404,7 +404,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -1300,11 +1300,11 @@ index 353f8598ae940b15a71e71d7c6b80f9d063decb6..d8c899566533dda4cf5e700769c842f9
this.pushEntities();
- this.level().getProfiler().pop();
// Paper start
// Paper start - Add EntityMoveEvent
if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof net.minecraft.world.entity.player.Player)) {
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 0b5334004b9d0489e8465824870662b467ce321b..3bf473e2904b4279b1bc14a0fa75ffe25189d1d2 100644
index 24629412d2b4acaa81788ce70412b03387cc777c..684749248be7d3a258f84398fd6d0073eeb11a17 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -146,8 +146,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -1351,13 +1351,11 @@ index 0b5334004b9d0489e8465824870662b467ce321b..3bf473e2904b4279b1bc14a0fa75ffe2
}
protected Vec3i getPickupReach() {
@@ -904,43 +900,23 @@ public abstract class Mob extends LivingEntity implements Targeting {
}
@@ -905,42 +901,22 @@ public abstract class Mob extends LivingEntity implements Targeting {
return;
}
- // Paper end
// Paper end - Allow nerfed mobs to jump and float
- this.level().getProfiler().push("sensing");
+ // Paper end);
this.sensing.tick();
- this.level().getProfiler().pop();
int i = this.level().getServer().getTickCount() + this.getId();
@@ -1397,7 +1395,7 @@ index 0b5334004b9d0489e8465824870662b467ce321b..3bf473e2904b4279b1bc14a0fa75ffe2
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index b738ee2d3801fadfd09313f05ae24593e56b0ec6..ce2804271bb67803c60c9121aec6c8dc0e99a1d9 100644
index 676f5485a4ca9252e911213dcda8d51776b637b6..fda42ae6579819aa140766829d852633415e8d76 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -11,7 +11,6 @@ import java.util.Set;
@@ -1470,13 +1468,13 @@ index b738ee2d3801fadfd09313f05ae24593e56b0ec6..ce2804271bb67803c60c9121aec6c8dc
public Set<WrappedGoal> getAvailableGoals() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index b37415d45dda8e658c8995a4519e552dc378bb41..91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a 100644
index a04fb58c29b462e20ed0b702cef478e3985b7cd2..33983ed67ad6b0d25d2ae00e03415bda940584eb 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -172,12 +172,10 @@ public abstract class PathNavigation {
@@ -173,12 +173,10 @@ public abstract class PathNavigation {
}
}
// Paper end
// Paper end - EntityPathfindEvent
- this.level.getProfiler().push("pathfind");
BlockPos blockPos = useHeadPos ? this.mob.blockPosition().above() : this.mob.blockPosition();
int i = (int)(followRange + (float)range);
@@ -1705,7 +1703,7 @@ index 937f81a859953498abe73bea560c86e6560e1c33..b73bccfcb1b94936f500926a06a28a6a
if ((this.tickCount + this.getId()) % 120 == 0) {
Warden.applyDarknessAround(worldserver, this.position(), this, 20);
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index e12f1f11386fa723f62b51ed0cc5715c1812d2bf..3bbba098ebaae7ed0178020ea35a04752d9d4daa 100644
index 1aae466e3e334d7f4bbb3ea9365a255afcc3dd3a..1edc23e457432b571d00bce5a4c32c6d790368c2 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -253,9 +253,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@@ -1719,7 +1717,7 @@ index e12f1f11386fa723f62b51ed0cc5715c1812d2bf..3bbba098ebaae7ed0178020ea35a0475
this.assignProfessionWhenSpawned = false;
}
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index 210b6d71207b99e66ba014b176b2c1445053b1d1..ce8e39d4bf4c7474e1e8694312e1985327a88e62 100644
index 28ef910885dbd48965fba6f08cec412697b1b7f0..5097a73ef96724c83e3c0369a5ca6b60012c9a18 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -659,7 +659,6 @@ public class Explosion {
@@ -1739,7 +1737,7 @@ index 210b6d71207b99e66ba014b176b2c1445053b1d1..ce8e39d4bf4c7474e1e8694312e19853
if (this.fire) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34736b11cd 100644
index ebe0bac2593e72b465f61643054f37f35d678672..588dccfa6a3e8e546be2b8b52bb07ceacbf0ab7d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -132,7 +132,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1750,7 +1748,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
public final boolean isClientSide;
private final WorldBorder worldBorder;
private final BiomeManager biomeManager;
@@ -211,7 +210,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -210,7 +209,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
@@ -1759,7 +1757,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
@@ -226,7 +225,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -225,7 +224,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
// CraftBukkit end
@@ -1767,7 +1765,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
this.levelData = worlddatamutable;
this.dimensionTypeRegistration = holder;
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
@@ -1266,9 +1264,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1261,9 +1259,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
protected void tickBlockEntities() {
@@ -1777,7 +1775,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
this.timings.tileEntityPending.startTiming(); // Spigot
this.tickingBlockEntities = true;
if (!this.pendingBlockEntityTickers.isEmpty()) {
@@ -1309,7 +1304,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1304,7 +1299,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
this.timings.tileEntityTick.stopTiming(); // Spigot
this.tickingBlockEntities = false;
co.aikar.timings.TimingHistory.tileEntityTicks += this.blockEntityTickers.size(); // Paper
@@ -1785,7 +1783,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
@@ -1519,7 +1513,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1514,7 +1508,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
@@ -1793,7 +1791,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
List<Entity> list = Lists.newArrayList();
((ServerLevel)this).getEntityLookup().getEntities(except, box, list, predicate); // Paper - optimise this call
return list;
@@ -1538,7 +1531,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1533,7 +1526,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public <T extends Entity> void getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate, List<? super T> result, int limit) {
@@ -1801,7 +1799,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
// Paper start - optimise this call
//TODO use limit
if (filter instanceof net.minecraft.world.entity.EntityType entityTypeTest) {
@@ -1797,11 +1789,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1792,11 +1784,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
public ProfilerFiller getProfiler() {
@@ -1816,7 +1814,7 @@ index 6a9ffef1b09b70e460fbd3aa90e34104057c0007..a759f61d2e56cbb7f526c854b6b26b34
@Override
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
index 46d743db099e69e10f5534aafdd7aa5eda67dec9..04415b50f527b40265e6b515ee50c9784ec376ee 100644
index 17e9f3a30e287faf210e08dc7eb177a70f049f43..0483ebfbbfe5a2e517bf6d9679f1afca73b14c05 100644
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
@@ -132,7 +132,6 @@ public final class NaturalSpawner {
@@ -1857,7 +1855,7 @@ index 0f1025495237aebe30132ace0832aa5718d6f9bb..9c2321ebb1237b4ecd3e7f7053e5039b
- }
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 27e8ee4507460b1cc72de692b41562b9f4f13929..0daa7dac5e1c64da86d6c26c9399363105b926a5 100644
index 6ec3fc801453fd54c25b642e6fa71c19b463311d..b02a2ca45152693e9974e802866feaa6bd2f2508 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -25,7 +25,6 @@ import net.minecraft.network.FriendlyByteBuf;
@@ -1900,9 +1898,9 @@ index 27e8ee4507460b1cc72de692b41562b9f4f13929..0daa7dac5e1c64da86d6c26c93993631
- gameprofilerfiller.pop();
} catch (Throwable throwable) {
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent tile entity and entity crashes
// Paper start - Prevent block entity and entity crashes
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
index d23481453717f715124156b5d83f6448f720d049..c4052d1a7c2903564a8a6226c1b019d299c71b2a 100644
index eb18494bd7257fa5eb00dea16cf4d5667b796f2b..61d5fe8e5344a6cb94d427859488c34821c8a3f6 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -12,7 +12,6 @@ import java.util.function.Function;
@@ -1916,7 +1914,7 @@ index d23481453717f715124156b5d83f6448f720d049..c4052d1a7c2903564a8a6226c1b019d2
@@ -44,7 +43,7 @@ public class PathFinder {
map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
}
// Paper end
// Paper end - Perf: remove streams and optimize collection
- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier);
+ Path path = this.findPath(node, map, followRange, distance, rangeMultiplier); // Gale - Purpur - remove vanilla profiler
this.nodeEvaluator.done();
@@ -1925,7 +1923,7 @@ index d23481453717f715124156b5d83f6448f720d049..c4052d1a7c2903564a8a6226c1b019d2
@@ -52,9 +51,7 @@ public class PathFinder {
@Nullable
// Paper start - optimize collection
// Paper start - Perf: remove streams and optimize collection
- private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
- profiler.push("find_path");
- profiler.markForCharting(MetricCategory.PATH_FINDING);

View File

@@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we
initialize it earlier, ensuring that it is available sooner.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index a692573423348db7a48e5cc79e1bcc469d8e21aa..3f637a3e666c24ed2d293f86824e91c751a3095e 100644
index 2de2c2c09a57f46a7c7ff9603f57c104d5a911d9..62c4576b3e7f50054cca6157019b2b53133009dc 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -960,7 +960,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -955,7 +955,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
// Paper start - optimise random block ticking
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
@@ -31,12 +31,12 @@ index a692573423348db7a48e5cc79e1bcc469d8e21aa..3f637a3e666c24ed2d293f86824e91c7
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a759f61d2e56cbb7f526c854b6b26b34736b11cd..39e95e11c3c7c784a007138b65860e4b0c7c43bb 100644
index 588dccfa6a3e8e546be2b8b52bb07ceacbf0ab7d..25af78bbb07e174f6c57e26743421f2143d73bd7 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -184,6 +184,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -183,6 +183,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Map<Explosion.CacheKey, Float> explosionDensityCache = new HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Move from Map in BlockRedstoneTorch to here
public java.util.ArrayDeque<net.minecraft.world.level.block.RedstoneTorchBlock.Toggle> redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
+ public final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(this.random.nextLong()); // Gale - Pufferfish - move random tick random
+

View File

@@ -52,10 +52,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 7bde3392d46fb1be3d04db97a5ec02ecc4a5ca0a..51f86a87c89057351d6984e655674212da8c7dcc 100644
index 20ec10b843f90d2077f49d293d65fa6ed4876961..c43884019b7162c7f58f636a89c7c19c445eec88 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -505,6 +505,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -497,6 +497,7 @@ public class ServerChunkCache extends ChunkSource {
// Paper - optimise chunk tick iteration
@@ -64,10 +64,10 @@ index 7bde3392d46fb1be3d04db97a5ec02ecc4a5ca0a..51f86a87c89057351d6984e655674212
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 3f637a3e666c24ed2d293f86824e91c751a3095e..62eac1a915177ffe935f6a19a567932f6c787f75 100644
index 62c4576b3e7f50054cca6157019b2b53133009dc..83c001e809c76a5ec0b314967839713e63d67f0d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -962,6 +962,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -957,6 +957,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final BlockPos.MutableBlockPos chunkTickMutablePosition = new BlockPos.MutableBlockPos();
// Paper end
@@ -76,26 +76,26 @@ index 3f637a3e666c24ed2d293f86824e91c751a3095e..62eac1a915177ffe935f6a19a567932f
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
ChunkPos chunkcoordintpair = chunk.getPos();
boolean flag = this.isRaining();
@@ -969,7 +971,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -964,7 +966,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
int k = chunkcoordintpair.getMinBlockZ();
final BlockPos.MutableBlockPos blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - disable thunder
+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - disable thunder // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
- if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
+ if (!this.paperConfig().environment.disableThunder && flag && this.isThundering() && this.spigotConfig.thunderChance > 0 && /*this.random.nextInt(this.spigotConfig.thunderChance) == 0 &&*/ chunk.shouldDoLightning(this.random)) { // Spigot // Paper - Option to disable thunder // Gale - Airplane - optimize random calls in chunk ticking - replace random with shouldDoLightning
blockposition.set(this.findLightningTargetAround(this.getBlockRandomPos(j, 0, k, 15))); // Paper
if (this.isRainingAt(blockposition)) {
@@ -997,7 +999,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -992,7 +994,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
- if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
+ if (!this.paperConfig().environment.disableIceAndSnow && (this.currentIceAndSnowTick++ & 15) == 0) { // Paper - Option to disable ice and snow // Gale - Airplane - optimize random calls in chunk ticking - optimize further random ticking
for (int l = 0; l < randomTickSpeed; ++l) {
if (this.random.nextInt(48) == 0) {
// Paper start
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 0daa7dac5e1c64da86d6c26c9399363105b926a5..d13a61ad34c00e5ad67adc64e919c4f559621cc9 100644
index b02a2ca45152693e9974e802866feaa6bd2f2508..3d0b8761866046ae7ee6b5777fb098ce786abd94 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -85,6 +85,18 @@ public class LevelChunk extends ChunkAccess {

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
index c157309ac78e7af084d3acb6e8b2bcd469a39d5e..09bc539502dada5dfdd95e50141e587c1c3dee4c 100644
index c8a80c1b2fedff22e8a877d466062375ffb2f0d7..29963fbccdd9adadcf46970473ff1fccc68572f0 100644
--- a/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
+++ b/src/main/java/net/minecraft/world/entity/ai/targeting/TargetingConditions.java
@@ -75,9 +75,18 @@ public class TargetingConditions {
@@ -39,7 +39,7 @@ index c157309ac78e7af084d3acb6e8b2bcd469a39d5e..09bc539502dada5dfdd95e50141e587c
if (this.range > 0.0D) {
- double d = this.testInvisible ? targetEntity.getVisibilityPercent(baseEntity) : 1.0D;
- double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0D); // Paper
- double e = Math.max((this.useFollowRange ? this.getFollowRange(baseEntity) : this.range) * d, 2.0D); // Paper - Fix MC-145656
+ // Gale start - Airplane - check targeting range before getting visibility
+ // d = invisibility percent, e = follow range adjusted for invisibility, f = distance
double f = baseEntity.distanceToSqr(targetEntity.getX(), targetEntity.getY(), targetEntity.getZ());

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6c453bbb929007d9bcd041f856eb65d409bac32a..33b8551ef0d7ac3b29a1c111088a2c1912f5e494 100644
index 8116b55cf34a97979d94494055bb67a651c9eeb3..67f0ca38ceae1e1485bc23fa862bb3f13de880a6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1121,6 +1121,13 @@ public final class CraftServer implements Server {
@@ -47,4 +47,4 @@ index 6c453bbb929007d9bcd041f856eb65d409bac32a..33b8551ef0d7ac3b29a1c111088a2c19
+ // Gale end - Airplane - print stack trace for plugins not shutting down tasks
}
}
// Paper end
// Paper end - Wait for Async Tasks during shutdown

View File

@@ -186,7 +186,7 @@ index 0000000000000000000000000000000000000000..bf6a36c933b686f0e34591dff3d43b37
+ }
+}
diff --git a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
index e21f4c5aff3a8e97101f6efc1349fbecf326b5ea..3164150f83a49fe565a3f7f691b976cb323a50da 100644
index 6d8ff6c06af5545634f255ed17dc1e489ece2548..05273fa3b59d67858abffcb1ff18a6ff5885c316 100644
--- a/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/FlowingFluid.java
@@ -45,6 +45,8 @@ public abstract class FlowingFluid extends Fluid {
@@ -213,7 +213,7 @@ index e21f4c5aff3a8e97101f6efc1349fbecf326b5ea..3164150f83a49fe565a3f7f691b976cb
private final Map<FluidState, VoxelShape> shapes = Maps.newIdentityHashMap();
public FlowingFluid() {}
@@ -252,6 +262,8 @@ public abstract class FlowingFluid extends Fluid {
@@ -251,6 +261,8 @@ public abstract class FlowingFluid extends Fluid {
return false;
}
// Paper end - optimise collisions
@@ -222,7 +222,7 @@ index e21f4c5aff3a8e97101f6efc1349fbecf326b5ea..3164150f83a49fe565a3f7f691b976cb
Object2ByteLinkedOpenHashMap object2bytelinkedopenhashmap;
if (!state.getBlock().hasDynamicShape() && !fromState.getBlock().hasDynamicShape()) {
@@ -259,9 +271,16 @@ public abstract class FlowingFluid extends Fluid {
@@ -258,9 +270,16 @@ public abstract class FlowingFluid extends Fluid {
} else {
object2bytelinkedopenhashmap = null;
}
@@ -239,7 +239,7 @@ index e21f4c5aff3a8e97101f6efc1349fbecf326b5ea..3164150f83a49fe565a3f7f691b976cb
if (object2bytelinkedopenhashmap != null) {
block_a = new Block.BlockStatePairKey(state, fromState, face);
byte b0 = object2bytelinkedopenhashmap.getAndMoveToFirst(block_a);
@@ -272,11 +291,22 @@ public abstract class FlowingFluid extends Fluid {
@@ -271,11 +290,22 @@ public abstract class FlowingFluid extends Fluid {
} else {
block_a = null;
}
@@ -262,7 +262,7 @@ index e21f4c5aff3a8e97101f6efc1349fbecf326b5ea..3164150f83a49fe565a3f7f691b976cb
if (object2bytelinkedopenhashmap != null) {
if (object2bytelinkedopenhashmap.size() == 200) {
object2bytelinkedopenhashmap.removeLastByte();
@@ -284,6 +314,11 @@ public abstract class FlowingFluid extends Fluid {
@@ -283,6 +313,11 @@ public abstract class FlowingFluid extends Fluid {
object2bytelinkedopenhashmap.putAndMoveToFirst(block_a, (byte) (flag ? 1 : 0));
}

View File

@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d8c899566533dda4cf5e700769c842f93e5c0b49..8df80c5cfaee022e5796dcced0185ddcd794fa0d 100644
index 0c82be4f9dc6886c19b0f2edca019f7e6ffff6c2..8eddc8fb65c0f248d735841561444cb96c214833 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -142,7 +142,6 @@ import org.bukkit.event.entity.EntityTeleportEvent;
@@ -64,10 +64,10 @@ index d8c899566533dda4cf5e700769c842f93e5c0b49..8df80c5cfaee022e5796dcced0185ddc
if (this.isSpectator()) {
return false;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index fafc8b84d6b6368c70b8eedfdb4c3a9deace9c26..9153d333f17d8b2864d1572473fdf561881905b0 100644
index c39894e824334f1dc52e0466cf9d84f7e219be70..b32f8960d707b1567db059b14456623658ebf159 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -297,7 +297,7 @@ public class ActivationRange
@@ -296,7 +296,7 @@ public class ActivationRange
if ( entity instanceof LivingEntity )
{
LivingEntity living = (LivingEntity) entity;

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 35674f92a67f93382103c2766df4b678ba5c862f..e8bb35322d3204e6a126bc6df0beed3f931dae6d 100644
index 529ab44baaf573b97cf7e89560c548642733188f..733ff850468c8a6474a15a455e89bf1195dd7e65 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -178,6 +178,7 @@ public class ServerEntity {
@@ -184,6 +184,7 @@ public class ServerEntity {
boolean flag6 = k < -32768L || k > 32767L || l < -32768L || l > 32767L || i1 < -32768L || i1 > 32767L;
if (!flag6 && this.teleportDelay <= 400 && !this.wasRiding && this.wasOnGround == this.entity.onGround()&& !(io.papermc.paper.configuration.GlobalConfiguration.get().collisions.sendFullPosForHardCollidingEntities && this.entity.hardCollides())) { // Paper - send full pos for hard colliding entities to prevent collision problems due to desync
@@ -42,7 +42,7 @@ index 35674f92a67f93382103c2766df4b678ba5c862f..e8bb35322d3204e6a126bc6df0beed3f
if ((!flag2 || !flag3) && !(this.entity instanceof AbstractArrow)) {
if (flag2) {
packet1 = new ClientboundMoveEntityPacket.Pos(this.entity.getId(), (short) ((int) k), (short) ((int) l), (short) ((int) i1), this.entity.onGround());
@@ -191,6 +192,7 @@ public class ServerEntity {
@@ -197,6 +198,7 @@ public class ServerEntity {
flag4 = true;
flag5 = true;
}

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 39e95e11c3c7c784a007138b65860e4b0c7c43bb..ff484009c8e0f9ecf0381e33670c13d30f47829d 100644
index 25af78bbb07e174f6c57e26743421f2143d73bd7..89631d1af894647fe4469f88e39c4506805ab96d 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -212,6 +212,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -211,6 +211,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public abstract ResourceKey<LevelStem> getTypeKey();
@@ -50,7 +50,7 @@ index 39e95e11c3c7c784a007138b65860e4b0c7c43bb..ff484009c8e0f9ecf0381e33670c13d3
protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, GaleWorldConfiguration> galeWorldConfigCreator, java.util.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor // Gale - Gale configuration // Gale - Purpur - remove vanilla profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
@@ -234,6 +243,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -233,6 +242,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
});
final DimensionType dimensionmanager = (DimensionType) holder.value();

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 57bdaf48e7f1edc387d0ebbaada7b9643c2e8410..486ae8532fc0a3fb44cbb98bb0e2d042f38bf5bb 100644
index f07a0008387c18dae5b133b90ed291b364428d02..76604a8d3aa6ce7b3c7abfb37f1a059a9e793fe0 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -1451,8 +1451,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1441,8 +1441,30 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
return ChunkMap.this.level.getServer().getScaledTrackingDistance(initialDistance);
}
@@ -65,7 +65,7 @@ index 57bdaf48e7f1edc387d0ebbaada7b9643c2e8410..486ae8532fc0a3fb44cbb98bb0e2d042
Iterator iterator = this.entity.getIndirectPassengers().iterator();
while (iterator.hasNext()) {
@@ -1464,6 +1486,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
@@ -1454,6 +1476,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
i = j;
}
}

View File

@@ -31,14 +31,14 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
index 34f319ad09276c6f68dde449c79351de0d7d86f5..faa95db38528b24f2274e92f71e3001a640a428b 100644
index 07519c817cc6de04a98198c43a0c2b02ba3141eb..13a8d345a8876810dc1efafc55c98243fbbbf873 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
@@ -119,6 +119,7 @@ public abstract class MoveToBlockGoal extends Goal {
@@ -120,6 +120,7 @@ public abstract class MoveToBlockGoal extends Goal {
for(int m = 0; m <= l; m = m > 0 ? -m : 1 - m) {
for(int n = m < l && m > -l ? l : 0; n <= l; n = n > 0 ? -n : 1 - n) {
mutableBlockPos.setWithOffset(blockPos, m, k - 1, n);
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
this.blockPos = mutableBlockPos;
setTargetPosition(mutableBlockPos.immutable()); // Paper
this.mob.movingTarget = mutableBlockPos == BlockPos.ZERO ? null : mutableBlockPos.immutable(); // Paper

View File

@@ -31,19 +31,19 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d1bdfda6f24d6c9a103e20eb36e6ca3ff6466b6c..66e10dd20961d49742a5f016dab9c2cd1a2b64b6 100644
index df915549b366d25727ac9c6ff4e9521927ad50c8..71d9ed6d3067c64165c41b35f2ea41791dd597b9 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -440,6 +440,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.originWorld;
@@ -501,6 +501,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return chunkMap.playerEntityTrackerTrackMaps[type.ordinal()].getObjectsInRange(MCUtil.getCoordinateKey(this));
}
// Paper end
// Paper end - optimise entity tracking
+
public float getBukkitYaw() {
return this.yRot;
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
index 7204b973c3ad9239e82355513f6d538107102e48..526494aab4212311c3a8cdb9288629a39cc0eeb9 100644
index 897d7632ecfea40890433474870dd7a5e534d8ab..58b82ac5b861ccb489f5586452ae020050be5ec8 100644
--- a/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/src/main/java/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -23,9 +23,11 @@ public class AttributeMap {

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 62eac1a915177ffe935f6a19a567932f6c787f75..ec840eb5438eaa9aadfdf62b0c7d4810e83d6402 100644
index 83c001e809c76a5ec0b314967839713e63d67f0d..3fa891050ef7e62668ecdcf939d702db92514b23 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -899,7 +899,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -894,7 +894,20 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
@@ -57,22 +57,22 @@ index 62eac1a915177ffe935f6a19a567932f6c787f75..ec840eb5438eaa9aadfdf62b0c7d4810
}
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index ff484009c8e0f9ecf0381e33670c13d30f47829d..5ddae106ccd4a81dd0e3f873f7f64c0061814669 100644
index 89631d1af894647fe4469f88e39c4506805ab96d..1a11939a1ffdeca87e18dc5279b11cf96b395407 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1329,13 +1329,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1324,13 +1324,13 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
try {
tickConsumer.accept(entity);
MinecraftServer.getServer().executeMidTickTasks(); // Paper - execute chunk tasks mid tick
- } catch (Throwable throwable) {
+ } catch (Throwable throwable) { // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
if (throwable instanceof ThreadDeath) throw throwable; // Paper
// Paper start - Prevent tile entity and entity crashes
// Paper start - Prevent block entity and entity crashes
final String msg = String.format("Entity threw exception at %s:%s,%s,%s", entity.level().getWorld().getName(), entity.getX(), entity.getY(), entity.getZ());
MinecraftServer.LOGGER.error(msg, throwable);
getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable)));
getCraftServer().getPluginManager().callEvent(new ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
- entity.discard();
+ entity.discard(); // Gale - Airplane - remove lambda from ticking guard - diff on change ServerLevel#tick
// Paper end
// Paper end - Prevent block entity and entity crashes
}
}

View File

@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 5724f794b898f439a0f0929bbf2937b3b9de1a9f..f06db4f9cdddcbedaa3cb047ed4dd81be8547f13 100644
index 71d9ed6d3067c64165c41b35f2ea41791dd597b9..683ec06badc4943d80e51ee3f9bd58f4be5e2b16 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4394,16 +4394,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4386,16 +4386,18 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public boolean updateFluidHeightAndDoFluidPushing(TagKey<Fluid> tag, double speed) {
@@ -60,7 +60,7 @@ index 5724f794b898f439a0f0929bbf2937b3b9de1a9f..f06db4f9cdddcbedaa3cb047ed4dd81b
double d1 = 0.0D;
boolean flag = this.isPushedByFluid();
boolean flag1 = false;
@@ -4411,14 +4413,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4403,14 +4405,61 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
int k1 = 0;
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
@@ -128,7 +128,7 @@ index 5724f794b898f439a0f0929bbf2937b3b9de1a9f..f06db4f9cdddcbedaa3cb047ed4dd81b
if (d2 >= axisalignedbb.minY) {
flag1 = true;
@@ -4440,9 +4489,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4432,9 +4481,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// CraftBukkit end
}
}
@@ -142,7 +142,7 @@ index 5724f794b898f439a0f0929bbf2937b3b9de1a9f..f06db4f9cdddcbedaa3cb047ed4dd81b
if (vec3d.length() > 0.0D) {
if (k1 > 0) {
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index f0de72afad4bb571153436399386a6a8a70582a6..9712e6d62fab5d99dcc9644b1708c30d7d78af34 100644
index 796bbef3544e06b8e7aac7e8ac5f740a2613f4bd..f34b5ecf71602c95208d0f72e56c636b3a2bc34a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -25,6 +25,7 @@ public class LevelChunkSection {
@@ -169,11 +169,11 @@ index f0de72afad4bb571153436399386a6a8a70582a6..9712e6d62fab5d99dcc9644b1708c30d
}
this.updateBlockCallback(x, y, z, iblockdata1, state); // Paper - optimise collisions
@@ -161,6 +164,7 @@ public class LevelChunkSection {
if (fluid.isRandomlyTicking()) {
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
}
@@ -162,6 +165,7 @@ public class LevelChunkSection {
if (fluid.isRandomlyTicking()) {
this.tickingFluidCount = (short) (this.tickingFluidCount + 1);
}
+ this.fluidStateCount++; // Gale - Airplane - reduce entity fluid lookups if no fluids
}
}
// Paper start - optimise collisions
// Paper start - optimise collisions

View File

@@ -22,7 +22,7 @@ you to easily disable books, should you want to preemptively remove this
functionality before additional exploits are found.
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index e5d734234ae0543b0772e8a12da3f60b3a97a6cb..054119323bcb5efb6688a68dbe47818fb79e8c71 100644
index 8ca5d7c1bfacb1b47aa680eee167af08d0396ae0..521153303fca35df7d4589abda772cc27b565ede 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -186,6 +186,8 @@ import net.minecraft.world.phys.Vec3;
@@ -34,7 +34,7 @@ index e5d734234ae0543b0772e8a12da3f60b3a97a6cb..054119323bcb5efb6688a68dbe47818f
import org.slf4j.Logger;
// CraftBukkit start
@@ -1124,6 +1126,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1121,6 +1123,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
@@ -43,7 +43,7 @@ index e5d734234ae0543b0772e8a12da3f60b3a97a6cb..054119323bcb5efb6688a68dbe47818f
+ return;
+ }
+ // Gale end - Pufferfish - make book writing configurable
// Paper start
// Paper start - Book size limits
if (!this.cserver.isPrimaryThread()) {
List<String> pageList = packet.getPages();
diff --git a/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java b/src/main/java/org/bukkit/craftbukkit/util/permissions/CraftDefaultPermissions.java

View File

@@ -22,7 +22,7 @@ data is already available in the blockPosition struct, so we use that
instead of re-doing the casting.
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index adfb793ba2ca4552e0b800d37f166ea55562a57a..af49374eea8e85917687da19e8aa7491e560e41b 100644
index 7ec5be740f34508d59bd7a41e4388e0d705aa278..f6afb663d9687ab8bf2bd14986f0952d35e3ef8b 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -210,7 +210,7 @@ public final class MCUtil {
@@ -35,10 +35,10 @@ index adfb793ba2ca4552e0b800d37f166ea55562a57a..af49374eea8e85917687da19e8aa7491
public static long getCoordinateKey(final ChunkPos pair) {
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index b0a18b5b1f3904093439b6993e32734eae3544fa..1939f5037376d5968a649c9d90f74edd592a7d5e 100644
index 683ec06badc4943d80e51ee3f9bd58f4be5e2b16..a1cbb62b518d14a605bda2e9c5b0bd0289d84a60 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -309,7 +309,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -308,7 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public double yo;
public double zo;
private Vec3 position;

View File

@@ -13,22 +13,22 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 3e8e5fe6a67af911847e7f4c3e2874a340d39016..e91f27cde736c3ef49c44180a718e5c8980c2f38 100644
index e8ebc8588642479f22c6971bb2ea8ba557d9596a..932eb924a9d37130b53949d55c8d9e678900efd2 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -275,6 +275,7 @@ public class ServerPlayer extends Player {
public boolean joining = true;
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
+ public boolean didPlayerJoinEvent = false; // Gale - EMC - do not process chat/commands before player has joined
// CraftBukkit end
public boolean isRealPlayer; // Paper
public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> cachedSingleHashSet; // Paper
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 054119323bcb5efb6688a68dbe47818fb79e8c71..d8ab047a573590afa3b3976393537e4ac06365ec 100644
index 521153303fca35df7d4589abda772cc27b565ede..cb70e6f6b9db9637977eff1eebdf868713fe73c6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -2280,6 +2280,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2260,6 +2260,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
return Optional.empty();
@@ -40,7 +40,7 @@ index 054119323bcb5efb6688a68dbe47818fb79e8c71..d8ab047a573590afa3b3976393537e4a
this.player.resetLastActionTime();
return optional;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e6b84e4891927d79f993944ea4d3525c68c6c1b9..caa365842067207e357053e2b3ae054a9de71027 100644
index e0ee45036b9bf14a6e2013fe291cde0402b85b1f..a9acf052c61b0592da9cf3ade8c4c8f7ba068dad 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -347,6 +347,8 @@ public abstract class PlayerList {

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d8ab047a573590afa3b3976393537e4ac06365ec..377398ee22fb53f0a4bef841d1f7e2750787b3a6 100644
index cb70e6f6b9db9637977eff1eebdf868713fe73c6..1cace957572e60ac595b81910b58c2fcdc76298e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -187,6 +187,7 @@ import net.minecraft.world.phys.shapes.BooleanOp;
@@ -18,7 +18,7 @@ index d8ab047a573590afa3b3976393537e4ac06365ec..377398ee22fb53f0a4bef841d1f7e275
import org.galemc.gale.configuration.GaleGlobalConfiguration;
import org.slf4j.Logger;
@@ -2449,7 +2450,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2429,7 +2430,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// CraftBukkit start
String s = message.signedContent();
if (s.isEmpty()) {

View File

@@ -28,7 +28,7 @@ index e4fd372a1d585887287253a02531cd192929377b..397f985756c5bc6c11a32c844d536000
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 75b9b73b7938816337a4ba7a65cb631051498751..b4baebee042e3287fa24f3865c1ec01efbde6b3b 100644
index a9acf052c61b0592da9cf3ade8c4c8f7ba068dad..25ddf54a4c07c7be1f9ecafe411ff83f3522063d 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -100,6 +100,7 @@ import net.minecraft.world.phys.Vec3;
@@ -39,7 +39,7 @@ index 75b9b73b7938816337a4ba7a65cb631051498751..b4baebee042e3287fa24f3865c1ec01e
import org.slf4j.Logger;
// CraftBukkit start
@@ -1433,7 +1434,7 @@ public abstract class PlayerList {
@@ -1432,7 +1433,7 @@ public abstract class PlayerList {
// Paper end
boolean flag = this.verifyChatTrusted(message);

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 45c07733f03b5c11f6d8e820f65dc950c70d9a67..fa1888db518d22e4069b4dcc42d80560181243e7 100644
index 9daf8aa557d9f4fdbcc138a47892ea5a061dd877..af1baf10490f5792481f072ca34fba9494dcd1e2 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -133,7 +133,7 @@ public class FallingBlockEntity extends Entity {
@@ -49,9 +49,9 @@ index 45c07733f03b5c11f6d8e820f65dc950c70d9a67..fa1888db518d22e4069b4dcc42d80560
return;
}
// Paper end - fix sand duping
@@ -150,7 +150,7 @@ public class FallingBlockEntity extends Entity {
this.move(MoverType.SELF, this.getDeltaMovement());
@@ -149,7 +149,7 @@ public class FallingBlockEntity extends Entity {
this.move(MoverType.SELF, this.getDeltaMovement());
// Paper start - fix sand duping
- if (this.isRemoved()) {
+ if (this.level().galeConfig().gameplayMechanics.fixes.sandDuping && this.isRemoved()) { // Gale - Purpur - make sand duping fix configurable

View File

@@ -19,10 +19,10 @@ the displayed hunger bar never goes down. Hunger (or any related value, includin
should not go down on peaceful. See https://bugs.mojang.com/browse/MC-31819.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index ccc1caafb0ada52c7b99b7358253826f5390843e..544b610f7c42a57099115fb5f76245f6c7a6eca3 100644
index 44a17a8e763455e834dcf488044a0f4907ce346e..c37e0321392c3e65f02a0ac26843b8af06b4826a 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -1866,6 +1866,11 @@ public abstract class Player extends LivingEntity {
@@ -1864,6 +1864,11 @@ public abstract class Player extends LivingEntity {
}
public void causeFoodExhaustion(float f, EntityExhaustionEvent.ExhaustionReason reason) {

View File

@@ -13,13 +13,13 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 206f179a4c6ea8eab75200ee72efb21e29d28a53..2306d7aca29b3e399f152eb8470115e6f7bb172a 100644
index 25ddf54a4c07c7be1f9ecafe411ff83f3522063d..3c0d21f964cd0ed4ead16ebd9d662059137ff8b3 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -490,7 +490,13 @@ public abstract class PlayerList {
@@ -489,7 +489,13 @@ public abstract class PlayerList {
scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
}
// Paper end
// CraftBukkit - Moved from above, added world
// Paper end - Configurable player collision
+ if (GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), s1, player.getId(), worldserver1.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
+ // Gale start - JettPack - make logging login location configurable

View File

@@ -181,7 +181,7 @@ index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b4c2fbdd56ba278560fc1c0d7e086dce
@Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 4c8f2dbdd6e384be026ae1c890096f89fd744eb0..27f133159d3b9a128faa764e9605f690bf51ed4c 100644
index eea9866aecb7189455319d83561fcef35a777d7a..81976797e7c384ddd629d28c76837d9d83fd5b13 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -1,6 +1,5 @@
@@ -325,7 +325,7 @@ index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..43f402d9032e4570a81a80e412215598
protected CipherBase(Cipher cipher) {
this.cipher = cipher;
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 81fb880cdcd433bd692461b3d7b315f30d2747f7..9fc2b83c4e99da8bd9e0fdd6bb1d5ff8520f1e57 100644
index b189aeb8646b5385c7cca0c4babfcb071a642220..7dedd112bd220bee86d56afbb401c20baf44b3ec 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -23,7 +23,6 @@ import io.netty.channel.epoll.EpollSocketChannel;
@@ -377,7 +377,7 @@ index d45e39bc009281c298f3dfae113dc87f2b3b1fbd..25f25c3e2882e11a80142d3282a020d2
private static final Codec<Object> ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC).xmap((either) -> {
return either.map((object) -> {
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 4a565321174d9230823a07cf37fb104f9f92245f..d619d520486f15602916d03dc10abae1db91de69 100644
index 61840cfd64caba6595dfc99c91c76a195638d4ee..96cb26fae947006ae7bceb3187ed2c28c4214f16 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -87,7 +87,7 @@ public class Main {
@@ -390,10 +390,10 @@ index 4a565321174d9230823a07cf37fb104f9f92245f..d619d520486f15602916d03dc10abae1
OptionSpec<Integer> optionspec10 = optionparser.accepts("port").withRequiredArg().ofType(Integer.class).defaultsTo(-1, new Integer[0]);
OptionSpec<String> optionspec11 = optionparser.accepts("serverId").withRequiredArg();
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 29e06ff52c34fa4cc64d808fe8107435b001ed89..dc2762f3c5eca99e74cfc75d5fcdb15f0378a7b9 100644
index 733ff850468c8a6474a15a455e89bf1195dd7e65..04249a147f2c0a41499d1149a1f9749689074232 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -329,7 +329,7 @@ public class ServerEntity {
@@ -335,7 +335,7 @@ public class ServerEntity {
if (this.entity instanceof LivingEntity) {
List<Pair<EquipmentSlot, ItemStack>> list = Lists.newArrayList();
@@ -403,7 +403,7 @@ index 29e06ff52c34fa4cc64d808fe8107435b001ed89..dc2762f3c5eca99e74cfc75d5fcdb15f
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ec840eb5438eaa9aadfdf62b0c7d4810e83d6402..ceb91d3fc2463e0518f889299e21f612476b016a 100644
index 3fa891050ef7e62668ecdcf939d702db92514b23..e18764104c306de17ced824b96e163b2466b8dba 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -38,6 +38,8 @@ import java.util.stream.Collectors;
@@ -415,7 +415,7 @@ index ec840eb5438eaa9aadfdf62b0c7d4810e83d6402..ceb91d3fc2463e0518f889299e21f612
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.Util;
@@ -1049,7 +1051,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1044,7 +1046,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
BlockPos blockposition2 = blockposition.set(j + randomX, randomY, k + randomZ);
BlockState iblockdata = com.destroystokyo.paper.util.maplist.IBlockDataList.getBlockDataFromRaw(raw);
@@ -424,7 +424,7 @@ index ec840eb5438eaa9aadfdf62b0c7d4810e83d6402..ceb91d3fc2463e0518f889299e21f612
}
// We drop the fluid tick since LAVA is ALREADY TICKED by the above method (See LiquidBlock).
// TODO CHECK ON UPDATE (ping the Canadian)
@@ -1355,7 +1357,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1350,7 +1352,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
@@ -434,7 +434,7 @@ index ec840eb5438eaa9aadfdf62b0c7d4810e83d6402..ceb91d3fc2463e0518f889299e21f612
return ret;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 377398ee22fb53f0a4bef841d1f7e2750787b3a6..a4b86d40728341cf9baeacc8c0478cc30c0b4f50 100644
index 1cace957572e60ac595b81910b58c2fcdc76298e..7ca3cddf3a25d01cc02599873f7661e87fe16f93 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -28,6 +28,8 @@ import java.util.function.UnaryOperator;
@@ -463,24 +463,8 @@ index 377398ee22fb53f0a4bef841d1f7e2750787b3a6..a4b86d40728341cf9baeacc8c0478cc3
import org.bukkit.event.player.PlayerChatEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
@@ -775,13 +774,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - run this async
// CraftBukkit start
if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper start - split and make configurable
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause // Gale - JettPack - reduce array allocations
return;
}
// Paper start
String str = packet.getCommand(); int index = -1;
if (str.length() > 64 && ((index = str.indexOf(' ')) == -1 || index >= 64)) {
- server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", new Object[0]))); // Paper
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam", ArrayConstants.emptyObjectArray), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper // Paper - kick event cause // Gale - JettPack - reduce array allocations
return;
}
// Paper end
@@ -3221,7 +3220,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start
@@ -3201,7 +3200,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
// Paper start - auto recipe limit
if (!org.bukkit.Bukkit.isPrimaryThread()) {
if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
- this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam", new Object[0]), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
@@ -489,7 +473,7 @@ index 377398ee22fb53f0a4bef841d1f7e2750787b3a6..a4b86d40728341cf9baeacc8c0478cc3
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 9490d5890f5bdea17c4aef1a5e43998eeee4bcd7..fe75d37ed1f2affef47c2f78bd4af3568180da48 100644
index 854aea894b8efeb4cdd591507a2a414d751d7bbb..83d2b25529efec93ec22c3739bf87cc7bb79ac5f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -13,9 +13,10 @@ import java.security.PrivateKey;
@@ -536,7 +520,7 @@ index 9490d5890f5bdea17c4aef1a5e43998eeee4bcd7..fe75d37ed1f2affef47c2f78bd4af356
ServerConfigurationPacketListenerImpl serverconfigurationpacketlistenerimpl = new ServerConfigurationPacketListenerImpl(this.server, this.connection, commonlistenercookie, this.player); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 911faf0dc1398d91f4c0e8de89c3a4380e049263..65cc4cc0051476e761b6b0584f5e7281b7a2fac6 100644
index 3c0d21f964cd0ed4ead16ebd9d662059137ff8b3..0fdbd05af21cb33d54addb59c236263e16a12ebd 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -25,6 +25,8 @@ import java.util.UUID;
@@ -548,7 +532,7 @@ index 911faf0dc1398d91f4c0e8de89c3a4380e049263..65cc4cc0051476e761b6b0584f5e7281
import net.minecraft.ChatFormatting;
import net.minecraft.FileUtil;
import net.minecraft.commands.CommandSourceStack;
@@ -723,7 +725,7 @@ public abstract class PlayerList {
@@ -722,7 +724,7 @@ public abstract class PlayerList {
while (iterator.hasNext()) {
entityplayer = (ServerPlayer) iterator.next();
this.save(entityplayer); // CraftBukkit - Force the player's inventory to be saved
@@ -558,7 +542,7 @@ index 911faf0dc1398d91f4c0e8de89c3a4380e049263..65cc4cc0051476e761b6b0584f5e7281
// Instead of kicking then returning, we need to store the kick reason
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 665120a62525f56912263a3e1b6f12f6c3e15dec..71e1c1a1ae59f74cfeea071aa6988f6fe47a286d 100644
index 35f973cc2c0989256fa21abaf0327c2f36dbe4c9..219e0059418e6d64f5b859ba253c3cf3e91713cf 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -1,7 +1,6 @@
@@ -578,7 +562,7 @@ index 665120a62525f56912263a3e1b6f12f6c3e15dec..71e1c1a1ae59f74cfeea071aa6988f6f
import net.minecraft.Util;
import net.minecraft.util.GsonHelper;
import org.slf4j.Logger;
@@ -79,7 +80,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@@ -77,7 +78,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
}
public String[] getUserList() {
@@ -608,7 +592,7 @@ index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..a4f7fee3ea112c8f7b0b94949f9eb899
}
}
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
index 311625277a26c9c187025a1036978229241b965f..79b223ef3c86f3bc035e9abd84aa080b5d722f61 100644
index f8de91393564b3691c17339ac9196cc0fc1cf748..d06b49a47c2dcb4b235e5353f347640ee34f1da3 100644
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
@@ -2,10 +2,11 @@ package net.minecraft.util;
@@ -638,7 +622,7 @@ index 2e324276ea4cd9e528c6a3f9a9ba394b378fe075..8e91714e3167ab0ad16df681bc080772
private EquipmentSlot(EquipmentSlot.Type type, int entityId, int armorStandId, String name) {
this.type = type;
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 59071351d60514bf23626dd9d4140be537321e9c..171b81067377f6fface9a8cd9922a194334c50b1 100644
index a3e74ee433814da7670fb3dc472a67a8fff7ff6d..e0a6b34323fb6eaf552d794cfd72bdb95e4f0095 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3139,7 +3139,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -651,7 +635,7 @@ index 59071351d60514bf23626dd9d4140be537321e9c..171b81067377f6fface9a8cd9922a194
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 3bf473e2904b4279b1bc14a0fa75ffe25189d1d2..cd5c19380a808719476acc51e8d5c022e627992c 100644
index 684749248be7d3a258f84398fd6d0073eeb11a17..40edbefa9efaa897d203d4cf13ea796d6f35b965 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1056,7 +1056,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
@@ -704,7 +688,7 @@ index 7de9d012e7416eaa0189b513a0972c846e93c4b6..9274015f58c71f991903bd28434a4832
for (int j = 0; j < i; ++j) {
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
index 46c7c36a07169915f7409f1146e5066e8ac65c21..cc5ee9936dc00fe142abf9cb7750133f50409dbf 100644
index ed27a963223bfe18310ad5adabf461b5e307ef9c..5ab93a8790f48e72f17a86bd84c16ab2cb8e956c 100644
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
@@ -1052,7 +1052,7 @@ public final class ItemStack {
@@ -756,7 +740,7 @@ index 6c2e8049c2197ddc912c1a0fc99c87beae81e25b..a13822a22ab524a0fb9fd998c4ada06b
private static Enchantment register(String name, Enchantment enchantment) {
return Registry.register(BuiltInRegistries.ENCHANTMENT, name, enchantment);
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 5ddae106ccd4a81dd0e3f873f7f64c0061814669..a2d388ff4dd85daf0ffed2161e55538842c815cd 100644
index 1a11939a1ffdeca87e18dc5279b11cf96b395407..7e0cc7e9cbcfcdfa9c0ed2aab4c0e4d6813d1040 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -12,6 +12,8 @@ import java.util.function.Consumer;
@@ -768,7 +752,7 @@ index 5ddae106ccd4a81dd0e3f873f7f64c0061814669..a2d388ff4dd85daf0ffed2161e555388
import net.minecraft.CrashReport;
import net.minecraft.CrashReportCategory;
import net.minecraft.core.BlockPos;
@@ -1851,7 +1853,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -1866,7 +1868,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
io.papermc.paper.world.ChunkEntitySlices slices = ((ServerLevel)this).getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {
@@ -818,7 +802,7 @@ index d78fe4081bc2938326066e0afddb4a6c833a4bf7..f991a3f0ba55aeb99138038618f80bd3
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
index b39c6c91e088dbe2187ed7fd598076f41c53bd49..f64682dc7476c25c8a14608ba156a901029e65d8 100644
index d04fc84eef11adb5ea64077f48794b6ed7fb3ada..a1ee7133d182dcbacf474172a9f1b5c0219102c6 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -9,6 +9,8 @@ import java.util.Iterator;
@@ -840,7 +824,7 @@ index b39c6c91e088dbe2187ed7fd598076f41c53bd49..f64682dc7476c25c8a14608ba156a901
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
public static final int DATA_LIT_DURATION = 1;
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index b3a90d6ef0e17c236e0b3c46e2d0012671afdaa7..9c82568d31da70e30c45dbb41be48026eb0dc85a 100644
index 63e187c65cb855031f286aad0d25ac4694f7a331..083849817786e08d23b05f8cc6c2469ce19e9107 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -6,13 +6,14 @@ import java.io.File;

View File

@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 1939f5037376d5968a649c9d90f74edd592a7d5e..f97790842558577238949efbbb21fc31de6b5141 100644
index a1cbb62b518d14a605bda2e9c5b0bd0289d84a60..81163774d783bfdefaf0031b589e8496ab0d3a92 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -308,7 +308,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -307,7 +307,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public double xo;
public double yo;
public double zo;
@@ -45,7 +45,7 @@ index 1939f5037376d5968a649c9d90f74edd592a7d5e..f97790842558577238949efbbb21fc31
this.absMoveTo(x, y, z);
this.setYRot(yaw % 360.0F);
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index cd5c19380a808719476acc51e8d5c022e627992c..465cfffbbc5db5fb2c95e953db09d3169b52060d 100644
index 40edbefa9efaa897d203d4cf13ea796d6f35b965..d3a1af49024c7cd2854dc8a715450adc64aa083e 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -1690,13 +1690,29 @@ public abstract class Mob extends LivingEntity implements Targeting {

View File

@@ -13,10 +13,10 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f97790842558577238949efbbb21fc31de6b5141..dd8eb98086c4d303c54d0f8bf45fcabd7039686c 100644
index 81163774d783bfdefaf0031b589e8496ab0d3a92..54a95ea88f79f58d1214a0e6a3d8fe6492a53f3c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -317,6 +317,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -316,6 +316,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
public float yRotO;
public float xRotO;
private AABB bb;
@@ -24,7 +24,7 @@ index f97790842558577238949efbbb21fc31de6b5141..dd8eb98086c4d303c54d0f8bf45fcabd
public boolean onGround;
public boolean horizontalCollision;
public boolean verticalCollision;
@@ -1077,6 +1078,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -1076,6 +1077,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
// Paper end - detailed watchdog information
public void move(MoverType movementType, Vec3 movement) {
@@ -33,10 +33,10 @@ index f97790842558577238949efbbb21fc31de6b5141..dd8eb98086c4d303c54d0f8bf45fcabd
+ return;
+ }
+ // Gale end - VMP - skip entity move if movement is zero
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
io.papermc.paper.util.TickThread.ensureTickThread("Cannot move an entity off-main");
synchronized (this.posLock) {
@@ -4075,6 +4081,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4070,6 +4076,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
}
public final void setBoundingBox(AABB boundingBox) {

View File

@@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index dd8eb98086c4d303c54d0f8bf45fcabd7039686c..f077ecfd1d65ca42e6a5dc12d9bfa09688cfe587 100644
index 54a95ea88f79f58d1214a0e6a3d8fe6492a53f3c..ab0ebade8eeb125007884acabdd5d1acb3ecf9b4 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -879,7 +879,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -878,7 +878,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
this.checkBelowWorld();
if (!this.level().isClientSide) {

View File

@@ -13,10 +13,10 @@ As part of: SportPaper (https://github.com/Electroid/SportPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index ceb91d3fc2463e0518f889299e21f612476b016a..508d22f505bdc277520900c92fd6d96eb23990e7 100644
index e18764104c306de17ced824b96e163b2466b8dba..1591e201ebca4354d5912d3f803f59759af1ba6e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1757,7 +1757,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1737,7 +1737,17 @@ public class ServerLevel extends Level implements WorldGenLevel {
@Override
public void destroyBlockProgress(int entityId, BlockPos pos, int progress) {
@@ -35,7 +35,7 @@ index ceb91d3fc2463e0518f889299e21f612476b016a..508d22f505bdc277520900c92fd6d96e
// CraftBukkit start
Player entityhuman = null;
@@ -1780,7 +1790,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
@@ -1760,7 +1770,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) {

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5c08c176d 100644
index 0fdbd05af21cb33d54addb59c236263e16a12ebd..18f8e64b17d482066f74a4790494552036b12454 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -13,6 +13,8 @@ import java.net.SocketAddress;
@@ -70,7 +70,7 @@ index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5
this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
this.playersByUUID.put(player.getUUID(), player);
// this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(entityplayer))); // CraftBukkit - replaced with loop below
@@ -671,6 +675,7 @@ public abstract class PlayerList {
@@ -670,6 +674,7 @@ public abstract class PlayerList {
entityplayer.retireScheduler(); // Paper - Folia schedulers
entityplayer.getAdvancements().stopListening();
this.players.remove(entityplayer);
@@ -78,7 +78,7 @@ index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.server.getCustomBossEvents().onPlayerDisconnect(entityplayer);
UUID uuid = entityplayer.getUUID();
@@ -832,6 +837,7 @@ public abstract class PlayerList {
@@ -831,6 +836,7 @@ public abstract class PlayerList {
// Paper end - Expand PlayerRespawnEvent
entityplayer.stopRiding(); // CraftBukkit
this.players.remove(entityplayer);
@@ -86,7 +86,7 @@ index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5
this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
entityplayer.serverLevel().removePlayerImmediately(entityplayer, Entity.RemovalReason.DISCARDED);
BlockPos blockposition = entityplayer.getRespawnPosition();
@@ -968,6 +974,7 @@ public abstract class PlayerList {
@@ -967,6 +973,7 @@ public abstract class PlayerList {
if (!entityplayer.connection.isDisconnected()) {
worldserver1.addRespawnedPlayer(entityplayer1);
this.players.add(entityplayer1);
@@ -94,7 +94,7 @@ index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5
this.playersByName.put(entityplayer1.getScoreboardName().toLowerCase(java.util.Locale.ROOT), entityplayer1); // Spigot
this.playersByUUID.put(entityplayer1.getUUID(), entityplayer1);
}
@@ -1026,20 +1033,55 @@ public abstract class PlayerList {
@@ -1025,20 +1032,55 @@ public abstract class PlayerList {
this.sendPlayerPermissionLevel(player, i, recalculatePermissions); // Paper - avoid recalculating permissions if possible
}
@@ -157,7 +157,7 @@ index 65cc4cc0051476e761b6b0584f5e7281b7a2fac6..294b612534194180a9af7d9039bf3df5
}
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index ad291fa31741af85c86dab66b753705f96a0634a..878c545c6f8e97fdcbf00cc413898919e534aa81 100644
index c37e0321392c3e65f02a0ac26843b8af06b4826a..4d2502d77cc78c1382f108efad9a2a47e712cbd9 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -39,6 +39,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
@@ -168,7 +168,7 @@ index ad291fa31741af85c86dab66b753705f96a0634a..878c545c6f8e97fdcbf00cc413898919
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
@@ -194,12 +195,15 @@ public abstract class Player extends LivingEntity {
@@ -192,12 +193,15 @@ public abstract class Player extends LivingEntity {
}
// CraftBukkit end

View File

@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 45ed45e636421cc49d78f05a0e75c9a88f13c112..908166ab8afd41a67493eb7c2ad574c327e200bf 100644
index 18f8e64b17d482066f74a4790494552036b12454..8c07bb29d28c7eacebfedb4ef90a8a441353883e 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1069,14 +1069,18 @@ public abstract class PlayerList {
@@ -1068,14 +1068,18 @@ public abstract class PlayerList {
// Gale start - Purpur - spread out sending all player info
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
if (sendAllPlayerInfoBucket != null) {

View File

@@ -37,18 +37,18 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
index 9d25fcd598517871eb260dff3d208e3b4ec33251..1aac80a41abb983d10a9999653b9611d84e7217d 100644
index 7600991949de84b6667c0a80bfec4a13823ab9b8..3842fcd51f2a56aaa6d2fd190e837f5862e6ab87 100644
--- a/src/main/java/net/minecraft/commands/Commands.java
+++ b/src/main/java/net/minecraft/commands/Commands.java
@@ -500,6 +500,7 @@ public class Commands {
@@ -499,6 +499,7 @@ public class Commands {
private void runSync(ServerPlayer player, Collection<String> bukkit, RootCommandNode<SharedSuggestionProvider> rootcommandnode) {
// Paper end - Async command map building
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper
// Paper end - Perf: Async command map building
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent<CommandSourceStack>(player.getBukkitEntity(), (RootCommandNode) rootcommandnode, false).callEvent(); // Paper - Brigadier API
+ if (PlayerCommandSendEvent.getHandlerList().getRegisteredListeners().length > 0) { // Gale - Purpur - skip PlayerCommandSendEvent if there are no listeners
PlayerCommandSendEvent event = new PlayerCommandSendEvent(player.getBukkitEntity(), new LinkedHashSet<>(bukkit));
event.getPlayer().getServer().getPluginManager().callEvent(event);
@@ -510,6 +511,7 @@ public class Commands {
@@ -509,6 +510,7 @@ public class Commands {
}
}
// CraftBukkit end

View File

@@ -37,7 +37,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 6ddb0abcc89af93e4cff5b0e461bc8490aacbbc3..bd08b6f29177cdfc165416790cac3093499b1871 100644
index e7583996cc6d750cbd72f749de39ecded56d7f7c..d791c2f2facfc46d8664225c8b28f95f92df3413 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -4,6 +4,9 @@ import com.mojang.authlib.GameProfile;
@@ -77,7 +77,7 @@ index 6ddb0abcc89af93e4cff5b0e461bc8490aacbbc3..bd08b6f29177cdfc165416790cac3093
@@ -92,6 +100,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - handle ServerboundKeepAlivePacket async
+ // Gale start - Purpur - send multiple keep-alive packets
+ if (GaleGlobalConfiguration.get().misc.keepalive.sendMultiple) {
+ long id = packet.getId();
@@ -93,7 +93,7 @@ index 6ddb0abcc89af93e4cff5b0e461bc8490aacbbc3..bd08b6f29177cdfc165416790cac3093
@@ -104,6 +122,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
});
// Paper endg
// Paper end - This needs to be handled on the main thread for plugins
}
+ } // Gale - Purpur - send multiple keep-alive packets
@@ -125,11 +125,11 @@ index 6ddb0abcc89af93e4cff5b0e461bc8490aacbbc3..bd08b6f29177cdfc165416790cac3093
}
}
+ } // Gale - Purpur - send multiple keep-alive packets
// Paper end
// Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a4b86d40728341cf9baeacc8c0478cc30c0b4f50..d9c6d49aed9d84c1f317748e113acb068d1e488d 100644
index 7ca3cddf3a25d01cc02599873f7661e87fe16f93..15be6d4c333f6e48608becb6ace7f7d201afa81a 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -8,6 +8,8 @@ import com.mojang.brigadier.StringReader;
@@ -141,7 +141,7 @@ index a4b86d40728341cf9baeacc8c0478cc30c0b4f50..d9c6d49aed9d84c1f317748e113acb06
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import it.unimi.dsi.fastutil.objects.ObjectIterator;
import java.net.SocketAddress;
@@ -3413,6 +3415,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -3393,6 +3395,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
@Override

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
index 73823d637d9859797d57507932d132b21ba46d70..cea5bef4e50ffaa4015f9224625aa6216c65f3b1 100644
index cfd4ac06a9af6bf3fac293110482e1df690e075e..751420687c04719373626ce01af18ad7cb4638bf 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -174,7 +174,7 @@ public class ServerPlayerGameMode {
@@ -16,11 +16,11 @@ index 73823d637d9859797d57507932d132b21ba46d70..cea5bef4e50ffaa4015f9224625aa621
public void handleBlockBreakAction(BlockPos pos, ServerboundPlayerActionPacket.Action action, Direction direction, int worldHeight, int sequence) {
- if (this.player.getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) > ServerGamePacketListenerImpl.MAX_INTERACTION_DISTANCE) {
+ if (this.player.getEyePosition().distanceToSqr(Vec3.atCenterOf(pos)) > ServerGamePacketListenerImpl.getMaxInteractionDistanceSquared(this.player.level())) { // Gale - make max interaction distance configurable
if (true) return; // Paper - Don't notify if unreasonably far away
if (true) return; // Paper - Don't allow digging into unloaded chunks; Don't notify if unreasonably far away
this.debugLogging(pos, false, sequence, "too far");
} else if (pos.getY() >= worldHeight) {
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index d9c6d49aed9d84c1f317748e113acb068d1e488d..ea8a136e2ca0aebc668391e15becd48f7d0e586f 100644
index 15be6d4c333f6e48608becb6ace7f7d201afa81a..e1b6583a3bb9269a14b1e9028a87a6877da5ae78 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -251,7 +251,7 @@ import org.bukkit.inventory.SmithingInventory;
@@ -46,7 +46,7 @@ index d9c6d49aed9d84c1f317748e113acb068d1e488d..ea8a136e2ca0aebc668391e15becd48f
@Override
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
@@ -1934,7 +1941,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -1914,7 +1921,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
BlockPos blockposition = movingobjectpositionblock.getBlockPos();
Vec3 vec3d1 = Vec3.atCenterOf(blockposition);
@@ -55,7 +55,7 @@ index d9c6d49aed9d84c1f317748e113acb068d1e488d..ea8a136e2ca0aebc668391e15becd48f
Vec3 vec3d2 = vec3d.subtract(vec3d1);
double d0 = 1.0000001D;
@@ -2722,7 +2729,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
@@ -2702,7 +2709,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
AABB axisalignedbb = entity.getBoundingBox();

View File

@@ -13,10 +13,10 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index f077ecfd1d65ca42e6a5dc12d9bfa09688cfe587..d1563e21e22c92465db57521ee4fc3619c286997 100644
index ab0ebade8eeb125007884acabdd5d1acb3ecf9b4..9f3b926e73f5c96b4faf6f73d601a578de20cd32 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3696,6 +3696,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -3693,6 +3693,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
Entity entity = this.getType().create(worldserver);
if (entity != null) {

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d1563e21e22c92465db57521ee4fc3619c286997..d0f7351802cb7ab1130254b102ff059c413c10af 100644
index 9f3b926e73f5c96b4faf6f73d601a578de20cd32..5335b8e41f34654254f28862f3852dfdbc9c938f 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4613,6 +4613,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -4605,6 +4605,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
return this.feetBlockState;
}
@@ -28,7 +28,7 @@ index d1563e21e22c92465db57521ee4fc3619c286997..d0f7351802cb7ab1130254b102ff059c
return this.chunkPosition;
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 2935c02fde4b81ac3b8b1c2cc2422f9e01413e7b..2033a14d313db7012733b8de508fc781b3b38327 100644
index 55a30cd5c189213fc46ee26027f5a9f9bb63603e..3a44d9421e539a5d3af372b26af9a4cb347e7716 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2016,19 +2016,43 @@ public abstract class LivingEntity extends Entity implements Attackable {

View File

@@ -13,10 +13,10 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 51f86a87c89057351d6984e655674212da8c7dcc..6dce2cb25a5e8b7c979a3f515e4c6c9cfbacd305 100644
index c43884019b7162c7f58f636a89c7c19c445eec88..68ad7cb06d85c428f3560f95ed46bca32187e729 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -507,11 +507,16 @@ public class ServerChunkCache extends ChunkSource {
@@ -499,11 +499,16 @@ public class ServerChunkCache extends ChunkSource {
this.level.resetIceAndSnowTick(); // Gale - Airplane - optimize random calls in chunk ticking - reset ice & snow tick random
if (this.level.getServer().tickRateManager().runsNormally()) {
@@ -28,13 +28,13 @@ index 51f86a87c89057351d6984e655674212da8c7dcc..6dce2cb25a5e8b7c979a3f515e4c6c9c
+ // Gale end - MultiPaper - skip unnecessary mob spawning computations
this.level.timings.countNaturalMobs.startTiming(); // Paper - timings
int k = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - per player mob spawning
// Paper start - Optional per player mob spawns
int naturalSpawnChunkCount = k;
- NaturalSpawner.SpawnState spawnercreature_d; // moved down
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
// re-set mob counts
for (ServerPlayer player : this.level.players) {
@@ -535,7 +540,11 @@ public class ServerChunkCache extends ChunkSource {
@@ -527,7 +532,11 @@ public class ServerChunkCache extends ChunkSource {
this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
this.lastSpawnState = spawnercreature_d;
@@ -47,7 +47,7 @@ index 51f86a87c89057351d6984e655674212da8c7dcc..6dce2cb25a5e8b7c979a3f515e4c6c9c
// Paper start - optimise chunk tick iteration
ChunkMap playerChunkMap = this.chunkMap;
@@ -623,7 +632,7 @@ public class ServerChunkCache extends ChunkSource {
@@ -615,7 +624,7 @@ public class ServerChunkCache extends ChunkSource {
if (tick && chunk1.chunkStatus.isOrAfter(net.minecraft.server.level.FullChunkStatus.ENTITY_TICKING)) {
// Paper end - optimise chunk tick iteration
chunk1.incrementInhabitedTime(j);
@@ -56,7 +56,7 @@ index 51f86a87c89057351d6984e655674212da8c7dcc..6dce2cb25a5e8b7c979a3f515e4c6c9c
NaturalSpawner.spawnForChunk(this.level, chunk1, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag1);
}
@@ -669,6 +678,20 @@ public class ServerChunkCache extends ChunkSource {
@@ -661,6 +670,20 @@ public class ServerChunkCache extends ChunkSource {
}
}

View File

@@ -13,7 +13,7 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 33b8551ef0d7ac3b29a1c111088a2c1912f5e494..4e51fb4555349bc486e80bcd72b58e3ede1bd1f8 100644
index 67f0ca38ceae1e1485bc23fa862bb3f13de880a6..df2d663ac85ec6b9c15e3bcd7ee4f2924deffd1e 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -43,6 +43,9 @@ import java.util.logging.Logger;
@@ -34,7 +34,7 @@ index 33b8551ef0d7ac3b29a1c111088a2c1912f5e494..4e51fb4555349bc486e80bcd72b58e3e
private final Map<Class<?>, Registry<?>> registries = new HashMap<>();
private YamlConfiguration configuration;
private YamlConfiguration commandsConfiguration;
@@ -1448,6 +1452,7 @@ public final class CraftServer implements Server {
@@ -1447,6 +1451,7 @@ public final class CraftServer implements Server {
this.getLogger().log(Level.SEVERE, null, ex);
}
@@ -42,7 +42,7 @@ index 33b8551ef0d7ac3b29a1c111088a2c1912f5e494..4e51fb4555349bc486e80bcd72b58e3e
this.worlds.remove(world.getName().toLowerCase(java.util.Locale.ENGLISH));
this.console.removeLevel(handle);
return true;
@@ -1466,12 +1471,7 @@ public final class CraftServer implements Server {
@@ -1465,12 +1470,7 @@ public final class CraftServer implements Server {
@Override
public World getWorld(UUID uid) {
@@ -56,7 +56,7 @@ index 33b8551ef0d7ac3b29a1c111088a2c1912f5e494..4e51fb4555349bc486e80bcd72b58e3e
}
// Paper start
@@ -1489,6 +1489,7 @@ public final class CraftServer implements Server {
@@ -1488,6 +1488,7 @@ public final class CraftServer implements Server {
System.out.println("World " + world.getName() + " is a duplicate of another world and has been prevented from loading. Please delete the uid.dat file from " + world.getName() + "'s world directory if you want to be able to load the duplicate world.");
return;
}

View File

@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index cda784d7dc88988ed6c64c13c8cac2bb549ec219..fe076da59b91301db720c0d06cd6596aa201814a 100644
index df2d663ac85ec6b9c15e3bcd7ee4f2924deffd1e..62de14156e7fd08e4a9d5acce1d0760c8e6186f9 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2979,6 +2979,25 @@ public final class CraftServer implements Server {
@@ -3048,6 +3048,24 @@ public final class CraftServer implements Server {
};
}
@@ -30,9 +30,8 @@ index cda784d7dc88988ed6c64c13c8cac2bb549ec219..fe076da59b91301db720c0d06cd6596a
+ public double get15MinuteTPSAverage() {
+ return net.minecraft.server.MinecraftServer.getServer().tps15.getAverage();
+ }
+
+ // Gale end - specific interval TPS API
+
// Paper start - adventure sounds
@Override
public long[] getTickTimes() {
return getServer().tickTimes5s.getTimes();
public void playSound(final net.kyori.adventure.sound.Sound sound) {

View File

@@ -37,32 +37,32 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
index 066b9e4c4f0e7773548eda045cdd1ca8445221d2..6be80b8dfd28a5e25a7f6ae603d8510e52b89085 100644
index 039a86034928a5eb7aaa2d7ca76a7bddcca346bd..7c32c60100cf2bd109eb8762efa856c10b704fdd 100644
--- a/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
+++ b/src/main/java/com/destroystokyo/paper/gui/RAMDetails.java
@@ -58,7 +58,7 @@ public class RAMDetails extends JList<String> {
@@ -59,7 +59,7 @@ public class RAMDetails extends JList<String> {
GraphData data = RAMGraph.DATA.peekLast();
Vector<String> vector = new Vector<>();
- double[] tps = new double[] {server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage()};
+ double[] tps = new double[] {server.tps5s.getAverage(), server.tps1.getAverage(), server.tps5.getAverage(), server.tps15.getAverage()}; // Gale - Purpur - 5 second TPS average
- double[] tps = org.bukkit.Bukkit.getTPS();
+ double[] tps = org.bukkit.Bukkit.getTPSIncluding5SecondAverage(); // Gale - Purpur - 5 second TPS average
String[] tpsAvg = new String[tps.length];
for ( int g = 0; g < tps.length; g++) {
@@ -67,7 +67,7 @@ public class RAMDetails extends JList<String> {
@@ -68,7 +68,7 @@ public class RAMDetails extends JList<String> {
vector.add("Memory use: " + (data.getUsedMem() / 1024L / 1024L) + " mb (" + (data.getFree() * 100L / data.getMax()) + "% free)");
vector.add("Heap: " + (data.getTotal() / 1024L / 1024L) + " / " + (data.getMax() / 1024L / 1024L) + " mb");
vector.add("Avg tick: " + DECIMAL_FORMAT.format(this.getAverage(server.getTickTimesNanos())) + " ms");
vector.add("Avg tick: " + DECIMAL_FORMAT.format((double)this.server.getAverageTickTimeNanos() / (double) TimeUtil.NANOSECONDS_PER_MILLISECOND) + " ms");
- vector.add("TPS from last 1m, 5m, 15m: " + String.join(", ", tpsAvg));
+ vector.add("TPS from last 5s, 1m, 5m, 15m: " + String.join(", ", tpsAvg)); // Gale - Purpur - 5 second TPS average
setListData(vector);
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 36fc043b282f64f329e5fcf00c81f5d9f2412ece..8ef27f52b8eda633135f59e68e53b5db271b65f7 100644
index 377cf883f6a78d3d2ccbbcae451d1358295b20c8..3f7be2c6c95f23e7ea1b03d4083e93c920ccdcf7 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1056,6 +1056,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1055,6 +1055,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private static final long MAX_CATCHUP_BUFFER = TICK_TIME * TPS * 60L;
private long lastTick = 0;
private long catchupTime = 0;
@@ -70,19 +70,19 @@ index 36fc043b282f64f329e5fcf00c81f5d9f2412ece..8ef27f52b8eda633135f59e68e53b5db
public final RollingAverage tps1 = new RollingAverage(60);
public final RollingAverage tps5 = new RollingAverage(60 * 5);
public final RollingAverage tps15 = new RollingAverage(60 * 15);
@@ -1166,6 +1167,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
curTime = Util.getNanos();
final long diff = curTime - tickSection;
java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
@@ -1167,6 +1168,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
if (++MinecraftServer.currentTick % MinecraftServer.SAMPLE_INTERVAL == 0) {
final long diff = currentTime - tickSection;
final java.math.BigDecimal currentTps = TPS_BASE.divide(new java.math.BigDecimal(diff), 30, java.math.RoundingMode.HALF_UP);
+ tps5s.add(currentTps, diff); // Gale - Purpur - 5 second TPS average
tps1.add(currentTps, diff);
tps5.add(currentTps, diff);
tps15.add(currentTps, diff);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index fe076da59b91301db720c0d06cd6596aa201814a..1b58377593cba07101d714e38592041df78d3e52 100644
index 62de14156e7fd08e4a9d5acce1d0760c8e6186f9..e999d954d72d8061468981213a92ea046b94558a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -2979,8 +2979,27 @@ public final class CraftServer implements Server {
@@ -3048,8 +3048,27 @@ public final class CraftServer implements Server {
};
}

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8ef27f52b8eda633135f59e68e53b5db271b65f7..e9fc86639a7e7ba6525d63059aed412b8effd2d0 100644
index 3f7be2c6c95f23e7ea1b03d4083e93c920ccdcf7..11433c92a7c9d5537710b220b93c83b939a00ab5 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1106,6 +1106,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1105,6 +1105,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public static volatile RuntimeException chunkSystemCrash; // Paper - rewrite chunk system
@@ -38,9 +38,9 @@ index 8ef27f52b8eda633135f59e68e53b5db271b65f7..e9fc86639a7e7ba6525d63059aed412b
protected void runServer() {
try {
long serverStartTime = Util.getNanos(); // Paper
@@ -1185,9 +1190,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1187,9 +1192,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time
lastTick = curTime;
lastTick = currentTime;
this.nextTickTimeNanos += i;
+ long tickProperStart = System.nanoTime(); // Gale - YAPFA - last tick time
this.tickServer(flag ? () -> {
@@ -50,7 +50,7 @@ index 8ef27f52b8eda633135f59e68e53b5db271b65f7..e9fc86639a7e7ba6525d63059aed412b
this.mayHaveDelayedTasks = true;
this.delayedTasksMaxNextTickTimeNanos = Math.max(Util.getNanos() + i, this.nextTickTimeNanos);
this.waitUntilNextTick();
@@ -1298,9 +1305,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -1301,9 +1308,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
protected void waitUntilNextTick() {
//this.executeAll(); // Paper - move this into the tick method for timings

View File

@@ -23,10 +23,10 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 1b58377593cba07101d714e38592041df78d3e52..00ac6a86d3d40364332b5839bc497dd7bf6ed395 100644
index e999d954d72d8061468981213a92ea046b94558a..f07b78249abb95b1d1d279831e48ebac2715a755 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -3287,4 +3287,22 @@ public final class CraftServer implements Server {
@@ -3281,4 +3281,22 @@ public final class CraftServer implements Server {
}
// Paper end

View File

@@ -45,7 +45,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index b6c2044d9688c352b96a81c8d0abc4028fbe0ad1..13130eb5d54bff689391855c153f3b2359200794 100644
index 4d2502d77cc78c1382f108efad9a2a47e712cbd9..654133f8c1991f4949131856a50d14afc4f18630 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -112,6 +112,7 @@ import net.minecraft.world.phys.AABB;
@@ -64,7 +64,7 @@ index b6c2044d9688c352b96a81c8d0abc4028fbe0ad1..13130eb5d54bff689391855c153f3b23
private long timeEntitySatOnShoulder;
private final Inventory inventory = new Inventory(this);
protected PlayerEnderChestContainer enderChestInventory = new PlayerEnderChestContainer(this); // CraftBukkit - add "this" to constructor
@@ -282,19 +284,23 @@ public abstract class Player extends LivingEntity {
@@ -280,19 +282,23 @@ public abstract class Player extends LivingEntity {
this.moveCloak();
if (!this.level().isClientSide) {
this.foodData.tick(this);

View File

@@ -16,7 +16,7 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index d0f7351802cb7ab1130254b102ff059c413c10af..e60b426a2a02a417496ae420023a466c84fdd891 100644
index 5335b8e41f34654254f28862f3852dfdbc9c938f..32973e7294c6c62f76ed6da69fa5bcddf584fbaf 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2123,8 +2123,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
@@ -26,6 +26,6 @@ index d0f7351802cb7ab1130254b102ff059c413c10af..e60b426a2a02a417496ae420023a466c
+ if (!entity.noPhysics && !this.noPhysics) { // Gale - Akarin - collision physics check before vehicle check
if (!this.isPassengerOfSameVehicle(entity)) {
- if (!entity.noPhysics && !this.noPhysics) {
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6e20843dce5a3446d7c11ad1c0fb85639bb6981f..c712427d5eda3b4c1f6968836da594f193f189b4 100644
index 11433c92a7c9d5537710b220b93c83b939a00ab5..ff9cd1e0337400ccbab5eb3ec708bdad3d67d0f3 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -182,6 +182,8 @@ import co.aikar.timings.MinecraftTimings; // Paper
@@ -19,7 +19,7 @@ index 6e20843dce5a3446d7c11ad1c0fb85639bb6981f..c712427d5eda3b4c1f6968836da594f1
private static MinecraftServer SERVER; // Paper
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
@@ -314,6 +316,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@@ -312,6 +314,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
S s0 = serverFactory.apply(thread); // CraftBukkit - decompile error
atomicreference.set(s0);

View File

@@ -7,7 +7,7 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..c13df3a375f416273c6a26f5f77624c1f34a918c 100644
index 9017907c0ec67a37a506f09b7e4499cef7885279..8dffb330b474b830d2f816ecf8be2e8d2e4556cd 100644
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
@@ -25,6 +25,7 @@ import java.util.Optional;
@@ -31,7 +31,7 @@ index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..c13df3a375f416273c6a26f5f77624c1
for (final File regionFile : regionFiles) {
final ChunkPos regionPos = RegionFileStorage.getRegionFileCoordinates(regionFile.toPath());
if (regionPos == null) {
@@ -96,8 +102,25 @@ public class ThreadedWorldUpgrader {
@@ -96,7 +102,23 @@ public class ThreadedWorldUpgrader {
continue;
}
@@ -53,12 +53,18 @@ index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..c13df3a375f416273c6a26f5f77624c1
+ };
+ this.threadPool.execute(taskWithNotification);
+ // Gale end - instantly continue on world upgrade finish
// Paper start - Write SavedData IO async
this.threadPool.execute(() -> {
try {
@@ -107,6 +129,7 @@ public class ThreadedWorldUpgrader {
});
// Paper end - Write SavedData IO async
}
+ finalExpectedChunks[0] = expectedChunks; // Gale - instantly continue on world upgrade finish
this.threadPool.shutdown();
final DecimalFormat format = new DecimalFormat("#0.00");
@@ -109,9 +132,16 @@ public class ThreadedWorldUpgrader {
@@ -118,9 +141,16 @@ public class ThreadedWorldUpgrader {
LOGGER.info("{}% completed ({} / {} chunks)...", format.format((double)current / (double)expectedChunks * 100.0), current, expectedChunks);