mirror of
https://github.com/Winds-Studio/Leaf.git
synced 2025-12-19 15:09:25 +00:00
Updated Upstream (Gale/Purpur/Leaves/Dependencies)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
group = org.dreeam.leaf
|
||||
version = 1.20.4-R0.1-SNAPSHOT
|
||||
|
||||
galeCommit = 469ba1180160d3c9bf3fae917262ab56dfad1cf3
|
||||
galeCommit = 58e6ce04758cf150a199628e2b796d7fee01ef07
|
||||
|
||||
org.gradle.caching = true
|
||||
org.gradle.parallel = true
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
20
gradlew.bat
vendored
20
gradlew.bat
vendored
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
|
||||
@@ -7,14 +7,14 @@ Original license: GPL v3
|
||||
Original project: https://github.com/pufferfish-gg/Pufferfish
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3f11b99f87eb380daeb1f660f63a8347958e1e0f..0d9531a62d7667b98a57bd6b8e627a3e2f105001 100644
|
||||
index f2cbc7a803177a901135cf020239031979292c6c..9a116f72816226aa35c86c1e6ddfbbf8aa4b652d 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -51,6 +51,7 @@ dependencies {
|
||||
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
+ api("io.sentry:sentry:7.2.0") // Pufferfish
|
||||
+ api("io.sentry:sentry:7.3.0") // Pufferfish
|
||||
|
||||
implementation("org.ow2.asm:asm:9.5")
|
||||
implementation("org.ow2.asm:asm-commons:9.5")
|
||||
|
||||
@@ -6,7 +6,7 @@ Subject: [PATCH] Purpur API Changes
|
||||
Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
Commit: 3d52f066c1bf1fc61d86164993fd7cac94ca5dce
|
||||
Commit: 03a732c8eacd4eac7507d1220eaee381072c5866
|
||||
|
||||
Patches below are removed in this patch:
|
||||
Pufferfish-API-Changes.patch
|
||||
@@ -34,7 +34,7 @@ index a736d7bcdc5861a01b66ba36158db1c716339346..22fc165fd9c95f0f3ae1be7a0857e48c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
||||
index 097cecdf1a535539b660f2edf4776ba85458ce0a..85dd549064ddcdb51b6d26ba66985e15f23886f4 100644
|
||||
index 45afe93b84db8fad37c758427a849609fceeeea9..593a23c43723b40bc14d33929e38ad074d58fc14 100644
|
||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||
@@ -2909,4 +2909,127 @@ public final class Bukkit {
|
||||
@@ -301,13 +301,13 @@ index f9af60356da4668cec8b24e73f5747ab82e35a91..b304ad1307cdd6785653b1eab9781e07
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a322acadecc 100644
|
||||
index abb5109ed08a3a651c2c27d4d17a3d49eb06da1e..98308b759907e03b168f7e06704a91925ffcd3fd 100644
|
||||
--- a/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
|
||||
@@ -522,4 +522,114 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
@@ -545,4 +545,106 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
*/
|
||||
@Nullable
|
||||
public Location getLastDeathLocation();
|
||||
public Location getLocation();
|
||||
+
|
||||
+ // Purpur start - OfflinePlayer API
|
||||
+ /**
|
||||
@@ -375,14 +375,6 @@ index bce07d84cafca677bb6fad78c21b82097f06430c..4ef0fa4f1ef72bb784674671473c6a32
|
||||
+ public float getWalkSpeed();
|
||||
+
|
||||
+ /**
|
||||
+ * Gets the entity's current position
|
||||
+ *
|
||||
+ * @return a new copy of Location containing the position of this offline player
|
||||
+ */
|
||||
+ @Nullable
|
||||
+ public Location getLocation();
|
||||
+
|
||||
+ /**
|
||||
+ * Sets OfflinePlayer's location. If player is online, it falls back to the Player#teleport implementation.
|
||||
+ *
|
||||
+ * @param destination
|
||||
@@ -555,7 +547,7 @@ index b39a5ca6f4fa32d76acafd1fdd5b5af8954e34a4..1e7e16d33a57d930276a07096a58be2f
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
|
||||
index bf4b94ea2577e9d7e344385209fc0644a4e6bfbb..eea802fbee51e919595f6501161bf2fd58d6a1c1 100644
|
||||
index efa2043e044b0e461780e808c347d6ec00f6da0a..3d4481ea5328735357a7c60c99e5b3a073e7aa0f 100644
|
||||
--- a/src/main/java/org/bukkit/World.java
|
||||
+++ b/src/main/java/org/bukkit/World.java
|
||||
@@ -4172,6 +4172,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
|
||||
@@ -794,7 +786,7 @@ index 138d2530de2410f4a9424dabd3e5ce0cd1c1dcd2..10a8d64ad2da0be2c14f34c3e7d1957c
|
||||
// Paper start
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
|
||||
index 1d0fd7ff8449f815a7d980af0b378181ea8bf8d8..c20f29e1ddfd1d73df19f6d6f730fa23dc23dc7a 100644
|
||||
index 6ace3581f8d0c2a1b7e2188d5b6af5c984b74a0e..d3a0df7b895898578a7473c4c4b4f71694fc2bb2 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Entity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Entity.java
|
||||
@@ -1107,4 +1107,42 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
|
||||
@@ -866,7 +858,7 @@ index 655e37cb3a09610a3f3df805d6dcad17d722da62..09fd716c8fc9ea34a1cbf87bcbe22df0
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Item.java b/src/main/java/org/bukkit/entity/Item.java
|
||||
index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a710da952 100644
|
||||
index bcc6ba95bd21c7972865838c636a03f50b6c1f1a..c3fcd8dd7dbb1e1a18e17c014c1e641149ea5960 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Item.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Item.java
|
||||
@@ -153,4 +153,62 @@ public interface Item extends Entity, io.papermc.paper.entity.Frictional { // Pa
|
||||
@@ -933,7 +925,7 @@ index 58017fce436cdbda255f7172fbdadb726d4b113c..05600fc8bf2a61aca8094029bc4c208a
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
index 47b0154928b3d36e2602da202df07defbcf82108..7498179f6df47008c4da6ad6d67b2ce16f49e7a6 100644
|
||||
index 0f0b965ce48d13a64b5546a0abcfb45c4f5f4722..76c8601c1563c28cfce00f461c99805187db5178 100644
|
||||
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
|
||||
@@ -1276,4 +1276,41 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
|
||||
@@ -1004,10 +996,10 @@ index bc84b892cae5fe7019a3ad481e9da79956efa1fe..48eb5b00c460cccde29d327cef1d63fc
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index caa24af01ee57c8d1917818c1063d2fa75f1ae4a..5579fe9823d13be13d501cd0e3383b5763e2a4ed 100644
|
||||
index 7b751fac9dcfab016f1ad7e799708110dd3c2724..e700243e293312cfee516a870520b23f89e20580 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3584,4 +3584,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3629,4 +3629,123 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@Override
|
||||
Spigot spigot();
|
||||
// Spigot end
|
||||
@@ -1295,7 +1287,7 @@ index f680545b6b59bf8d2ad154b0472dda4cba42a162..3709ff939acdcaec124c2875a37c4a07
|
||||
+ // Purpur end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
index 36e3fbc727cd748aa138f52976154ba32954cd87..623bebf9964cff02728bf4270f082b6a89ff1572 100644
|
||||
index 7adf54c561d64e6337af8a2d86f6b574b083edb5..5fc2456b9367a902af5e97314f50f8a5cf8f4862 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
|
||||
@@ -17,6 +17,18 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||
@@ -1317,7 +1309,7 @@ index 36e3fbc727cd748aa138f52976154ba32954cd87..623bebf9964cff02728bf4270f082b6a
|
||||
|
||||
/**
|
||||
* Represents a stack of items.
|
||||
@@ -1005,4 +1017,636 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
@@ -1016,4 +1028,636 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
|
||||
return type.isAir() || amount <= 0;
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f006f9a4b 100644
|
||||
index 9a116f72816226aa35c86c1e6ddfbbf8aa4b652d..0d6b1e7225060cdb027f446acba4d5d2143d4a9a 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -9,11 +9,11 @@ java {
|
||||
@@ -13,9 +13,8 @@ index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f
|
||||
}
|
||||
|
||||
-val annotationsVersion = "24.0.1"
|
||||
-val bungeeCordChatVersion = "1.20-R0.1"
|
||||
+val annotationsVersion = "24.1.0" // Leaf - Bump Dependencies
|
||||
+val bungeeCordChatVersion = "1.20-R0.2-deprecated+build.18" // Leaf - Bump Dependencies
|
||||
val bungeeCordChatVersion = "1.20-R0.2"
|
||||
val adventureVersion = "4.15.0"
|
||||
-val slf4jVersion = "2.0.9"
|
||||
-val log4jVersion = "2.17.1"
|
||||
@@ -24,7 +23,7 @@ index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f
|
||||
val apiAndDocs: Configuration by configurations.creating {
|
||||
attributes {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
|
||||
@@ -28,10 +28,10 @@ configurations.api {
|
||||
@@ -28,7 +28,7 @@ configurations.api {
|
||||
|
||||
dependencies {
|
||||
// api dependencies are listed transitively to API consumers
|
||||
@@ -32,11 +31,7 @@ index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f
|
||||
+ api("com.google.guava:guava:33.0.0-jre") // Leaf - Bump Dependencies
|
||||
api("com.google.code.gson:gson:2.10.1")
|
||||
// Paper start - adventure
|
||||
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") {
|
||||
+ api("net.md-5:bungeecord-chat:$bungeeCordChatVersion") { // Leaf - Bump Dependencies
|
||||
exclude("com.google.guava", "guava")
|
||||
}
|
||||
// Paper - adventure
|
||||
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
|
||||
@@ -41,7 +41,7 @@ dependencies {
|
||||
api("com.googlecode.json-simple:json-simple:1.1.1") {
|
||||
isTransitive = false // includes junit
|
||||
@@ -48,7 +43,7 @@ index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f
|
||||
apiAndDocs("net.kyori:adventure-text-minimessage")
|
||||
@@ -53,11 +53,12 @@ dependencies {
|
||||
api("org.slf4j:slf4j-api:$slf4jVersion")
|
||||
api("io.sentry:sentry:7.2.0") // Pufferfish
|
||||
api("io.sentry:sentry:7.3.0") // Pufferfish
|
||||
|
||||
- implementation("org.ow2.asm:asm:9.5")
|
||||
- implementation("org.ow2.asm:asm-commons:9.5")
|
||||
@@ -79,7 +74,7 @@ index 0d9531a62d7667b98a57bd6b8e627a3e2f105001..e6d9550e7e1226a75bb44a1cb599625f
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
- testImplementation("org.ow2.asm:asm-tree:9.5")
|
||||
+ testImplementation("org.mockito:mockito-core:5.9.0")
|
||||
+ testImplementation("org.mockito:mockito-core:5.10.0")
|
||||
+ testImplementation("org.ow2.asm:asm-tree:9.6")
|
||||
+ // Leaf end
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ Original license: MIT
|
||||
Original project: https://github.com/KeYiMC/KeYi
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index 5579fe9823d13be13d501cd0e3383b5763e2a4ed..e13f778a5a44c4eb352779cfca389ccfa570556a 100644
|
||||
index e700243e293312cfee516a870520b23f89e20580..7a91e3d6a608c9dfb3727e89013056365184e31e 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -9,6 +9,10 @@ import java.util.Date;
|
||||
@@ -21,7 +21,7 @@ index 5579fe9823d13be13d501cd0e3383b5763e2a4ed..e13f778a5a44c4eb352779cfca389ccf
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Effect;
|
||||
import org.bukkit.GameMode;
|
||||
@@ -3703,4 +3707,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3748,4 +3752,22 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
sendDeathScreen(message);
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: MIT
|
||||
Original project: https://github.com/Cryptite/Slice
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
|
||||
index e13f778a5a44c4eb352779cfca389ccfa570556a..93d6dd81777969df34d1cf55d3c7a4af777a5974 100644
|
||||
index 7a91e3d6a608c9dfb3727e89013056365184e31e..92856bebba3f523d9a029c16a77cfe04a144b245 100644
|
||||
--- a/src/main/java/org/bukkit/entity/Player.java
|
||||
+++ b/src/main/java/org/bukkit/entity/Player.java
|
||||
@@ -3451,6 +3451,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
@@ -3496,6 +3496,19 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
String getClientBrandName();
|
||||
// Paper end
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ index e45e6b44b2a8f2cdae6e0048a812b92126aa17ca..b5f3f213da8a40d5184098af017c8e26
|
||||
.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 ff6b3392390036ad4caa9da3f519a25bd8373493..2b6e7808b518476903302d4f2214dbd2f09125fb 100644
|
||||
index fbdc65a01b04abae4c3770666c6a77e0e85be502..9e7119152664e785e23f08e3a702f0bc60d817a0 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -942,7 +942,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -940,7 +940,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
@@ -86,7 +86,7 @@ index ff6b3392390036ad4caa9da3f519a25bd8373493..2b6e7808b518476903302d4f2214dbd2
|
||||
while (this.getRunningThread().isAlive()) {
|
||||
this.getRunningThread().stop();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 00ac6a86d3d40364332b5839bc497dd7bf6ed395..6eb24411388dc80dea275850e2693940e5306e98 100644
|
||||
index 014cfa82cd35aa907040f9782bb534f60629bb9a..adcc3a2f2777b9810433bd9156f43c692754a07d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -267,7 +267,7 @@ import javax.annotation.Nullable; // Paper
|
||||
@@ -99,10 +99,10 @@ index 00ac6a86d3d40364332b5839bc497dd7bf6ed395..6eb24411388dc80dea275850e2693940
|
||||
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 ddcc9f28cb9ca85e0875bacdfccb883cd1ce0aef..4be39d64431b7c42ef23c13c2872f8ab46fffdc7 100644
|
||||
index 79192e3a0f27d48f35c0378b58e587212ed2c305..006adb2adb27c497ede69f87e78bc3e34499cbf8 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
|
||||
@@ -151,7 +151,7 @@ index 3d674eca7d20202d8f811c5c3e3946a12046028a..9f96c6a23372f496a5c71fda8c688d73
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
index b50a626f85c19880789b1c9e7bbc3998323c2488..649175690a3d2ac120876ab4518ad783ae0a5e18 100644
|
||||
index 7e3efdc59ce2c84403d0c2b77c1c48f3e28a28a2..f82038f47074302bdd9a2e25110ac207b9d36fec 100644
|
||||
--- a/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
|
||||
@@ -160,15 +160,15 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -173,7 +173,7 @@ index b50a626f85c19880789b1c9e7bbc3998323c2488..649175690a3d2ac120876ab4518ad783
|
||||
//
|
||||
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
|
||||
{
|
||||
@@ -196,13 +196,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -195,13 +195,13 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
@@ -186,10 +186,10 @@ index b50a626f85c19880789b1c9e7bbc3998323c2488..649175690a3d2ac120876ab4518ad783
|
||||
log.log( Level.SEVERE, "------------------------------" );
|
||||
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Gale!):" ); // Paper // Gale - branding changes
|
||||
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Leaf!):" ); // Paper // Gale - branding changes // Leaf
|
||||
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 );
|
||||
@@ -223,7 +223,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
@@ -222,7 +222,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
|
||||
We do not want people to report thread issues to Paper,
|
||||
but we do want people to report thread issues to Gale.
|
||||
*/
|
||||
|
||||
@@ -23,10 +23,10 @@ index 936c738fcaa8e97c36d0742d2398d63c20cd2f68..830161ffd2f109cc5bd78a59e3b42eed
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index f749516e5d3c22e808638f3a7672aab837571b1a..61fc65624f7d9a3bfa399a58112efb7f55b31652 100644
|
||||
index 429cff43a9f0c74161fdab857f5d45771f774ac2..0756ee94251620d591cd11e935c579559afab589 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -303,8 +303,9 @@ public class TimingsExport extends Thread {
|
||||
@@ -301,8 +301,9 @@ public class TimingsExport extends Thread {
|
||||
pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)),
|
||||
// Gale start - Gale configuration - include in timings
|
||||
pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)),
|
||||
@@ -38,7 +38,7 @@ index f749516e5d3c22e808638f3a7672aab837571b1a..61fc65624f7d9a3bfa399a58112efb7f
|
||||
|
||||
new TimingsExport(listeners, parent, history).start();
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 55df8e8108c09fba4aa9754264eae758142b21cb..fc3217cfee8d13c3b3f4c6948c484bc992b116bf 100644
|
||||
index c51081e9e60003e116c21d628a8aec4d6caecb2a..387f367544464c73721219ec55cb42033f4bb9c3 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -232,6 +232,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
|
||||
@@ -20,12 +20,12 @@ and, in my opinion, worth the low risk of minor mob-spawning-related
|
||||
inconsistencies.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 22734bad2fd73fbac5cc3e62de36a5c2cbfde9dc..824004849ef389d629ddca7e60f664f5f465ff90 100644
|
||||
index 9e7119152664e785e23f08e3a702f0bc60d817a0..a001fd51a7eb4ff97a84965679170f2da6619a9b 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -299,6 +299,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public static final long SERVER_INIT = System.nanoTime();
|
||||
// Paper end - lag compensation
|
||||
@@ -297,6 +297,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
public volatile boolean abnormalExit = false; // Paper
|
||||
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
|
||||
|
||||
+ public gg.pufferfish.pufferfish.util.AsyncExecutor mobSpawnExecutor = new gg.pufferfish.pufferfish.util.AsyncExecutor("MobSpawning"); // Pufferfish - optimize mob spawning
|
||||
+
|
||||
@@ -33,7 +33,7 @@ index 22734bad2fd73fbac5cc3e62de36a5c2cbfde9dc..824004849ef389d629ddca7e60f664f5
|
||||
AtomicReference<S> atomicreference = new AtomicReference();
|
||||
Thread thread = new io.papermc.paper.util.TickThread(() -> { // Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index fc017f554147eaaee5c436ede2595bccd6b8fd7f..5f1d63343b1d7fbcf19b1ef189504e55170dce34 100644
|
||||
index 387f367544464c73721219ec55cb42033f4bb9c3..ba5925a229494c530c92b35de1a82d6e0a259a33 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -350,6 +350,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -45,7 +45,7 @@ index fc017f554147eaaee5c436ede2595bccd6b8fd7f..5f1d63343b1d7fbcf19b1ef189504e55
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 5838e05d9d5b6a0b3b7d6b775577b11f7f603a56..c9fb6458ed3d3fa48a758c053662f11d83e727c7 100644
|
||||
index d8a3b28b38f2ac62fbf0f87f8b5ff811873f8701..42869d35abb8d006fb720ca7190a770ce5cbf778 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -243,7 +243,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -58,28 +58,28 @@ index 5838e05d9d5b6a0b3b7d6b775577b11f7f603a56..c9fb6458ed3d3fa48a758c053662f11d
|
||||
|
||||
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 6dce2cb25a5e8b7c979a3f515e4c6c9cfbacd305..58f3d1f957ec85e69b80c78e533cedc3a7ac1937 100644
|
||||
index 68ad7cb06d85c428f3560f95ed46bca32187e729..cd71e1127673e625746bce45174afb619ddebd3e 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -72,6 +72,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<LevelChunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
|
||||
|
||||
@@ -76,6 +76,9 @@ public class ServerChunkCache extends ChunkSource {
|
||||
private final LevelChunk[] lastLoadedChunks = new LevelChunk[4 * 4];
|
||||
+
|
||||
// Paper end
|
||||
|
||||
+ public boolean firstRunSpawnCounts = true; // Pufferfish
|
||||
+ public final java.util.concurrent.atomic.AtomicBoolean _pufferfish_spawnCountsReady = new java.util.concurrent.atomic.AtomicBoolean(false); // Pufferfish - optimize countmobs
|
||||
|
||||
private static int getChunkCacheKey(int x, int z) {
|
||||
return x & 3 | ((z & 3) << 2);
|
||||
@@ -518,6 +521,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper start - per player mob spawning
|
||||
+
|
||||
public ServerChunkCache(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor workerExecutor, ChunkGenerator chunkGenerator, int viewDistance, int simulationDistance, boolean dsync, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory) {
|
||||
this.level = world;
|
||||
this.mainThreadProcessor = new ServerChunkCache.MainThreadExecutor(world);
|
||||
@@ -510,6 +513,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper start - Optional per player mob spawns
|
||||
int naturalSpawnChunkCount = k;
|
||||
if ((this.spawnFriendlies || this.spawnEnemies) && this.level.paperConfig().entities.spawning.perPlayerMobSpawns) { // don't count mobs when animals and monsters are disabled
|
||||
+ if (!org.dreeam.leaf.LeafConfig.enableAsyncMobSpawning) { // Pufferfish - moved down when async processing
|
||||
// re-set mob counts
|
||||
for (ServerPlayer player : this.level.players) {
|
||||
// Paper start - per player mob spawning backoff
|
||||
@@ -532,17 +536,21 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -524,17 +528,21 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
// Paper end - per player mob spawning backoff
|
||||
}
|
||||
@@ -93,7 +93,7 @@ index 6dce2cb25a5e8b7c979a3f515e4c6c9cfbacd305..58f3d1f957ec85e69b80c78e533cedc3
|
||||
+ _pufferfish_spawnCountsReady.set(true);
|
||||
+ // Pufferfish end
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Optional per player mob spawns
|
||||
this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
||||
|
||||
- this.lastSpawnState = spawnercreature_d;
|
||||
@@ -105,7 +105,7 @@ index 6dce2cb25a5e8b7c979a3f515e4c6c9cfbacd305..58f3d1f957ec85e69b80c78e533cedc3
|
||||
}
|
||||
// Gale end - MultiPaper - skip unnecessary mob spawning computations
|
||||
|
||||
@@ -632,8 +640,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -624,8 +632,8 @@ 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);
|
||||
@@ -116,7 +116,7 @@ index 6dce2cb25a5e8b7c979a3f515e4c6c9cfbacd305..58f3d1f957ec85e69b80c78e533cedc3
|
||||
}
|
||||
|
||||
if (true || this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) { // Paper - optimise chunk tick iteration
|
||||
@@ -676,6 +684,40 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -668,6 +676,40 @@ public class ServerChunkCache extends ChunkSource {
|
||||
this.level.timings.broadcastChunkUpdates.stopTiming(); // Paper - timing
|
||||
// Paper - optimise chunk tick iteration
|
||||
}
|
||||
|
||||
@@ -30,10 +30,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 508d22f505bdc277520900c92fd6d96eb23990e7..997cd2387ea2de9ba081eb0664e5658ac93542fc 100644
|
||||
index 1591e201ebca4354d5912d3f803f59759af1ba6e..98e666c69b51f7b4fec040b7abd9667d293c9ccb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -885,6 +885,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -880,6 +880,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
|
||||
this.timings.entityTick.startTiming(); // Spigot
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
@@ -42,12 +42,12 @@ index 508d22f505bdc277520900c92fd6d96eb23990e7..997cd2387ea2de9ba081eb0664e5658a
|
||||
if (false && this.shouldDiscardEntity(entity)) { // CraftBukkit - We prevent spawning in general, so this butchering is not needed
|
||||
entity.discard();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d5606d5cc2ebe75c21925071663ea013824c7af6..4190ed6911357839386818cd8717dea66d8c95c0 100644
|
||||
index 6231a59a22b47b16de0b4186eae70759cab92a7f..be371242518c4027e03e233db1bd0a9192e9edc9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -442,6 +442,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -503,6 +503,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - optimise entity tracking
|
||||
|
||||
+ // Pufferfish start
|
||||
+ public boolean activatedPriorityReset = false; // DAB
|
||||
@@ -58,7 +58,7 @@ index d5606d5cc2ebe75c21925071663ea013824c7af6..4190ed6911357839386818cd8717dea6
|
||||
return this.yRot;
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index e52f3da3b63cc3dba59d3e874a8420dd312b5e96..72fdd85426872ac096eabfd273239e112e08826c 100644
|
||||
index 09e8445a3f8c6b3ebc852a75a9a25b41a51ba659..d86c34111ede6a1454dde5e7223d7caf2ab39ef3 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -305,6 +305,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -70,7 +70,7 @@ index e52f3da3b63cc3dba59d3e874a8420dd312b5e96..72fdd85426872ac096eabfd273239e11
|
||||
private String descriptionId;
|
||||
@Nullable
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index 465cfffbbc5db5fb2c95e953db09d3169b52060d..2888eb09566852a2989b6776d74c3a49e8586aac 100644
|
||||
index d3a1af49024c7cd2854dc8a715450adc64aa083e..7828db1230d0fea3d6ea43423b4118906890692f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -227,10 +227,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -119,7 +119,7 @@ index 646d9a121d908a2fc3e4e302484dd5cd1bfc6804..e546ecdccde352502e26a8668eaaafe0
|
||||
}
|
||||
|
||||
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 86fc528551c2c90c78783d4d46a4a2c52e4efe41..034dfd1a62f97ffa4ca2c466fea609cee18d4798 100644
|
||||
index 5e7b978a3019bc31ef94c1c666a3abdf380ced5c..aae8e547996f9a9ce6a3e110b2fc17f94b69ad3c 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
|
||||
@@ -51,9 +51,12 @@ public class GoalSelector {
|
||||
@@ -260,7 +260,7 @@ index b73bccfcb1b94936f500926a06a28a6a134bbc33..5cad15c512919ce6b0cae9f45e9011dd
|
||||
super.customServerAiStep();
|
||||
if ((this.tickCount + this.getId()) % 120 == 0) {
|
||||
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 5f585a955a876fe2452a0bf1c7caa0ad7e58d1d6..07fb53a908f8b10b40017f083648fdc47f2d6150 100644
|
||||
index 5a9d567fdcaa02cf91dac889949f4428987f6fdd..e6b5b7c58505f021dc042c2c40733addcf286dcd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
|
||||
@@ -144,6 +144,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
|
||||
@@ -357,7 +357,7 @@ index 5d161351e7517acf57e98203bab8c9f9ab9d4005..634a4e46022f1d63a67c64f19f255538
|
||||
|
||||
private static void network() {
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index 9ae73480c06003f7073fc571c61943c64f466616..ece01155a8281fb40ae3696d511fb317d68635aa 100644
|
||||
index 1cff8378c4939af4bbe300e5d6428539e75218ae..2833c1ebc3a4d0e268527d1fcf2c74b5b5038c82 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -40,6 +40,9 @@ import net.minecraft.world.level.Level;
|
||||
@@ -370,7 +370,7 @@ index 9ae73480c06003f7073fc571c61943c64f466616..ece01155a8281fb40ae3696d511fb317
|
||||
|
||||
public class ActivationRange
|
||||
{
|
||||
@@ -237,6 +240,25 @@ public class ActivationRange
|
||||
@@ -236,6 +239,25 @@ public class ActivationRange
|
||||
}
|
||||
// Paper end - Configurable marker ticking
|
||||
ActivationRange.activateEntity(entity);
|
||||
@@ -396,7 +396,7 @@ index 9ae73480c06003f7073fc571c61943c64f466616..ece01155a8281fb40ae3696d511fb317
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
@@ -253,12 +275,12 @@ public class ActivationRange
|
||||
@@ -252,12 +274,12 @@ public class ActivationRange
|
||||
if ( MinecraftServer.currentTick > entity.activatedTick )
|
||||
{
|
||||
if ( entity.defaultActivationState )
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPL v3
|
||||
Original project: https://github.com/pufferfish-gg/Pufferfish
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4190ed6911357839386818cd8717dea66d8c95c0..293ed3942268c4ae915c0331e3988ce9dcd83306 100644
|
||||
index be371242518c4027e03e233db1bd0a9192e9edc9..7eff987694d03ccfa687114ee4f2650a7f83a1ea 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -815,6 +815,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -814,6 +814,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
public void tick() {
|
||||
@@ -24,7 +24,7 @@ index 4190ed6911357839386818cd8717dea66d8c95c0..293ed3942268c4ae915c0331e3988ce9
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 72fdd85426872ac096eabfd273239e112e08826c..f772f7c4cd41ec52bea53d619b5b953971825df0 100644
|
||||
index d86c34111ede6a1454dde5e7223d7caf2ab39ef3..dc11683ee4d8a6b7a1c42bcae36dc6e8105cd994 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -306,6 +306,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,15 +7,15 @@ Original license: MIT
|
||||
Original project: https://github.com/PurpurMC/Purpur
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 2e8c390a0b1a4342bfdfca5bee3a2eeef2ac9beb..3e38c0b186d49ecb8e3408f7c005da37cc64e1c9 100644
|
||||
index 330f0f66ab16c88b2a827f09f99c42671a53a410..b0e87f3df1985c84d013db2a67c7e1b5b528a6fa 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1842,7 +1842,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1845,7 +1845,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
@DontObfuscate
|
||||
public String getServerModName() {
|
||||
- return "Gale"; // Gale - branding changes - Gale > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
+ return org.dreeam.leaf.LeafConfig.serverModName; // Leaf - Leaf > // Gale - branding changes - Gale > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
|
||||
- return "Gale"; // Paper // Gale - branding changes
|
||||
+ return org.dreeam.leaf.LeafConfig.serverModName; // Paper // Gale - branding changes // Leaf
|
||||
}
|
||||
|
||||
public SystemReport fillSystemReport(SystemReport details) {
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable server Gui name
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
index 64e12201e164f4dc8070711605dcfcb6e56421f6..4eb4d9eebe72089faaf6683103ef44e5e024c3f3 100644
|
||||
index 7f07ffab0835d45d4d170fe171d7fa996d5913d9..0f20cb3dcf4aac8a8c6cd7408808dec962869c1a 100644
|
||||
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
|
||||
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
|
||||
@@ -21,20 +21,20 @@ index 64e12201e164f4dc8070711605dcfcb6e56421f6..4eb4d9eebe72089faaf6683103ef44e5
|
||||
jframe.pack();
|
||||
jframe.setLocationRelativeTo((Component) null);
|
||||
jframe.setVisible(true);
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper // Purpur
|
||||
+ jframe.setName(org.dreeam.leaf.LeafConfig.serverGuiName); // Paper // Purpur // Leaf - Configurable server Gui name
|
||||
- jframe.setName("Purpur Minecraft server"); // Paper - Improve ServerGUI // Purpur
|
||||
+ jframe.setName(org.dreeam.leaf.LeafConfig.serverGuiName); // Paper - Improve ServerGUI // Purpur // Leaf - Configurable server Gui name
|
||||
|
||||
// Paper start - Add logo as frame image
|
||||
// Paper start - Improve ServerGUI
|
||||
try {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 80a196442edbc6b4eb44bb6a405100871aea2f6a..d6db0ecadf840fd0957f4a7da92ca78c180b58fa 100644
|
||||
index 80a196442edbc6b4eb44bb6a405100871aea2f6a..c3c186a561442351ef7e1146ae09f3b5be900dbc 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -165,8 +165,10 @@ public class LeafConfig {
|
||||
}
|
||||
|
||||
public static String serverModName = "Leaf";
|
||||
+ public static String serverGuiName = "Leaf Minecraft server";
|
||||
+ public static String serverGuiName = "Leaf Console";
|
||||
private static void serverModName() {
|
||||
serverModName = getString("server-mod-name", serverModName);
|
||||
+ serverGuiName = getString("server-Gui-name", serverGuiName);
|
||||
|
||||
@@ -194,10 +194,10 @@ index 4b467f1af93452d13829f756d55dee18b8889d40..00000000000000000000000000000000
|
||||
-}
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
deleted file mode 100644
|
||||
index 61fc65624f7d9a3bfa399a58112efb7f55b31652..0000000000000000000000000000000000000000
|
||||
index 0756ee94251620d591cd11e935c579559afab589..0000000000000000000000000000000000000000
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ /dev/null
|
||||
@@ -1,453 +0,0 @@
|
||||
@@ -1,451 +0,0 @@
|
||||
-/*
|
||||
- * This file is licensed under the MIT License (MIT).
|
||||
- *
|
||||
@@ -421,11 +421,9 @@ index 61fc65624f7d9a3bfa399a58112efb7f55b31652..00000000000000000000000000000000
|
||||
- pair("gamerules", toObjectMapper(world.getWorld().getGameRules(), rule -> {
|
||||
- return pair(rule, world.getWorld().getGameRuleValue(rule));
|
||||
- })),
|
||||
- // Paper start - replace chunk loader system
|
||||
- pair("ticking-distance", world.getWorld().getSimulationDistance()),
|
||||
- pair("no-ticking-distance", world.getWorld().getViewDistance()),
|
||||
- pair("sending-distance", world.getWorld().getSendViewDistance())
|
||||
- // Paper end - replace chunk loader system
|
||||
- ));
|
||||
- }));
|
||||
-
|
||||
@@ -941,7 +939,7 @@ index 3e2d5dcd62775b6ed7c0ce0ba51a71b635b1d644..deca974c2a82bc341fe23ea46f61f42f
|
||||
} catch (Exception exception) {
|
||||
label25:
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c10dfbb4f 100644
|
||||
index b0e87f3df1985c84d013db2a67c7e1b5b528a6fa..b2dee5866f44dfedad37827257b56818d9f6b00f 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -178,8 +178,6 @@ import org.bukkit.craftbukkit.Main;
|
||||
@@ -953,15 +951,15 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTask> implements ServerInfo, CommandSource, AutoCloseable {
|
||||
|
||||
public static final int SERVER_THREAD_PRIORITY = Integer.getInteger("gale.thread.priority.server", -1); // Gale - server thread priority environment variable
|
||||
@@ -961,7 +959,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -959,7 +957,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
MinecraftServer.LOGGER.info("Stopping server");
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Shutdown and don't bother finishing
|
||||
Commands.COMMAND_SENDING_POOL.shutdownNow(); // Paper - Perf: Async command map building; Shutdown and don't bother finishing
|
||||
- MinecraftTimings.stopServer(); // Paper
|
||||
// Purpur start
|
||||
if (upnp) {
|
||||
if (dev.omega24.upnp4j.UPnP4J.close(this.getPort(), dev.omega24.upnp4j.util.Protocol.TCP)) {
|
||||
@@ -1337,7 +1334,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1340,7 +1337,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
protected void waitUntilNextTick() {
|
||||
@@ -970,7 +968,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
long tickOversleepStart = System.nanoTime(); // Gale - YAPFA - last tick time
|
||||
this.managedBlock(() -> {
|
||||
return !this.canSleepForTickNoOversleep(); // Paper - move oversleep into full server tick
|
||||
@@ -1406,8 +1403,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1409,8 +1406,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -979,7 +977,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
for (;;) {
|
||||
boolean moreTasks = this.tickMidTickTasks();
|
||||
long currTime = System.nanoTime();
|
||||
@@ -1432,9 +1427,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1435,9 +1430,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -989,7 +987,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
}
|
||||
// Paper end - execute chunk tasks mid tick
|
||||
|
||||
@@ -1507,15 +1499,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1510,15 +1502,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
|
||||
public void tickServer(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -1005,29 +1003,29 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
- isOversleep = false;MinecraftTimings.serverOversleep.stopTiming();
|
||||
+ isOversleep = false;
|
||||
// Paper end
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper
|
||||
new com.destroystokyo.paper.event.server.ServerTickStartEvent(this.tickCount+1).callEvent(); // Paper - Server Tick Events
|
||||
|
||||
@@ -1549,11 +1540,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1552,11 +1543,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
// 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
|
||||
- try (co.aikar.timings.Timing ignored = MinecraftTimings.processTasksTimer.startTiming()) {
|
||||
- this.runAllTasks();
|
||||
- }
|
||||
- // Paper end
|
||||
// Paper start
|
||||
// Paper start - Server Tick Events
|
||||
long endTime = System.nanoTime();
|
||||
long remaining = (TICK_TIME - (endTime - lastTick)) - catchupTime;
|
||||
@@ -1575,7 +1561,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end
|
||||
@@ -1578,7 +1564,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper end - Add tick times API and /mspt command
|
||||
this.logTickTime(l - i);
|
||||
org.spigotmc.WatchdogThread.tick(); // Spigot
|
||||
- co.aikar.timings.TimingsManager.FULL_SERVER_TICK.stopTimingFullServerTick(); // Paper // Gale - final timings calls
|
||||
}
|
||||
|
||||
private int computeNextAutosaveInterval() {
|
||||
@@ -1637,9 +1622,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1640,9 +1625,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
this.getPlayerList().getPlayers().forEach((entityplayer) -> {
|
||||
entityplayer.connection.suspendFlushing();
|
||||
});
|
||||
@@ -1037,7 +1035,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
// Paper start - Folia scheduler API
|
||||
((io.papermc.paper.threadedregions.scheduler.FoliaGlobalRegionScheduler) Bukkit.getGlobalRegionScheduler()).tick();
|
||||
getAllLevels().forEach(level -> {
|
||||
@@ -1655,20 +1638,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1658,20 +1641,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
});
|
||||
// Paper end - Folia scheduler API
|
||||
io.papermc.paper.adventure.providers.ClickCallbackProviderImpl.CALLBACK_MANAGER.handleQueue(this.tickCount); // Paper
|
||||
@@ -1056,17 +1054,17 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
|
||||
- MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper
|
||||
// Send time updates to everyone, it will get the right time from the world the player is in.
|
||||
// Paper start - optimize time updates
|
||||
// Paper start - Perf: Optimize time updates
|
||||
for (final ServerLevel level : this.getAllLevels()) {
|
||||
@@ -1688,7 +1666,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1691,7 +1669,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Perf: Optimize time updates
|
||||
- MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper
|
||||
|
||||
this.isIteratingOverLevels = true; // Paper - Throw exception on world create while being ticked
|
||||
net.minecraft.network.FriendlyByteBuf.hasItemSerializeEvent = org.purpurmc.purpur.event.packet.NetworkItemSerializeEvent.getHandlerList().getRegisteredListeners().length > 0; // Purpur
|
||||
@@ -1708,14 +1685,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1711,14 +1688,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// CraftBukkit end */
|
||||
|
||||
try {
|
||||
@@ -1081,7 +1079,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world");
|
||||
|
||||
@@ -1727,21 +1702,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1730,21 +1705,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
}
|
||||
this.isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
|
||||
|
||||
@@ -1103,7 +1101,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
|
||||
iterator = this.playerList.getPlayers().iterator();
|
||||
|
||||
@@ -1751,7 +1720,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1754,7 +1723,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
entityplayer.connection.chunkSender.sendNextChunks(entityplayer);
|
||||
entityplayer.connection.resumeFlushing();
|
||||
}
|
||||
@@ -1112,7 +1110,7 @@ index 3e38c0b186d49ecb8e3408f7c005da37cc64e1c9..7334b13af92d7a323dd24a14102b789c
|
||||
|
||||
private void synchronizeTime(ServerLevel world) {
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index 0a59c30f84e2b7b77ec1ebc9bf307524408999e0..40118a13b6b66c56313432cf8dcb6f3dea976ae9 100644
|
||||
index 246d991a9da75ceeba2404bbd57d3025c83ea35e..bd0195eb09c3bf16d248b3243d197fd1ad1108e9 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -57,7 +57,6 @@ import org.apache.logging.log4j.Level;
|
||||
@@ -1128,7 +1126,7 @@ index 0a59c30f84e2b7b77ec1ebc9bf307524408999e0..40118a13b6b66c56313432cf8dcb6f3d
|
||||
|
||||
public void handleConsoleInputs() {
|
||||
- MinecraftTimings.serverCommandTimer.startTiming(); // Spigot
|
||||
// Paper start - use proper queue
|
||||
// Paper start - Perf: use proper queue
|
||||
ConsoleInput servercommand;
|
||||
while ((servercommand = this.serverCommandQueue.poll()) != null) {
|
||||
@@ -549,8 +547,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -1166,7 +1164,7 @@ index 0a59c30f84e2b7b77ec1ebc9bf307524408999e0..40118a13b6b66c56313432cf8dcb6f3d
|
||||
// Paper start
|
||||
if (waitableArray[0] != null) {
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a715c7b54f 100644
|
||||
index 42869d35abb8d006fb720ca7190a770ce5cbf778..2b9968a8a3d0d66d9db5a83dcf2a44767a9fe412 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1176,7 +1174,7 @@ index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a7
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableList.Builder;
|
||||
import com.google.common.collect.Iterables;
|
||||
@@ -545,13 +544,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -538,13 +537,9 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
protected void tick(BooleanSupplier shouldKeepTicking) {
|
||||
@@ -1190,7 +1188,7 @@ index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a7
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1149,25 +1144,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1135,25 +1130,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
|
||||
// Paper start - optimised tracker
|
||||
private final void processTrackQueue() {
|
||||
@@ -1216,7 +1214,7 @@ index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a7
|
||||
}
|
||||
// Paper end - optimised tracker
|
||||
|
||||
@@ -1181,7 +1165,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1167,7 +1151,6 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
List<ServerPlayer> list = Lists.newArrayList();
|
||||
List<ServerPlayer> list1 = this.level.players();
|
||||
ObjectIterator objectiterator = this.entityMap.values().iterator();
|
||||
@@ -1224,7 +1222,7 @@ index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a7
|
||||
|
||||
ChunkMap.TrackedEntity playerchunkmap_entitytracker;
|
||||
|
||||
@@ -1206,17 +1189,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1192,17 +1175,14 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
playerchunkmap_entitytracker.serverEntity.sendChanges();
|
||||
}
|
||||
}
|
||||
@@ -1243,21 +1241,21 @@ index ac564147383af02820f38ea823e083b9e74a8a3d..95add10db1d7600167312160cd1a15a7
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef51476ce1 100644
|
||||
index cd71e1127673e625746bce45174afb619ddebd3e..e841f12a43c4506f87b64b537a8c47bf54de5aa2 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -291,10 +291,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -276,10 +276,8 @@ public class ServerChunkCache extends ChunkSource {
|
||||
if (!completablefuture.isDone()) { // Paper
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.pushChunkWait(this.level, x1, z1); // Paper - rewrite chunk system
|
||||
// Paper end
|
||||
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x1, z1); // Paper - sync load info
|
||||
com.destroystokyo.paper.io.SyncLoadFinder.logSyncLoad(this.level, x, z); // Paper - Add debug for sync chunk loads
|
||||
- this.level.timings.syncChunkLoad.startTiming(); // Paper
|
||||
chunkproviderserver_b.managedBlock(completablefuture::isDone);
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - async chunk debug // Paper - rewrite chunk system
|
||||
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.popChunkWait(); // Paper - rewrite chunk system
|
||||
- this.level.timings.syncChunkLoad.stopTiming(); // Paper
|
||||
} // Paper
|
||||
ichunkaccess = (ChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> {
|
||||
return ichunkaccess1;
|
||||
@@ -443,17 +441,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -428,17 +426,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
public void save(boolean flush) {
|
||||
this.runDistanceManagerUpdates();
|
||||
@@ -1266,16 +1264,16 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
|
||||
- } // Paper - Timings
|
||||
}
|
||||
|
||||
// Paper start - duplicate save, but call incremental
|
||||
// Paper start - Incremental chunk and player saving; duplicate save, but call incremental
|
||||
public void saveIncrementally() {
|
||||
this.runDistanceManagerUpdates();
|
||||
- try (co.aikar.timings.Timing timed = level.timings.chunkSaveData.startTiming()) { // Paper - Timings
|
||||
this.chunkMap.saveIncrementally();
|
||||
- } // Paper - Timings
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Incremental chunk and player saving
|
||||
|
||||
@@ -479,21 +473,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -471,21 +465,15 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
@Override
|
||||
public void tick(BooleanSupplier shouldKeepTicking, boolean tickChunks) {
|
||||
@@ -1297,7 +1295,7 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
|
||||
this.clearCache();
|
||||
}
|
||||
|
||||
@@ -503,8 +491,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -495,8 +483,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
this.lastInhabitedUpdate = i;
|
||||
if (!this.level.isDebug()) {
|
||||
@@ -1306,23 +1304,23 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
|
||||
|
||||
// Paper - optimise chunk tick iteration
|
||||
|
||||
@@ -516,7 +502,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -508,7 +494,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
boolean flagAndHasNaturalSpawn = flag && this.anySpawnCategoryIsSpawnedThisTick();
|
||||
if (flagAndHasNaturalSpawn) {
|
||||
// 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;
|
||||
@@ -545,7 +530,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -537,7 +522,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Pufferfish end
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Optional per player mob spawns
|
||||
- this.level.timings.countNaturalMobs.stopTiming(); // Paper - timings
|
||||
|
||||
//this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
|
||||
// Gale start - MultiPaper - skip unnecessary mob spawning computations
|
||||
@@ -657,17 +641,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -649,17 +633,13 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
@@ -1340,7 +1338,7 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
|
||||
// Paper start - optimise chunk tick iteration
|
||||
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
||||
it.unimi.dsi.fastutil.objects.ReferenceOpenHashSet<ChunkHolder> copy = this.chunkMap.needsChangeBroadcasting.clone();
|
||||
@@ -681,7 +661,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -673,7 +653,6 @@ public class ServerChunkCache extends ChunkSource {
|
||||
}
|
||||
}
|
||||
// Paper end - optimise chunk tick iteration
|
||||
@@ -1349,7 +1347,7 @@ index 58f3d1f957ec85e69b80c78e533cedc3a7ac1937..e04ab410b88f681032de4406dceac5ef
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4922e830c 100644
|
||||
index a6a9a425aecdd58a65a926a22cd44f7a5c711007..a3b9068efc38b3eb05e884bcc3fb13532e49308d 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1,7 +1,6 @@
|
||||
@@ -1360,7 +1358,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.datafixers.DataFixer;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
@@ -867,27 +866,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -862,27 +861,19 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
this.tickTime();
|
||||
}
|
||||
|
||||
@@ -1388,7 +1386,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
}
|
||||
|
||||
this.handlingTick = false;
|
||||
@@ -898,13 +889,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -893,13 +884,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
|
||||
if (flag1 || this.emptyTime++ < 300) {
|
||||
@@ -1402,7 +1400,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
this.entityTickList.forEach((entity) -> {
|
||||
entity.activatedPriorityReset = false; // Pufferfish - DAB
|
||||
if (!entity.isRemoved()) {
|
||||
@@ -941,8 +930,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -936,8 +925,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -1411,15 +1409,15 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
this.tickBlockEntities();
|
||||
}
|
||||
|
||||
@@ -1076,7 +1063,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1071,7 +1058,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
} // Paper
|
||||
} // Paper - Option to disable ice and snow
|
||||
|
||||
- timings.chunkTicksBlocks.startTiming(); // Paper
|
||||
if (randomTickSpeed > 0) {
|
||||
// Paper start - optimize random block ticking
|
||||
LevelChunkSection[] sections = chunk.getSections();
|
||||
@@ -1109,8 +1095,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1104,8 +1090,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
// Paper end - optimise random block ticking
|
||||
@@ -1428,7 +1426,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@@ -1440,31 +1424,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1435,31 +1419,21 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
currentlyTickingEntity.lazySet(entity);
|
||||
}
|
||||
// Paper end - log detailed entity tick information
|
||||
@@ -1460,7 +1458,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
Iterator iterator = entity.getPassengers().iterator();
|
||||
|
||||
while (iterator.hasNext()) {
|
||||
@@ -1472,7 +1446,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1467,7 +1441,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
this.tickPassenger(entity, entity1);
|
||||
}
|
||||
@@ -1468,7 +1466,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
// Paper start - log detailed entity tick information
|
||||
} finally {
|
||||
if (currentlyTickingEntity.get() == entity) {
|
||||
@@ -1487,9 +1460,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1482,9 +1455,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
if (passenger instanceof Player || this.entityTickList.contains(passenger)) {
|
||||
// Paper - EAR 2
|
||||
final boolean isActive = org.spigotmc.ActivationRange.checkIfActive(passenger);
|
||||
@@ -1478,7 +1476,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
passenger.setOldPosAndRot();
|
||||
++passenger.tickCount;
|
||||
// Paper start - EAR 2
|
||||
@@ -1510,8 +1480,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1505,8 +1475,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
this.tickPassenger(passenger, entity2);
|
||||
}
|
||||
@@ -1487,13 +1485,13 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
}
|
||||
} else {
|
||||
passenger.stopRiding();
|
||||
@@ -1531,14 +1499,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1526,14 +1494,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld()));
|
||||
}
|
||||
|
||||
- try (co.aikar.timings.Timing ignored = this.timings.worldSave.startTiming()) {
|
||||
if (doFull) {
|
||||
this.saveLevelData();
|
||||
this.saveLevelData(true); // Paper - Write SavedData IO async
|
||||
}
|
||||
|
||||
- this.timings.worldSaveChunks.startTiming(); // Paper
|
||||
@@ -1502,15 +1500,15 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
|
||||
// Copied from save()
|
||||
// CraftBukkit start - moved from MinecraftServer.saveChunks
|
||||
@@ -1550,7 +1515,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1545,7 +1510,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
this.convertable.saveDataTag(this.server.registryAccess(), this.serverLevelData, this.server.getPlayerList().getSingleplayerData());
|
||||
}
|
||||
// CraftBukkit end
|
||||
- }
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Incremental chunk and player saving
|
||||
|
||||
@@ -1564,7 +1528,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1559,7 +1523,6 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
if (!savingDisabled) {
|
||||
org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(this.getWorld())); // CraftBukkit
|
||||
@@ -1518,7 +1516,7 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
if (progressListener != null) {
|
||||
progressListener.progressStartNoAbort(Component.translatable("menu.savingLevel"));
|
||||
}
|
||||
@@ -1574,11 +1537,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -1569,11 +1532,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
progressListener.progressStage(Component.translatable("menu.savingChunks"));
|
||||
}
|
||||
|
||||
@@ -1531,10 +1529,10 @@ index d4d86b650dd305187b69820923d66003d9e46b24..dbd18a3b72cb116f636049e137464cc4
|
||||
|
||||
} else if (close) { chunkproviderserver.close(false); } // Paper - rewrite chunk system
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 03b9416aa19a4fac28a1499f15cc097ef71a657e..c82101247896498e7b02a3f6b212262720e41241 100644
|
||||
index 32c04eac5936719eeb1fdd41b729e87eadbbd47f..4d1d3e10a2bea585cdd86bc641e20c89e7014c6a 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2489,7 +2489,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2468,7 +2468,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
public void handleCommand(String s) { // Paper - private -> public
|
||||
org.spigotmc.AsyncCatcher.catchOp("Command Dispatched Async: " + s); // Paper - Add async catcher
|
||||
@@ -1542,7 +1540,7 @@ index 03b9416aa19a4fac28a1499f15cc097ef71a657e..c82101247896498e7b02a3f6b2122627
|
||||
if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot
|
||||
this.LOGGER.info(this.player.getScoreboardName() + " issued server command: " + s);
|
||||
|
||||
@@ -2499,7 +2498,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2478,7 +2477,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.cserver.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
@@ -1550,7 +1548,7 @@ index 03b9416aa19a4fac28a1499f15cc097ef71a657e..c82101247896498e7b02a3f6b2122627
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2511,8 +2509,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -2490,8 +2488,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
player.sendMessage(org.bukkit.ChatColor.RED + "An internal error occurred while attempting to perform this command");
|
||||
java.util.logging.Logger.getLogger(ServerGamePacketListenerImpl.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
|
||||
return;
|
||||
@@ -1560,7 +1558,7 @@ index 03b9416aa19a4fac28a1499f15cc097ef71a657e..c82101247896498e7b02a3f6b2122627
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 4652ff409ba93440f249fc2ee504e4fe6e1609de..2ac6126e1a840950e284c453f99ce704ce949c7b 100644
|
||||
index 5748ada42d5039e8f2999f1ca0a74067a1dad08f..6fe6126dd37272ddeac89087887d9fe688a6bfcc 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1570,7 +1568,7 @@ index 4652ff409ba93440f249fc2ee504e4fe6e1609de..2ac6126e1a840950e284c453f99ce704
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.google.common.collect.Sets;
|
||||
@@ -1338,7 +1337,6 @@ public abstract class PlayerList {
|
||||
@@ -1337,7 +1336,6 @@ public abstract class PlayerList {
|
||||
|
||||
public void saveAll(int interval) {
|
||||
io.papermc.paper.util.MCUtil.ensureMain("Save Players" , () -> { // Paper - Ensure main
|
||||
@@ -1578,16 +1576,16 @@ index 4652ff409ba93440f249fc2ee504e4fe6e1609de..2ac6126e1a840950e284c453f99ce704
|
||||
int numSaved = 0;
|
||||
long now = MinecraftServer.currentTick;
|
||||
for (int i = 0; i < this.players.size(); ++i) {
|
||||
@@ -1349,7 +1347,6 @@ public abstract class PlayerList {
|
||||
@@ -1348,7 +1346,6 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Incremental chunk and player saving
|
||||
}
|
||||
- MinecraftTimings.savePlayers.stopTiming(); // Paper
|
||||
return null; }); // Paper - ensure main
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
index 658c6d27b828e5a1d4538136a74fc49a69b471c0..bc6940beb4bfdaba082b101e7e20f195e958c86d 100644
|
||||
index a9e2a758669550530eb29475ba99fe42e520f6ae..d617e803f47219621b6b3b42c3bb7f30eb6cb805 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
||||
@@ -340,15 +340,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -1606,7 +1604,7 @@ index 658c6d27b828e5a1d4538136a74fc49a69b471c0..bc6940beb4bfdaba082b101e7e20f195
|
||||
this.builtInRegistryHolder = BuiltInRegistries.ENTITY_TYPE.createIntrusiveHolder(this);
|
||||
this.factory = factory;
|
||||
this.category = spawnGroup;
|
||||
@@ -724,12 +715,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -720,12 +711,6 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
return this.updateInterval;
|
||||
}
|
||||
|
||||
@@ -1619,7 +1617,7 @@ index 658c6d27b828e5a1d4538136a74fc49a69b471c0..bc6940beb4bfdaba082b101e7e20f195
|
||||
public boolean trackDeltas() {
|
||||
return this != EntityType.PLAYER && this != EntityType.LLAMA_SPIT && this != EntityType.WITHER && this != EntityType.BAT && this != EntityType.ITEM_FRAME && this != EntityType.GLOW_ITEM_FRAME && this != EntityType.LEASH_KNOT && this != EntityType.PAINTING && this != EntityType.END_CRYSTAL && this != EntityType.EVOKER_FANGS;
|
||||
}
|
||||
@@ -839,7 +824,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
@@ -835,7 +820,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT
|
||||
Util.fetchChoiceType(References.ENTITY_TREE, id);
|
||||
}
|
||||
|
||||
@@ -1726,10 +1724,10 @@ index fcdb9bde8e1605e30dde3e580491522d4b62cdc0..4de18d00cc464313b777874430da3f55
|
||||
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 3a1ef6f06d8911709eabdefc4f69ba76bc93a409..8126df40be79b3da0b8b841477b02feae0b667fb 100644
|
||||
index 765f7034d3b1da22dd81c4186649e06fa58e50a5..36a420f8cf463dcabe5717df1af59472db3142fc 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -179,7 +179,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -176,7 +176,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
|
||||
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
|
||||
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
|
||||
@@ -1737,15 +1735,15 @@ index 3a1ef6f06d8911709eabdefc4f69ba76bc93a409..8126df40be79b3da0b8b841477b02fea
|
||||
public static BlockPos lastPhysicsProblem; // Spigot
|
||||
private org.spigotmc.TickLimiter entityLimiter;
|
||||
private org.spigotmc.TickLimiter tileLimiter;
|
||||
@@ -358,7 +357,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -355,7 +354,6 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
public void onBorderSetDamageSafeZOne(WorldBorder border, double safeZoneRadius) {}
|
||||
});
|
||||
// CraftBukkit end
|
||||
- this.timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings
|
||||
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper
|
||||
this.keepSpawnInMemory = this.paperConfig().spawn.keepSpawnLoaded; // Paper - Option to keep spawn chunks loaded
|
||||
this.entityLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.entityMaxTickTime);
|
||||
this.tileLimiter = new org.spigotmc.TickLimiter(this.spigotConfig.tileMaxTickTime);
|
||||
@@ -1330,15 +1328,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1323,15 +1321,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
|
||||
protected void tickBlockEntities() {
|
||||
@@ -1761,9 +1759,9 @@ index 3a1ef6f06d8911709eabdefc4f69ba76bc93a409..8126df40be79b3da0b8b841477b02fea
|
||||
// Spigot start
|
||||
// Iterator<TickingBlockEntity> iterator = this.blockEntityTickers.iterator();
|
||||
boolean flag = this.tickRateManager().runsNormally();
|
||||
@@ -1367,9 +1362,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -1360,9 +1355,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
}
|
||||
this.blockEntityTickers.removeAll(toRemove);
|
||||
this.blockEntityTickers.removeAll(toRemove); // Paper - Fix MC-117075
|
||||
|
||||
- this.timings.tileEntityTick.stopTiming(); // Spigot
|
||||
this.tickingBlockEntities = false;
|
||||
@@ -1772,7 +1770,7 @@ index 3a1ef6f06d8911709eabdefc4f69ba76bc93a409..8126df40be79b3da0b8b841477b02fea
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index 1e7cd5b79b6c0e2f07518b6149c60af01f99285b..7508d91a692a5cfdf49bd0143167edcff2d14811 100644
|
||||
index 88b13e6eeec956c10b486e4811b1e0dae0fd990e..31003588de8bef9952a688c486049077328e89a3 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 {
|
||||
@@ -1784,7 +1782,7 @@ index 1e7cd5b79b6c0e2f07518b6149c60af01f99285b..7508d91a692a5cfdf49bd0143167edcf
|
||||
int i = aenumcreaturetype.length;
|
||||
|
||||
@@ -184,8 +183,6 @@ public final class NaturalSpawner {
|
||||
// Paper end
|
||||
// Paper end - Optional per player mob spawns
|
||||
}
|
||||
}
|
||||
-
|
||||
@@ -1793,7 +1791,7 @@ index 1e7cd5b79b6c0e2f07518b6149c60af01f99285b..7508d91a692a5cfdf49bd0143167edcf
|
||||
|
||||
// Paper start - Add mobcaps commands
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index b2ae99b9826a33e0cd736eb1bdc072afb1d74e5d..c10af7f406f61a2b41a252c59332bcd6022472af 100644
|
||||
index 8c242b67f162a40311d7d987fd76771c38c3eadb..f1ca87ab1ab07a5b8ddda959a90f29ea6a16b346 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -114,13 +114,6 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -1811,7 +1809,7 @@ index b2ae99b9826a33e0cd736eb1bdc072afb1d74e5d..c10af7f406f61a2b41a252c59332bcd6
|
||||
@Nullable
|
||||
private String descriptionId;
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
index 075aa1f0c0ced25d5c2fd8bf434915d08ac3e483..b9536b3f6ea07d8f0e41410808a96de29912a253 100644
|
||||
index 07a83e06e9cb6e30c600445809e49a3fd23a391a..171feda35239281b0ec2416485bead192dd9d0f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BlockEntity.java
|
||||
@@ -23,14 +23,9 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
|
||||
@@ -1830,7 +1828,7 @@ index 075aa1f0c0ced25d5c2fd8bf434915d08ac3e483..b9536b3f6ea07d8f0e41410808a96de2
|
||||
private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
|
||||
public CraftPersistentDataContainer persistentDataContainer;
|
||||
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 d13a61ad34c00e5ad67adc64e919c4f559621cc9..897919d305ca669fb746dd3202cd393a4c4227f5 100644
|
||||
index 3d0b8761866046ae7ee6b5777fb098ce786abd94..221a4a3fbeac621ec593c7ba44b83f4b247a5589 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
|
||||
@@ -792,7 +792,6 @@ public class LevelChunk extends ChunkAccess {
|
||||
@@ -1858,9 +1856,9 @@ index d13a61ad34c00e5ad67adc64e919c4f559621cc9..897919d305ca669fb746dd3202cd393a
|
||||
|
||||
if (this.blockEntity.getType().isValid(iblockdata)) {
|
||||
@@ -1185,14 +1182,9 @@ public class LevelChunk extends ChunkAccess {
|
||||
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new ServerInternalException(msg, throwable)));
|
||||
net.minecraft.world.level.chunk.LevelChunk.this.level.getCraftServer().getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new ServerInternalException(msg, throwable))); // Paper - ServerExceptionEvent
|
||||
LevelChunk.this.removeBlockEntity(this.getPos());
|
||||
// Paper end
|
||||
// Paper end - Prevent block entity and entity crashes
|
||||
- // Spigot start
|
||||
- } finally {
|
||||
- this.blockEntity.tickTimer.stopTiming();
|
||||
@@ -1873,7 +1871,7 @@ index d13a61ad34c00e5ad67adc64e919c4f559621cc9..897919d305ca669fb746dd3202cd393a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 864c62d6c84da666adfba105e3fb5c0ca0341889..99fe3b9444c436eba0642135c7e19d147f7df022 100644
|
||||
index 3be29ecb26bf46ad8873fc948c8d19118779d88d..e0e7e1b986c04cbefb86dfd1ecef2504bda3ecfb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -468,7 +468,6 @@ public final class CraftServer implements Server {
|
||||
@@ -1885,10 +1883,10 @@ index 864c62d6c84da666adfba105e3fb5c0ca0341889..99fe3b9444c436eba0642135c7e19d14
|
||||
console.autosavePeriod = this.configuration.getInt("ticks-per.autosave");
|
||||
this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose"));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index ff921eeb4d7d5791794484315bf751629307ac62..d7d5622c0d2940567e9020aa4b8fe634b1569d98 100644
|
||||
index 94a998b877e3cfff0477cbef4400ca4113e7681d..e43203060dfc26387fd5826ffae9e9ca7a01abf2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -372,8 +372,6 @@ public class Main {
|
||||
@@ -373,8 +373,6 @@ public class Main {
|
||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport");
|
||||
tryPreloadClass("org.jline.terminal.impl.MouseSupport$1");
|
||||
tryPreloadClass("org.jline.terminal.Terminal$MouseTracking");
|
||||
@@ -1898,7 +1896,7 @@ index ff921eeb4d7d5791794484315bf751629307ac62..d7d5622c0d2940567e9020aa4b8fe634
|
||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$11");
|
||||
tryPreloadClass("io.netty.channel.AbstractChannelHandlerContext$12");
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520ce3586f77 100644
|
||||
index 006adb2adb27c497ede69f87e78bc3e34499cbf8..4ee1c3461d21feab3a54e76a7c2ab80b6ea2ab38 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
||||
@@ -1,6 +1,5 @@
|
||||
@@ -1908,7 +1906,7 @@ index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520c
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
||||
import java.util.ArrayList;
|
||||
@@ -302,7 +301,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -304,7 +303,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1917,7 +1915,7 @@ index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520c
|
||||
this.handle(task, 0L);
|
||||
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
||||
if (taskPending == task) {
|
||||
@@ -342,7 +341,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -344,7 +343,7 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1926,7 +1924,7 @@ index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520c
|
||||
this.handle(task, 0L);
|
||||
for (CraftTask taskPending = this.head.getNext(); taskPending != null; taskPending = taskPending.getNext()) {
|
||||
if (taskPending == task) {
|
||||
@@ -513,10 +512,8 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -515,10 +514,8 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
this.runners.remove(task.getTaskId());
|
||||
}
|
||||
}
|
||||
@@ -1937,7 +1935,7 @@ index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520c
|
||||
//this.debugHead = this.debugHead.getNextHead(currentTick); // Paper
|
||||
}
|
||||
|
||||
@@ -559,7 +556,6 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -561,7 +558,6 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
}
|
||||
|
||||
void parsePending() { // Paper
|
||||
@@ -1945,7 +1943,7 @@ index 4be39d64431b7c42ef23c13c2872f8ab46fffdc7..1b8728dbb8dcde72935ce0b45f32520c
|
||||
CraftTask head = this.head;
|
||||
CraftTask task = head.getNext();
|
||||
CraftTask lastTask = head;
|
||||
@@ -578,7 +574,6 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
@@ -580,7 +576,6 @@ public class CraftScheduler implements BukkitScheduler {
|
||||
task.setNext(null);
|
||||
}
|
||||
this.head = lastTask;
|
||||
@@ -2038,7 +2036,7 @@ index b3e1adeb932da9b3bed16acd94e2f16da48a7c72..e9798517b9211c50a20ea5c69603aab3
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 8561bc5482574365d7cff3a4046afe11b00f6d1f..b39d1ba982f633d68837a04dd0be2e639ee69ba4 100644
|
||||
index b1bd810d4a83086966da16f4b0327f67c794246a..19d2015437c764f0cc5970b05de33f037b96caf0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -209,12 +209,6 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -2272,7 +2270,7 @@ index 139d946346594d2a59a8b2930c4eae794c880dbc..00000000000000000000000000000000
|
||||
-
|
||||
-}
|
||||
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
index fb8260a1801f7f11a13b4310b0c7ccd963854591..48a836df10dec491185c33ba2e3e2892c96958f7 100644
|
||||
index d88d553fc5b9d9e13d24d94275ed5b9c91d5e41f..83841079cb17d426a89e9d8b43afdc289d13dee6 100644
|
||||
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
||||
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
||||
@@ -35,7 +35,6 @@ import net.minecraft.world.entity.projectile.FireworkRocketEntity;
|
||||
@@ -2291,7 +2289,7 @@ index fb8260a1801f7f11a13b4310b0c7ccd963854591..48a836df10dec491185c33ba2e3e2892
|
||||
final int miscActivationRange = world.spigotConfig.miscActivationRange;
|
||||
final int raiderActivationRange = world.spigotConfig.raiderActivationRange;
|
||||
final int animalActivationRange = world.spigotConfig.animalActivationRange;
|
||||
@@ -264,7 +262,6 @@ public class ActivationRange
|
||||
@@ -263,7 +261,6 @@ public class ActivationRange
|
||||
}
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Bump Dependencies
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 04d0a5827c454478b80c2da1b204e20ab7828370..1871bcb34cc1cc0bb810d44ec043df215a0f0e8d 100644
|
||||
index 04d0a5827c454478b80c2da1b204e20ab7828370..e7ac805b5b455083b6b07eec05ca2e3bc655edd0 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -22,9 +22,9 @@ dependencies {
|
||||
@@ -13,7 +13,7 @@ index 04d0a5827c454478b80c2da1b204e20ab7828370..1871bcb34cc1cc0bb810d44ec043df21
|
||||
// Gale end - project setup
|
||||
// Paper start
|
||||
- implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
+ implementation("org.jline:jline-terminal-jansi:3.25.0") // Leaf - Bump Dependencies
|
||||
+ implementation("org.jline:jline-terminal-jansi:3.25.1") // Leaf - Bump Dependencies
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
- implementation("net.kyori:adventure-text-serializer-ansi:4.14.0") // Keep in sync with adventureVersion from Paper-API build file
|
||||
+ implementation("net.kyori:adventure-text-serializer-ansi:4.15.0") // Keep in sync with adventureVersion from Paper-API build file // Leaf - Bump Dependencies
|
||||
@@ -46,7 +46,7 @@ index 04d0a5827c454478b80c2da1b204e20ab7828370..1871bcb34cc1cc0bb810d44ec043df21
|
||||
- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
+ // Leaf end
|
||||
+ implementation("net.fabricmc:mapping-io:0.5.1") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.45.0.0")
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.45.1.0") // Leaf - Bump Dependencies
|
||||
+ runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
|
||||
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper // Leaf - Bump Dependencies - Waiting Log4j 3.x that supported disruptor 4.0.0
|
||||
// Paper start - Use Velocity cipher
|
||||
@@ -66,7 +66,7 @@ index 04d0a5827c454478b80c2da1b204e20ab7828370..1871bcb34cc1cc0bb810d44ec043df21
|
||||
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.1")
|
||||
testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
- testImplementation("org.mockito:mockito-core:5.5.0")
|
||||
+ testImplementation("org.mockito:mockito-core:5.9.0")
|
||||
+ testImplementation("org.mockito:mockito-core:5.10.0")
|
||||
+
|
||||
+ implementation("io.netty:netty-all:4.1.105.Final")
|
||||
+ // Leaf end
|
||||
|
||||
@@ -7,10 +7,10 @@ This Check is added in 1.17.x -> 1.18.x update by Mojang.
|
||||
By removing this check, it enable hackers to use some modules of hack clients.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index c82101247896498e7b02a3f6b212262720e41241..a5fb09c24788fef07463a6abb6bee2718bdd779e 100644
|
||||
index 4d1d3e10a2bea585cdd86bc641e20c89e7014c6a..1c1f6d89b622a5fb7d2ab541dbe4f029723c7811 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -2013,7 +2013,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1992,7 +1992,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Vec3 vec3d2 = vec3d.subtract(vec3d1);
|
||||
double d0 = 1.0000001D;
|
||||
|
||||
@@ -20,7 +20,7 @@ index c82101247896498e7b02a3f6b212262720e41241..a5fb09c24788fef07463a6abb6bee271
|
||||
|
||||
this.player.resetLastActionTime();
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 4660e1732f8f2e2c236b3d6c3c60e5122daa1172..4ef2a90296dd4ca7c61e257821d794e112489735 100644
|
||||
index e88cfb1a48f253e2f6360b2ff00bd36b58af6a23..df16a84545dd726e6f4eaaff13232e4d95dd11af 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -173,6 +173,8 @@ public class LeafConfig {
|
||||
|
||||
@@ -7,7 +7,7 @@ Original license: MIT
|
||||
Original project: https://github.com/KeYiMC/KeYi
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 8c90eddd40c8ab2f4d727e3c7d9b6312d57bf277..2026f2b42658e5625da39097d3faae2b86b0153b 100644
|
||||
index f16d150526c99b8a280ec681f8eb548419691357..c63b0da7e41d2827dacf45745d8f6581b6f930ed 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -29,6 +29,11 @@ import java.util.Optional;
|
||||
@@ -30,7 +30,7 @@ index 8c90eddd40c8ab2f4d727e3c7d9b6312d57bf277..2026f2b42658e5625da39097d3faae2b
|
||||
import org.bukkit.map.MapCursor;
|
||||
import org.bukkit.map.MapView;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
@@ -3470,4 +3476,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3473,4 +3479,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundPlayerCombatKillPacket(getEntityId(), io.papermc.paper.adventure.PaperAdventure.asVanilla(message)));
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -8,7 +8,7 @@ Original license: GPL v3
|
||||
Original project: https://github.com/Akarin-project/Akarin
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
index 71e1c1a1ae59f74cfeea071aa6988f6fe47a286d..ca8f58aef40ff481dc3d620998f432dc23e48c1c 100644
|
||||
index 219e0059418e6d64f5b859ba253c3cf3e91713cf..a358d177c266841f79809053e5b158f8202e54dc 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
|
||||
@@ -23,6 +23,7 @@ import java.util.stream.Stream;
|
||||
@@ -19,7 +19,7 @@ index 71e1c1a1ae59f74cfeea071aa6988f6fe47a286d..ca8f58aef40ff481dc3d620998f432dc
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.GsonHelper;
|
||||
import org.slf4j.Logger;
|
||||
@@ -127,37 +128,43 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
@@ -104,37 +105,43 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
|
||||
}
|
||||
|
||||
public void save() throws IOException {
|
||||
|
||||
@@ -7,7 +7,7 @@ Original license: MIT
|
||||
Original project: https://github.com/Cryptite/Slice
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 9363801ce4342f598309b3aab40ee36b95e0d047..b20aa80b500e689c920cd6bc85a45f342bb6e9c0 100644
|
||||
index 98c488e5e8cfc0947d80b5d11aa40f7ca801a67b..331f6c6cfb96795ce3002f86165f34e5bbbcc526 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -286,6 +286,7 @@ public class ServerPlayer extends Player {
|
||||
@@ -19,10 +19,10 @@ index 9363801ce4342f598309b3aab40ee36b95e0d047..b20aa80b500e689c920cd6bc85a45f34
|
||||
// Paper start - replace player chunk loader
|
||||
private final java.util.concurrent.atomic.AtomicReference<io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances> viewDistances = new java.util.concurrent.atomic.AtomicReference<>(new io.papermc.paper.chunk.system.RegionizedPlayerChunkLoader.ViewDistances(-1, -1, -1));
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index de08bdced1d55da22b5abd6f44fdad708ec8f238..0a6f3536d6ca9bf2efb18524eb1dd00ef5a8f1e0 100644
|
||||
index 6fe6126dd37272ddeac89087887d9fe688a6bfcc..8fd80d1167edea751fec1c14deabc427c221e98b 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -970,10 +970,10 @@ public abstract class PlayerList {
|
||||
@@ -969,10 +969,10 @@ public abstract class PlayerList {
|
||||
ServerLevel worldserver2 = entityplayer1.serverLevel();
|
||||
LevelData worlddata = worldserver2.getLevelData();
|
||||
|
||||
@@ -36,10 +36,10 @@ index de08bdced1d55da22b5abd6f44fdad708ec8f238..0a6f3536d6ca9bf2efb18524eb1dd00e
|
||||
entityplayer1.connection.send(new ClientboundChangeDifficultyPacket(worlddata.getDifficulty(), worlddata.isDifficultyLocked()));
|
||||
entityplayer1.connection.send(new ClientboundSetExperiencePacket(entityplayer1.experienceProgress, entityplayer1.totalExperience, entityplayer1.experienceLevel));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 2026f2b42658e5625da39097d3faae2b86b0153b..7e13ffee8e650cd5fe63fddf636321830e6ffb6d 100644
|
||||
index c63b0da7e41d2827dacf45745d8f6581b6f930ed..8875cf92722a1a25c02cd887ff5d000a84e6722d 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -1278,6 +1278,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -1236,6 +1236,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 4e3d22cc21b50e563416a3f89715078aeb059f40..6da78fe423b78b35dd408367209b5b0fbdc6154d 100644
|
||||
index c984b9a614690a44f9506de42707edc63d1ecc65..fc77f4ec5234ad0d450a8fa74f316b4355033022 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -425,6 +425,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -424,6 +424,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
public boolean fixedPose = false; // Paper - Expand Pose API
|
||||
@@ -18,7 +18,7 @@ index 4e3d22cc21b50e563416a3f89715078aeb059f40..6da78fe423b78b35dd408367209b5b0f
|
||||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -2531,6 +2532,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -2528,6 +2529,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
nbttagcompound.putBoolean("Paper.FreezeLock", true);
|
||||
}
|
||||
// Paper end
|
||||
@@ -26,7 +26,7 @@ index 4e3d22cc21b50e563416a3f89715078aeb059f40..6da78fe423b78b35dd408367209b5b0f
|
||||
return nbttagcompound;
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT");
|
||||
@@ -2678,6 +2680,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -2675,6 +2677,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
freezeLocked = nbt.getBoolean("Paper.FreezeLock");
|
||||
}
|
||||
// Paper end
|
||||
@@ -38,7 +38,7 @@ index 4e3d22cc21b50e563416a3f89715078aeb059f40..6da78fe423b78b35dd408367209b5b0f
|
||||
|
||||
} catch (Throwable throwable) {
|
||||
CrashReport crashreport = CrashReport.forThrowable(throwable, "Loading entity NBT");
|
||||
@@ -5115,4 +5122,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -5107,4 +5114,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
return false;
|
||||
}
|
||||
// Purpur end
|
||||
|
||||
@@ -25,10 +25,10 @@ index af86f752c33a2990405fea058b7c41c437ba9d46..bada9fae1e7178162429e1f5a1608b9c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 7334b13af92d7a323dd24a14102b789c10dfbb4f..a2933d814d453971080eeba90bb1819a8d599ba7 100644
|
||||
index b2dee5866f44dfedad37827257b56818d9f6b00f..9af04084afe0689e5486be775cee3ba20e30617e 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1708,6 +1708,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1711,6 +1711,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
GameTestTicker.SINGLETON.tick();
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ index 7334b13af92d7a323dd24a14102b789c10dfbb4f..a2933d814d453971080eeba90bb1819a
|
||||
((Runnable) this.tickables.get(i)).run();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
index a90569dbdf9122866d57e2876d9940f4ef4b8a45..5920b8eecc6db362b0c55b521730cff67b84b6ea 100644
|
||||
index 61cd58a5bb3d228b29b9cc4db11be03d4c833223..1610f21bbfbca0d12ca12373e56d90a54ac7c9f7 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
|
||||
@@ -136,6 +136,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -46,7 +46,7 @@ index a90569dbdf9122866d57e2876d9940f4ef4b8a45..5920b8eecc6db362b0c55b521730cff6
|
||||
@Override
|
||||
public void handleCustomPayload(ServerboundCustomPayloadPacket packet) {
|
||||
+ top.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePayload(player, packet.payload()); // Leaves - protocol
|
||||
// Paper start - handle brand payload packet
|
||||
// Paper start - Brand support
|
||||
if (packet.payload() instanceof net.minecraft.network.protocol.common.custom.BrandPayload brandPayload) {
|
||||
this.player.clientBrandName = brandPayload.brand();
|
||||
@@ -153,6 +154,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
|
||||
@@ -58,7 +58,7 @@ index a90569dbdf9122866d57e2876d9940f4ef4b8a45..5920b8eecc6db362b0c55b521730cff6
|
||||
} catch (Exception ex) {
|
||||
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index d0b782b80d834c0e5be1570b0fd3e38681fc616b..9b8b0740a06b5b92fb3e905d7f8945c91ee637fb 100644
|
||||
index 8fd80d1167edea751fec1c14deabc427c221e98b..80db3fcf338846770e8c8ee6aa7635a68f2b6753 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -361,6 +361,7 @@ public abstract class PlayerList {
|
||||
@@ -69,7 +69,7 @@ index d0b782b80d834c0e5be1570b0fd3e38681fc616b..9b8b0740a06b5b92fb3e905d7f8945c9
|
||||
|
||||
final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
|
||||
|
||||
@@ -620,6 +621,7 @@ public abstract class PlayerList {
|
||||
@@ -619,6 +620,7 @@ public abstract class PlayerList {
|
||||
return this.remove(entityplayer, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? entityplayer.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(entityplayer.getDisplayName())));
|
||||
}
|
||||
public net.kyori.adventure.text.Component remove(ServerPlayer entityplayer, net.kyori.adventure.text.Component leaveMessage) {
|
||||
@@ -78,7 +78,7 @@ index d0b782b80d834c0e5be1570b0fd3e38681fc616b..9b8b0740a06b5b92fb3e905d7f8945c9
|
||||
org.purpurmc.purpur.task.BossBarTask.removeFromAll(entityplayer.getBukkitEntity()); // Purpur
|
||||
ServerLevel worldserver = entityplayer.serverLevel();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 99fe3b9444c436eba0642135c7e19d147f7df022..9830f45484988e931ed1f47db24e131c4dbd88d3 100644
|
||||
index e0e7e1b986c04cbefb86dfd1ecef2504bda3ecfb..30e31c99778eceb867c7c1eb4974a9cfdd422435 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -480,6 +480,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
@@ -21,8 +21,21 @@ index b2a92648490ac54cd6ecc3bbfb9740db684284ce..1fbd034002fd5761011976510b9f9263
|
||||
return Math.max(0, Tadpole.ticksToBeFrog - this.age);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
index 7292e68199d244990efa8475fb40b94fe72323c0..3c234bfcecd6d93f8ff9b1abc6dfc72c26fa30f0 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerData.java
|
||||
@@ -50,7 +50,7 @@ public class TrialSpawnerData {
|
||||
});
|
||||
protected final Set<UUID> detectedPlayers = new HashSet<>();
|
||||
protected final Set<UUID> currentMobs = new HashSet<>();
|
||||
- protected long cooldownEndsAt;
|
||||
+ public long cooldownEndsAt; // Leaves - protected -> public
|
||||
protected long nextMobSpawnsAt;
|
||||
protected int totalMobsSpawned;
|
||||
protected Optional<SpawnData> nextSpawnData;
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 08f794bbd19d596591b4c786f5b131f56bf88b2e..b96b32e417ce2db80ea7fd581ae6122925d69ed8 100644
|
||||
index e81cb3b303a53b4d2edb80563be806c8ef9c8bed..cd50493c1d165424c7e66d55e7b9b26645f2bf50 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -248,7 +248,9 @@ public class LeafConfig {
|
||||
@@ -37,10 +50,10 @@ index 08f794bbd19d596591b4c786f5b131f56bf88b2e..b96b32e417ce2db80ea7fd581ae61229
|
||||
public static String sentryDsn = "";
|
||||
diff --git a/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java b/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c4e863ec6
|
||||
index 0000000000000000000000000000000000000000..d175d83fc7fe509349cb76220362f7b5df33c7f2
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/top/leavesmc/leaves/protocol/JadeProtocol.java
|
||||
@@ -0,0 +1,621 @@
|
||||
@@ -0,0 +1,900 @@
|
||||
+package top.leavesmc.leaves.protocol;
|
||||
+
|
||||
+import com.google.common.cache.Cache;
|
||||
@@ -49,8 +62,11 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+import com.google.common.collect.ImmutableList;
|
||||
+import com.google.common.collect.ListMultimap;
|
||||
+import com.google.common.collect.Lists;
|
||||
+import com.google.common.collect.Multimap;
|
||||
+import com.mojang.authlib.GameProfile;
|
||||
+import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap;
|
||||
+import net.minecraft.core.BlockPos;
|
||||
+import net.minecraft.core.Direction;
|
||||
+import net.minecraft.core.registries.BuiltInRegistries;
|
||||
+import net.minecraft.nbt.CompoundTag;
|
||||
+import net.minecraft.nbt.ListTag;
|
||||
@@ -61,16 +77,17 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
|
||||
+import net.minecraft.resources.ResourceLocation;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import net.minecraft.server.level.ServerLevel;
|
||||
+import net.minecraft.server.level.ServerPlayer;
|
||||
+import net.minecraft.server.players.GameProfileCache;
|
||||
+import net.minecraft.world.Container;
|
||||
+import net.minecraft.world.LockCode;
|
||||
+import net.minecraft.world.MenuProvider;
|
||||
+import net.minecraft.world.Nameable;
|
||||
+import net.minecraft.world.RandomizableContainer;
|
||||
+import net.minecraft.world.effect.MobEffectCategory;
|
||||
+import net.minecraft.world.effect.MobEffectInstance;
|
||||
+import net.minecraft.world.entity.AgeableMob;
|
||||
+import net.minecraft.world.entity.Entity;
|
||||
+import net.minecraft.world.entity.EntityType;
|
||||
+import net.minecraft.world.entity.LivingEntity;
|
||||
+import net.minecraft.world.entity.OwnableEntity;
|
||||
+import net.minecraft.world.entity.animal.Animal;
|
||||
@@ -78,18 +95,23 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+import net.minecraft.world.entity.animal.allay.Allay;
|
||||
+import net.minecraft.world.entity.animal.frog.Tadpole;
|
||||
+import net.minecraft.world.entity.animal.horse.AbstractHorse;
|
||||
+import net.minecraft.world.entity.monster.ZombieVillager;
|
||||
+import net.minecraft.world.entity.vehicle.ContainerEntity;
|
||||
+import net.minecraft.world.inventory.PlayerEnderChestContainer;
|
||||
+import net.minecraft.world.item.Item;
|
||||
+import net.minecraft.world.item.ItemStack;
|
||||
+import net.minecraft.world.item.Items;
|
||||
+import net.minecraft.world.level.BaseCommandBlock;
|
||||
+import net.minecraft.world.level.Level;
|
||||
+import net.minecraft.world.level.block.CalibratedSculkSensorBlock;
|
||||
+import net.minecraft.world.level.block.ChestBlock;
|
||||
+import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BaseContainerBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
+import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.CampfireBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.CommandBlockEntity;
|
||||
@@ -98,11 +120,11 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+import net.minecraft.world.level.block.entity.HopperBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.JukeboxBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.LecternBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity;
|
||||
+import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerData;
|
||||
+import net.minecraft.world.level.block.state.BlockState;
|
||||
+import net.minecraft.world.level.block.state.properties.BlockStateProperties;
|
||||
+import net.minecraft.world.phys.BlockHitResult;
|
||||
+import org.apache.commons.lang3.mutable.MutableInt;
|
||||
+import org.jetbrains.annotations.Contract;
|
||||
+import org.jetbrains.annotations.NotNull;
|
||||
+import org.jetbrains.annotations.Nullable;
|
||||
@@ -116,7 +138,11 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+import java.util.Objects;
|
||||
+import java.util.UUID;
|
||||
+import java.util.concurrent.ExecutionException;
|
||||
+import java.util.concurrent.TimeUnit;
|
||||
+import java.util.concurrent.atomic.AtomicInteger;
|
||||
+import java.util.concurrent.atomic.AtomicLong;
|
||||
+import java.util.function.Function;
|
||||
+import java.util.function.Predicate;
|
||||
+import java.util.stream.IntStream;
|
||||
+import java.util.stream.Stream;
|
||||
+
|
||||
@@ -129,8 +155,13 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ public static final ResourceLocation PACKET_SERVER_PING = id("server_ping");
|
||||
+ public static final ResourceLocation PACKET_RECEIVE_DATA = id("receive_data");
|
||||
+
|
||||
+ private static final HierarchyLookup<IJadeProvider<Entity>> entityDataProviders = new HierarchyLookup<>(Entity.class);
|
||||
+ private static final HierarchyLookup<IJadeProvider<BlockEntity>> tileDataProviders = new HierarchyLookup<>(BlockEntity.class);
|
||||
+ private static final HierarchyLookup<IJadeDataProvider<Entity>> entityDataProviders = new HierarchyLookup<>(Entity.class);
|
||||
+ private static final HierarchyLookup<IJadeDataProvider<BlockEntity>> tileDataProviders = new HierarchyLookup<>(BlockEntity.class);
|
||||
+
|
||||
+ private static final HierarchyLookup<IServerExtensionProvider<Entity, ItemStack>> entityItemProviders = new HierarchyLookup<>(Entity.class);
|
||||
+ private static final HierarchyLookup<IServerExtensionProvider<BlockEntity, ItemStack>> tileItemProviders = new HierarchyLookup<>(BlockEntity.class);
|
||||
+
|
||||
+ public static final Cache<Object, ItemCollector<?>> targetCache = CacheBuilder.newBuilder().weakKeys().expireAfterAccess(60, TimeUnit.SECONDS).build();
|
||||
+
|
||||
+ public static final int MAX_DISTANCE_SQR = 900;
|
||||
+
|
||||
@@ -141,13 +172,101 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+
|
||||
+ @ProtocolHandler.Init
|
||||
+ public static void init() {
|
||||
+ entityDataProviders.register(Entity.class, ((data, player, world, entity, showDetails) -> {
|
||||
+ UUID ownerUUID = null;
|
||||
+ if (entity instanceof OwnableEntity) {
|
||||
+ ownerUUID = ((OwnableEntity) entity).getOwnerUUID();
|
||||
+ entityItemProviders.register(Entity.class, (player, world, target) -> {
|
||||
+ if (target instanceof ContainerEntity containerEntity && containerEntity.getLootTable() != null) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+
|
||||
+ ItemCollector<?> itemCollector;
|
||||
+ try {
|
||||
+ itemCollector = targetCache.get(target, () -> {
|
||||
+ if (target instanceof AbstractHorse) {
|
||||
+ return new ItemCollector<>(new ItemIterator.ContainerItemIterator(o -> {
|
||||
+ if (o instanceof AbstractHorse horse) {
|
||||
+ return horse.inventory;
|
||||
+ }
|
||||
+ return null;
|
||||
+ }, 2));
|
||||
+ }
|
||||
+ return ItemCollector.EMPTY;
|
||||
+ });
|
||||
+ } catch (ExecutionException e) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ if (itemCollector == ItemCollector.EMPTY) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ return itemCollector.update(target, world.getGameTime());
|
||||
+ });
|
||||
+
|
||||
+ tileItemProviders.register(CampfireBlockEntity.class, (player, world, target) -> {
|
||||
+ CampfireBlockEntity campfire = (CampfireBlockEntity) target;
|
||||
+ List<ItemStack> list = Lists.newArrayList();
|
||||
+ for (int i = 0; i < campfire.cookingTime.length; i++) {
|
||||
+ ItemStack stack = campfire.getItems().get(i);
|
||||
+ if (stack.isEmpty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ stack = stack.copy();
|
||||
+ stack.getOrCreateTag().putInt("jade:cooking", campfire.cookingTime[i] - campfire.cookingProgress[i]);
|
||||
+ list.add(stack);
|
||||
+ }
|
||||
+ return List.of(new ViewGroup<>(list));
|
||||
+ });
|
||||
+ tileItemProviders.register(BlockEntity.class, (player, world, target) -> {
|
||||
+ if (target instanceof RandomizableContainer te && te.getLootTable() != null) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+
|
||||
+ if (!player.isCreative() && !player.isSpectator() && target instanceof BaseContainerBlockEntity te) {
|
||||
+ if (te.lockKey != LockCode.NO_LOCK) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+ }
|
||||
+ if (target instanceof EnderChestBlockEntity) {
|
||||
+ PlayerEnderChestContainer inventory = player.getEnderChestInventory();
|
||||
+ return new ItemCollector<>(new ItemIterator.ContainerItemIterator(0)).update(inventory, world.getGameTime());
|
||||
+ }
|
||||
+ ItemCollector<?> itemCollector;
|
||||
+ try {
|
||||
+ itemCollector = targetCache.get(target, () -> {
|
||||
+ if (target instanceof Container) {
|
||||
+ if (target instanceof ChestBlockEntity) {
|
||||
+ return new ItemCollector<>(new ItemIterator.ContainerItemIterator(o -> {
|
||||
+ if (o instanceof ChestBlockEntity be) {
|
||||
+ if (be.getBlockState().getBlock() instanceof ChestBlock chestBlock) {
|
||||
+ Container compound = ChestBlock.getContainer(chestBlock, be.getBlockState(), world, be.getBlockPos(), false);
|
||||
+ if (compound != null) {
|
||||
+ return compound;
|
||||
+ }
|
||||
+ }
|
||||
+ return be;
|
||||
+ }
|
||||
+ return null;
|
||||
+ }, 0));
|
||||
+ }
|
||||
+ return new ItemCollector<>(new ItemIterator.ContainerItemIterator(0));
|
||||
+ }
|
||||
+ return ItemCollector.EMPTY;
|
||||
+ });
|
||||
+ } catch (ExecutionException e) {
|
||||
+ return null;
|
||||
+ }
|
||||
+
|
||||
+ if (itemCollector == ItemCollector.EMPTY) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ return itemCollector.update(target, world.getGameTime());
|
||||
+ });
|
||||
+
|
||||
+ entityDataProviders.register(OwnableEntity.class, ((data, player, world, entity, showDetails) -> {
|
||||
+ UUID ownerUUID = ((OwnableEntity) entity).getOwnerUUID();
|
||||
+ if (ownerUUID != null) {
|
||||
+ MinecraftServer.getServer().getProfileCache().get(ownerUUID).map(GameProfile::getName).ifPresent(name -> data.putString("OwnerName", name));
|
||||
+ GameProfileCache cache = MinecraftServer.getServer().getProfileCache();
|
||||
+ if (cache != null) {
|
||||
+ cache.get(ownerUUID).map(GameProfile::getName).ifPresent(name -> data.putString("OwnerName", name));
|
||||
+ }
|
||||
+ }
|
||||
+ }));
|
||||
+ entityDataProviders.register(LivingEntity.class, ((data, player, world, entity, showDetails) -> {
|
||||
@@ -199,27 +318,38 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+ }));
|
||||
+ entityDataProviders.register(Chicken.class, ((data, player, world, entity, showDetails) -> {
|
||||
+ data.putInt("NextEgg", ((Chicken) entity).eggTime / 20);
|
||||
+ data.putInt("NextEggIn", ((Chicken) entity).eggTime);
|
||||
+ }));
|
||||
+ entityDataProviders.register(Entity.class, ((tag, player, world, object, showDetails) -> {
|
||||
+ var groups = getGroups(player, (ServerLevel) world, object, showDetails);
|
||||
+ if (groups != null) {
|
||||
+ for (var provider : entityItemProviders.get(object)) {
|
||||
+ var groups = provider.getGroups(player, world, object);
|
||||
+ if (groups == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ if (ViewGroup.saveList(tag, "JadeItemStorage", groups, item -> {
|
||||
+ CompoundTag itemTag = new CompoundTag();
|
||||
+ int count = item.getCount();
|
||||
+ if (count > 64) item.setCount(1);
|
||||
+ if (count > 64) {
|
||||
+ item.setCount(1);
|
||||
+ }
|
||||
+ item.save(itemTag);
|
||||
+ if (count > 64) itemTag.putInt("NewCount", count);
|
||||
+ if (count > 64) {
|
||||
+ itemTag.putInt("NewCount", count);
|
||||
+ item.setCount(count);
|
||||
+ }
|
||||
+ return itemTag;
|
||||
+ })) {
|
||||
+ tag.putString("JadeItemStorageUid", EntityType.getKey(object.getType()).toString());
|
||||
+ } else {
|
||||
+ if (object instanceof ContainerEntity containerEntity && containerEntity.getLootTable() != null) {
|
||||
+ tag.putBoolean("Loot", true);
|
||||
+ }
|
||||
+ tag.putString("JadeItemStorageUid", "minecraft:item_storage");
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ }));
|
||||
+ entityDataProviders.register(ZombieVillager.class, (data, player, world, object, showDetails) -> {
|
||||
+ ZombieVillager entity = (ZombieVillager) object;
|
||||
+ if (entity.villagerConversionTime > 0) {
|
||||
+ data.putInt("ConversionTime", entity.villagerConversionTime);
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
+ tileDataProviders.register(BrewingStandBlockEntity.class, ((data, player, world, object, showDetails) -> {
|
||||
+ if (object instanceof BrewingStandBlockEntity brewingStand) {
|
||||
@@ -236,7 +366,7 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ data.putBoolean("Full", beehive.isFull());
|
||||
+ }));
|
||||
+ tileDataProviders.register(CommandBlockEntity.class, ((data, player, world, object, showDetails) -> {
|
||||
+ if (object == null || !player.canUseGameMasterBlocks()) {
|
||||
+ if (!player.canUseGameMasterBlocks()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ BaseCommandBlock logic = ((CommandBlockEntity) object).getCommandBlock();
|
||||
@@ -287,8 +417,18 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }));
|
||||
+ tileDataProviders.register(BlockEntity.class, ((data, player, world, object, showDetails) -> {
|
||||
+ if (object instanceof Nameable nameable) {
|
||||
+ if (nameable.hasCustomName()) {
|
||||
+ data.putString("givenName", Component.Serializer.toJson(nameable.getCustomName()));
|
||||
+ Component name = null;
|
||||
+ if (nameable instanceof ChestBlockEntity chestBlock) {
|
||||
+ MenuProvider menuProvider = chestBlock.getBlockState().getMenuProvider(world, chestBlock.getBlockPos());
|
||||
+ if (menuProvider != null) {
|
||||
+ name = menuProvider.getDisplayName();
|
||||
+ }
|
||||
+ } else if (nameable.hasCustomName()) {
|
||||
+ name = nameable.getDisplayName();
|
||||
+ }
|
||||
+
|
||||
+ if (name != null) {
|
||||
+ data.putString("givenName", Component.Serializer.toJson(name));
|
||||
+ }
|
||||
+ }
|
||||
+ }));
|
||||
@@ -302,29 +442,48 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ if (object instanceof AbstractFurnaceBlockEntity) {
|
||||
+ return;
|
||||
+ }
|
||||
+ var groups = getGroups(player, (ServerLevel) world, object, showDetails);
|
||||
+ if (groups != null) {
|
||||
+
|
||||
+ for (var provider : tileItemProviders.get(object)) {
|
||||
+ var groups = provider.getGroups(player, world, object);
|
||||
+ if (groups == null) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (ViewGroup.saveList(tag, "JadeItemStorage", groups, item -> {
|
||||
+ CompoundTag itemTag = new CompoundTag();
|
||||
+ int count = item.getCount();
|
||||
+ if (count > 64) item.setCount(1);
|
||||
+ if (count > 64) {
|
||||
+ item.setCount(1);
|
||||
+ }
|
||||
+ item.save(itemTag);
|
||||
+ if (count > 64) itemTag.putInt("NewCount", count);
|
||||
+ if (count > 64) {
|
||||
+ itemTag.putInt("NewCount", count);
|
||||
+ item.setCount(count);
|
||||
+ }
|
||||
+ return itemTag;
|
||||
+ })) {
|
||||
+ tag.putString("JadeItemStorageUid", BlockEntityType.getKey(object.getType()).toString());
|
||||
+ } else {
|
||||
+ if (object instanceof RandomizableContainerBlockEntity te && te.lootTable != null) {
|
||||
+ tag.putString("JadeItemStorageUid", "minecraft:item_storage");
|
||||
+ } else if (object instanceof RandomizableContainer containerEntity && containerEntity.getLootTable() != null) {
|
||||
+ tag.putBoolean("Loot", true);
|
||||
+ return;
|
||||
+ }
|
||||
+ if (!player.isCreative() && !player.isSpectator() && object instanceof BaseContainerBlockEntity te) {
|
||||
+ } else if (!player.isCreative() && !player.isSpectator() && object instanceof BaseContainerBlockEntity te) {
|
||||
+ if (te.lockKey != LockCode.NO_LOCK) {
|
||||
+ tag.putBoolean("Locked", true);
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ }
|
||||
+ }));
|
||||
+ tileDataProviders.register(TrialSpawnerBlockEntity.class, (data, player, world, object, showDetails) -> {
|
||||
+ TrialSpawnerBlockEntity spawner = (TrialSpawnerBlockEntity) object;
|
||||
+ TrialSpawnerData spawnerData = spawner.getTrialSpawner().getData();
|
||||
+ if (spawner.getTrialSpawner().canSpawnInLevel(world) && world.getGameTime() < spawnerData.cooldownEndsAt) {
|
||||
+ data.putInt("Cooldown", (int) (spawnerData.cooldownEndsAt - world.getGameTime()));
|
||||
+ }
|
||||
+ });
|
||||
+ tileDataProviders.register(CalibratedSculkSensorBlockEntity.class, ((data, player, world, object, showDetails) -> {
|
||||
+ Direction direction = object.getBlockState().getValue(CalibratedSculkSensorBlock.FACING).getOpposite();
|
||||
+ int signal = world.getSignal(object.getBlockPos().relative(direction), direction);
|
||||
+ data.putInt("Signal", signal);
|
||||
+ }));
|
||||
+ }
|
||||
+
|
||||
@@ -356,7 +515,7 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+
|
||||
+ CompoundTag tag = new CompoundTag();
|
||||
+ for (IJadeProvider<Entity> provider : providers) {
|
||||
+ for (IJadeDataProvider<Entity> provider : providers) {
|
||||
+ try {
|
||||
+ provider.saveData(tag, player, world, entity, showDetails);
|
||||
+ } catch (Exception e) {
|
||||
@@ -388,13 +547,13 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ BlockEntity tile = world.getBlockEntity(pos);
|
||||
+ if (tile == null) return;
|
||||
+
|
||||
+ List<IJadeProvider<BlockEntity>> providers = tileDataProviders.get(tile);
|
||||
+ List<IJadeDataProvider<BlockEntity>> providers = tileDataProviders.get(tile);
|
||||
+ if (providers.isEmpty()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ CompoundTag tag = new CompoundTag();
|
||||
+ for (IJadeProvider<BlockEntity> provider : providers) {
|
||||
+ for (IJadeDataProvider<BlockEntity> provider : providers) {
|
||||
+ try {
|
||||
+ provider.saveData(tag, player, world, tile, showDetails);
|
||||
+ } catch (Exception e) {
|
||||
@@ -424,10 +583,6 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public interface IJadeProvider<T> {
|
||||
+ void saveData(CompoundTag data, ServerPlayer player, Level world, T object, boolean showDetails);
|
||||
+ }
|
||||
+
|
||||
+ public record RequestEntityPayload(boolean showDetails, int entityId, float hitX, float hitY, float hitZ) implements CustomPacketPayload {
|
||||
+
|
||||
+ private static final ResourceLocation PACKET_REQUEST_ENTITY = JadeProtocol.id("request_entity");
|
||||
@@ -485,53 +640,26 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ return mutableComponent;
|
||||
+ }
|
||||
+
|
||||
+ public static List<ViewGroup<ItemStack>> getGroups(ServerPlayer player, ServerLevel world, Object target, boolean showDetails) {
|
||||
+ if (target instanceof RandomizableContainerBlockEntity te && te.lootTable != null) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+ if (target instanceof ContainerEntity containerEntity && containerEntity.getLootTable() != null) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+ if (!player.isCreative() && !player.isSpectator() && target instanceof BaseContainerBlockEntity te) {
|
||||
+ if (te.lockKey != LockCode.NO_LOCK) {
|
||||
+ return List.of();
|
||||
+ }
|
||||
+ public interface IJadeProvider {
|
||||
+ }
|
||||
+
|
||||
+ return wrapItemStorage(target, player);
|
||||
+ public interface IJadeDataProvider<T> {
|
||||
+ void saveData(CompoundTag data, ServerPlayer player, Level world, T object, boolean showDetails);
|
||||
+ }
|
||||
+
|
||||
+ public static List<ViewGroup<ItemStack>> wrapItemStorage(Object target, ServerPlayer player) {
|
||||
+ int size = 54;
|
||||
+ if (target instanceof AbstractHorse horse) {
|
||||
+ return List.of(fromContainer(horse.inventory, size, 2));
|
||||
+ }
|
||||
+ if (target instanceof Container container) {
|
||||
+ if (target instanceof ChestBlockEntity be) {
|
||||
+ if (be.getBlockState().getBlock() instanceof ChestBlock chestBlock) {
|
||||
+ Container compound = ChestBlock.getContainer(chestBlock, be.getBlockState(), be.getLevel(), be.getBlockPos(), false);
|
||||
+ if (compound != null) {
|
||||
+ container = compound;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return List.of(fromContainer(container, size, 0));
|
||||
+ }
|
||||
+ if (player != null && target instanceof EnderChestBlockEntity) {
|
||||
+ return List.of(fromContainer(player.getEnderChestInventory(), size, 0));
|
||||
+ }
|
||||
+ return null;
|
||||
+ public interface IServerExtensionProvider<IN, OUT> {
|
||||
+ List<ViewGroup<OUT>> getGroups(ServerPlayer player, Level world, IN target);
|
||||
+ }
|
||||
+
|
||||
+ public static ViewGroup<ItemStack> fromContainer(Container container, int maxSize, int startIndex) {
|
||||
+ return compacted(IntStream.range(startIndex, container.getContainerSize()).limit(maxSize * 3L).mapToObj(container::getItem), maxSize);
|
||||
+ public static class ItemCollector<T> {
|
||||
+ public static final int MAX_SIZE = 54;
|
||||
+ public static final ItemCollector<?> EMPTY = new ItemCollector<>(null);
|
||||
+ private static final Predicate<ItemStack> NON_EMPTY = stack -> {
|
||||
+ if (stack.isEmpty()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ public static ViewGroup<ItemStack> compacted(Stream<ItemStack> stream, int maxSize) {
|
||||
+ List<ItemStack> stacks = Lists.newArrayList();
|
||||
+ MutableInt start = new MutableInt();
|
||||
+ stream.filter(stack -> !stack.isEmpty()).filter(stack -> {
|
||||
+ if (stack.hasTag() && stack.getTag().contains("CustomModelData")) {
|
||||
+ CompoundTag tag = stack.getTag();
|
||||
+ if (tag != null && tag.contains("CustomModelData")) {
|
||||
+ for (String key : stack.getTag().getAllKeys()) {
|
||||
+ if (key.toLowerCase(Locale.ENGLISH).endsWith("clear") && stack.getTag().getBoolean(key)) {
|
||||
+ return false;
|
||||
@@ -539,21 +667,180 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+ }
|
||||
+ return true;
|
||||
+ }).forEach(stack -> {
|
||||
+ int size = stacks.size();
|
||||
+ if (size > maxSize) return;
|
||||
+ for (int i = 0; i < size; i++) {
|
||||
+ int j = (i + start.intValue()) % size;
|
||||
+ if (ItemStack.isSameItemSameTags(stack, stacks.get(j))) {
|
||||
+ stacks.get(j).grow(stack.getCount());
|
||||
+ start.setValue(j);
|
||||
+ return;
|
||||
+ };
|
||||
+ private final Object2IntLinkedOpenHashMap<ItemDefinition> items = new Object2IntLinkedOpenHashMap<>();
|
||||
+ private final ItemIterator<T> iterator;
|
||||
+ public long version;
|
||||
+ public long lastTimeFinished;
|
||||
+ public List<ViewGroup<ItemStack>> mergedResult;
|
||||
+
|
||||
+ public ItemCollector(ItemIterator<T> iterator) {
|
||||
+ this.iterator = iterator;
|
||||
+ }
|
||||
+
|
||||
+ public List<ViewGroup<ItemStack>> update(Object target, long gameTime) {
|
||||
+ if (iterator == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ T container = iterator.find(target);
|
||||
+ if (container == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ long currentVersion = iterator.getVersion(container);
|
||||
+ if (mergedResult != null && iterator.isFinished()) {
|
||||
+ if (version == currentVersion) {
|
||||
+ return mergedResult; // content not changed
|
||||
+ }
|
||||
+ if (lastTimeFinished + 5 > gameTime) {
|
||||
+ return mergedResult; // avoid update too frequently
|
||||
+ }
|
||||
+ iterator.reset();
|
||||
+ }
|
||||
+ AtomicInteger count = new AtomicInteger();
|
||||
+ iterator.populate(container).forEach(stack -> {
|
||||
+ count.incrementAndGet();
|
||||
+ if (NON_EMPTY.test(stack)) {
|
||||
+ ItemDefinition def = new ItemDefinition(stack);
|
||||
+ items.addTo(def, stack.getCount());
|
||||
+ }
|
||||
+ stacks.add(stack.copy());
|
||||
+ });
|
||||
+ if (stacks.size() > maxSize) stacks.remove(maxSize);
|
||||
+ return new ViewGroup<>(stacks);
|
||||
+ iterator.afterPopulate(count.get());
|
||||
+ if (mergedResult != null && !iterator.isFinished()) {
|
||||
+ updateCollectingProgress(mergedResult.get(0));
|
||||
+ return mergedResult;
|
||||
+ }
|
||||
+ List<ItemStack> partialResult = items.object2IntEntrySet().stream().limit(54).map(entry -> {
|
||||
+ ItemDefinition def = entry.getKey();
|
||||
+ return def.toStack(entry.getIntValue());
|
||||
+ }).toList();
|
||||
+ List<ViewGroup<ItemStack>> groups = List.of(updateCollectingProgress(new ViewGroup<>(partialResult)));
|
||||
+ if (iterator.isFinished()) {
|
||||
+ mergedResult = groups;
|
||||
+ version = currentVersion;
|
||||
+ lastTimeFinished = gameTime;
|
||||
+ items.clear();
|
||||
+ }
|
||||
+ return groups;
|
||||
+ }
|
||||
+
|
||||
+ protected ViewGroup<ItemStack> updateCollectingProgress(ViewGroup<ItemStack> group) {
|
||||
+ float progress = iterator.getCollectingProgress();
|
||||
+ CompoundTag data = group.getExtraData();
|
||||
+ if (Float.isNaN(progress)) {
|
||||
+ progress = 0;
|
||||
+ }
|
||||
+ if (progress >= 1) {
|
||||
+ data.remove("Collecting");
|
||||
+ } else {
|
||||
+ data.putFloat("Collecting", progress);
|
||||
+ }
|
||||
+ return group;
|
||||
+ }
|
||||
+
|
||||
+ public record ItemDefinition(Item item, @Nullable CompoundTag tag) {
|
||||
+ ItemDefinition(ItemStack stack) {
|
||||
+ this(stack.getItem(), stack.getTag());
|
||||
+ }
|
||||
+
|
||||
+ public ItemStack toStack(int count) {
|
||||
+ ItemStack stack = new ItemStack(item);
|
||||
+ stack.setCount(count);
|
||||
+ stack.setTag(tag);
|
||||
+ return stack;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static abstract class ItemIterator<T> {
|
||||
+ public static final AtomicLong version = new AtomicLong();
|
||||
+ protected final Function<Object, @Nullable T> containerFinder;
|
||||
+ protected final int fromIndex;
|
||||
+ protected boolean finished;
|
||||
+ protected int currentIndex;
|
||||
+
|
||||
+ protected ItemIterator(Function<Object, @Nullable T> containerFinder, int fromIndex) {
|
||||
+ this.containerFinder = containerFinder;
|
||||
+ this.currentIndex = this.fromIndex = fromIndex;
|
||||
+ }
|
||||
+
|
||||
+ public @Nullable T find(Object target) {
|
||||
+ return containerFinder.apply(target);
|
||||
+ }
|
||||
+
|
||||
+ public final boolean isFinished() {
|
||||
+ return finished;
|
||||
+ }
|
||||
+
|
||||
+ public long getVersion(T container) {
|
||||
+ return version.getAndIncrement();
|
||||
+ }
|
||||
+
|
||||
+ public abstract Stream<ItemStack> populate(T container);
|
||||
+
|
||||
+ public void reset() {
|
||||
+ currentIndex = fromIndex;
|
||||
+ finished = false;
|
||||
+ }
|
||||
+
|
||||
+ public void afterPopulate(int count) {
|
||||
+ currentIndex += count;
|
||||
+ if (count == 0 || currentIndex >= 10000) {
|
||||
+ finished = true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public float getCollectingProgress() {
|
||||
+ return Float.NaN;
|
||||
+ }
|
||||
+
|
||||
+ public static abstract class SlottedItemIterator<T> extends ItemIterator<T> {
|
||||
+ protected float progress;
|
||||
+
|
||||
+ public SlottedItemIterator(Function<Object, @Nullable T> containerFinder, int fromIndex) {
|
||||
+ super(containerFinder, fromIndex);
|
||||
+ }
|
||||
+
|
||||
+ protected abstract int getSlotCount(T container);
|
||||
+
|
||||
+ protected abstract ItemStack getItemInSlot(T container, int slot);
|
||||
+
|
||||
+ @Override
|
||||
+ public Stream<ItemStack> populate(T container) {
|
||||
+ int slotCount = getSlotCount(container);
|
||||
+ int toIndex = currentIndex + ItemCollector.MAX_SIZE * 2;
|
||||
+ if (toIndex >= slotCount) {
|
||||
+ toIndex = slotCount;
|
||||
+ finished = true;
|
||||
+ }
|
||||
+ progress = (float) (currentIndex - fromIndex) / (slotCount - fromIndex);
|
||||
+ return IntStream.range(currentIndex, toIndex).mapToObj(slot -> getItemInSlot(container, slot));
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public float getCollectingProgress() {
|
||||
+ return progress;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static class ContainerItemIterator extends SlottedItemIterator<Container> {
|
||||
+ public ContainerItemIterator(int fromIndex) {
|
||||
+ this(Container.class::cast, fromIndex);
|
||||
+ }
|
||||
+
|
||||
+ public ContainerItemIterator(Function<Object, @Nullable Container> containerFinder, int fromIndex) {
|
||||
+ super(containerFinder, fromIndex);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected int getSlotCount(Container container) {
|
||||
+ return container.getContainerSize();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ protected ItemStack getItemInSlot(Container container, int slot) {
|
||||
+ return container.getItem(slot);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static class ViewGroup<T> {
|
||||
@@ -583,7 +870,10 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+
|
||||
+ public static <T> boolean saveList(CompoundTag tag, String key, List<ViewGroup<T>> groups, Function<T, CompoundTag> writer) {
|
||||
+ if (groups == null || groups.isEmpty()) return false;
|
||||
+ if (groups == null || groups.isEmpty()) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ ListTag groupList = new ListTag();
|
||||
+ for (ViewGroup<T> group : groups) {
|
||||
+ if (group.views.isEmpty()) {
|
||||
@@ -606,18 +896,14 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+ return extraData;
|
||||
+ }
|
||||
+
|
||||
+ public void setProgress(float progress) {
|
||||
+ getExtraData().putFloat("Progress", progress);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ public static class HierarchyLookup<T extends IJadeProvider<?>> {
|
||||
+ public static class HierarchyLookup<T> {
|
||||
+
|
||||
+ private final Class<?> baseClass;
|
||||
+ private final ListMultimap<Class<?>, T> objects = ArrayListMultimap.create();
|
||||
+ private final Cache<Class<?>, List<T>> resultCache = CacheBuilder.newBuilder().build();
|
||||
+ private final boolean singleton;
|
||||
+ private ListMultimap<Class<?>, T> objects = ArrayListMultimap.create();
|
||||
+
|
||||
+ public HierarchyLookup(Class<?> baseClass) {
|
||||
+ this(baseClass, false);
|
||||
@@ -645,7 +931,9 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ return resultCache.get(clazz, () -> {
|
||||
+ List<T> list = Lists.newArrayList();
|
||||
+ getInternal(clazz, list);
|
||||
+ if (singleton && !list.isEmpty()) return ImmutableList.of(list.get(0));
|
||||
+ if (singleton && !list.isEmpty()) {
|
||||
+ return ImmutableList.of(list.get(0));
|
||||
+ }
|
||||
+ return list;
|
||||
+ });
|
||||
+ } catch (ExecutionException e) {
|
||||
@@ -660,5 +948,9 @@ index 0000000000000000000000000000000000000000..d9727943c5d44361d35b96ee8045918c
|
||||
+ }
|
||||
+ list.addAll(objects.get(clazz));
|
||||
+ }
|
||||
+
|
||||
+ public Multimap<Class<?>, T> getObjects() {
|
||||
+ return objects;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 9b8b0740a06b5b92fb3e905d7f8945c91ee637fb..d823423ae9e5273355c40e0f5b0e7b5ff4ef34c3 100644
|
||||
index 80db3fcf338846770e8c8ee6aa7635a68f2b6753..d9640b2a08101e9bd65323019c1de9c087822dde 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1376,6 +1376,7 @@ public abstract class PlayerList {
|
||||
@@ -1375,6 +1375,7 @@ public abstract class PlayerList {
|
||||
player.connection.send(new ClientboundInitializeBorderPacket(worldborder));
|
||||
player.connection.send(new ClientboundSetTimePacket(world.getGameTime(), world.getDayTime(), world.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)));
|
||||
player.connection.send(new ClientboundSetDefaultSpawnPositionPacket(world.getSharedSpawnPos(), world.getSharedSpawnAngle()));
|
||||
@@ -19,7 +19,7 @@ index 9b8b0740a06b5b92fb3e905d7f8945c91ee637fb..d823423ae9e5273355c40e0f5b0e7b5f
|
||||
// CraftBukkit start - handle player weather
|
||||
// entityplayer.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.START_RAINING, 0.0F));
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 472cbd7c35f8bbbdfdd2708f97b18f0422a1f648..3bfa1c7b7a4ad44224cde67fe3778fe8676e61ef 100644
|
||||
index 097c02b204369cd8e3acf852db761533ad58af89..429e2fb485a7c0fa9329078a2690ed48c649a49d 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -2,6 +2,7 @@ package org.dreeam.leaf;
|
||||
|
||||
@@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves
|
||||
This patch is Powered by Syncmatica(https://github.com/End-Tech/syncmatica)
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a5fb09c24788fef07463a6abb6bee2718bdd779e..998e8c9edbe658484f220daf8c6f7da1d4ce7cfd 100644
|
||||
index 1c1f6d89b622a5fb7d2ab541dbe4f029723c7811..e5aeb104beff9ca8969c86bb2b2c2bea9dcde5ab 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -311,6 +311,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -310,6 +310,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
Objects.requireNonNull(server);
|
||||
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(uuid, server::enforceSecureProfile);
|
||||
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
|
||||
@@ -20,7 +20,7 @@ index a5fb09c24788fef07463a6abb6bee2718bdd779e..998e8c9edbe658484f220daf8c6f7da1
|
||||
}
|
||||
|
||||
// CraftBukkit start - add fields
|
||||
@@ -350,6 +351,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -349,6 +350,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
);
|
||||
// Purpur end
|
||||
|
||||
@@ -30,7 +30,7 @@ index a5fb09c24788fef07463a6abb6bee2718bdd779e..998e8c9edbe658484f220daf8c6f7da1
|
||||
public void tick() {
|
||||
if (this.ackBlockChangesUpTo > -1) {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 3bfa1c7b7a4ad44224cde67fe3778fe8676e61ef..49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1 100644
|
||||
index 429e2fb485a7c0fa9329078a2690ed48c649a49d..86f95b0e99b1a00883d5f4c735f155769c53879f 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -253,11 +253,20 @@ public class LeafConfig {
|
||||
|
||||
@@ -7,10 +7,10 @@ Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5b0b7d54c 100644
|
||||
index e5aeb104beff9ca8969c86bb2b2c2bea9dcde5ab..268eff03168d25cccba703d1c5df603c9c3663cd 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -247,7 +247,6 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
@@ -246,7 +246,6 @@ import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.InventoryView;
|
||||
import org.bukkit.inventory.SmithingInventory;
|
||||
// CraftBukkit end
|
||||
@@ -18,16 +18,16 @@ index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5
|
||||
public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl implements ServerGamePacketListener, ServerPlayerConnection, TickablePacketListener {
|
||||
|
||||
static final Logger LOGGER = LogUtils.getLogger();
|
||||
@@ -583,7 +582,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -579,7 +578,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Prevent moving into unloaded chunks
|
||||
|
||||
- if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
|
||||
+ if (!org.dreeam.leaf.LeafConfig.disableMovedWronglyThreshold && d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) { // Leaves - disable can
|
||||
// CraftBukkit end
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", new Object[]{entity.getName().getString(), this.player.getName().getString(), d6, d7, d8});
|
||||
this.send(new ClientboundMoveVehiclePacket(entity));
|
||||
@@ -619,7 +618,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -615,7 +614,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
boolean flag2 = false;
|
||||
|
||||
@@ -36,7 +36,7 @@ index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5
|
||||
flag2 = true; // Paper - diff on change, this should be moved wrongly
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} (vehicle of {}) moved wrongly! {}", new Object[]{entity.getName().getString(), this.player.getName().getString(), Math.sqrt(d10)});
|
||||
}
|
||||
@@ -1489,7 +1488,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1483,7 +1482,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_TOO_QUICKLY,
|
||||
toX, toY, toZ, toYaw, toPitch, true);
|
||||
if (!event.isAllowed()) {
|
||||
@@ -45,9 +45,9 @@ index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5
|
||||
ServerGamePacketListenerImpl.LOGGER.warn("{} moved too quickly! {},{},{}", new Object[]{this.player.getName().getString(), d6, d7, d8});
|
||||
this.teleport(this.player.getX(), this.player.getY(), this.player.getZ(), this.player.getYRot(), this.player.getXRot());
|
||||
return;
|
||||
@@ -1559,7 +1558,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -1553,7 +1552,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
d10 = d6 * d6 + d7 * d7 + d8 * d8;
|
||||
boolean flag2 = false;
|
||||
boolean movedWrongly = false; // Paper - Add fail move event; rename
|
||||
|
||||
- if (!this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot
|
||||
+ if (!org.dreeam.leaf.LeafConfig.disableMovedWronglyThreshold && !this.player.isChangingDimension() && d10 > org.spigotmc.SpigotConfig.movedWronglyThreshold && !this.player.isSleeping() && !this.player.gameMode.isCreative() && this.player.gameMode.getGameModeForPlayer() != GameType.SPECTATOR) { // Spigot // Leaves - disable can
|
||||
@@ -55,7 +55,7 @@ index 998e8c9edbe658484f220daf8c6f7da1d4ce7cfd..a2950eab75913c3d8faa3955373d6ad5
|
||||
io.papermc.paper.event.player.PlayerFailMoveEvent event = fireFailMove(io.papermc.paper.event.player.PlayerFailMoveEvent.FailReason.MOVED_WRONGLY,
|
||||
toX, toY, toZ, toYaw, toPitch, true);
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 49fc8b6e0be0e1d5bdc283cef91ab0834dc387f1..c16913bda424c060d0abd83fcfaa93f52f4f8891 100644
|
||||
index 86f95b0e99b1a00883d5f4c735f155769c53879f..4cc25879528dc06f3a6f8112ad0571baae8d838b 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -176,6 +176,7 @@ public class LeafConfig {
|
||||
|
||||
@@ -7,12 +7,12 @@ Original license: GPLv3
|
||||
Original project: https://github.com/LeavesMC/Leaves
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
index 5d9f25da1bd502b0047abc64ef7602968ee3cb20..9f84d53f82e430e92568aef0bb7ec5bd7ffc46a0 100644
|
||||
index 72a69569fab9d62c27c3ea4005c4e24816bdc5cd..82199b522db0fb21e5a74111284f8574f48109c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
|
||||
@@ -107,7 +107,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
|
||||
if (!list.isEmpty()) {
|
||||
// Paper start
|
||||
// Paper start - Ensure safe gateway teleport
|
||||
for (Entity entity : list) {
|
||||
- if (entity.canChangeDimensions()) {
|
||||
+ if (org.dreeam.leaf.LeafConfig.useVanillaEndTeleport || entity.canChangeDimensions()) { // Leaf - be vanilla
|
||||
@@ -20,7 +20,7 @@ index 5d9f25da1bd502b0047abc64ef7602968ee3cb20..9f84d53f82e430e92568aef0bb7ec5bd
|
||||
break;
|
||||
}
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index c16913bda424c060d0abd83fcfaa93f52f4f8891..41009a22116ef4a81e9e550af186f5c0d9d43fa7 100644
|
||||
index 4cc25879528dc06f3a6f8112ad0571baae8d838b..1754f580d833670c16c8f9b7f087250ea62612dd 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -280,4 +280,9 @@ public class LeafConfig {
|
||||
|
||||
@@ -15,7 +15,7 @@ This patch was ported downstream from the Petal fork.
|
||||
Makes most pathfinding-related work happen asynchronously
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
index b9f1bfef9f33138c52f800084828bdc805960cab..1ea2f6829747e4c4a722a533c165aacd4aae1c81 100644
|
||||
index b171c53efae9cc39bc68164fbe0f90afb47769be..21d5abd15e833c77983692b59475a77c66ca3ecc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
|
||||
@@ -294,6 +294,7 @@ public abstract class Mob extends LivingEntity implements Targeting {
|
||||
@@ -320,7 +320,7 @@ index 9d3b32c852d660356e0f16d4cc10072b1c603e64..3a8579ccedc9c70abe75adc99d8e72aa
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
index 027eef4ace908147285c8d72b612d16e4f925672..5ce3daabd949f72b16abc8e7888e2e80deb13b21 100644
|
||||
index e35c38feb62c3345d82636081decc09db9f061ab..f9d34b6a3a470b45360a1b53c0b36d59465e70a9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
|
||||
@@ -10,16 +10,34 @@ import net.minecraft.world.level.pathfinder.FlyNodeEvaluator;
|
||||
@@ -367,7 +367,7 @@ index 027eef4ace908147285c8d72b612d16e4f925672..5ce3daabd949f72b16abc8e7888e2e80
|
||||
if (!this.isDone()) {
|
||||
if (this.canUpdatePath()) {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||
index ac996b066415e461af1fcb71b19807401179c7f8..8a36614c32d209e75fcbee0b2ea65855675363dd 100644
|
||||
index 47de460ff5435ea6712c800c77093126908d0fce..6c6d61a554e5bfdf7495fa5184dbd6eca1633971 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
|
||||
@@ -15,6 +15,8 @@ import net.minecraft.world.level.pathfinder.Path;
|
||||
@@ -407,7 +407,7 @@ index ac996b066415e461af1fcb71b19807401179c7f8..8a36614c32d209e75fcbee0b2ea65855
|
||||
}
|
||||
|
||||
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 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9bb67a03be 100644
|
||||
index 33983ed67ad6b0d25d2ae00e03415bda940584eb..801077daca6781e68193f71be20076390e42200e 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
|
||||
@@ -25,6 +25,8 @@ import net.minecraft.world.level.pathfinder.PathFinder;
|
||||
@@ -419,7 +419,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
|
||||
public abstract class PathNavigation {
|
||||
private static final int MAX_TIME_RECOMPUTE = 20;
|
||||
@@ -152,6 +154,10 @@ public abstract class PathNavigation {
|
||||
@@ -153,6 +155,10 @@ public abstract class PathNavigation {
|
||||
return null;
|
||||
} else if (!this.canUpdatePath()) {
|
||||
return null;
|
||||
@@ -430,7 +430,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
} else if (this.path != null && !this.path.isDone() && positions.contains(this.targetPos)) {
|
||||
return this.path;
|
||||
} else {
|
||||
@@ -176,11 +182,29 @@ public abstract class PathNavigation {
|
||||
@@ -177,11 +183,29 @@ public abstract class PathNavigation {
|
||||
int i = (int)(followRange + (float)range);
|
||||
PathNavigationRegion pathNavigationRegion = new PathNavigationRegion(this.level, blockPos.offset(-i, -i, -i), blockPos.offset(i, i, i));
|
||||
Path path = this.pathFinder.findPath(pathNavigationRegion, this.mob, positions, followRange, distance, this.maxVisitedNodesMultiplier);
|
||||
@@ -460,7 +460,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -227,8 +251,8 @@ public abstract class PathNavigation {
|
||||
@@ -228,8 +252,8 @@ public abstract class PathNavigation {
|
||||
if (this.isDone()) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -471,7 +471,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
return false;
|
||||
} else {
|
||||
this.speedModifier = speed;
|
||||
@@ -251,6 +275,7 @@ public abstract class PathNavigation {
|
||||
@@ -252,6 +276,7 @@ public abstract class PathNavigation {
|
||||
if (this.hasDelayedRecomputation) {
|
||||
this.recomputePath();
|
||||
}
|
||||
@@ -479,7 +479,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
|
||||
if (!this.isDone()) {
|
||||
if (this.canUpdatePath()) {
|
||||
@@ -277,6 +302,7 @@ public abstract class PathNavigation {
|
||||
@@ -278,6 +303,7 @@ public abstract class PathNavigation {
|
||||
}
|
||||
|
||||
protected void followThePath() {
|
||||
@@ -487,7 +487,7 @@ index 91f85cdf46f9bb59c6d00293b1d95d49a6c2a52a..a08149f9b8705a27fc5b20cbd76abc9b
|
||||
Vec3 vec3 = this.getTempMobPos();
|
||||
this.maxDistanceToWaypoint = this.mob.getBbWidth() > 0.75F ? this.mob.getBbWidth() / 2.0F : 0.75F - this.mob.getBbWidth() / 2.0F;
|
||||
Vec3i vec3i = this.path.getNextNodePos();
|
||||
@@ -432,7 +458,7 @@ public abstract class PathNavigation {
|
||||
@@ -433,7 +459,7 @@ public abstract class PathNavigation {
|
||||
public boolean shouldRecomputePath(BlockPos pos) {
|
||||
if (this.hasDelayedRecomputation) {
|
||||
return false;
|
||||
@@ -592,7 +592,7 @@ index 8db20db72cd51046213625fac46c35854c59ec5d..fc99483dfe248d26885c904b72c93b0d
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
index bdb78cc701543cfe91a6bafd1786fe2ea0bf1ddc..8d2e60c24e8d48094a93fdd864d931d0c33d0ca0 100644
|
||||
index 997ab942be9f742804041b07d607e7dd6473ba96..9ef7be84999ab0ec39d2b58a48cdaebf42db10c9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
|
||||
@@ -1154,7 +1154,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
|
||||
@@ -657,7 +657,7 @@ index 819445535895fbf79b99222bc6bf33cbd9089813..80a7197835531fa8cd276d9d31860f2b
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index 034bb2d1292dde6276885c3ea71d886c3894311c..3556f9a37d6a4790f9311e1004d32156aff541e2 100644
|
||||
index 7600e747d91ae888eb801cfafcb09bffb76c8e62..0939ca7c225790c7a294accd820be3ff8000ac75 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -282,7 +282,6 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -718,7 +718,7 @@ index 2f49b528601a1feb7246fe7a9b83ce828c2d78fc..a29f212f3b38f1d80d7d5023f86a7acf
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index 96f98389d8cdf588396bf6257a11236a577878a0..c23d192baf78890093b0e88d03735eef4569e75f 100644
|
||||
index 07fa613d75f3659145945245926e9068057e3ed2..da834424b655d49388926a0472cacb5ecc4d56fd 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -623,6 +623,16 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -757,7 +757,7 @@ index 42407c5c0c09cd9d19bc7af92af8868bb038c686..204a17ab514d63294e72d609b0b35749
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/Path.java b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
index eea4c932d909145e7af848cf76e3f49dbb2deff2..7160459ec8ba81f66a85082a1fe7b06377180afa 100644
|
||||
index 3049edb5a8b5967e5242a3896b23665888eb3472..0da9acd785cf785d82be7aab0a1e2bfd70c62998 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/Path.java
|
||||
@@ -27,6 +27,17 @@ public class Path {
|
||||
@@ -787,7 +787,7 @@ index eea4c932d909145e7af848cf76e3f49dbb2deff2..7160459ec8ba81f66a85082a1fe7b063
|
||||
return false;
|
||||
} else if (o.nodes.size() != this.nodes.size()) {
|
||||
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 c4052d1a7c2903564a8a6226c1b019d299c71b2a..97490ba1adeed8d0c941587d42700d35b5a41fd5 100644
|
||||
index 61d5fe8e5344a6cb94d427859488c34821c8a3f6..c679bdd7b26783463fddfd848005385e05d69903 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
|
||||
@@ -1,20 +1,18 @@
|
||||
@@ -852,13 +852,13 @@ index c4052d1a7c2903564a8a6226c1b019d299c71b2a..97490ba1adeed8d0c941587d42700d35
|
||||
+ NodeEvaluatorCache.removeNodeEvaluator(nodeEvaluator); // Kaiiju - petal - handle nodeEvaluatorGenerator
|
||||
return null;
|
||||
} else {
|
||||
// Paper start - remove streams - and optimize collection
|
||||
// Paper start - Perf: remove streams and optimize collection
|
||||
List<Map.Entry<Target, BlockPos>> map = Lists.newArrayList();
|
||||
for (BlockPos pos : positions) {
|
||||
- map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
|
||||
+ map.add(new java.util.AbstractMap.SimpleEntry<>(nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos)); // Kaiiju - petal - handle nodeEvaluatorGenerator
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - Perf: remove streams and optimize collection
|
||||
- Path path = this.findPath(node, map, followRange, distance, rangeMultiplier); // Gale - Purpur - remove vanilla profiler
|
||||
- this.nodeEvaluator.done();
|
||||
- return path;
|
||||
@@ -884,9 +884,8 @@ index c4052d1a7c2903564a8a6226c1b019d299c71b2a..97490ba1adeed8d0c941587d42700d35
|
||||
}
|
||||
}
|
||||
|
||||
- @Nullable
|
||||
+ //@Nullable // Kaiiju - Always not null
|
||||
// Paper start - optimize collection
|
||||
@Nullable
|
||||
// Paper start - Perf: remove streams and optimize collection
|
||||
private Path findPath(Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) { // Gale - Purpur - remove vanilla profiler
|
||||
+ // Kaiiju start - petal - split pathfinding into the original sync method for compat and processing for delaying
|
||||
+ try {
|
||||
@@ -920,7 +919,7 @@ index c4052d1a7c2903564a8a6226c1b019d299c71b2a..97490ba1adeed8d0c941587d42700d35
|
||||
}
|
||||
+ //noinspection ConstantConditions // Kaiiju - petal - ignore this warning, we know that the above loop always runs at least once since positions is not empty
|
||||
return best;
|
||||
// Paper end
|
||||
// Paper end - Perf: remove streams and optimize collection
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java b/src/main/java/net/minecraft/world/level/pathfinder/SwimNodeEvaluator.java
|
||||
index 0e2b14e7dfedf209d63279c81723fd7955122d78..079b278e2e262af433bb5bd0c12b3d8db4fa12fc 100644
|
||||
@@ -936,7 +935,7 @@ index 0e2b14e7dfedf209d63279c81723fd7955122d78..079b278e2e262af433bb5bd0c12b3d8d
|
||||
|
||||
public SwimNodeEvaluator(boolean canJumpOutOfWater) {
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index 41009a22116ef4a81e9e550af186f5c0d9d43fa7..d6646f4db522aa4a5404acf17fb34bfe01a5763a 100644
|
||||
index 1754f580d833670c16c8f9b7f087250ea62612dd..393c8d887e0de195d6bd95c9c3273b03d7b3eb03 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.core.registries.BuiltInRegistries;
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Fix tracker NPE
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 95add10db1d7600167312160cd1a15a715c7b54f..62ac94fff8542eedd3fea5fbaef5c4f617fdac01 100644
|
||||
index 2b9968a8a3d0d66d9db5a83dcf2a44767a9fe412..da9c5d362a0bde281c95e9ebc413c51d66aaaa0f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -241,7 +241,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -17,7 +17,7 @@ index 95add10db1d7600167312160cd1a15a715c7b54f..62ac94fff8542eedd3fea5fbaef5c4f6
|
||||
public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap = new gg.pufferfish.pufferfish.util.AsyncPlayerAreaMap(this.pooledLinkedPlayerHashSets); // Pufferfish
|
||||
// Paper end - optimise chunk tick iteration
|
||||
|
||||
@@ -1298,7 +1298,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1284,7 +1284,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
final Entity entity;
|
||||
private final int range;
|
||||
SectionPos lastSectionPos;
|
||||
@@ -27,7 +27,7 @@ index 95add10db1d7600167312160cd1a15a715c7b54f..62ac94fff8542eedd3fea5fbaef5c4f6
|
||||
public TrackedEntity(Entity entity, int i, int j, boolean flag) {
|
||||
this.serverEntity = new ServerEntity(ChunkMap.this.level, entity, j, flag, this::broadcast, this.seenBy); // CraftBukkit
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index e04ab410b88f681032de4406dceac5ef51476ce1..02b517288ef0794ccfd46802bf76fa56af21c524 100644
|
||||
index e841f12a43c4506f87b64b537a8c47bf54de5aa2..1273760f0c1dde908e2512efee2df5460e70eb42 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -9,6 +9,7 @@ import java.io.IOException;
|
||||
@@ -38,7 +38,7 @@ index e04ab410b88f681032de4406dceac5ef51476ce1..02b517288ef0794ccfd46802bf76fa56
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
@@ -650,7 +651,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -642,7 +643,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
// Paper - optimise chunk tick iteration
|
||||
// Paper start - optimise chunk tick iteration
|
||||
if (!this.chunkMap.needsChangeBroadcasting.isEmpty()) {
|
||||
@@ -48,7 +48,7 @@ index e04ab410b88f681032de4406dceac5ef51476ce1..02b517288ef0794ccfd46802bf76fa56
|
||||
for (ChunkHolder holder : copy) {
|
||||
holder.broadcastChanges(holder.getFullChunkNowUnchecked()); // LevelChunks are NEVER unloaded
|
||||
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 635037fb2a44a422b42d7c3c27cc7638c7715635..4fa17d2ba40bfd0159c182b909f9ab936e3ddf39 100644
|
||||
index 7394c2d99499faaa4489a7eee1dd8b73ec08668d..d1603df4f829a7f3690970965f5549c99620db01 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
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
@@ -6,10 +6,10 @@ Subject: [PATCH] Reduce canSee work
|
||||
Credit by: Martijn Muijsers <martijnmuijsers@live.nl>, MachineBreaker<machinebreaker>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 2c5c84c028d1298bb145fa1149752db3f83d5de2..86d535c704d174da9b75bd599a7b302ba5fe5e56 100644
|
||||
index 36a420f8cf463dcabe5717df1af59472db3142fc..3c5d8275782df8d9b3fb6e8047bfde02e26ca93f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -386,17 +386,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -383,17 +383,19 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
for (int i = 0, len = entities.size(); i < len; ++i) {
|
||||
Entity entity = entities.get(i);
|
||||
|
||||
@@ -35,10 +35,10 @@ index 2c5c84c028d1298bb145fa1149752db3f83d5de2..86d535c704d174da9b75bd599a7b302b
|
||||
if (net.minecraft.world.phys.shapes.Shapes.joinIsNotEmpty(voxelshape, net.minecraft.world.phys.shapes.Shapes.create(entity.getBoundingBox()), net.minecraft.world.phys.shapes.BooleanOp.AND)) {
|
||||
return false;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 7e13ffee8e650cd5fe63fddf636321830e6ffb6d..f0da7fb7b09c8a5483b5d741810ab99985df64b6 100644
|
||||
index 8875cf92722a1a25c02cd887ff5d000a84e6722d..2b4279efe6698e786f9db8066f73b7934c8660d4 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -591,6 +591,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -549,6 +549,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return false;
|
||||
}
|
||||
OfflinePlayer other = (OfflinePlayer) obj;
|
||||
|
||||
@@ -22,10 +22,10 @@ index ff1ad1024419182f7f3de578442c1c033d4c9ebb..5e51a1c79811291a740ad4d5e79a7d67
|
||||
@Deprecated
|
||||
static RandomSource createThreadSafe() {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||
index 86d535c704d174da9b75bd599a7b302ba5fe5e56..8658ba808791901cf45b3aeb6317b3ec80387609 100644
|
||||
index 3c5d8275782df8d9b3fb6e8047bfde02e26ca93f..a4c5bab9d2a714f15d8053e988e6f585377170d3 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||
@@ -128,6 +128,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
@@ -126,6 +126,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||
protected float oThunderLevel;
|
||||
public float thunderLevel;
|
||||
public final RandomSource random = RandomSource.create();
|
||||
@@ -34,10 +34,10 @@ index 86d535c704d174da9b75bd599a7b302ba5fe5e56..8658ba808791901cf45b3aeb6317b3ec
|
||||
@Deprecated
|
||||
private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/NaturalSpawner.java b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
index ec6afe51fd204e4c0764850dcc4535f7f8c159ab..9f8c6fa8fdf83ecc1e2582345bcf6bb757577f60 100644
|
||||
index 31003588de8bef9952a688c486049077328e89a3..9c4a8b6a4371bf8b1af05fb180b8fee020226e05 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/NaturalSpawner.java
|
||||
@@ -426,12 +426,12 @@ public final class NaturalSpawner {
|
||||
@@ -422,12 +422,12 @@ public final class NaturalSpawner {
|
||||
|
||||
private static BlockPos getRandomPosWithin(ServerLevel world, LevelChunk chunk) { // Gale - Airplane - Use ThreadUnsafeRandom for mob spawning - accept ServerLevel
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
|
||||
@@ -5,7 +5,7 @@ Subject: [PATCH] Configurable movement speed of more entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Drowned.java b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
index 3556f9a37d6a4790f9311e1004d32156aff541e2..232c6a456298c56f8ce7665705d766a874738b63 100644
|
||||
index 0939ca7c225790c7a294accd820be3ff8000ac75..cd0439a24644d0d5adf89911bad3e746b28191dc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Drowned.java
|
||||
@@ -89,6 +89,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
|
||||
@@ -37,7 +37,7 @@ index 06a5106a94a44c1d21537410d801cdd945503d69..be8e667841f7e4b9f9b261c90dc05c6a
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Zombie.java b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
index 007e75ec5a6a8f1522e7f0d105507834028eb819..cd3f64e88e1f0a600c19e9a0940442c912360332 100644
|
||||
index 6d69d936a2346f42abe8f867d51040121213b6ff..5ae6c0aa59f577ea4601fc8ba3768ed81bf0bcdb 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Zombie.java
|
||||
@@ -128,6 +128,7 @@ public class Zombie extends Monster {
|
||||
@@ -66,7 +66,7 @@ index 007e75ec5a6a8f1522e7f0d105507834028eb819..cd3f64e88e1f0a600c19e9a0940442c9
|
||||
@Override
|
||||
protected void defineSynchedData() {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
index d8731350ca97de34b256ccf44e08e32037ed527e..91b73e4ae6e556d37700706e9f5cee03d0d371a2 100644
|
||||
index d713afdc687b44595c40690f76e5d6c7ccb501c6..5435bbea79a4399b6e42ddd7c6dddf5e7e49d9bf 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombieVillager.java
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.world.entity.EntityType;
|
||||
@@ -86,7 +86,7 @@ index d8731350ca97de34b256ccf44e08e32037ed527e..91b73e4ae6e556d37700706e9f5cee03
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
index df8c7a45eb49a8c667030eb67d6d49dcbaef4fcf..6a534272546b19a75880940f39458ca69b0d1653 100644
|
||||
index feba8a264bae656244f60296d0511a8046297f73..2a24928fc4509ac3603f7e5ce574fed81274a5a1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/ZombifiedPiglin.java
|
||||
@@ -84,6 +84,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
|
||||
@@ -113,7 +113,7 @@ index df8c7a45eb49a8c667030eb67d6d49dcbaef4fcf..6a534272546b19a75880940f39458ca6
|
||||
@Override
|
||||
protected float getStandingEyeHeight(Pose pose, EntityDimensions dimensions) {
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e4675b4e7 100644
|
||||
index 88c9389f27f51a6423dfa4c71cf353b8b417e602..18a4b27a9159c211a0faf204e69e895f107b0163 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1535,6 +1535,7 @@ public class PurpurWorldConfig {
|
||||
@@ -148,7 +148,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
}
|
||||
|
||||
public boolean illusionerRidable = false;
|
||||
@@ -3122,6 +3126,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3124,6 +3128,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombieTakeDamageFromWater = false;
|
||||
public boolean zombieAlwaysDropExp = false;
|
||||
public double zombieHeadVisibilityPercent = 0.5D;
|
||||
@@ -156,7 +156,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
private void zombieSettings() {
|
||||
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
|
||||
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
|
||||
@@ -3141,6 +3146,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3143,6 +3148,7 @@ public class PurpurWorldConfig {
|
||||
zombieTakeDamageFromWater = getBoolean("mobs.zombie.takes-damage-from-water", zombieTakeDamageFromWater);
|
||||
zombieAlwaysDropExp = getBoolean("mobs.zombie.always-drop-exp", zombieAlwaysDropExp);
|
||||
zombieHeadVisibilityPercent = getDouble("mobs.zombie.head-visibility-percent", zombieHeadVisibilityPercent);
|
||||
@@ -164,7 +164,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
}
|
||||
|
||||
public boolean zombieHorseRidable = false;
|
||||
@@ -3189,6 +3195,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3191,6 +3197,7 @@ public class PurpurWorldConfig {
|
||||
public int zombieVillagerCuringTimeMax = 6000;
|
||||
public boolean zombieVillagerCureEnabled = true;
|
||||
public boolean zombieVillagerAlwaysDropExp = false;
|
||||
@@ -172,7 +172,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
private void zombieVillagerSettings() {
|
||||
zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable);
|
||||
zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater);
|
||||
@@ -3208,6 +3215,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3210,6 +3217,7 @@ public class PurpurWorldConfig {
|
||||
zombieVillagerCuringTimeMax = getInt("mobs.zombie_villager.curing_time.max", zombieVillagerCuringTimeMax);
|
||||
zombieVillagerCureEnabled = getBoolean("mobs.zombie_villager.cure.enabled", zombieVillagerCureEnabled);
|
||||
zombieVillagerAlwaysDropExp = getBoolean("mobs.zombie_villager.always-drop-exp", zombieVillagerAlwaysDropExp);
|
||||
@@ -180,7 +180,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
}
|
||||
|
||||
public boolean zombifiedPiglinRidable = false;
|
||||
@@ -3221,6 +3229,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3223,6 +3231,7 @@ public class PurpurWorldConfig {
|
||||
public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = true;
|
||||
public boolean zombifiedPiglinTakeDamageFromWater = false;
|
||||
public boolean zombifiedPiglinAlwaysDropExp = false;
|
||||
@@ -188,7 +188,7 @@ index 307d2703d61285dfe5225be27d8933098b4aa67c..0a29f28cf666896f0715d40bb121017e
|
||||
private void zombifiedPiglinSettings() {
|
||||
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
|
||||
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
|
||||
@@ -3238,6 +3247,7 @@ public class PurpurWorldConfig {
|
||||
@@ -3240,6 +3249,7 @@ public class PurpurWorldConfig {
|
||||
zombifiedPiglinCountAsPlayerKillWhenAngry = getBoolean("mobs.zombified_piglin.count-as-player-kill-when-angry", zombifiedPiglinCountAsPlayerKillWhenAngry);
|
||||
zombifiedPiglinTakeDamageFromWater = getBoolean("mobs.zombified_piglin.takes-damage-from-water", zombifiedPiglinTakeDamageFromWater);
|
||||
zombifiedPiglinAlwaysDropExp = getBoolean("mobs.zombified_piglin.always-drop-exp", zombifiedPiglinAlwaysDropExp);
|
||||
|
||||
@@ -13,23 +13,23 @@ Fixed errors in console has no color,also fixed`Advanced terminal features are n
|
||||
or `Unable to create terminal` like issues
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 3ed769d9fa46f8a5f340c5874f5cc6f11d2ba6f4..2adcf3c29257580b814e66b451ca71e772a6f49f 100644
|
||||
index e7ac805b5b455083b6b07eec05ca2e3bc655edd0..f9b4cd6f7032908ff32cfa68e736c01eaec24ce1 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -23,7 +23,7 @@ dependencies {
|
||||
// Gale end - project setup
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.0") // Leaf - Bump Dependencies
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.1") // Leaf - Bump Dependencies
|
||||
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
+ implementation("com.github.Dreeam-qwq:TerminalConsoleAppender:360a0759") // Leaf - Use own TerminalConsoleAppender fork to fix some issues under latest version of jline/log4j
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.15.0") // Keep in sync with adventureVersion from Paper-API build file // Leaf - Bump Dependencies
|
||||
implementation("net.kyori:ansi:1.0.3") // Manually bump beyond above transitive dep
|
||||
/*
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index a2933d814d453971080eeba90bb1819a8d599ba7..cd259a016a3f3189aab59ab1950e991fe6c31cd2 100644
|
||||
index 9af04084afe0689e5486be775cee3ba20e30617e..5b7f99a534dc7a02fcc6d6b01a80d5c62d8af527 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -1268,10 +1268,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -1270,10 +1270,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
//org.spigotmc.WatchdogThread.doStop(); // Spigot // Paper - move into stop
|
||||
// CraftBukkit start - Restore terminal to original settings
|
||||
@@ -43,8 +43,8 @@ index a2933d814d453971080eeba90bb1819a8d599ba7..cd259a016a3f3189aab59ab1950e991f
|
||||
+ //}
|
||||
+ // Leaf end
|
||||
// CraftBukkit end
|
||||
//io.papermc.paper.log.CustomLogManager.forceReset(); // Paper - Reset loggers after shutdown
|
||||
//this.onServerExit(); // Paper - moved into stop
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java b/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
||||
index e8e93538dfd71de86515d9405f728db1631e949a..ff2f6535754598857a442ecc0ce5b70521810ad6 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/ServerShutdownThread.java
|
||||
|
||||
@@ -11,10 +11,10 @@ This patch allows velocity applied when a player is hit to be modified in the co
|
||||
Reference: https://gist.github.com/YoungOG/e3265d98661957abece71594b70d6a01
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index 4a0af738a4eefe6512b56d23cd01685961b21b9c..eadab0caa0cf4a14b9ef51ca0ba6dfd644e85e7b 100644
|
||||
index cadb6ebde38658aba251de1259db6449cefc9c9d..1cd8bbf9f0bd10811c4fbc28a6f33a7553cac4fc 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -1966,7 +1966,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -1967,7 +1967,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 vec3d = this.getDeltaMovement();
|
||||
Vec3 vec3d1 = (new Vec3(x, 0.0D, z)).normalize().scale(strength);
|
||||
|
||||
@@ -26,39 +26,40 @@ index 4a0af738a4eefe6512b56d23cd01685961b21b9c..eadab0caa0cf4a14b9ef51ca0ba6dfd6
|
||||
+ vec3d.z / org.dreeam.leaf.LeafConfig.friction - vec3d1.z * org.dreeam.leaf.LeafConfig.horizontal
|
||||
+ );
|
||||
+ // Leaf end
|
||||
// Paper start - call EntityKnockbackByEntityEvent
|
||||
// Paper start - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
Vec3 currentMovement = this.getDeltaMovement();
|
||||
org.bukkit.util.Vector delta = new org.bukkit.util.Vector(currentMovement.x - vec3d.x, currentMovement.y - vec3d.y, currentMovement.z - vec3d.z);
|
||||
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 8b665475ab5cd2bae4e11aa1755af3bb9b99b284..681e6cf3593f44a018488e56d1a40aef5f821aa2 100644
|
||||
index 7264f6e05a6b1fee296ccde4f39e973c8a454b58..02ff878b2cc3b014d245e3e53565760a063adad1 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1371,11 +1371,22 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1371,11 +1371,23 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
if (flag5) {
|
||||
if (i > 0) {
|
||||
+ // Leaf start - Configurable PandaSpigot knockback
|
||||
if (target instanceof LivingEntity) {
|
||||
- ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper
|
||||
- ((LivingEntity) target).knockback((double) ((float) i * 0.5F), (double) Mth.sin(this.getYRot() * 0.017453292F), (double) (-Mth.cos(this.getYRot() * 0.017453292F)), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
+ ((LivingEntity) target).knockback(
|
||||
+ (float) i * 0.5F,
|
||||
+ Mth.sin(this.getYRot() * 0.017453292F),
|
||||
+ -Mth.cos(this.getYRot() * 0.017453292F),
|
||||
+ this
|
||||
+ ); // Paper
|
||||
+ ); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
} else {
|
||||
- target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F), this); // Paper
|
||||
- target.push((double) (-Mth.sin(this.getYRot() * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (Mth.cos(this.getYRot() * 0.017453292F) * (float) i * 0.5F), this); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
+ target.push(
|
||||
+ -Mth.sin(this.getYRot() * 0.017453292F) * (float) i * org.dreeam.leaf.LeafConfig.extraHorizontal,
|
||||
+ org.dreeam.leaf.LeafConfig.extraVertical,
|
||||
+ Mth.cos(this.getYRot() * 0.017453292F) * (float) i * org.dreeam.leaf.LeafConfig.extraHorizontal,
|
||||
+ this); // Paper
|
||||
+ this
|
||||
+ ); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
}
|
||||
+ // Leaf end
|
||||
|
||||
this.setDeltaMovement(this.getDeltaMovement().multiply(0.6D, 1.0D, 0.6D));
|
||||
// Paper start - Configuration option to disable automatic sprint interruption
|
||||
@@ -1406,27 +1417,27 @@ public abstract class Player extends LivingEntity {
|
||||
// Paper start - Configurable sprint interruption on attack
|
||||
@@ -1406,27 +1418,27 @@ public abstract class Player extends LivingEntity {
|
||||
this.sweepAttack();
|
||||
}
|
||||
|
||||
@@ -104,7 +105,7 @@ index 8b665475ab5cd2bae4e11aa1755af3bb9b99b284..681e6cf3593f44a018488e56d1a40aef
|
||||
|
||||
if (flag2) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 337a08470d015c9a28ef14f700ce6e11eb87c7a7..f673490b78f89efaffc1422ebe4bee95dd58b47e 100644
|
||||
index 2b4279efe6698e786f9db8066f73b7934c8660d4..d246d49b510160a9a53f6f4fc18398596d4e305a 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -67,6 +67,7 @@ import net.minecraft.network.protocol.game.ClientboundSetBorderSizePacket;
|
||||
@@ -115,7 +116,7 @@ index 337a08470d015c9a28ef14f700ce6e11eb87c7a7..f673490b78f89efaffc1422ebe4bee95
|
||||
import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket;
|
||||
import net.minecraft.network.protocol.game.ClientboundSetHealthPacket;
|
||||
@@ -3269,6 +3270,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -3242,6 +3243,40 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
getHandle().resetAttackStrengthTicker();
|
||||
}
|
||||
// Paper end
|
||||
@@ -157,7 +158,7 @@ index 337a08470d015c9a28ef14f700ce6e11eb87c7a7..f673490b78f89efaffc1422ebe4bee95
|
||||
private final Player.Spigot spigot = new Player.Spigot()
|
||||
{
|
||||
diff --git a/src/main/java/org/dreeam/leaf/LeafConfig.java b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
index c871d3c03b384a3f7e4c8c919b9d565ebe4e8a77..635f09b234c723b79d35686105c2c3335f868e6a 100644
|
||||
index 8db4b1268e7bc18d60cc53f2753a73c2fc3ec242..26c7a5020e9fd9dac212c6540dc79cad26e64796 100644
|
||||
--- a/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
+++ b/src/main/java/org/dreeam/leaf/LeafConfig.java
|
||||
@@ -305,4 +305,19 @@ public class LeafConfig {
|
||||
|
||||
@@ -17,38 +17,23 @@ This format saves about 50% of disk space.
|
||||
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 2adcf3c29257580b814e66b451ca71e772a6f49f..4dccb446c22055c2b4c9986094898607566fa204 100644
|
||||
index f9b4cd6f7032908ff32cfa68e736c01eaec24ce1..bc77b529a6345ccc79c344cfe807ff93396307d6 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -22,6 +22,8 @@ dependencies {
|
||||
}
|
||||
// Gale end - project setup
|
||||
// Paper start
|
||||
+ implementation("com.github.luben:zstd-jni:1.5.5-11")
|
||||
+ implementation("org.lz4:lz4-java:1.8.0")
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.0") // Leaf - Bump Dependencies
|
||||
+ implementation("com.github.luben:zstd-jni:1.5.5-11") // LinearPurpur
|
||||
+ implementation("org.lz4:lz4-java:1.8.0") // LinearPurpur
|
||||
implementation("org.jline:jline-terminal-jansi:3.25.1") // Leaf - Bump Dependencies
|
||||
implementation("com.github.Dreeam-qwq:TerminalConsoleAppender:360a0759") // Leaf - Use own TerminalConsoleAppender fork to fix some issues under latest version of jline/log4j
|
||||
implementation("net.kyori:adventure-text-serializer-ansi:4.15.0") // Keep in sync with adventureVersion from Paper-API build file // Leaf - Bump Dependencies
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
index f2c27e0ac65be4b75c1d86ef6fd45fdb538d96ac..bcd35b189bf5ec44733161df952ef6957f7fbe79 100644
|
||||
--- a/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
+++ b/src/main/java/com/destroystokyo/paper/io/PaperFileIOThread.java
|
||||
@@ -314,8 +314,8 @@ public final class PaperFileIOThread extends QueueExecutorThread {
|
||||
public abstract void writeData(final int x, final int z, final CompoundTag compound) throws IOException;
|
||||
public abstract CompoundTag readData(final int x, final int z) throws IOException;
|
||||
|
||||
- public abstract <T> T computeForRegionFile(final int chunkX, final int chunkZ, final Function<RegionFile, T> function);
|
||||
- public abstract <T> T computeForRegionFileIfLoaded(final int chunkX, final int chunkZ, final Function<RegionFile, T> function);
|
||||
+ public abstract <T> T computeForRegionFile(final int chunkX, final int chunkZ, final Function<org.purpurmc.purpur.region.AbstractRegionFile, T> function); // LinearPurpur
|
||||
+ public abstract <T> T computeForRegionFileIfLoaded(final int chunkX, final int chunkZ, final Function<org.purpurmc.purpur.region.AbstractRegionFile, T> function); // LinearPurpur
|
||||
|
||||
public static final class InProgressWrite {
|
||||
public long writeCounter;
|
||||
diff --git a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdcae88bf0bf 100644
|
||||
index 2934f0cf0ef09c84739312b00186c2ef0019a165..e67543ef424d448096379bef118b8cb24b938964 100644
|
||||
--- a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
+++ b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
|
||||
@@ -811,7 +811,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -816,7 +816,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
final ChunkDataController taskController) {
|
||||
final ChunkPos chunkPos = new ChunkPos(chunkX, chunkZ);
|
||||
if (intendingToBlock) {
|
||||
@@ -57,7 +42,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
if (file == null) { // null if no regionfile exists
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
@@ -824,7 +824,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -829,7 +829,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return Boolean.FALSE;
|
||||
} // else: it either exists or is not known, fall back to checking the loaded region file
|
||||
|
||||
@@ -66,7 +51,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
if (file == null) { // null if not loaded
|
||||
// not sure at this point, let the I/O thread figure it out
|
||||
return Boolean.TRUE;
|
||||
@@ -1126,9 +1126,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1131,9 +1131,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return this.getCache().doesRegionFileNotExistNoIO(new ChunkPos(chunkX, chunkZ));
|
||||
}
|
||||
|
||||
@@ -78,7 +63,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
synchronized (cache) {
|
||||
try {
|
||||
regionFile = cache.getRegionFile(new ChunkPos(chunkX, chunkZ), existingOnly, true);
|
||||
@@ -1141,19 +1141,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1146,19 +1146,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return function.apply(regionFile);
|
||||
} finally {
|
||||
if (regionFile != null) {
|
||||
@@ -102,7 +87,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1161,7 +1161,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
@@ -1166,7 +1166,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
|
||||
return function.apply(regionFile);
|
||||
} finally {
|
||||
if (regionFile != null) {
|
||||
@@ -112,7 +97,7 @@ index 8a11e10b01fa012b2f98b1c193c53251e848f909..17b6199a8b7184cf5b4b59d88ed8bdca
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54ab7ac8be4 100644
|
||||
index 8dffb330b474b830d2f816ecf8be2e8d2e4556cd..bed46642b59d38e58e6aa663a47cbfc92a40963b 100644
|
||||
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
|
||||
@@ -85,8 +85,15 @@ public class ThreadedWorldUpgrader {
|
||||
@@ -133,10 +118,10 @@ index c13df3a375f416273c6a26f5f77624c1f34a918c..e2c780e7d914e2cfd322fe07951aa54a
|
||||
long expectedChunks = (long)regionFiles.length * (32L * 32L);
|
||||
// Gale start - instantly continue on world upgrade finish
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619ab7f845fd 100644
|
||||
index 5b7f99a534dc7a02fcc6d6b01a80d5c62d8af527..0f3e73414ec946915c0a048c3174d516c1c93d38 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -868,7 +868,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -866,7 +866,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
// Paper start - rewrite chunk system
|
||||
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
|
||||
if (flush) {
|
||||
@@ -145,7 +130,7 @@ index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619a
|
||||
}
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
@@ -892,7 +892,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -890,7 +890,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
|
||||
}
|
||||
|
||||
@@ -155,7 +140,7 @@ index cd259a016a3f3189aab59ab1950e991fe6c31cd2..252ca6e63e50f4f19445c6abec24619a
|
||||
|
||||
return flag3;
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb14fcbb25e 100644
|
||||
index da9c5d362a0bde281c95e9ebc413c51d66aaaa0f..5dd66c3434205c03eecb842ee0211d9e19ff110f 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -246,7 +246,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -176,9 +161,9 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
this.setServerViewDistance(viewDistance);
|
||||
// Paper start
|
||||
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
|
||||
@@ -875,13 +875,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -861,13 +861,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
// Paper start - chunk status cache "api"
|
||||
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkPos chunkPos) {
|
||||
- net.minecraft.world.level.chunk.storage.RegionFile regionFile = regionFileCache.getRegionFileIfLoaded(chunkPos);
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile regionFile = regionFileCache.getRegionFileIfLoaded(chunkPos); // LinearPurpur
|
||||
@@ -192,7 +177,7 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
|
||||
if (regionFile == null || !regionFileCache.chunkExists(chunkPos)) {
|
||||
return null;
|
||||
@@ -899,7 +899,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -885,7 +885,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
}
|
||||
|
||||
public void updateChunkStatusOnDisk(ChunkPos chunkPos, @Nullable CompoundTag compound) throws IOException {
|
||||
@@ -202,10 +187,10 @@ index 62ac94fff8542eedd3fea5fbaef5c4f617fdac01..c175681d1e57d0ea922bec1f1c10cfb1
|
||||
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b802003dd7 100644
|
||||
index a3b9068efc38b3eb05e884bcc3fb13532e49308d..af8f03baf951fd539997092ae6be65673c217470 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -424,8 +424,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -419,8 +419,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
|
||||
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
|
||||
|
||||
@@ -216,7 +201,7 @@ index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b8
|
||||
}
|
||||
|
||||
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
|
||||
@@ -753,7 +753,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
@@ -748,7 +748,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
// CraftBukkit end
|
||||
boolean flag2 = minecraftserver.forceSynchronousWrites();
|
||||
DataFixer datafixer = minecraftserver.getFixerUpper();
|
||||
@@ -226,7 +211,7 @@ index dbd18a3b72cb116f636049e137464cc4922e830c..3019b98d6004c3e83c15ff9c388bd3b8
|
||||
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
|
||||
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
|
||||
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592f61de964 100644
|
||||
index 77dd632a266f4abed30b87b7909d77857c01e316..4938d86f62071f578822684f576b838296d4070f 100644
|
||||
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
|
||||
@@ -61,7 +61,7 @@ public class WorldUpgrader {
|
||||
@@ -253,7 +238,7 @@ index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592
|
||||
}
|
||||
|
||||
ImmutableMap<ResourceKey<Level>, ChunkStorage> immutablemap1 = builder1.build();
|
||||
@@ -235,7 +241,7 @@ public class WorldUpgrader {
|
||||
@@ -241,7 +247,7 @@ public class WorldUpgrader {
|
||||
File file = this.levelStorage.getDimensionPath(world).toFile();
|
||||
File file1 = new File(file, "region");
|
||||
File[] afile = file1.listFiles((file2, s) -> {
|
||||
@@ -262,7 +247,7 @@ index f2a7cb6ebed7a4b4019a09af2a025f624f6fe9c9..61c3730a1448e89c59983a1e92507592
|
||||
});
|
||||
|
||||
if (afile == null) {
|
||||
@@ -254,7 +260,11 @@ public class WorldUpgrader {
|
||||
@@ -260,7 +266,11 @@ public class WorldUpgrader {
|
||||
int l = Integer.parseInt(matcher.group(2)) << 5;
|
||||
|
||||
try {
|
||||
@@ -291,25 +276,23 @@ index 12a7aaeaa8b4b788b620b1985591c3b93253ccd5..af639cc29999a49f4f2d494dc82f9957
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
index 4a84ada69c6abc8f2743579d4451e639836274b4..31cd961bc296f84f5482318c1fb7fcef3e3c1445 100644
|
||||
index d16d7c2fed89fb1347df7ddd95856e7f08c22e8a..625a49f42bdd36772a8f4a992396f76822026911 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
|
||||
@@ -37,11 +37,11 @@ public class ChunkStorage implements AutoCloseable {
|
||||
public final RegionFileStorage regionFileCache;
|
||||
// Paper end - async chunk loading
|
||||
@@ -36,9 +36,9 @@ public class ChunkStorage implements AutoCloseable {
|
||||
@Nullable
|
||||
private volatile LegacyStructureDataHandler legacyStructureHandler;
|
||||
|
||||
- public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) {
|
||||
+ public ChunkStorage(org.purpurmc.purpur.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, DataFixer dataFixer, boolean dsync) { // LinearPurpur
|
||||
this.fixerUpper = dataFixer;
|
||||
// Paper start - async chunk io
|
||||
// remove IO worker
|
||||
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt
|
||||
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - nuke IOWorker // Paper - Attempt to recalculate regionfile header if it is corrupt // LinearPurpur
|
||||
// Paper end - async chunk io
|
||||
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - rewrite chunk system; async chunk IO & Attempt to recalculate regionfile header if it is corrupt
|
||||
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - rewrite chunk system; async chunk IO & Attempt to recalculate regionfile header if it is corrupt // LinearPurpur
|
||||
}
|
||||
|
||||
public boolean isOldChunkAround(ChunkPos chunkPos, int checkRadius) {
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4ee3e708a 100644
|
||||
index 21070516fc936109f537494e38e240982bebf66a..9f8ce97791dda51a23937f6522ad877d75df7044 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
|
||||
@@ -26,7 +26,7 @@ import net.minecraft.nbt.NbtIo; // Paper
|
||||
@@ -347,7 +330,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
if (!this.canRecalcHeader) {
|
||||
return false;
|
||||
}
|
||||
@@ -954,10 +964,10 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -955,10 +965,10 @@ public class RegionFile implements AutoCloseable {
|
||||
private static int getChunkIndex(int x, int z) {
|
||||
return (x & 31) + (z & 31) * 32;
|
||||
}
|
||||
@@ -360,7 +343,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
final int offset = getChunkIndex(x, z);
|
||||
boolean previous = this.oversized[offset] == 1;
|
||||
this.oversized[offset] = (byte) (oversized ? 1 : 0);
|
||||
@@ -996,7 +1006,7 @@ public class RegionFile implements AutoCloseable {
|
||||
@@ -997,7 +1007,7 @@ public class RegionFile implements AutoCloseable {
|
||||
return this.regionFile.getParent().resolve(this.regionFile.getFileName().toString().replaceAll("\\.mca$", "") + "_oversized_" + x + "_" + z + ".nbt");
|
||||
}
|
||||
|
||||
@@ -370,7 +353,7 @@ index ad0859ccc7603ebe3b51e16b275d952bd2508299..0d21e8fc3de43e9c02157114778be3a4
|
||||
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
|
||||
return NbtIo.read((java.io.DataInput) out);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb36a582d2a 100644
|
||||
index fe312b1aef579cb4bf81bdd967cf72ff880d7505..8ee307a453e79e59444f5c5b8b45ffc7755237c7 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
|
||||
@@ -19,11 +19,17 @@ import net.minecraft.world.level.ChunkPos;
|
||||
@@ -474,7 +457,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
@@ -123,28 +148,45 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
// Paper end - cache regionfile does not exist state
|
||||
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable
|
||||
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - Sanitise RegionFileCache and make configurable
|
||||
- ((RegionFile) this.regionCache.removeLast()).close();
|
||||
+ this.regionCache.removeLast().close(); // LinearPurpur
|
||||
}
|
||||
@@ -524,16 +507,16 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
}
|
||||
// Paper end
|
||||
return regionfile1;
|
||||
@@ -172,7 +214,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -156,7 +198,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
|
||||
}
|
||||
|
||||
|
||||
- private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
|
||||
+ private static CompoundTag readOversizedChunk(org.purpurmc.purpur.region.AbstractRegionFile regionfile, ChunkPos chunkCoordinate) throws IOException { // LinearPurpur
|
||||
synchronized (regionfile) {
|
||||
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
|
||||
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
|
||||
@@ -219,14 +261,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -191,14 +233,14 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@Nullable
|
||||
public CompoundTag read(ChunkPos pos) throws IOException {
|
||||
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
|
||||
@@ -550,7 +533,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
|
||||
// if we decide to re-read
|
||||
// Paper end
|
||||
@@ -236,7 +278,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -208,7 +250,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
// Paper start
|
||||
if (regionfile.isOversized(pos.x, pos.z)) {
|
||||
@@ -559,7 +542,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
return readOversizedChunk(regionfile, pos);
|
||||
}
|
||||
// Paper end
|
||||
@@ -250,12 +292,12 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -222,12 +264,12 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
if (this.isChunkData) {
|
||||
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
|
||||
if (!chunkPos.equals(pos)) {
|
||||
@@ -575,7 +558,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -289,13 +331,13 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -261,13 +303,13 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
return nbttagcompound;
|
||||
} finally { // Paper start
|
||||
@@ -591,25 +574,25 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
if (regionfile == null) {
|
||||
return;
|
||||
}
|
||||
@@ -325,7 +367,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
@@ -298,7 +340,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
|
||||
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
|
||||
- RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit // Paper // Paper start - rewrite chunk system
|
||||
// Paper start - rewrite chunk system
|
||||
- RegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile regionfile = this.getRegionFile(pos, nbt == null, true); // CraftBukkit // Paper // Paper start - rewrite chunk system // LinearPurpur
|
||||
if (nbt == null && regionfile == null) {
|
||||
return;
|
||||
}
|
||||
@@ -375,7 +417,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
}
|
||||
// Paper end
|
||||
} finally { // Paper start
|
||||
@@ -353,7 +395,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
// Paper end - Chunk save reattempt
|
||||
// Paper start - rewrite chunk system
|
||||
} finally {
|
||||
- regionfile.fileLock.unlock();
|
||||
+ regionfile.getFileLock().unlock(); // LinearPurpur
|
||||
} // Paper end
|
||||
}
|
||||
|
||||
@@ -384,7 +426,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
// Paper end - rewrite chunk system
|
||||
}
|
||||
@@ -363,7 +405,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -618,7 +601,7 @@ index 6bec4549fbcfb68a053300451e25babf8ff38e99..70f0bff6eff0b4190b832335a32e6eb3
|
||||
|
||||
try {
|
||||
regionfile.close();
|
||||
@@ -400,7 +442,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
@@ -379,7 +421,7 @@ public class RegionFileStorage implements AutoCloseable {
|
||||
ObjectIterator objectiterator = this.regionCache.values().iterator();
|
||||
|
||||
while (objectiterator.hasNext()) {
|
||||
@@ -643,13 +626,13 @@ index 4aac1979cf57300825a999c876fcf24d3170e68e..79a389b9a139f6838adf32d3b5d4d7ec
|
||||
this.factory = factory;
|
||||
this.fixerUpper = dataFixer;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 4b222fc6a4824caffef4aad78092bd02a8892026..db36f3b98a3955ec867972f546211db8975734ec 100644
|
||||
index 9fc292c4767b6275b17d0657b4289327ebaeaefe..325e9580ac4409111488e2728b7ae5d0c5390a6c 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -567,7 +567,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
world.getChunk(x, z); // make sure we're at ticket level 32 or lower
|
||||
return true;
|
||||
}
|
||||
|
||||
- net.minecraft.world.level.chunk.storage.RegionFile file;
|
||||
+ org.purpurmc.purpur.region.AbstractRegionFile file; // LinearPurpur
|
||||
try {
|
||||
@@ -680,7 +663,7 @@ index b12437a7e292fbf9aefc7a41b5bc1695733a11c5..c3f095236093c436d37c4730f5537d4f
|
||||
private static void disableGiveCommandDrops() {
|
||||
disableGiveCommandDrops = getBoolean("settings.disable-give-dropping", disableGiveCommandDrops);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 0a29f28cf666896f0715d40bb121017e4675b4e7..2b4408d398962fa4feab9eb248540c6d11037a94 100644
|
||||
index 18a4b27a9159c211a0faf204e69e895f107b0163..b32fb80be08146d28d437d5db320c56ba05aebc7 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -27,6 +27,7 @@ import java.util.Map;
|
||||
|
||||
@@ -37,7 +37,7 @@ index eb60d2d99155aae4a761051175fbbddf9ed5dad9..5444213b336bc08eb371673890ded04c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
index 11181c0429b720381e7752f8a0d5e89615bcce4b..637beec8d5a1d39748db9e87bfb9a999f2c728ec 100644
|
||||
index 8a3e815bf1c35d39d3c07e483c5b8ef70ee45654..7b87ea3578f3bb8b7e93054171a0f66c0e0d1262 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
||||
@@ -95,6 +95,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
|
||||
@@ -116,7 +116,7 @@ index 1fbd034002fd5761011976510b9f9263ca0f5cac..a9d75fe602d0f946519582d2eaf2eb55
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
index b8a055f938ade211c07ca5a74bade19707568eb1..7e8de65d7e5f9251d8ea4fb9bd3a4044457e0bda 100644
|
||||
index 9962e83e9478db6de3869d53eaa4c4dc9dc847b4..4e7867e7239eb573b287a70eee8191bdf434f686 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
|
||||
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
|
||||
@@ -139,7 +139,7 @@ index b8a055f938ade211c07ca5a74bade19707568eb1..7e8de65d7e5f9251d8ea4fb9bd3a4044
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
index c23d192baf78890093b0e88d03735eef4569e75f..25ee9670c37c4342993c3aed8417ff050bbcb779 100644
|
||||
index da834424b655d49388926a0472cacb5ecc4d56fd..141c41c05623ab5802ae3e03ee772d310efda3a8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
|
||||
@@ -147,6 +147,23 @@ public class Warden extends Monster implements VibrationSystem {
|
||||
@@ -209,7 +209,7 @@ index c3f095236093c436d37c4730f5537d4fbc0ea6c0..d13bc7e913ebe816598f6104f928c90b
|
||||
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
|
||||
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
index 2b4408d398962fa4feab9eb248540c6d11037a94..8191ca6341bafbdc7a74a42ebcb0615f61e5bbab 100644
|
||||
index b32fb80be08146d28d437d5db320c56ba05aebc7..c2bd513882ae8716f52ef7540d9fec9bd3f6017e 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
|
||||
@@ -1195,7 +1195,15 @@ public class PurpurWorldConfig {
|
||||
@@ -290,7 +290,7 @@ index 2b4408d398962fa4feab9eb248540c6d11037a94..8191ca6341bafbdc7a74a42ebcb0615f
|
||||
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
|
||||
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
|
||||
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
|
||||
@@ -2999,7 +3037,15 @@ public class PurpurWorldConfig {
|
||||
@@ -3001,7 +3039,15 @@ public class PurpurWorldConfig {
|
||||
public boolean wardenRidable = false;
|
||||
public boolean wardenRidableInWater = true;
|
||||
public boolean wardenControllable = true;
|
||||
|
||||
@@ -16,7 +16,7 @@ now is just updating dirty map/decoration data.
|
||||
When no bukkit renderers are added to the map, we also re-use the same packet for all players who are tracking it which avoids a lot of work.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
index dc09d893f1a7dd36f994ac8ea5bea5b1fa689c83..be950b74d68662932e8f62e3d321db1262289c4e 100644
|
||||
index 515e3f444e317de1d82421ad414c1ac10d4668ab..66e04209f45c03b3efab10cd567f147fc85cd106 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
|
||||
@@ -111,29 +111,42 @@ public class ServerEntity {
|
||||
@@ -67,7 +67,7 @@ index dc09d893f1a7dd36f994ac8ea5bea5b1fa689c83..be950b74d68662932e8f62e3d321db12
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,6 +381,19 @@ public class ServerEntity {
|
||||
@@ -374,6 +387,19 @@ public class ServerEntity {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ So instead of paying the price on each tick, we pay the price when the chunk is
|
||||
Which, if you think about it, is actually better, since we tick chunks more than we load chunks
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
index 17ba07cbd4792f63d88ce29d00da280f30c4abff..8e8aad958c96fa1df3d906ec120a89adecae38c4 100644
|
||||
index f164256d59b761264876ca0c85f812d101bfd5de..10465a33d90a1e43b9dbd7764c895dd39ef11b1a 100644
|
||||
--- a/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
+++ b/src/main/java/io/papermc/paper/util/player/NearbyPlayers.java
|
||||
@@ -106,6 +106,14 @@ public final class NearbyPlayers {
|
||||
@@ -32,10 +32,10 @@ index 17ba07cbd4792f63d88ce29d00da280f30c4abff..8e8aad958c96fa1df3d906ec120a89ad
|
||||
final TrackedChunk chunk = this.byChunk.get(CoordinateUtils.getChunkKey(chunkX, chunkZ));
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
index 02b517288ef0794ccfd46802bf76fa56af21c524..e75ebf0bbb9da6e294d52e8c99607ed590c123a5 100644
|
||||
index 1273760f0c1dde908e2512efee2df5460e70eb42..34f03851ccca7870545128155a6dbb43fb42eda9 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
|
||||
@@ -602,7 +602,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
@@ -594,7 +594,7 @@ public class ServerChunkCache extends ChunkSource {
|
||||
|
||||
// Paper start - optimise chunk tick iteration
|
||||
com.destroystokyo.paper.util.maplist.ReferenceList<ServerPlayer> playersNearby
|
||||
|
||||
@@ -16,10 +16,10 @@ This seems stupid, but it does seem that it improves the performance a bit, and
|
||||
We also create a "canSee" method tailored for "ChunkMap#updatePlayer()", a method without the equals check (the "updatePlayer()" already checks if the entity is the same entity) because the CraftPlayer's `equals()` check is a *bit* expensive compared to only checking the object's identity, and because the identity has already been check, we don't need to check it twice.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
index c175681d1e57d0ea922bec1f1c10cfb14fcbb25e..ab790bcf4c4ea067ba5bdfb30c006fa0cc65def0 100644
|
||||
index 5dd66c3434205c03eecb842ee0211d9e19ff110f..413c648691ce45bce536e870d772d0335f89679a 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
|
||||
@@ -1409,7 +1409,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
@@ -1399,7 +1399,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
|
||||
// Paper end - Configurable entity tracking range by Y
|
||||
|
||||
// CraftBukkit start - respect vanish API
|
||||
@@ -29,7 +29,7 @@ index c175681d1e57d0ea922bec1f1c10cfb14fcbb25e..ab790bcf4c4ea067ba5bdfb30c006fa0
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index f673490b78f89efaffc1422ebe4bee95dd58b47e..7f7f2c558c359b816adae6eae62a8e8b5bccabf6 100644
|
||||
index d246d49b510160a9a53f6f4fc18398596d4e305a..df07fbabe36573282c60f4a469e1b9534405d7a0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -188,7 +188,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -41,7 +41,7 @@ index f673490b78f89efaffc1422ebe4bee95dd58b47e..7f7f2c558c359b816adae6eae62a8e8b
|
||||
private final Set<UUID> unlistedEntities = new HashSet<>(); // Paper - Add Listing API for Player
|
||||
private static final WeakHashMap<Plugin, WeakReference<Plugin>> pluginWeakReferences = new WeakHashMap<>();
|
||||
private int hash = 0;
|
||||
@@ -2164,9 +2164,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2137,9 +2137,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean canSee(org.bukkit.entity.Entity entity) {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Redirect to Gale's method to fix plugin incompatibility
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index a2950eab75913c3d8faa3955373d6ad5b0b7d54c..b7058feb8ea17fa1515fee9c7e110f8cf0f656ee 100644
|
||||
index 268eff03168d25cccba703d1c5df603c9c3663cd..e64c8942668830ca9e460b519cceb4397e0b4b56 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -336,6 +336,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -335,6 +335,8 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
}
|
||||
// Gale end - make max interaction distance configurable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user