ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
@@ -52,10 +52,10 @@ index 12207256ae0fa5f2f822116cd22f1a1250e6ee1c..07a9ccf572e514047a5af7071b9270d2
return GoalKey.of(type, NamespacedKey.minecraft(key));
}
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
-index f738bbcefe288474c5f591dda03d713850633854..5c10ab3deb359bd0045ba5999bcbce19a7949eaa 100644
+index f738bbcefe288474c5f591dda03d713850633854..c198304386e83edc2ec582fdf66d97d624004771 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
-@@ -19,6 +19,12 @@ public interface ServerBuildInfo {
+@@ -19,6 +19,13 @@ public interface ServerBuildInfo {
*/
Key BRAND_PAPER_ID = Key.key("papermc", "paper");
@@ -65,14 +65,15 @@ index f738bbcefe288474c5f591dda03d713850633854..5c10ab3deb359bd0045ba5999bcbce19
+ */
+ Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
+ // Purpur end
++
// Leaf start - Rebrand
/**
* The brand id for Gale.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
-index 2e316238da9377c046105249273b260912ebfcab..98cfd68226494dbb1a2eaa6680e23a76c2129a62 100644
+index ffb2f5d949cc255263674b2a03d4da809b0c36c5..f04f42832a098836bf41e98787c2db35d154c892 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
-@@ -3073,4 +3073,133 @@ public final class Bukkit {
+@@ -3082,4 +3082,133 @@ public final class Bukkit {
public static void restart() {
server.restart();
}
@@ -289,10 +290,10 @@ index 918a045165cdcde264bc24082b7afebb407271de..f283bcabff7fe6eede6cf4344537e430
+ // Purpur end - ChatColor conveniences
}
diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java
-index 5a1b9f81830dee052bafd743f4a1bf0c39288c7a..cf8fd9a981c7fbaa304988df17233ccf40d6829e 100644
+index ac8d14010940d55e2d885e75ce6ff436c46e2d69..8f45823ea89c8208374115f8ed9c5a535a64c017 100644
--- a/src/main/java/org/bukkit/Material.java
+++ b/src/main/java/org/bukkit/Material.java
-@@ -3616,4 +3616,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
+@@ -3636,4 +3636,40 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
return this.asItemType().getDefaultDataTypes();
}
// Paper end - data component API
@@ -443,10 +444,10 @@ index 6f83097b1097d0ffa81a95e6f0300cb410dfee2b..c1f19d5c1b819873fce1185b4fbf4c72
+ // Purpur end - OfflinePlayer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
-index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2d0ce00c8 100644
+index ad65ee800d9d394d0322e7ca0b71972d81ca66a1..cc12db46d30c2499dea87f953ef6bf1fa18900c9 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
-@@ -2438,6 +2438,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
+@@ -2445,6 +2445,18 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
// Paper end
@@ -465,7 +466,7 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
/**
* Sends the component to the player
*
-@@ -2799,4 +2811,121 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
+@@ -2806,4 +2818,111 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
long getLastTickOversleepTime();
// Gale end - YAPFA - last tick time - API
@@ -473,7 +474,6 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ // Purpur start - Bring back server name
+ /**
+ * Get the name of this server
-+ *
+ * @return the name of the server
+ */
+ @NotNull
@@ -481,7 +481,6 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ // Purpur end - Bring back server name
+
+ // Purpur start - Lagging threshold
-+
+ /**
+ * Check if server is lagging according to laggy threshold setting
+ *
@@ -491,7 +490,6 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ // Purpur end - Lagging threshold
+
+ // Purpur start - Added the ability to add combustible items
-+
+ /**
+ * Add an Item as fuel for furnaces
+ *
@@ -509,12 +507,10 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ // Purpur end - Added the ability to add combustible items
+
+ // Purpur start - Debug Marker API
-+
+ /**
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
+ */
@@ -524,10 +520,9 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
-+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
++ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ */
+ void sendBlockHighlight(@NotNull Location location, int duration, int argb);
+
@@ -535,10 +530,9 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
-+ * @param text Text to show above the highlight
++ * @param text Text to show above the highlight
+ */
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text);
+
@@ -546,11 +540,10 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
+ * @param location Location to highlight
+ * @param duration Duration for highlight to show in milliseconds
-+ * @param text Text to show above the highlight
-+ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
++ * @param text Text to show above the highlight
++ * @param argb Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
+ */
+ void sendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb);
+
@@ -558,10 +551,9 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
-+ * @param location Location to highlight
-+ * @param duration Duration for highlight to show in milliseconds
-+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
++ * @param location Location to highlight
++ * @param duration Duration for highlight to show in milliseconds
++ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ */
@@ -571,11 +563,10 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ * Creates debug block highlight on specified block location and show it to all players on the server.
+ *
+ * Clients may be inconsistent in displaying it.
-+ *
-+ * @param location Location to highlight
-+ * @param duration Duration for highlight to show in milliseconds
-+ * @param text Text to show above the highlight
-+ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
++ * @param location Location to highlight
++ * @param duration Duration for highlight to show in milliseconds
++ * @param text Text to show above the highlight
++ * @param color Color of the highlight. Will be ignored on some versions of vanilla client
+ * @param transparency Transparency of the highlight
+ * @throws IllegalArgumentException If transparency is outside 0-255 range
+ */
@@ -588,10 +579,10 @@ index db8c2d3ded812e8d96b8752d4890006d022e72a6..b4d8bc92cf99dbc470e259f569be20e2
+ // Purpur end - Debug Marker API
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
-index a8b64f78bf3c453094074b4b4d3c8fd07b9eb273..d0c2ff65893c1fd3903633ebc24aae879dc91f10 100644
+index 04a1379f5fe281ab72610d2f8f18e1355fe3a134..f75b76bf5c0025d4f74037de435d9cb1aa8defee 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
-@@ -4290,6 +4290,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
+@@ -4308,6 +4308,86 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public DragonBattle getEnderDragonBattle();
@@ -811,7 +802,7 @@ index 332c55fd6b4b3a8c0cad920a6e765ecc40e684e4..10a8d64ad2da0be2c14f34c3e7d1957c
// Paper start
/**
diff --git a/src/main/java/org/bukkit/entity/Entity.java b/src/main/java/org/bukkit/entity/Entity.java
-index 66a31c5d83b78dddb43e70cfd5ce7c7fb8a551b6..b6ee04873c1ee57f7e8804f6d247806f2c0e448f 100644
+index 0aa51b777fd28444b53ccc74362798553954c52d..a3d2013adf038f1fe96127c5dba442ffd2e031a8 100644
--- a/src/main/java/org/bukkit/entity/Entity.java
+++ b/src/main/java/org/bukkit/entity/Entity.java
@@ -1261,4 +1261,59 @@ public interface Entity extends Metadatable, CommandSender, Nameable, Persistent
@@ -1170,7 +1161,7 @@ index 7fbfdb07585c7b28acea1f0c1f58ada0cc744441..21fcca092e2e31baa5ece0de9e44e3fa
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
-index 4d88bb2eaa43709fb6103a6f77d8c01e83bfe743..bb3773e002ebcfd8eced792bf0236c4cfbae8663 100644
+index 1be07639143cd80bd4fb304d6f3bbced58887617..120159852cae3b1a71c6c7ce949cadb386023095 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -408,4 +408,13 @@ public interface Villager extends AbstractVillager {
@@ -1213,7 +1204,7 @@ index 11ae1b3ad8c215f9245945d223c52f4a62ac47d9..7f23eb5a60ff08fb31e8ba3731a43bd7
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/entity/Wolf.java b/src/main/java/org/bukkit/entity/Wolf.java
-index a6414ffc4a6d8ebef3486abc877688507e34e5c8..ade8b061f0a3d94f990e997659d5ad32aa1631c4 100644
+index d0a64457e4bf40f2a78ffe90c2d402adc154e327..ea51840e4f40733a48ca34f7a8fcf17dc963d659 100644
--- a/src/main/java/org/bukkit/entity/Wolf.java
+++ b/src/main/java/org/bukkit/entity/Wolf.java
@@ -163,4 +163,20 @@ public interface Wolf extends Tameable, Sittable, io.papermc.paper.entity.Collar
diff --git a/leaf-api/paper-patches/features/0013-Remove-Timings.patch b/leaf-api/paper-patches/features/0012-Remove-Timings.patch
similarity index 99%
rename from leaf-api/paper-patches/features/0013-Remove-Timings.patch
rename to leaf-api/paper-patches/features/0012-Remove-Timings.patch
index d6c3127a..02d4eaa1 100644
--- a/leaf-api/paper-patches/features/0013-Remove-Timings.patch
+++ b/leaf-api/paper-patches/features/0012-Remove-Timings.patch
@@ -2936,7 +2936,7 @@ index 613a0bad5c07cf14098218652eba1f4deaf77c6d..25a0414cc9482925ad0426dde57e6501
server.getPluginManager().callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerCommandException(ex, target, sender, args))); // Paper
throw new CommandException(msg, ex);
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
-index 2e6d62c4f3687e299c34e876c503b400e13be05a..e7f1a35610d53891d346a3284cca1bca8e53761d 100644
+index cc07a76545aefbf9eb0915025c89770298be2c1c..9788a49287ea5d537d19e55f6bffedf79d3b05d6 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -61,7 +61,6 @@ public final class SimplePluginManager implements PluginManager {
diff --git a/leaf-api/paper-patches/features/0014-KeYi-Player-Skull-API.patch b/leaf-api/paper-patches/features/0013-KeYi-Player-Skull-API.patch
similarity index 100%
rename from leaf-api/paper-patches/features/0014-KeYi-Player-Skull-API.patch
rename to leaf-api/paper-patches/features/0013-KeYi-Player-Skull-API.patch
diff --git a/leaf-api/paper-patches/features/0015-Slice-Smooth-Teleports.patch b/leaf-api/paper-patches/features/0014-Slice-Smooth-Teleports.patch
similarity index 100%
rename from leaf-api/paper-patches/features/0015-Slice-Smooth-Teleports.patch
rename to leaf-api/paper-patches/features/0014-Slice-Smooth-Teleports.patch
diff --git a/leaf-api/paper-patches/features/0015-Use-warning-instead-of-direct-throw.patch b/leaf-api/paper-patches/features/0015-Use-warning-instead-of-direct-throw.patch
new file mode 100644
index 00000000..f54b4b3e
--- /dev/null
+++ b/leaf-api/paper-patches/features/0015-Use-warning-instead-of-direct-throw.patch
@@ -0,0 +1,36 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
+Date: Mon, 30 Jun 2025 02:41:48 +0800
+Subject: [PATCH] Use warning instead of direct throw
+
+Dreeam's Note:
+We use soft warning which in Paper is directly exception throw,
+Only print warning to avoid break plugins directly.
+
+Also see `Configurable LibraryLoader maven repos` patch,
+able to match googleapi mirror urls, to replace to repo url we custom defined.
+This able to switch back to maven central repo, to prevent
+situation that dependencies exist in maven central, but not in mirror.
+
+diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
+index c1fccd64b1329e31ccf7e6a11853ce3a749b7ea4..b0069a05c322e058f0df668908f0918c0b85a814 100644
+--- a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
++++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
+@@ -121,10 +121,13 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+ */
+ public void addRepository(final RemoteRepository remoteRepository) {
+ if (MAVEN_CENTRAL_URLS.stream().anyMatch(remoteRepository.getUrl()::startsWith)) {
+- LOGGER.warn(
+- "Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead.",
+- new RuntimeException("Plugin used Maven Central for library resolution")
+- );
++ // Leaf start - Use warning instead of direct throw
++ try {
++ throw new RuntimeException("Plugin used Maven Central for library resolution");
++ } catch (RuntimeException e) {
++ LOGGER.error("Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead. Please contact plugin's support for help.", e);
++ }
++ // Leaf end - Use warning instead of direct throw
+ }
+ this.repositories.add(remoteRepository);
+ }
diff --git a/leaf-api/paper-patches/features/0016-Configurable-LibraryLoader-maven-repos.patch b/leaf-api/paper-patches/features/0016-Configurable-LibraryLoader-maven-repos.patch
index 125dfdfe..9a125a56 100644
--- a/leaf-api/paper-patches/features/0016-Configurable-LibraryLoader-maven-repos.patch
+++ b/leaf-api/paper-patches/features/0016-Configurable-LibraryLoader-maven-repos.patch
@@ -7,10 +7,10 @@ Add JVM flag `-DLeaf.library-download-repo=link` to choose library download repo
e.g. `-DLeaf.library-download-repo=https://maven.aliyun.com/repository/public`
diff --git a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
-index f12c25f35f3d26dc69e05c7965385e66a3d3d545..f5fb8c3214a421c4d4f681176335dc92cf59834a 100644
+index b0069a05c322e058f0df668908f0918c0b85a814..b899e9cbb2658c7f08343b2e6500fb34427fc238 100644
--- a/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
+++ b/src/main/java/io/papermc/paper/plugin/loader/library/impl/MavenLibraryResolver.java
-@@ -60,12 +60,25 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+@@ -59,12 +59,25 @@ public class MavenLibraryResolver implements ClassPathLibrary {
*
This repository is also used by the legacy {@link org.bukkit.plugin.java.LibraryLoader}.
*/
public static final String MAVEN_CENTRAL_DEFAULT_MIRROR = getDefaultMavenCentralMirror();
@@ -35,18 +35,19 @@ index f12c25f35f3d26dc69e05c7965385e66a3d3d545..f5fb8c3214a421c4d4f681176335dc92
+ "http://maven-central-asia.storage-download.googleapis.com/maven2"
+ };
+ // Leaf end - Configurable LibraryLoader maven repos
- // Paper end - Avoid and discourage use of Maven Central as a CDN
-
private static final Logger LOGGER = LoggerFactory.getLogger("MavenLibraryResolver");
-@@ -124,13 +137,32 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+
+ private final RepositorySystem repository;
+@@ -120,15 +133,34 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+ * dependencies from
*/
public void addRepository(final RemoteRepository remoteRepository) {
- // Paper start - Avoid and discourage use of Maven Central as a CDN
- if (MAVEN_CENTRAL_URLS.stream().anyMatch(remoteRepository.getUrl()::startsWith)) {
+- // Leaf start - Use warning instead of direct throw
- try {
- throw new RuntimeException("Plugin used Maven Central for library resolution");
- } catch (RuntimeException e) {
-- LOGGER.error("Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead.", e);
+- LOGGER.error("Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead. Please contact plugin's support for help.", e);
+ // Leaf start - Configurable LibraryLoader maven repos
+ for (String url : MAVEN_CENTRAL_URLS) {
+ if (remoteRepository.getUrl().startsWith(url)) {
@@ -55,12 +56,15 @@ index f12c25f35f3d26dc69e05c7965385e66a3d3d545..f5fb8c3214a421c4d4f681176335dc92
+ this.repositories.add(mirrorRepo);
+ return;
+ }
++ // Leaf start - Use warning instead of direct throw
+ try {
+ throw new RuntimeException("Plugin used Maven Central for library resolution");
+ } catch (RuntimeException e) {
-+ LOGGER.error("Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead.", e);
++ LOGGER.error("Use of Maven Central as a CDN is against the Maven Central Terms of Service. Use MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR instead. Please contact plugin's support for help.", e);
+ }
++ // Leaf end - Use warning instead of direct throw
}
+- // Leaf end - Use warning instead of direct throw
}
+ // Match google api maven central mirror urls
+ for (String url : MAVEN_CENTRAL_GOOGLE_MIRROR_URLS) {
@@ -73,13 +77,13 @@ index f12c25f35f3d26dc69e05c7965385e66a3d3d545..f5fb8c3214a421c4d4f681176335dc92
+ }
+ }
+ // Leaf end - Configurable LibraryLoader maven repos
- // Paper end - Avoid and discourage use of Maven Central as a CDN
this.repositories.add(remoteRepository);
}
-@@ -170,4 +202,15 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+
+@@ -165,4 +197,15 @@ public class MavenLibraryResolver implements ClassPathLibrary {
+ }
return central;
}
- // Paper end - Avoid and discourage use of Maven Central as a CDN
+
+ // Leaf start - Configurable LibraryLoader maven repos
+ @org.jspecify.annotations.Nullable
@@ -93,14 +97,14 @@ index f12c25f35f3d26dc69e05c7965385e66a3d3d545..f5fb8c3214a421c4d4f681176335dc92
+ // Leaf end - Configurable LibraryLoader maven repos
}
diff --git a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
-index 1f2e86e9a830b990bbba3704889671465816ea1c..fce316374a0ae06a34acbce0907dfde52b7905e8 100644
+index 70d57e6abbd876d7f3087905d5277777162d317c..15992c275ae143af5b140a787f921658de58e05a 100644
--- a/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/LibraryLoader.java
-@@ -49,6 +49,7 @@ public class LibraryLoader {
+@@ -47,6 +47,7 @@ public class LibraryLoader {
+ public static java.util.function.Function, List> REMAPPER; // Paper - remap libraries
- // Paper start - Avoid and discourage use of Maven Central as a CDN
private static List getRepositories() {
-+ if (io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver.CUSTOM_MAVEN_CENTRAL_MIRROR_REPO != null) return List.of(io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver.CUSTOM_MAVEN_CENTRAL_MIRROR_REPO); // Leaf - Configurable LibraryLoader maven repos
- return List.of(new RemoteRepository.Builder("central", "default", io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR).build());
++ if (io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver.CUSTOM_MAVEN_CENTRAL_MIRROR_REPO != null) return List.of(io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver.CUSTOM_MAVEN_CENTRAL_MIRROR_REPO ); // Leaf - Configurable LibraryLoader maven repos
+ return List.of(new RemoteRepository.Builder("central", "default", MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR).build());
}
- // Paper end - Avoid and discourage use of Maven Central as a CDN
+
diff --git a/leaf-api/paper-patches/features/0017-Leaves-Replay-Mod-API.patch b/leaf-api/paper-patches/features/0017-Leaves-Replay-Mod-API.patch
index 862ef580..aaeb9364 100644
--- a/leaf-api/paper-patches/features/0017-Leaves-Replay-Mod-API.patch
+++ b/leaf-api/paper-patches/features/0017-Leaves-Replay-Mod-API.patch
@@ -11,10 +11,10 @@ Original project: https://github.com/LeavesMC/Leaves
This patch is Powered by ReplayMod(https://github.com/ReplayMod)
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
-index 98cfd68226494dbb1a2eaa6680e23a76c2129a62..0f8a1b82dc9d3f4911a0aaa092ef06388ace5108 100644
+index f04f42832a098836bf41e98787c2db35d154c892..b7782de2fb8e636e82a6ef89a62edeec902b367e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
-@@ -3202,4 +3202,10 @@ public final class Bukkit {
+@@ -3211,4 +3211,10 @@ public final class Bukkit {
server.clearBlockHighlights();
}
// Purpur end - Debug Marker API
@@ -26,10 +26,10 @@ index 98cfd68226494dbb1a2eaa6680e23a76c2129a62..0f8a1b82dc9d3f4911a0aaa092ef0638
+ // Leaves end - Photographer API
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
-index b4d8bc92cf99dbc470e259f569be20e2d0ce00c8..64a94b228fe70ff81b2b9af337339bc7ea15b958 100644
+index cc12db46d30c2499dea87f953ef6bf1fa18900c9..0d8463905bc15382c284fc31a1be6fbb7ee0a46b 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
-@@ -2928,4 +2928,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
+@@ -2925,4 +2925,8 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
*/
void clearBlockHighlights();
// Purpur end - Debug Marker API
diff --git a/leaf-api/paper-patches/features/0018-Async-structure-locate-api.patch b/leaf-api/paper-patches/features/0018-Async-structure-locate-api.patch
index b44f74ae..d144d14c 100644
--- a/leaf-api/paper-patches/features/0018-Async-structure-locate-api.patch
+++ b/leaf-api/paper-patches/features/0018-Async-structure-locate-api.patch
@@ -9,10 +9,10 @@ Added some asynchronous structure locate methods in World,
requires async-locator to be enabled in Leaf config, or else it will fall back to sync methods.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
-index d0c2ff65893c1fd3903633ebc24aae879dc91f10..000ed0527609690b01a32053557b74049beed73c 100644
+index f75b76bf5c0025d4f74037de435d9cb1aa8defee..0f1a6ac47c1b6d66d611a4c9bb0198b07d3e7a1c 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
-@@ -4084,6 +4084,60 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
+@@ -4102,6 +4102,60 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
StructureSearchResult locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored);
diff --git a/leaf-api/paper-patches/features/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch b/leaf-archived-patches/removed/1.21.6/api/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch
similarity index 99%
rename from leaf-api/paper-patches/features/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch
rename to leaf-archived-patches/removed/1.21.6/api/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch
index 6a19d820..840c5577 100644
--- a/leaf-api/paper-patches/features/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch
+++ b/leaf-archived-patches/removed/1.21.6/api/0003-Paper-Avoid-and-discourage-use-of-Maven-Central-as-a.patch
@@ -3,6 +3,8 @@ From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Wed, 18 Jun 2025 10:47:21 -0700
Subject: [PATCH] Paper: Avoid and discourage use of Maven Central as a CDN
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/minecraft-patches/features/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch b/leaf-archived-patches/removed/1.21.6/mcserver/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
similarity index 96%
rename from leaf-server/minecraft-patches/features/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
rename to leaf-archived-patches/removed/1.21.6/mcserver/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
index 328fa224..0d97e0fe 100644
--- a/leaf-server/minecraft-patches/features/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
+++ b/leaf-archived-patches/removed/1.21.6/mcserver/0128-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
@@ -4,6 +4,9 @@ Date: Sun, 19 Nov 2023 12:35:16 -0300
Subject: [PATCH] SparklyPaper: Skip EntityScheduler's executeTick checks if
there isn't any tasks to be run
+Removed since Leaf 1.21.6, replaced by spottedleaf's impl added on Paper
+https://github.com/PaperMC/Paper/commit/7c90c7c4970b44b8bcaebd1b3f4f124e9757dc3c
+
Original project: https://github.com/SparklyPower/SparklyPaper
On each tick, Paper runs EntityScheduler's executeTick of each entity. This is a bit expensive, due to ArrayDeque's size() call because it ain't a simple "get the current queue size" function, due to the thread checks, and because it needs to iterate all entities in all worlds.
diff --git a/leaf-server/minecraft-patches/features/0272-Paper-Fix-excess-slot-updates.patch b/leaf-archived-patches/removed/1.21.6/mcserver/0275-Paper-Fix-excess-slot-updates.patch
similarity index 97%
rename from leaf-server/minecraft-patches/features/0272-Paper-Fix-excess-slot-updates.patch
rename to leaf-archived-patches/removed/1.21.6/mcserver/0275-Paper-Fix-excess-slot-updates.patch
index 55db9ebe..41e1a530 100644
--- a/leaf-server/minecraft-patches/features/0272-Paper-Fix-excess-slot-updates.patch
+++ b/leaf-archived-patches/removed/1.21.6/mcserver/0275-Paper-Fix-excess-slot-updates.patch
@@ -3,6 +3,8 @@ From: AJ Ferguson
Date: Mon, 6 Jan 2025 20:31:00 +1100
Subject: [PATCH] Paper: Fix excess slot updates
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
Paper pull request: https://github.com/PaperMC/Paper/pull/12654
diff --git a/leaf-server/minecraft-patches/features/0279-Paper-Improve-Fix-MC-44654.patch b/leaf-archived-patches/removed/1.21.6/mcserver/0279-Paper-Improve-Fix-MC-44654.patch
similarity index 98%
rename from leaf-server/minecraft-patches/features/0279-Paper-Improve-Fix-MC-44654.patch
rename to leaf-archived-patches/removed/1.21.6/mcserver/0279-Paper-Improve-Fix-MC-44654.patch
index 3c6aa896..ea9b6de3 100644
--- a/leaf-server/minecraft-patches/features/0279-Paper-Improve-Fix-MC-44654.patch
+++ b/leaf-archived-patches/removed/1.21.6/mcserver/0279-Paper-Improve-Fix-MC-44654.patch
@@ -3,6 +3,8 @@ From: Owen <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 20 Jun 2025 16:02:24 -0400
Subject: [PATCH] Paper: Improve Fix MC-44654
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/minecraft-patches/features/0280-Paper-Cleanup-Primed-TNT-Fix.patch b/leaf-archived-patches/removed/1.21.6/mcserver/0280-Paper-Cleanup-Primed-TNT-Fix.patch
similarity index 98%
rename from leaf-server/minecraft-patches/features/0280-Paper-Cleanup-Primed-TNT-Fix.patch
rename to leaf-archived-patches/removed/1.21.6/mcserver/0280-Paper-Cleanup-Primed-TNT-Fix.patch
index c414e012..3f16d38e 100644
--- a/leaf-server/minecraft-patches/features/0280-Paper-Cleanup-Primed-TNT-Fix.patch
+++ b/leaf-archived-patches/removed/1.21.6/mcserver/0280-Paper-Cleanup-Primed-TNT-Fix.patch
@@ -3,6 +3,8 @@ From: Owen <23108066+Owen1212055@users.noreply.github.com>
Date: Fri, 20 Jun 2025 18:22:37 -0400
Subject: [PATCH] Paper: Cleanup Primed TNT Fix
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/minecraft-patches/features/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch b/leaf-archived-patches/removed/1.21.6/mcserver/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch
similarity index 97%
rename from leaf-server/minecraft-patches/features/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch
rename to leaf-archived-patches/removed/1.21.6/mcserver/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch
index c4789c17..35eb69d4 100644
--- a/leaf-server/minecraft-patches/features/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch
+++ b/leaf-archived-patches/removed/1.21.6/mcserver/0281-Paper-Fix-Raids-illager-ominus-banner-pickup-mechani.patch
@@ -4,6 +4,8 @@ Date: Fri, 20 Jun 2025 19:22:27 -0400
Subject: [PATCH] Paper: Fix Raids - illager ominus banner pickup mechanic
broken
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/paper-patches/features/0015-Optimize-entity-coordinate-key.patch b/leaf-archived-patches/removed/1.21.6/paperserver/0015-Optimize-entity-coordinate-key.patch
similarity index 97%
rename from leaf-server/paper-patches/features/0015-Optimize-entity-coordinate-key.patch
rename to leaf-archived-patches/removed/1.21.6/paperserver/0015-Optimize-entity-coordinate-key.patch
index 34ed20f0..6d49417e 100644
--- a/leaf-server/paper-patches/features/0015-Optimize-entity-coordinate-key.patch
+++ b/leaf-archived-patches/removed/1.21.6/paperserver/0015-Optimize-entity-coordinate-key.patch
@@ -3,6 +3,8 @@ From: Martijn Muijsers
Date: Wed, 23 Nov 2022 23:32:51 +0100
Subject: [PATCH] Optimize entity coordinate key
+Removed since Leaf 1.21.6, added in Paper
+
License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/leaf-server/paper-patches/features/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch b/leaf-archived-patches/removed/1.21.6/paperserver/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
similarity index 97%
rename from leaf-server/paper-patches/features/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
rename to leaf-archived-patches/removed/1.21.6/paperserver/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
index 1a501f33..c8d7ddc6 100644
--- a/leaf-server/paper-patches/features/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
+++ b/leaf-archived-patches/removed/1.21.6/paperserver/0033-SparklyPaper-Skip-EntityScheduler-s-executeTick-chec.patch
@@ -4,6 +4,9 @@ Date: Sun, 19 Nov 2023 12:35:16 -0300
Subject: [PATCH] SparklyPaper: Skip EntityScheduler's executeTick checks if
there isn't any tasks to be run
+Removed since Leaf 1.21.6, replaced by spottedleaf's impl added on Paper
+https://github.com/PaperMC/Paper/commit/7c90c7c4970b44b8bcaebd1b3f4f124e9757dc3c
+
Original project: https://github.com/SparklyPower/SparklyPaper
On each tick, Paper runs EntityScheduler's executeTick of each entity. This is a bit expensive, due to ArrayDeque's size() call because it ain't a simple "get the current queue size" function, due to the thread checks, and because it needs to iterate all entities in all worlds.
diff --git a/leaf-server/paper-patches/features/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch b/leaf-archived-patches/removed/1.21.6/paperserver/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch
similarity index 98%
rename from leaf-server/paper-patches/features/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch
rename to leaf-archived-patches/removed/1.21.6/paperserver/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch
index b899e268..1f3afa5b 100644
--- a/leaf-server/paper-patches/features/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch
+++ b/leaf-archived-patches/removed/1.21.6/paperserver/0058-Paper-Optimise-CraftWorld-getLoadedChunks.patch
@@ -3,6 +3,8 @@ From: Spottedleaf
Date: Thu, 5 Jun 2025 08:16:25 -0700
Subject: [PATCH] Paper: Optimise CraftWorld#getLoadedChunks
+Removed since Paper 1.21.6, added on Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/paper-patches/features/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch b/leaf-archived-patches/removed/1.21.6/paperserver/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch
similarity index 97%
rename from leaf-server/paper-patches/features/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch
rename to leaf-archived-patches/removed/1.21.6/paperserver/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch
index bc0a0581..8d6aea54 100644
--- a/leaf-server/paper-patches/features/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch
+++ b/leaf-archived-patches/removed/1.21.6/paperserver/0059-Paper-Update-CraftWorld-getForceLoadedChunks-to-avoi.patch
@@ -4,6 +4,8 @@ Date: Thu, 5 Jun 2025 14:55:57 -0700
Subject: [PATCH] Paper: Update CraftWorld#getForceLoadedChunks to avoid using
getChunkAt
+Removed since Paper 1.21.6, added on Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/paper-patches/features/0060-Paper-Check-type-of-Material-in-get-set-stats.patch b/leaf-archived-patches/removed/1.21.6/paperserver/0060-Paper-Check-type-of-Material-in-get-set-stats.patch
similarity index 99%
rename from leaf-server/paper-patches/features/0060-Paper-Check-type-of-Material-in-get-set-stats.patch
rename to leaf-archived-patches/removed/1.21.6/paperserver/0060-Paper-Check-type-of-Material-in-get-set-stats.patch
index f4145586..1a652c71 100644
--- a/leaf-server/paper-patches/features/0060-Paper-Check-type-of-Material-in-get-set-stats.patch
+++ b/leaf-archived-patches/removed/1.21.6/paperserver/0060-Paper-Check-type-of-Material-in-get-set-stats.patch
@@ -3,6 +3,8 @@ From: Pedro <3602279+Doc94@users.noreply.github.com>
Date: Fri, 20 Jun 2025 10:45:40 -0400
Subject: [PATCH] Paper: Check type of Material in get/set stats
+Removed since Leaf 1.21.6, added in Paper
+
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
diff --git a/leaf-server/minecraft-patches/features/0241-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch b/leaf-archived-patches/work/server/0244-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch
similarity index 98%
rename from leaf-server/minecraft-patches/features/0241-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch
rename to leaf-archived-patches/work/server/0244-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch
index a8ab5e52..28f98bad 100644
--- a/leaf-server/minecraft-patches/features/0241-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch
+++ b/leaf-archived-patches/work/server/0244-Sakura-Optimise-check-inside-blocks-and-traverse-blo.patch
@@ -6,7 +6,7 @@ Subject: [PATCH] Sakura: Optimise check inside blocks and traverse blocks
Dreeam TODO: refactor checkinsideblcoks
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 8618a9221bb4feb459ed50c20c9dc5edb6308aec..9305f790bd80df1d7d14065e6ad621ec9c2e1a49 100644
+index e0db9281f023a09d69479f28a7c8f681641f642f..cc6b6b442d72b4a974cedd8ceef710304e52ab18 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -1701,6 +1701,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
diff --git a/leaf-server/minecraft-patches/features/0270-Cache-potential-behaviors-in-Brain.patch b/leaf-archived-patches/work/server/0270-Cache-potential-behaviors-in-Brain.patch
similarity index 97%
rename from leaf-server/minecraft-patches/features/0270-Cache-potential-behaviors-in-Brain.patch
rename to leaf-archived-patches/work/server/0270-Cache-potential-behaviors-in-Brain.patch
index 28995b66..0b53e82f 100644
--- a/leaf-server/minecraft-patches/features/0270-Cache-potential-behaviors-in-Brain.patch
+++ b/leaf-archived-patches/work/server/0270-Cache-potential-behaviors-in-Brain.patch
@@ -3,6 +3,8 @@ From: Taiyou06
Date: Sat, 7 Jun 2025 19:21:19 +0200
Subject: [PATCH] Cache potential behaviors in Brain
+Replace by ActivityBitSet and cache availableBehaviorsByPriority TreeMap entry
+TODO: benchmark
diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
index 655c3028440e62bcc01d8f1b3e808fd68484128e..7f6572d2259cd244222e5893c9e906075cc3cb92 100644
diff --git a/leaf-server/minecraft-patches/features/0271-Use-ActivationList-on-runningBehaviors.patch b/leaf-archived-patches/work/server/0271-Use-ActivationList-on-runningBehaviors.patch
similarity index 98%
rename from leaf-server/minecraft-patches/features/0271-Use-ActivationList-on-runningBehaviors.patch
rename to leaf-archived-patches/work/server/0271-Use-ActivationList-on-runningBehaviors.patch
index 564402d1..52ad29c9 100644
--- a/leaf-server/minecraft-patches/features/0271-Use-ActivationList-on-runningBehaviors.patch
+++ b/leaf-archived-patches/work/server/0271-Use-ActivationList-on-runningBehaviors.patch
@@ -3,6 +3,8 @@ From: Taiyou06
Date: Sat, 7 Jun 2025 23:22:56 +0200
Subject: [PATCH] Use ActivationList on runningBehaviors
+Replace by ActivityBitSet and cache availableBehaviorsByPriority TreeMap entry
+TODO: benchmark
diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
index 7f6572d2259cd244222e5893c9e906075cc3cb92..521f07a1ef8bfa708fcabf1434fdf133022ee92a 100644
diff --git a/leaf-server/build.gradle.kts.patch b/leaf-server/build.gradle.kts.patch
index 5286eff6..2e94181d 100644
--- a/leaf-server/build.gradle.kts.patch
+++ b/leaf-server/build.gradle.kts.patch
@@ -1,21 +1,21 @@
--- a/paper-server/build.gradle.kts
+++ b/paper-server/build.gradle.kts
-@@ -13,10 +_,11 @@
+@@ -15,10 +_,11 @@
}
val paperMavenPublicUrl = "https://repo.papermc.io/repository/maven-public/"
+val leafMavenPublicUrl = "https://maven.nostal.ink/repository/maven-snapshots/" // Leaf - project setup - Add publish repo
dependencies {
- mache("io.papermc:mache:1.21.5+build.2")
+ mache("io.papermc:mache:1.21.6+build.1")
- paperclip("io.papermc:paperclip:3.0.3")
+ paperclip("cn.dreeam:quantumleaper:1.0.0-SNAPSHOT") // Leaf - project setup - Use own paperclip fork
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
-@@ -28,6 +_,19 @@
- // oldPaperCommit = "f4f275519f7c1fbe9db173b7144a4fe81440e365"
- //}
+@@ -26,6 +_,19 @@
+ minecraftVersion = providers.gradleProperty("mcVersion")
+ gitFilePatches = false
+ // Leaf start - project setup
+ val leaf = forks.register("leaf") {
@@ -31,9 +31,9 @@
+ // Leaf end - project setup
+
spigot {
- buildDataRef = "702e1a0a5072b2c4082371d5228cb30525687efc"
- packageVersion = "v1_21_R4" // also needs to be updated in MappingEnvironment
-@@ -50,6 +_,7 @@
+ enabled = true
+ buildDataRef = "281ac0de7a76d808753ede97d11b034bc801b63d"
+@@ -49,6 +_,7 @@
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
paperMavenPublicUrl,
@@ -41,7 +41,7 @@
)
}
-@@ -108,7 +_,22 @@
+@@ -107,7 +_,22 @@
}
}
@@ -65,7 +65,7 @@
configurations.named(log4jPlugins.compileClasspathConfigurationName) {
extendsFrom(configurations.compileClasspath.get())
}
-@@ -130,10 +_,20 @@
+@@ -129,10 +_,20 @@
}
dependencies {
@@ -87,9 +87,9 @@
+ implementation("org.jline:jline-terminal-ffm:3.29.0") // use ffm on java 22+ // Leaf - Bump Dependencies
+ implementation("org.jline:jline-terminal-jni:3.29.0") // fall back to jni on java 21 // Leaf - Bump Dependencies
implementation("net.minecrell:terminalconsoleappender:1.3.0")
- implementation("net.kyori:adventure-text-serializer-ansi:4.21.0") // Keep in sync with adventureVersion from Paper-API build file
+ implementation("net.kyori:adventure-text-serializer-ansi:4.23.0") // Keep in sync with adventureVersion from Paper-API build file
runtimeConfiguration(sourceSets.main.map { it.runtimeClasspath })
-@@ -144,41 +_,58 @@
+@@ -143,41 +_,58 @@
all its classes to check if they are plugins.
Scanning takes about 1-2 seconds so adding this speeds up the server start.
*/
@@ -161,7 +161,7 @@
implementation("net.neoforged:srgutils:1.0.9") // Mappings handling
implementation("net.neoforged:AutoRenamingTool:2.0.3") // Remap plugins
-@@ -189,31 +_,45 @@
+@@ -188,31 +_,45 @@
implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
@@ -216,7 +216,7 @@
"Build-Number" to (build ?: ""),
"Build-Time" to buildTime.toString(),
"Git-Branch" to gitBranch,
-@@ -267,7 +_,7 @@
+@@ -271,7 +_,7 @@
jvmArgumentProviders.add(provider)
}
@@ -225,7 +225,7 @@
idea {
module {
generatedSourceDirs.add(generatedDir.toFile())
-@@ -325,6 +_,8 @@
+@@ -329,6 +_,8 @@
val memoryGb = providers.gradleProperty("paper.runMemoryGb").getOrElse("2")
minHeapSize = "${memoryGb}G"
maxHeapSize = "${memoryGb}G"
@@ -234,9 +234,9 @@
doFirst {
workingDir.mkdirs()
-@@ -370,3 +_,62 @@
- classpath(tasks.createReobfPaperclipJar.flatMap { it.outputZip })
- mainClass.set(null as String?)
+@@ -391,3 +_,62 @@
+ }
+ }
}
+
+// Gale start - package license into jar
diff --git a/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch b/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch
index c3806897..6337923d 100644
--- a/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch
+++ b/leaf-server/minecraft-patches/features/0002-Gale-configuration.patch
@@ -13,10 +13,10 @@ As part of: Paper (https://github.com/PaperMC/Paper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index f1373fd5fdebb9f4600ba7f32a5df6188de3a0e9..96d34149b1009b1522335784bc1858f61bb59cd1 100644
+index d6dcb6d146d89a8fb96e7c669e5deb802223abd6..84f4f0c87f904a31f3f972e9fb1da8a01474dfca 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -299,6 +299,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
-@@ -469,6 +470,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop, AutoCl
diff --git a/leaf-server/minecraft-patches/features/0003-Leaf-config.patch b/leaf-server/minecraft-patches/features/0003-Leaf-config.patch
index 609c03c7..20ed777a 100644
--- a/leaf-server/minecraft-patches/features/0003-Leaf-config.patch
+++ b/leaf-server/minecraft-patches/features/0003-Leaf-config.patch
@@ -13,10 +13,10 @@ Update config reload:
(Or sync reload)
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
-index 9c9b601a3f903bebb0dd1bda0e24745587229727..6c65122fe15e08c352885c7dfd3ddf496f0c00c4 100644
+index fd3553bdc1c3cdbf6aa3dc00e0a4987f8eaa4fb8..b16f3f515a76ddbbd74d73464396cf094cb30599 100644
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
-@@ -108,10 +108,12 @@ public class Main {
+@@ -109,10 +109,12 @@ public class Main {
JvmProfiler.INSTANCE.start(Environment.SERVER);
}
@@ -30,10 +30,10 @@ index 9c9b601a3f903bebb0dd1bda0e24745587229727..6c65122fe15e08c352885c7dfd3ddf49
DedicatedServerSettings dedicatedServerSettings = new DedicatedServerSettings(optionSet); // CraftBukkit - CLI argument support
dedicatedServerSettings.forceSave();
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 96d34149b1009b1522335784bc1858f61bb59cd1..d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6 100644
+index 54a9c4b14a51b3480d634703d4936b15330fba53..991833bfa8d6cb6ab3faccc94199b7105523583f 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1182,6 +1182,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop parseResults, String command, String label, boolean throwCommandError) {
+ org.spigotmc.AsyncCatcher.catchOp("Cannot perform command async");
// Paper end
CommandSourceStack commandSourceStack = parseResults.getContext().getSource();
- Profiler.get().push(() -> "/" + command);
- ContextChain contextChain = this.finishParsing(parseResults, command, commandSourceStack, label); // CraftBukkit // Paper - Add UnknownCommandEvent
+ ContextChain contextChain = finishParsing(parseResults, command, commandSourceStack);
try {
-@@ -385,8 +381,6 @@ public class Commands {
+@@ -387,8 +383,6 @@ public class Commands {
commandSourceStack.sendFailure(Component.literal(Util.describeError(var12)));
LOGGER.error("'/{}' threw an exception", command, var12);
}
@@ -81,7 +81,7 @@ index 1927163db5d44383b69f41e4b9855535e853d127..f1a637272a8e4ec9c46209ca6b58a490
}
}
-@@ -443,7 +437,7 @@ public class Commands {
+@@ -445,7 +439,7 @@ public class Commands {
int max = Math.max(1, server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_CHAIN_LENGTH));
int _int = server.getGameRules().getInt(GameRules.RULE_MAX_COMMAND_FORK_COUNT);
@@ -169,10 +169,10 @@ index 18071dcc69cc28471dddb7de94e803ec1e5fc2e4..e30bb9c4046200c1a6e4e917d15b205f
}
}
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..923fc9d611d46017cf7ac8e6de6cf0966e0ce9f9 100644
+index 89b7af92f9d8e4e449d9eb1a3ddfe2ec89fd63a4..4deffef83bc7afe688127b9cf184c95bf82f86c8 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -113,19 +113,8 @@ import net.minecraft.util.TimeUtil;
+@@ -114,19 +114,8 @@ import net.minecraft.util.TimeUtil;
import net.minecraft.util.debugchart.RemoteDebugSampleType;
import net.minecraft.util.debugchart.SampleLogger;
import net.minecraft.util.debugchart.TpsDebugDimensions;
@@ -192,7 +192,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..923fc9d611d46017cf7ac8e6de6cf096
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
import net.minecraft.world.Difficulty;
import net.minecraft.world.RandomSequences;
-@@ -198,13 +187,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop tickables = Lists.newArrayList();
@@ -206,7 +206,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..923fc9d611d46017cf7ac8e6de6cf096
private ServerConnectionListener connection;
public final ChunkProgressListenerFactory progressListenerFactory;
@Nullable
-@@ -989,9 +971,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop false : this::haveTime);
// Paper start - rewrite chunk system
-@@ -1258,7 +1230,6 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0 && this.tickCount % autosavePeriod == 0;
try {
this.isSaving = true;
-@@ -1555,10 +1519,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop serverPlayer1.connection.suspendFlushing());
this.server.getScheduler().mainThreadHeartbeat(); // CraftBukkit
- // Paper start - Folia scheduler API
-@@ -1673,9 +1629,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - Add EntityMoveEvent
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
@@ -348,7 +348,7 @@ index d8179f1b7441679a96ac8ccbd67c2cb1c4fc4fd6..923fc9d611d46017cf7ac8e6de6cf096
try {
serverLevel.tick(hasTimeLeft);
} catch (Throwable var7) {
-@@ -1729,34 +1678,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop true);
@@ -790,7 +790,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("purge");
if (this.level.tickRateManager().runsNormally() || !tickChunks || this.level.spigotConfig.unloadFrozenChunks) { // Spigot
- this.ticketStorage.purgeStaleTickets();
+ this.ticketStorage.purgeStaleTickets(this.chunkMap);
}
this.runDistanceManagerUpdates();
@@ -807,7 +807,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
this.clearCache();
}
-@@ -511,22 +499,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -511,22 +500,15 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
long l = gameTime - this.lastInhabitedUpdate;
this.lastInhabitedUpdate = gameTime;
if (!this.level.isDebug()) {
@@ -833,7 +833,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
for (ChunkHolder chunkHolder : this.chunkHoldersToBroadcast) {
LevelChunk tickingChunk = chunkHolder.getChunkToSend(); // Paper - rewrite chunk system
if (tickingChunk != null) {
-@@ -535,11 +516,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -535,11 +517,9 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
this.chunkHoldersToBroadcast.clear();
@@ -846,7 +846,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
int naturalSpawnChunkCount = this.distanceManager.getNaturalSpawnChunkCount();
// Paper start - Optional per player mob spawns
NaturalSpawner.SpawnState spawnState;
-@@ -564,7 +543,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -564,7 +544,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
// Paper end - Optional per player mob spawns
this.lastSpawnState = spawnState;
@@ -854,7 +854,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
boolean _boolean = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
int _int = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
List filteredSpawningCategories;
-@@ -586,14 +564,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -586,14 +565,11 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
List list = this.spawningChunks;
try {
@@ -869,7 +869,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
for (LevelChunk levelChunk : list) {
this.tickSpawningChunk(levelChunk, timeInhabited, filteredSpawningCategories, spawnState);
-@@ -602,10 +577,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -602,10 +578,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
list.clear();
}
@@ -880,7 +880,7 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
if (_boolean) {
this.level.tickCustomSpawners(this.spawnEnemies, this.spawnFriendlies);
}
-@@ -814,7 +786,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -817,7 +790,6 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@Override
protected void doRunTask(Runnable task) {
@@ -889,10 +889,10 @@ index 59e8a5e1b35c81883c9b1ca00c6e55d77584d8cc..4167b46148fc370f20b35c2a261e38c0
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec1293a2ec70b 100644
+index b4c983216cd839d793a09e327bb2f15ab90cbff8..1413511500ce8ae25cc4af1d54fc33c8912c24bc 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -74,8 +74,6 @@ import net.minecraft.util.Mth;
+@@ -75,8 +75,6 @@ import net.minecraft.util.Mth;
import net.minecraft.util.ProgressListener;
import net.minecraft.util.RandomSource;
import net.minecraft.util.datafix.DataFixTypes;
@@ -901,7 +901,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
-@@ -704,16 +702,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -708,16 +706,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
public void tick(BooleanSupplier hasTimeLeft) {
@@ -918,7 +918,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
}
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
-@@ -747,41 +741,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -751,41 +745,30 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.tickTime();
}
@@ -960,7 +960,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
}
io.papermc.paper.entity.activation.ActivationRange.activateEntities(this); // Paper - EAR
-@@ -790,9 +773,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -794,9 +777,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
entity -> {
if (!entity.isRemoved()) {
if (!tickRateManager.isEntityFrozen(entity)) {
@@ -970,7 +970,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
if (true) { // Paper - rewrite chunk system
Entity vehicle = entity.getVehicle();
if (vehicle != null) {
-@@ -803,21 +784,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -807,21 +788,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
entity.stopRiding();
}
@@ -992,7 +992,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
}
@Override
-@@ -832,9 +807,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -836,9 +811,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
if (this.tickTime) {
long l = this.levelData.getGameTime() + 1L;
this.serverLevelData.setGameTime(l);
@@ -1002,7 +1002,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
if (this.serverLevelData.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)) {
this.setDayTime(this.levelData.getDayTime() + 1L);
}
-@@ -913,8 +886,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -917,8 +890,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
ChunkPos pos = chunk.getPos();
int minBlockX = pos.getMinBlockX();
int minBlockZ = pos.getMinBlockZ();
@@ -1011,7 +1011,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
if (!this.paperConfig().environment.disableIceAndSnow) { // Paper - Option to disable ice and snow
for (int i = 0; i < randomTickSpeed; i++) {
-@@ -924,12 +895,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -928,12 +899,9 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
} // Paper - Option to disable ice and snow
@@ -1024,7 +1024,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
}
public void tickThunder(LevelChunk chunk) {
-@@ -937,8 +905,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -941,8 +909,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
boolean isRaining = this.isRaining();
int minBlockX = pos.getMinBlockX();
int minBlockZ = pos.getMinBlockZ();
@@ -1033,7 +1033,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
if (!this.paperConfig().environment.disableThunder && isRaining && this.isThundering() && this.spigotConfig.thunderChance > 0 && this.random.nextInt(this.spigotConfig.thunderChance) == 0) { // Spigot // Paper - Option to disable thunder
BlockPos blockPos = this.findLightningTargetAround(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
if (this.isRainingAt(blockPos)) {
-@@ -964,8 +930,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -968,8 +934,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
}
}
@@ -1042,7 +1042,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
}
@VisibleForTesting
-@@ -1259,17 +1223,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1267,17 +1231,13 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper end - log detailed entity tick information
entity.setOldPosAndRot();
@@ -1060,7 +1060,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
for (Entity entity1 : entity.getPassengers()) {
this.tickPassenger(entity, entity1, isActive); // Paper - EAR 2
-@@ -1290,9 +1250,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1298,9 +1258,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
passengerEntity.setOldPosAndRot();
passengerEntity.tickCount++;
passengerEntity.totalEntityAge++; // Paper - age-like counter for all entities
@@ -1070,7 +1070,7 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
// Paper start - EAR 2
if (isActive) {
passengerEntity.rideTick();
-@@ -1304,7 +1261,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1312,7 +1269,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
ridingEntity.positionRider(passengerEntity);
}
// Paper end - EAR 2
@@ -1079,10 +1079,10 @@ index f66aca0b506390ca5c2f95aacb9495417de325e7..c130a4c61fed477f32be2d1b233ec129
for (Entity entity : passengerEntity.getPassengers()) {
this.tickPassenger(passengerEntity, entity, isActive); // Paper - EAR 2
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index 580e1ce2eaab3a8f1c4ac59be73be2703f769741..6f60f5e92628e744a22b3d3f83c2010d8a4661be 100644
+index b1fba7be059247bc4ba4e652f730e026e837b608..5a4b6005de28f62c98ac8172890689d3150fd4da 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -103,8 +103,6 @@ import net.minecraft.util.HashOps;
+@@ -106,8 +106,6 @@ import net.minecraft.util.HashOps;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -1091,7 +1091,7 @@ index 580e1ce2eaab3a8f1c4ac59be73be2703f769741..6f60f5e92628e744a22b3d3f83c2010d
import net.minecraft.world.Container;
import net.minecraft.world.Difficulty;
import net.minecraft.world.InteractionHand;
-@@ -1375,14 +1373,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1471,14 +1469,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.unsetRemoved();
*/
// CraftBukkit end
@@ -1106,7 +1106,7 @@ index 580e1ce2eaab3a8f1c4ac59be73be2703f769741..6f60f5e92628e744a22b3d3f83c2010d
// CraftBukkit start
this.isChangingDimension = true; // CraftBukkit - Set teleport invulnerability only if player changing worlds
LevelData worlddata = level.getLevelData();
-@@ -1399,7 +1393,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1495,7 +1489,6 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
level.addDuringTeleport(this);
@@ -1115,10 +1115,10 @@ index 580e1ce2eaab3a8f1c4ac59be73be2703f769741..6f60f5e92628e744a22b3d3f83c2010d
this.stopUsingItem();
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-index 186393485396cfe9b1baef29586198356e2d2600..776ff13b399fa01bf3900280cf1b5782370732a0 100644
+index 43f70a5561d6cc62aaeba6d1e39598ecb382e369..ccbf60f546974692c2c840f4bce87e2c95d1866c 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-@@ -24,7 +24,6 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket;
+@@ -26,7 +26,6 @@ import net.minecraft.network.protocol.cookie.ServerboundCookieResponsePacket;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ClientInformation;
import net.minecraft.util.VisibleForDebug;
@@ -1126,16 +1126,16 @@ index 186393485396cfe9b1baef29586198356e2d2600..776ff13b399fa01bf3900280cf1b5782
import org.slf4j.Logger;
public abstract class ServerCommonPacketListenerImpl implements ServerCommonPacketListener, org.bukkit.craftbukkit.entity.CraftPlayer.TransferCookieConnection { // CraftBukkit
-@@ -237,7 +236,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -273,7 +272,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
protected void keepConnectionAlive() {
- Profiler.get().push("keepAlive");
long millis = Util.getMillis();
- // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
- // This should effectively place the keepalive handling back to "as it was" before 1.12.2
-@@ -255,8 +253,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
- this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
+ // Paper start - improve keepalives
+ if (this.checkIfClosed(millis) && !this.processedDisconnect) {
+@@ -294,8 +292,6 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ // Paper end - improve keepalives
}
}
-
@@ -1234,19 +1234,19 @@ index 64b0508ef21952c65b0b967b756b2a4c64d96899..b6b03fbbd669e6331b30255df5419611
protected abstract T prepare(ResourceManager resourceManager, ProfilerFiller profiler);
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9cfae142a 100644
+index 162dfba21cee2f3a9eb8403bf04aa3de5211a31c..31a939facfd4b506a2cff3cee6e4b86a12b1d343 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -82,8 +82,6 @@ import net.minecraft.tags.FluidTags;
- import net.minecraft.tags.TagKey;
+@@ -80,8 +80,6 @@ import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
+ import net.minecraft.util.ProblemReporter;
import net.minecraft.util.RandomSource;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.Nameable;
-@@ -816,8 +814,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -841,8 +839,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public void baseTick() {
@@ -1255,7 +1255,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
if (firstTick && this instanceof net.minecraft.world.entity.NeutralMob neutralMob) neutralMob.tickInitialPersistentAnger(level); // Paper - Prevent entity loading causing async lookups
this.inBlockState = null;
if (this.isPassenger() && this.getVehicle().isRemoved()) {
-@@ -874,8 +870,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -896,8 +892,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
if (this.level() instanceof ServerLevel serverLevelx && this instanceof Leashable) {
Leashable.tickLeash(serverLevelx, (Entity & Leashable)this);
}
@@ -1264,7 +1264,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
}
public void setSharedFlagOnFire(boolean isOnFire) {
-@@ -1095,8 +1089,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1117,8 +1111,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -1273,7 +1273,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
if (this.stuckSpeedMultiplier.lengthSqr() > 1.0E-7) {
movement = movement.multiply(this.stuckSpeedMultiplier);
this.stuckSpeedMultiplier = Vec3.ZERO;
-@@ -1105,7 +1097,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1127,7 +1119,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper start - ignore movement changes while inactive.
if (isTemporarilyActive && !(this instanceof ItemEntity) && movement == getDeltaMovement() && type == MoverType.SELF) {
setDeltaMovement(Vec3.ZERO);
@@ -1281,8 +1281,8 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
return;
}
// Paper end
-@@ -1140,8 +1131,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- this.setPos(vec31);
+@@ -1152,8 +1143,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ this.setPos(vec32);
}
- profilerFiller.pop();
@@ -1290,7 +1290,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
boolean flag = !Mth.equal(movement.x, vec3.x);
boolean flag1 = !Mth.equal(movement.z, vec3.z);
this.horizontalCollision = flag || flag1;
-@@ -1164,7 +1153,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1176,7 +1165,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
if (this.isRemoved()) {
@@ -1298,7 +1298,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
} else {
if (this.horizontalCollision) {
Vec3 deltaMovement = this.getDeltaMovement();
-@@ -1208,7 +1196,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1220,7 +1208,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
float blockSpeedFactor = this.getBlockSpeedFactor();
this.setDeltaMovement(this.getDeltaMovement().multiply(blockSpeedFactor, 1.0, blockSpeedFactor));
@@ -1306,7 +1306,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
}
}
// Paper start - detailed watchdog information
-@@ -3212,8 +3199,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3407,8 +3394,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.processPortalCooldown();
if (this.portalProcess != null) {
if (this.portalProcess.processPortalTeleportation(serverLevel, this, this.canUsePortal(false))) {
@@ -1315,7 +1315,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
this.setPortalCooldown();
TeleportTransition portalDestination = this.portalProcess.getPortalDestination(serverLevel, this);
if (portalDestination != null) {
-@@ -3224,7 +3209,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3419,7 +3404,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
@@ -1323,7 +1323,7 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
} else if (this.portalProcess.hasExpired()) {
this.portalProcess = null;
}
-@@ -3779,15 +3763,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3986,15 +3970,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
entity.teleport(this.calculatePassengerTransition(teleportTransition, entity));
}
@@ -1339,31 +1339,31 @@ index 55f8ca326d52385c92a0b6ee49ee9652e86fa870..e84081f571190fc00db07bdc9da349b9
return this;
}
-@@ -3803,11 +3784,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4010,11 +3991,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
- ProfilerFiller profilerFiller = Profiler.get();
- profilerFiller.push("teleportCrossDimension");
- Entity entityx = this.getType().create(level, EntitySpawnReason.DIMENSION_TRAVEL);
+ Entity entityx = this.getType().create(newLevel, EntitySpawnReason.DIMENSION_TRAVEL);
if (entityx == null) {
- profilerFiller.pop();
return null;
} else {
// Paper start - Fix item duplication and teleport issues
-@@ -3826,7 +3804,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
-
- level.resetEmptyTime();
+@@ -4034,7 +4012,6 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ newLevel.resetEmptyTime();
teleportTransition.postTeleportTransition().onTransition(entityx);
+ this.teleportSpectators(teleportTransition, oldLevel);
- profilerFiller.pop();
return entityx;
}
}
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c713290bc008d0 100644
+index 35d71978a3d360eed97feb66d1048bee337ef2b9..97431aa47b5425578bf14b992596962c64c87f35 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -70,8 +70,6 @@ import net.minecraft.tags.FluidTags;
+@@ -69,8 +69,6 @@ import net.minecraft.tags.FluidTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
@@ -1372,7 +1372,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
import net.minecraft.world.Difficulty;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.CombatRules;
-@@ -415,8 +413,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -429,8 +427,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
super.baseTick();
@@ -1381,7 +1381,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if (this.fireImmune() || this.level().isClientSide) {
this.clearFire();
}
-@@ -501,7 +497,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -515,7 +511,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.yBodyRotO = this.yBodyRot;
this.yRotO = this.getYRot();
this.xRotO = this.getXRot();
@@ -1389,7 +1389,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
}
@Override
-@@ -3233,11 +3228,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3285,11 +3280,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
f1 = this.getYRot();
}
@@ -1401,7 +1401,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
// Paper start - stop large pitch and yaw changes from crashing the server
this.yRotO += Math.round((this.getYRot() - this.yRotO) / 360.0F) * 360.0F;
-@@ -3249,7 +3240,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3301,7 +3292,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.yHeadRotO += Math.round((this.yHeadRot - this.yHeadRotO) / 360.0F) * 360.0F;
// Paper end - stop large pitch and yaw changes from crashing the server
@@ -1409,7 +1409,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if (this.isFallFlying()) {
this.fallFlyTicks++;
} else {
-@@ -3425,21 +3415,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3477,21 +3467,15 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
this.setDeltaMovement(d, d1, d2);
@@ -1431,7 +1431,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if (this.jumping && this.isAffectedByFluids()) {
double fluidHeight;
if (this.isInLava()) {
-@@ -3468,8 +3452,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3520,8 +3504,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.noJumpDelay = 0;
}
@@ -1440,7 +1440,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if (this.isFallFlying()) {
this.updateFallFlying();
}
-@@ -3494,9 +3476,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3546,9 +3528,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.calculateEntityAnimation(this instanceof FlyingAnimal);
}
@@ -1450,7 +1450,7 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if ((!this.isInPowderSnow || !this.canFreeze()) && !this.freezeLocked) { // Paper - Freeze Tick Lock API
this.setTicksFrozen(Math.max(0, this.getTicksFrozen() - 2));
}
-@@ -3506,18 +3486,14 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3558,18 +3538,14 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (this.tickCount % 40 == 0 && this.isFullyFrozen() && this.canFreeze()) {
this.hurtServer(serverLevel, this.damageSources().freeze(), 1.0F);
}
@@ -1470,10 +1470,10 @@ index ef92dc4384f698cc6b5c4e67fe052a3d4af98f4c..79f499fea47a9c675da1aed718c71329
if (((ServerLevel) this.level()).hasEntityMoveEvent && !(this instanceof Player)) {
if (this.xo != this.getX() || this.yo != this.getY() || this.zo != this.getZ() || this.yRotO != this.getYRot() || this.xRotO != this.getXRot()) {
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e74d5113d 100644
+index 0470c4bbf8be7e48ce8dfa4910c3b9f5ebb23360..4d4b58b684ca115f4d8f672362d4c8252ef9481a 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -30,8 +30,6 @@ import net.minecraft.sounds.SoundEvent;
+@@ -26,8 +26,6 @@ import net.minecraft.sounds.SoundEvent;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -1482,7 +1482,7 @@ index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e
import net.minecraft.world.Container;
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
-@@ -316,14 +314,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -319,14 +317,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void baseTick() {
super.baseTick();
@@ -1497,7 +1497,7 @@ index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e
}
@Override
-@@ -489,8 +483,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -502,8 +496,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void aiStep() {
super.aiStep();
@@ -1506,7 +1506,7 @@ index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e
if (this.level() instanceof ServerLevel serverLevel
&& this.canPickUpLoot()
&& this.isAlive()
-@@ -513,8 +505,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -526,8 +518,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
}
}
@@ -1515,7 +1515,7 @@ index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e
}
protected Vec3i getPickupReach() {
-@@ -724,42 +714,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -741,42 +731,21 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return;
}
// Paper end - Allow nerfed mobs to jump and float
@@ -1559,10 +1559,10 @@ index 73ba442b9d39bc021cd5eb6c1c0f98aed94a5a02..7f5981f71e6380c09e40a0c80db6a77e
}
diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java
-index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc17373fa77ff6 100644
+index 859b859d29b637200cf7c9a0bd52d9f712413e3d..653c58c7637c46c8b46a5082f671324a2221d431 100644
--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java
-@@ -7,8 +7,6 @@ import java.util.EnumSet;
+@@ -6,8 +6,6 @@ import java.util.EnumSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Predicate;
@@ -1571,7 +1571,7 @@ index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc1737
public class GoalSelector {
private static final WrappedGoal NO_GOAL = new WrappedGoal(Integer.MAX_VALUE, new Goal() {
-@@ -84,9 +82,6 @@ public class GoalSelector {
+@@ -82,9 +80,6 @@ public class GoalSelector {
}
public void tick() {
@@ -1581,7 +1581,7 @@ index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc1737
for (WrappedGoal wrappedGoal : this.availableGoals) {
if (wrappedGoal.isRunning() && (goalContainsAnyFlags(wrappedGoal, this.goalTypes) || !wrappedGoal.canContinueToUse())) { // Paper - Perf: optimize goal types by removing streams
wrappedGoal.stop();
-@@ -94,8 +89,6 @@ public class GoalSelector {
+@@ -92,8 +87,6 @@ public class GoalSelector {
}
this.lockedFlags.entrySet().removeIf(entry -> !entry.getValue().isRunning());
@@ -1590,7 +1590,7 @@ index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc1737
for (WrappedGoal wrappedGoalx : this.availableGoals) {
// Paper start
-@@ -115,21 +108,15 @@ public class GoalSelector {
+@@ -113,21 +106,15 @@ public class GoalSelector {
}
}
@@ -1613,7 +1613,7 @@ index a927c2790c8ab9ccaa7161b970e10b0b44817dd8..b816b2de8eb327060ca6ea7c4afc1737
public Set getAvailableGoals() {
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index 06389019deba08c7c0966affcdc90512c88db3d5..6bbdfc748f1ce66689c63424fadcf261b1e967b3 100644
+index 3b29cc4e11efe6f27023f52cfde16fd118c310ad..c8e4ccb96a0f162c780066cf4f61b970b49b7703 100644
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -10,8 +10,6 @@ import net.minecraft.core.Vec3i;
@@ -1663,11 +1663,38 @@ index c569074403b1d8b443aaa98ba9cf9bbd0e98bd2d..b1aa7294f9479f45fcde77c5ea46db9f
if (hasLineOfSight) {
this.seen.add(id);
} else {
+diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
+index 24fdfda487bf5348c32707022719ec9907debc80..4e74d5b3076f50f9294553b453f5903ef32f1e8a 100644
+--- a/net/minecraft/world/entity/animal/HappyGhast.java
++++ b/net/minecraft/world/entity/animal/HappyGhast.java
+@@ -13,8 +13,6 @@ import net.minecraft.sounds.SoundEvents;
+ import net.minecraft.sounds.SoundSource;
+ import net.minecraft.tags.ItemTags;
+ import net.minecraft.util.Mth;
+-import net.minecraft.util.profiling.Profiler;
+-import net.minecraft.util.profiling.ProfilerFiller;
+ import net.minecraft.world.InteractionHand;
+ import net.minecraft.world.InteractionResult;
+ import net.minecraft.world.damagesource.DamageSource;
+@@ -379,13 +377,8 @@ public class HappyGhast extends Animal {
+ @Override
+ protected void customServerAiStep(ServerLevel level) {
+ if (this.isBaby()) {
+- ProfilerFiller profilerFiller = Profiler.get();
+- profilerFiller.push("happyGhastBrain");
+ ((Brain)this.brain).tick(level, this);
+- profilerFiller.pop();
+- profilerFiller.push("happyGhastActivityUpdate");
+ HappyGhastAi.updateActivity(this);
+- profilerFiller.pop();
+ }
+
+ this.checkRestriction();
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index eaa1745d34323cd684782a7fb2e153851a736471..fc2290a62c0a01cfa3143e77384f30e17d94f039 100644
+index b7b964bd4e2d611a3e48ece072d5787193077a92..de3bf0b62371f06ecb5d2035638e352ca0c06182 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -29,8 +29,6 @@ import net.minecraft.tags.GameEventTags;
+@@ -25,8 +25,6 @@ import net.minecraft.tags.GameEventTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
@@ -1676,7 +1703,7 @@ index eaa1745d34323cd684782a7fb2e153851a736471..fc2290a62c0a01cfa3143e77384f30e1
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.SimpleContainer;
-@@ -241,13 +239,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -226,13 +224,8 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1691,10 +1718,10 @@ index eaa1745d34323cd684782a7fb2e153851a736471..fc2290a62c0a01cfa3143e77384f30e1
}
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-index b72e07ad954efa7f26f876a59f428086b40d9bb2..657f4b56699c33590a0494ef860275e952794c2a 100644
+index c1798db2972c8f2a343cf6e16fd9354ff212d906..ee2c6c86631ba50a4e8503131c678596bc2c0363 100644
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-@@ -24,8 +24,6 @@ import net.minecraft.util.ByIdMap;
+@@ -23,8 +23,6 @@ import net.minecraft.util.ByIdMap;
import net.minecraft.util.RandomSource;
import net.minecraft.util.StringRepresentable;
import net.minecraft.util.TimeUtil;
@@ -1703,7 +1730,7 @@ index b72e07ad954efa7f26f876a59f428086b40d9bb2..657f4b56699c33590a0494ef860275e9
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
-@@ -134,13 +132,8 @@ public class Armadillo extends Animal {
+@@ -135,13 +133,8 @@ public class Armadillo extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1718,7 +1745,7 @@ index b72e07ad954efa7f26f876a59f428086b40d9bb2..657f4b56699c33590a0494ef860275e9
this.forceDrops = true; // CraftBukkit
if (this.dropFromGiftLootTable(level, BuiltInLootTables.ARMADILLO_SHED, this::spawnAtLocation)) {
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-index 233025bc1d4ba2590223def9b206140c68ea5f26..d3d4d8b025480f9e2202157591319df3af43f9de 100644
+index b0467750dab4c6f411fd2f318009d25f83d94bc0..6a5e9e9582e322aaa1555933de97e545ba74f8f4 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
@@ -31,8 +31,6 @@ import net.minecraft.util.ByIdMap;
@@ -1730,7 +1757,7 @@ index 233025bc1d4ba2590223def9b206140c68ea5f26..d3d4d8b025480f9e2202157591319df3
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -327,13 +325,8 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -329,13 +327,8 @@ public class Axolotl extends Animal implements Bucketable {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1745,10 +1772,10 @@ index 233025bc1d4ba2590223def9b206140c68ea5f26..d3d4d8b025480f9e2202157591319df3
Optional memory = this.getBrain().getMemory(MemoryModuleType.PLAY_DEAD_TICKS);
this.setPlayingDead(memory.isPresent() && memory.get() > 0);
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
-index 6336fb58f4314be2fe987d7e3de258d977369417..b63b32bac1872db7be64fcb645acd0a0a4290cee 100644
+index 757b63ee059c95e673a098706b4ee7ab4fc21f70..adc336c6cec601b8855c1013adf1eebf018597f0 100644
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
-@@ -19,8 +19,6 @@ import net.minecraft.tags.BlockTags;
+@@ -18,8 +18,6 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -1757,7 +1784,7 @@ index 6336fb58f4314be2fe987d7e3de258d977369417..b63b32bac1872db7be64fcb645acd0a0
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -157,14 +155,9 @@ public class Camel extends AbstractHorse {
+@@ -159,14 +157,9 @@ public class Camel extends AbstractHorse {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1773,10 +1800,10 @@ index 6336fb58f4314be2fe987d7e3de258d977369417..b63b32bac1872db7be64fcb645acd0a0
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 8ffbe420528cd63f30f9b41d4fb0a6519042eadc..fdf40dc10aad108db6ca68fcfec9ecf48f76a9c1 100644
+index 66f503e045ccb0985ec718b39be07eea538fad8d..b8703409dd3dc8e3020ed81b44ce4812984c88c3 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -29,8 +29,6 @@ import net.minecraft.tags.ItemTags;
+@@ -28,8 +28,6 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -1785,7 +1812,7 @@ index 8ffbe420528cd63f30f9b41d4fb0a6519042eadc..fdf40dc10aad108db6ca68fcfec9ecf4
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AgeableMob;
-@@ -203,13 +201,8 @@ public class Frog extends Animal {
+@@ -204,13 +202,8 @@ public class Frog extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1800,7 +1827,7 @@ index 8ffbe420528cd63f30f9b41d4fb0a6519042eadc..fdf40dc10aad108db6ca68fcfec9ecf4
}
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index ebdfd3fb6c0de48982d392bb2aa415f3676c6056..faaa8197e8421c2bbdc2a8bbaae4f4d0820dbbe7 100644
+index 17f58246849ed407821a987b200cc765eb7943f9..c1510a6f1146f446ed65a1f08984af6c29de439a 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -12,8 +12,6 @@ import net.minecraft.server.level.ServerLevel;
@@ -1812,7 +1839,7 @@ index ebdfd3fb6c0de48982d392bb2aa415f3676c6056..faaa8197e8421c2bbdc2a8bbaae4f4d0
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
-@@ -98,13 +96,8 @@ public class Tadpole extends AbstractFish {
+@@ -100,13 +98,8 @@ public class Tadpole extends AbstractFish {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1827,10 +1854,10 @@ index ebdfd3fb6c0de48982d392bb2aa415f3676c6056..faaa8197e8421c2bbdc2a8bbaae4f4d0
}
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
-index b22321ead9d66cb089b67276743624b3cca52fc1..9047e75a5edf9fec2b73aec272284d8003793eaa 100644
+index 75af1b92a0a60cffa3317d83bd599a3d4d26f93c..bdac4929db71a39fc02985109cedc9cd316ec3cc 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
-@@ -21,8 +21,6 @@ import net.minecraft.tags.ItemTags;
+@@ -20,8 +20,6 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
@@ -1839,7 +1866,7 @@ index b22321ead9d66cb089b67276743624b3cca52fc1..9047e75a5edf9fec2b73aec272284d80
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -189,13 +187,8 @@ public class Goat extends Animal {
+@@ -190,13 +188,8 @@ public class Goat extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1854,7 +1881,7 @@ index b22321ead9d66cb089b67276743624b3cca52fc1..9047e75a5edf9fec2b73aec272284d80
}
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-index d34dcbbdeae41d23d6fb497e0e8da038580b6d01..622c2eac70c81ed7ccf605069b8dd68508bebf76 100644
+index 6a9f31c1f39cc14ad7b5ae3af85908bc7a4caae4..05d269b51715a71fa653900e7187b07d001afdb7 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -29,8 +29,6 @@ import net.minecraft.tags.BlockTags;
@@ -1866,7 +1893,7 @@ index d34dcbbdeae41d23d6fb497e0e8da038580b6d01..622c2eac70c81ed7ccf605069b8dd685
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
-@@ -454,12 +452,8 @@ public class Sniffer extends Animal {
+@@ -465,12 +463,8 @@ public class Sniffer extends Animal {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1880,10 +1907,10 @@ index d34dcbbdeae41d23d6fb497e0e8da038580b6d01..622c2eac70c81ed7ccf605069b8dd685
}
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
-index 4405f465ad5b136390c4204b177967c6e47738dd..33c7081c2aee7a31c4dd143f9d1a36cadcfcb29f 100644
+index 0dbc528bcad2b2f79585e2462a265d43fcbebe76..662b95d27f6630ec27fd88ca279e395438faa96b 100644
--- a/net/minecraft/world/entity/monster/Zoglin.java
+++ b/net/minecraft/world/entity/monster/Zoglin.java
-@@ -15,8 +15,6 @@ import net.minecraft.network.syncher.SynchedEntityData;
+@@ -14,8 +14,6 @@ import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
@@ -1892,7 +1919,7 @@ index 4405f465ad5b136390c4204b177967c6e47738dd..33c7081c2aee7a31c4dd143f9d1a36ca
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
-@@ -249,10 +247,7 @@ public class Zoglin extends Monster implements HoglinBase {
+@@ -250,10 +248,7 @@ public class Zoglin extends Monster implements HoglinBase {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1930,10 +1957,10 @@ index c12653070d62c44b97a07676f24caf7ab570cd2a..d91ce14cc39b1b6ccd558f53ed605d4c
}
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
-index bdefd070cfebe7f3f792c998f2f53be720cbfbcd..2183f5aaf6cf7a4df8c659f0766af40289761987 100644
+index 567e7952efec69b4222563fae724d18a9902bb05..f66bd6cc4aab828e847b990b193be54cd0d0dc01 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
-@@ -17,8 +17,6 @@ import net.minecraft.server.level.ServerLevel;
+@@ -16,8 +16,6 @@ import net.minecraft.server.level.ServerLevel;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.DamageTypeTags;
@@ -1942,7 +1969,7 @@ index bdefd070cfebe7f3f792c998f2f53be720cbfbcd..2183f5aaf6cf7a4df8c659f0766af402
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AnimationState;
import net.minecraft.world.entity.Entity;
-@@ -204,10 +202,7 @@ public class Creaking extends Monster {
+@@ -205,10 +203,7 @@ public class Creaking extends Monster {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1954,10 +1981,10 @@ index bdefd070cfebe7f3f792c998f2f53be720cbfbcd..2183f5aaf6cf7a4df8c659f0766af402
}
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-index 0d05d21158a59dc3aa648c1d6541121c5bb547e6..2989add9a4746646f06ec3f6c386ac5df4a64726 100644
+index 0ecf8533f6cad081df8713856feb74db93028f71..bde6f9d9d1cc7a5ee8334ee9207afae304ddcfa9 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-@@ -16,8 +16,6 @@ import net.minecraft.sounds.SoundEvents;
+@@ -15,8 +15,6 @@ import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.RandomSource;
@@ -1966,7 +1993,7 @@ index 0d05d21158a59dc3aa648c1d6541121c5bb547e6..2989add9a4746646f06ec3f6c386ac5d
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -161,10 +159,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -162,10 +160,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -1978,10 +2005,10 @@ index 0d05d21158a59dc3aa648c1d6541121c5bb547e6..2989add9a4746646f06ec3f6c386ac5d
if (this.isConverting()) {
this.timeInOverworld++;
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
-index e200e974e46de6166d56e051806c00a69aefc9bb..27052ded60db7c3916de3f4c8b48227f53fd7249 100644
+index 8392ff1316f0c5be685a6ded7ccd08933c10ff4e..689f200554d8c03313b3d194f209c527f315c29a 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
-@@ -17,8 +17,6 @@ import net.minecraft.tags.ItemTags;
+@@ -16,8 +16,6 @@ import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.util.RandomSource;
import net.minecraft.util.VisibleForDebug;
@@ -1990,7 +2017,7 @@ index e200e974e46de6166d56e051806c00a69aefc9bb..27052ded60db7c3916de3f4c8b48227f
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-@@ -319,10 +317,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -320,10 +318,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -2026,10 +2053,10 @@ index 219978cb0341b2d691f44c1146707d875788881e..589a130f8855f464c1930a0aa8b54c03
PiglinBruteAi.maybePlayActivitySound(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index cd28ca290c081d9f5e4498f59d7b87a566f81544..67fdcbe05e8d5f4000255f753565591825f54f67 100644
+index 4a4cc7f9c95d4f4b6ad4948e3ed3504efbbcef15..dd6666bd8b8df4148a1557627ce2a6ddab245ed6 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -31,8 +31,6 @@ import net.minecraft.tags.TagKey;
+@@ -27,8 +27,6 @@ import net.minecraft.tags.TagKey;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
@@ -2038,7 +2065,7 @@ index cd28ca290c081d9f5e4498f59d7b87a566f81544..67fdcbe05e8d5f4000255f7535655918
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffectInstance;
-@@ -281,10 +279,7 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -279,10 +277,7 @@ public class Warden extends Monster implements VibrationSystem {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -2050,10 +2077,10 @@ index cd28ca290c081d9f5e4498f59d7b87a566f81544..67fdcbe05e8d5f4000255f7535655918
if ((this.tickCount + this.getId()) % 120 == 0) {
applyDarknessAround(level, this.position(), this, 20);
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
-index e0e0d2ea7fc60e3142c675404d152eca60263240..09d559adb603e3d34bb82b944a2a3e8c2c37b136 100644
+index 43f16df230f87a43e249a58fc10ef2da517f22ee..532618ae4acd548129006a6c42c62a5b046dbd7e 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
-@@ -36,8 +36,6 @@ import net.minecraft.stats.Stats;
+@@ -35,8 +35,6 @@ import net.minecraft.stats.Stats;
import net.minecraft.tags.ItemTags;
import net.minecraft.util.Mth;
import net.minecraft.util.SpawnUtil;
@@ -2062,7 +2089,7 @@ index e0e0d2ea7fc60e3142c675404d152eca60263240..09d559adb603e3d34bb82b944a2a3e8c
import net.minecraft.world.Difficulty;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.InteractionHand;
-@@ -294,10 +292,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -295,10 +293,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
protected void customServerAiStep(ServerLevel level, final boolean inactive) {
// Paper end - EAR 2
@@ -2074,7 +2101,7 @@ index e0e0d2ea7fc60e3142c675404d152eca60263240..09d559adb603e3d34bb82b944a2a3e8c
this.assignProfessionWhenSpawned = false;
}
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index 4c31b039eb697ba84598dd1fdded707a2f155ce5..2ebb7f0f3686fa631de874fee9474f7ab530631f 100644
+index 4b96e512905aca3b69408145054c0658ee932eed..9f630dda781dd540ab5655bd7ce916949eeee61c 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -35,8 +35,6 @@ import net.minecraft.util.AbortableIterationConsumer;
@@ -2119,7 +2146,7 @@ index 4c31b039eb697ba84598dd1fdded707a2f155ce5..2ebb7f0f3686fa631de874fee9474f7a
this.spigotConfig.currentPrimedTnt = 0; // Spigot
}
-@@ -1742,7 +1735,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -1735,7 +1728,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
@Override
public List getEntities(@Nullable Entity entity, AABB boundingBox, Predicate super Entity> predicate) {
@@ -2127,7 +2154,7 @@ index 4c31b039eb697ba84598dd1fdded707a2f155ce5..2ebb7f0f3686fa631de874fee9474f7a
List list = Lists.newArrayList();
// Paper start - rewrite chunk system
-@@ -1771,8 +1763,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -1764,8 +1756,6 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
public void getEntities(final EntityTypeTest entityTypeTest,
final AABB boundingBox, final Predicate super T> predicate,
final List super T> into, final int maxCount) {
@@ -2169,7 +2196,7 @@ index 14a2514a408a66a83f7b5fb43b4c4dc8f23fd5f4..ec32d77447dd250857a2af1d8cc3e6e2
// Paper start - Add mobcaps commands
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
-index ec4b63a574e7ff2c807c283c9f4b402229864e51..63d0b83d648ab1a6e7c84a49f7e2e825076904ad 100644
+index 07e4025ca6c9c31905db2e6921138a0ded479dde..fa4695b7ee56724b4d47ce4da0a5aeb8b5467db4 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
@@ -13,8 +13,6 @@ import net.minecraft.Util;
@@ -2181,7 +2208,7 @@ index ec4b63a574e7ff2c807c283c9f4b402229864e51..63d0b83d648ab1a6e7c84a49f7e2e825
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
-@@ -654,10 +652,7 @@ public class ServerExplosion implements Explosion {
+@@ -652,10 +650,7 @@ public class ServerExplosion implements Explosion {
List list = this.calculateExplodedPositions();
this.hurtEntities();
if (this.interactsWithBlocks()) {
@@ -2193,19 +2220,19 @@ index ec4b63a574e7ff2c807c283c9f4b402229864e51..63d0b83d648ab1a6e7c84a49f7e2e825
if (this.fire) {
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
-index 5d3fc807221392d378fec283bfdefb8747fb8376..61fa8f2bf018b8892a11acec058f36914c5a1573 100644
+index 75578e6ed7233a03d9b6cd3c6d3997f1c6148392..b88254fb3c12b99684c6ede1ae8a6671ffbe9ad6 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -23,8 +23,6 @@ import net.minecraft.network.FriendlyByteBuf;
- import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
+@@ -24,8 +24,6 @@ import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel;
+ import net.minecraft.util.ProblemReporter;
-import net.minecraft.util.profiling.Profiler;
-import net.minecraft.util.profiling.ProfilerFiller;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
-@@ -383,12 +381,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -385,12 +383,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
if (LightEngine.hasDifferentLightProperties(blockState, state)) {
@@ -2218,7 +2245,7 @@ index 5d3fc807221392d378fec283bfdefb8747fb8376..61fa8f2bf018b8892a11acec058f3691
}
boolean flag = !blockState.is(block);
-@@ -915,8 +909,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -922,8 +916,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
BlockPos blockPos = this.blockEntity.getBlockPos();
if (LevelChunk.this.isTicking(blockPos)) {
try {
@@ -2227,7 +2254,7 @@ index 5d3fc807221392d378fec283bfdefb8747fb8376..61fa8f2bf018b8892a11acec058f3691
BlockState blockState = LevelChunk.this.getBlockState(blockPos);
if (this.blockEntity.getType().isValid(blockState)) {
this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), blockState, this.blockEntity);
-@@ -930,8 +922,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -937,8 +929,6 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
// Paper end - Remove the Block Entity if it's invalid
}
diff --git a/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch b/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch
index ded97942..8203eb83 100644
--- a/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch
+++ b/leaf-server/minecraft-patches/features/0009-Reduce-projectile-chunk-loading.patch
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
-index 4487c03183d20a187d391dd124abb7b926508b5b..84c846d2ef4990befb2891631ac5ae16d881401b 100644
+index ee16a05b8b2747ce95fcae1616c96143a5dec74e..36124bfd4189e35208875e971733889410242641 100644
--- a/net/minecraft/world/entity/projectile/Projectile.java
+++ b/net/minecraft/world/entity/projectile/Projectile.java
-@@ -53,6 +53,55 @@ public abstract class Projectile extends Entity implements TraceableEntity {
+@@ -50,6 +50,55 @@ public abstract class Projectile extends Entity implements TraceableEntity {
super(entityType, level);
}
@@ -87,6 +87,6 @@ index 4487c03183d20a187d391dd124abb7b926508b5b..84c846d2ef4990befb2891631ac5ae16
+ }
+ // Gale end - Airplane - reduce projectile chunk loading
+
- public void setOwner(@Nullable Entity owner) {
- if (owner != null) {
- this.ownerUUID = owner.getUUID();
+ protected void setOwner(@Nullable EntityReference owner) {
+ this.owner = owner;
+ }
diff --git a/leaf-server/minecraft-patches/features/0010-Predict-Halloween.patch b/leaf-server/minecraft-patches/features/0010-Predict-Halloween.patch
index 78a9d307..108de3bc 100644
--- a/leaf-server/minecraft-patches/features/0010-Predict-Halloween.patch
+++ b/leaf-server/minecraft-patches/features/0010-Predict-Halloween.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
-index eb9fb57440f498079182030a46034008d3f6b5e8..65a9ea8d4a208f447b5e78b58b10a0917e35e4f2 100644
+index 912b099a51269f92f250c7d6094ad41817749f93..5dadb42fd2d2d03ef366ca83c9c4aae6c288aaa4 100644
--- a/net/minecraft/world/entity/ambient/Bat.java
+++ b/net/minecraft/world/entity/ambient/Bat.java
-@@ -244,11 +244,66 @@ public class Bat extends AmbientCreature {
+@@ -245,11 +245,66 @@ public class Bat extends AmbientCreature {
}
}
diff --git a/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch b/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch
index de2a02a9..00d6fda6 100644
--- a/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch
+++ b/leaf-server/minecraft-patches/features/0011-Move-random-tick-random.patch
@@ -19,10 +19,10 @@ require it to be initialized earlier. By moving it to the superclass, we
initialize it earlier, ensuring that it is available sooner.
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 1d53c0b96ff781765155aac29256f4493f7d7c58..3941d15753aef952ad1fd5b5f96cb810f4f251e3 100644
+index 1413511500ce8ae25cc4af1d54fc33c8912c24bc..0665c2ec275086b8c555c550af93dfef197fba07 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -830,8 +830,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -834,8 +834,6 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper start - optimise random ticking
@@ -32,7 +32,7 @@ index 1d53c0b96ff781765155aac29256f4493f7d7c58..3941d15753aef952ad1fd5b5f96cb810
final LevelChunkSection[] sections = chunk.getSections();
final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this);
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index 9a5447dfa8cba271fdb205d21e4236c94074a7da..013e22dc4eceda9b947f1ff8fe43540b8855aa34 100644
+index 9f630dda781dd540ab5655bd7ce916949eeee61c..19a9b37bad1d465440047cbde9a00b12ba5d9a4b 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -168,6 +168,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
diff --git a/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch b/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch
index c9bfc054..fc037015 100644
--- a/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch
+++ b/leaf-server/minecraft-patches/features/0012-Optimize-random-calls-in-chunk-ticking.patch
@@ -52,10 +52,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
-index 5005ad97fe4830c6563bca50a77a6abd36c984df..3d7d336c2043b533012ee390e6da02ac4f64e1f2 100644
+index 6020b71802babb35ef60aca65afe9c2612c05bb7..e53440bd5f0e659db0745a009540520f6dc41238 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
-@@ -499,6 +499,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -500,6 +500,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
long l = gameTime - this.lastInhabitedUpdate;
this.lastInhabitedUpdate = gameTime;
if (!this.level.isDebug()) {
@@ -64,10 +64,10 @@ index 5005ad97fe4830c6563bca50a77a6abd36c984df..3d7d336c2043b533012ee390e6da02ac
this.tickChunks(l); // Gale - Purpur - remove vanilla profiler
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 28377b1d568e70f4ff1e5a6eea39e7fb9e1233e7..606dee544c669dcaa0eb02808c5786545b5519eb 100644
+index 0665c2ec275086b8c555c550af93dfef197fba07..6bc70c1d53049a1f75268ab9944bfb1557ca74ee 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -879,13 +879,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -883,13 +883,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// Paper end - optimise random ticking
@@ -84,7 +84,7 @@ index 28377b1d568e70f4ff1e5a6eea39e7fb9e1233e7..606dee544c669dcaa0eb02808c578654
for (int i = 0; i < randomTickSpeed; i++) {
if (simpleRandom.nextInt(48) == 0) { // Paper - optimise random ticking
this.tickPrecipitation(this.getBlockRandomPos(minBlockX, 0, minBlockZ, 15));
-@@ -903,7 +905,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -907,7 +909,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
boolean isRaining = this.isRaining();
int minBlockX = pos.getMinBlockX();
int minBlockZ = pos.getMinBlockZ();
@@ -94,10 +94,10 @@ index 28377b1d568e70f4ff1e5a6eea39e7fb9e1233e7..606dee544c669dcaa0eb02808c578654
if (this.isRainingAt(blockPos)) {
DifficultyInstance currentDifficultyAt = this.getCurrentDifficultyAt(blockPos);
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
-index 61fa8f2bf018b8892a11acec058f36914c5a1573..a8db2a822deb07ddc707cf73fdc5c269d9842c06 100644
+index b88254fb3c12b99684c6ede1ae8a6671ffbe9ad6..9e2debee38bc4b25281c8a8c6e7082cca1f7b569 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -126,6 +126,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -128,6 +128,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
// Paper end - get block chunk optimisation
@@ -116,7 +116,7 @@ index 61fa8f2bf018b8892a11acec058f36914c5a1573..a8db2a822deb07ddc707cf73fdc5c269
public LevelChunk(Level level, ChunkPos pos) {
this(level, pos, UpgradeData.EMPTY, new LevelChunkTicks<>(), new LevelChunkTicks<>(), 0L, null, null, null);
}
-@@ -162,6 +174,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -164,6 +176,8 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
this.debug = !empty && this.level.isDebug();
this.defaultBlockState = empty ? VOID_AIR_BLOCKSTATE : AIR_BLOCKSTATE;
// Paper end - get block chunk optimisation
diff --git a/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch b/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch
index 0c241dc7..9f584756 100644
--- a/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch
+++ b/leaf-server/minecraft-patches/features/0013-Reduce-enderman-teleport-chunk-lookups.patch
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
-index 5ae08be75ca01924fc78bdd8d6bb6747ddc21aea..84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb 100644
+index 4edd94ac765d2ab107612504b67e6e07da609313..9b0235c50426accde002cbb0a09a992f13b05cd7 100644
--- a/net/minecraft/world/entity/monster/EnderMan.java
+++ b/net/minecraft/world/entity/monster/EnderMan.java
-@@ -300,11 +300,19 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -296,11 +296,19 @@ public class EnderMan extends Monster implements NeutralMob {
private boolean teleport(double x, double y, double z) {
BlockPos.MutableBlockPos mutableBlockPos = new BlockPos.MutableBlockPos(x, y, z);
diff --git a/leaf-server/minecraft-patches/features/0016-Cache-on-climbable-check.patch b/leaf-server/minecraft-patches/features/0016-Cache-on-climbable-check.patch
index 57ea3a6c..e2ac01eb 100644
--- a/leaf-server/minecraft-patches/features/0016-Cache-on-climbable-check.patch
+++ b/leaf-server/minecraft-patches/features/0016-Cache-on-climbable-check.patch
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
-index 2ebee223085fe7926c7f3e555df19ae69f36157e..602ed4c5556723e54a80ccc3481af31109d5a0a6 100644
+index ae2bb9a73106febfe5f0d090abd4252bbb5fd27e..eee9c41e40402e52b73f34a734b4cbdeb6cfbc22 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
-@@ -215,7 +215,7 @@ public final class ActivationRange {
+@@ -221,7 +221,7 @@ public final class ActivationRange {
}
// special cases.
if (entity instanceof final LivingEntity living) {
@@ -44,10 +44,10 @@ index 2ebee223085fe7926c7f3e555df19ae69f36157e..602ed4c5556723e54a80ccc3481af311
}
if (entity instanceof final Mob mob && mob.getTarget() != null) {
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index 79f499fea47a9c675da1aed718c713290bc008d0..f019571b4b6b5e2d1953030911449a02e459591c 100644
+index 97431aa47b5425578bf14b992596962c64c87f35..e174c7b8c637e6983cf0778e6956d8d11e9cd7d1 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -2083,6 +2083,21 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -2115,6 +2115,21 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
return this.lastClimbablePos;
}
diff --git a/leaf-server/minecraft-patches/features/0018-Better-checking-for-useless-move-packets.patch b/leaf-server/minecraft-patches/features/0018-Better-checking-for-useless-move-packets.patch
index 5f4def86..269068a5 100644
--- a/leaf-server/minecraft-patches/features/0018-Better-checking-for-useless-move-packets.patch
+++ b/leaf-server/minecraft-patches/features/0018-Better-checking-for-useless-move-packets.patch
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
-index 7360914a6f4dc43758c38f2c6c7f8d458cc14c4d..7fe21b10eefce56dde19baebf9cb6d2d0a8d73ec 100644
+index e958972ca09eb0ab07d81990e661076ab0371850..5df8ee3955593e70f0e67e91431e464d177bdeeb 100644
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
-@@ -189,19 +189,25 @@ public class ServerEntity {
+@@ -193,19 +193,25 @@ public class ServerEntity {
packet = ClientboundEntityPositionSyncPacket.of(this.entity);
flag3 = true;
flag4 = true;
diff --git a/leaf-server/minecraft-patches/features/0019-Block-goal-does-not-load-chunks.patch b/leaf-server/minecraft-patches/features/0019-Block-goal-does-not-load-chunks.patch
index d8628407..7a6e0e8b 100644
--- a/leaf-server/minecraft-patches/features/0019-Block-goal-does-not-load-chunks.patch
+++ b/leaf-server/minecraft-patches/features/0019-Block-goal-does-not-load-chunks.patch
@@ -31,7 +31,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
-index d0ab3db7bbd2942db19f473474371b20ce822608..3f080b15543bf8c5fa0774b62d7f12e13b82511a 100644
+index 7e70c7bee633c54497d1cd2854dd60f4fb5ff160..f15da598cb1d7872fafb8b173e5134b9667c9a9f 100644
--- a/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
+++ b/net/minecraft/world/entity/ai/goal/MoveToBlockGoal.java
@@ -119,6 +119,7 @@ public abstract class MoveToBlockGoal extends Goal {
@@ -39,6 +39,6 @@ index d0ab3db7bbd2942db19f473474371b20ce822608..3f080b15543bf8c5fa0774b62d7f12e1
for (int i5 = i4 < i3 && i4 > -i3 ? i3 : 0; i5 <= i3; i5 = i5 > 0 ? -i5 : 1 - i5) {
mutableBlockPos.setWithOffset(blockPos, i4, i2 - 1, i5);
+ if (!this.mob.level().hasChunkAt(mutableBlockPos)) continue; // Gale - Airplane - block goal does not load chunks - if this block isn't loaded, continue
- if (this.mob.isWithinRestriction(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
+ if (this.mob.isWithinHome(mutableBlockPos) && this.isValidTarget(this.mob.level(), mutableBlockPos)) {
this.blockPos = mutableBlockPos;
this.mob.movingTarget = mutableBlockPos == BlockPos.ZERO ? null : mutableBlockPos.immutable(); // Paper
diff --git a/leaf-server/minecraft-patches/features/0020-Remove-lambda-from-ticking-guard.patch b/leaf-server/minecraft-patches/features/0020-Remove-lambda-from-ticking-guard.patch
index cc1e7a2a..f9525f5b 100644
--- a/leaf-server/minecraft-patches/features/0020-Remove-lambda-from-ticking-guard.patch
+++ b/leaf-server/minecraft-patches/features/0020-Remove-lambda-from-ticking-guard.patch
@@ -31,10 +31,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 606dee544c669dcaa0eb02808c5786545b5519eb..f14aab66d200828952b647fa8424caec757a9e9c 100644
+index 6bc70c1d53049a1f75268ab9944bfb1557ca74ee..a9c2f419200483673f6743ed94af110a8e875e71 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -784,7 +784,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -788,7 +788,19 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
entity.stopRiding();
}
@@ -56,7 +56,7 @@ index 606dee544c669dcaa0eb02808c5786545b5519eb..f14aab66d200828952b647fa8424caec
}
}
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index a2513f58d6a19aef1f43fb120f6d78e53a3b129b..9e72ed6ed0c5acb69f23652dce473e914455c412 100644
+index 19a9b37bad1d465440047cbde9a00b12ba5d9a4b..b62ee276e2176da439ac2f4da4501861da746004 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -1489,10 +1489,10 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
diff --git a/leaf-server/minecraft-patches/features/0022-Make-book-writing-configurable.patch b/leaf-server/minecraft-patches/features/0022-Make-book-writing-configurable.patch
index 7c711e3d..6167db18 100644
--- a/leaf-server/minecraft-patches/features/0022-Make-book-writing-configurable.patch
+++ b/leaf-server/minecraft-patches/features/0022-Make-book-writing-configurable.patch
@@ -22,10 +22,10 @@ you to easily disable books, should you want to preemptively remove this
functionality before additional exploits are found.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 9041830c19e2899479e1519488faba5c416ccd88..3c5b1cf6d47738d232282abe7f7f24c40b7bb387 100644
+index aeb43902a09ef9c1b137964065780be3e87648f4..383652f0bd32fca3551db85fb6ac42a0e326836e 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -1225,6 +1225,11 @@ public class ServerGamePacketListenerImpl
+@@ -1255,6 +1255,11 @@ public class ServerGamePacketListenerImpl
@Override
public void handleEditBook(ServerboundEditBookPacket packet) {
diff --git a/leaf-server/minecraft-patches/features/0023-Reduce-in-wall-checks.patch b/leaf-server/minecraft-patches/features/0023-Reduce-in-wall-checks.patch
index 895a2ca0..fcd3b6e1 100644
--- a/leaf-server/minecraft-patches/features/0023-Reduce-in-wall-checks.patch
+++ b/leaf-server/minecraft-patches/features/0023-Reduce-in-wall-checks.patch
@@ -28,10 +28,10 @@ but is so much cheaper than the suffocation check that it's worth
keeping it.
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index f019571b4b6b5e2d1953030911449a02e459591c..85759f8fe3892e0af3cbbd836defc9ee4b2705f6 100644
+index e174c7b8c637e6983cf0778e6956d8d11e9cd7d1..dc7d53e93a49297e3a5e1204025b3a50e73fba4e 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -419,7 +419,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -433,7 +433,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (this.isAlive() && this.level() instanceof ServerLevel serverLevel1) {
boolean flag = this instanceof Player;
@@ -43,7 +43,7 @@ index f019571b4b6b5e2d1953030911449a02e459591c..85759f8fe3892e0af3cbbd836defc9ee
this.hurtServer(serverLevel1, this.damageSources().inWall(), 1.0F);
} else if (flag && !serverLevel1.getWorldBorder().isWithinBounds(this.getBoundingBox())) {
double d = serverLevel1.getWorldBorder().getDistanceToBorder(this) + serverLevel1.getWorldBorder().getDamageSafeZone();
-@@ -1367,6 +1370,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1399,6 +1402,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
return this.getHealth() <= 0.0F;
}
diff --git a/leaf-server/minecraft-patches/features/0026-Make-saving-fireworks-configurable.patch b/leaf-server/minecraft-patches/features/0026-Make-saving-fireworks-configurable.patch
index 4fb57e07..cdefde85 100644
--- a/leaf-server/minecraft-patches/features/0026-Make-saving-fireworks-configurable.patch
+++ b/leaf-server/minecraft-patches/features/0026-Make-saving-fireworks-configurable.patch
@@ -20,10 +20,10 @@ launcher can very easily fill a chunk.
Prevent saving Fireworks so that chunk unloads will wipe a chunks fireworks in this case.
diff --git a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
-index e0e193078e550225e163149638bf9e053c0531f8..70197071db4e46cd93579d92ff2f8aa7a49083cb 100644
+index d8dc196ef92e97f831cf97cd1536a46f81f9d5d1..8d29c5c7f651176639363f5227a386679f5b67f3 100644
--- a/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
+++ b/net/minecraft/world/entity/projectile/FireworkRocketEntity.java
-@@ -354,4 +354,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
+@@ -350,4 +350,11 @@ public class FireworkRocketEntity extends Projectile implements ItemSupplier {
double d1 = entity.position().z - this.position().z;
return DoubleDoubleImmutablePair.of(d, d1);
}
diff --git a/leaf-server/minecraft-patches/features/0027-Reduce-hopper-item-checks.patch b/leaf-server/minecraft-patches/features/0027-Reduce-hopper-item-checks.patch
index f269e436..4d58edea 100644
--- a/leaf-server/minecraft-patches/features/0027-Reduce-hopper-item-checks.patch
+++ b/leaf-server/minecraft-patches/features/0027-Reduce-hopper-item-checks.patch
@@ -17,10 +17,10 @@ Licensed under: MIT (https://opensource.org/licenses/MIT)
Only do an item "suck in" action once per second
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
-index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..bf2f81232ac40218c6d0241b7a0a26cb2272e06b 100644
+index 51804b611f469f2ab53e455e8c633b867b00cc88..fcb1f6806908eb66592dc52f2b57286498cf7032 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
-@@ -150,7 +150,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -148,7 +148,13 @@ public class ItemEntity extends Entity implements TraceableEntity {
}
// CraftBukkit end
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
@@ -34,7 +34,7 @@ index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..bf2f81232ac40218c6d0241b7a0a26cb
}
// Paper end - EAR 2
-@@ -234,9 +240,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -232,9 +238,31 @@ public class ItemEntity extends Entity implements TraceableEntity {
}
// CraftBukkit end
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
@@ -67,10 +67,10 @@ index 6c0ebfb2be4e8b884456a2aa3d5fdc87e45a0e3c..bf2f81232ac40218c6d0241b7a0a26cb
@Override
public BlockPos getBlockPosBelowThatAffectsMyMovement() {
diff --git a/net/minecraft/world/entity/vehicle/MinecartHopper.java b/net/minecraft/world/entity/vehicle/MinecartHopper.java
-index a56d9cdeb6589a053ffaaf2cd599a98ae0a0989a..df5eda70d1d2eafcd32606fb93bb62409e5a8943 100644
+index 41a6ec508a10a49a37539d2f10171d15c233b280..fb099517927f3c2699a348ea7692772c5420b8d1 100644
--- a/net/minecraft/world/entity/vehicle/MinecartHopper.java
+++ b/net/minecraft/world/entity/vehicle/MinecartHopper.java
-@@ -22,6 +22,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
+@@ -23,6 +23,7 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
private static final boolean DEFAULT_ENABLED = true;
private boolean enabled = true;
private boolean consumedItemThisFrame = false;
@@ -78,7 +78,7 @@ index a56d9cdeb6589a053ffaaf2cd599a98ae0a0989a..df5eda70d1d2eafcd32606fb93bb6240
public MinecartHopper(EntityType extends MinecartHopper> entityType, Level level) {
super(entityType, level);
-@@ -150,4 +151,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
+@@ -151,4 +152,12 @@ public class MinecartHopper extends AbstractMinecartContainer implements Hopper
}
// Paper end
@@ -105,7 +105,7 @@ index 484c2ba2752fbf3ad929e46c2f078e906f6f0637..6ced5a7e27703a7cf5a7495dc3a1a290
double getLevelY();
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
-index 15d4f60942c0cc612c1468b4c0fda886867a67cb..c2c7832fbb207ecfd23c7a086ef72db9648f48f9 100644
+index 800b7e78ae989868ed0b9e060c80dcd002759412..2a49f65a2ea13414099b636f463239ced4fbb5f6 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -544,7 +544,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
diff --git a/leaf-server/minecraft-patches/features/0029-Variable-entity-wake-up-duration.patch b/leaf-server/minecraft-patches/features/0029-Variable-entity-wake-up-duration.patch
index 19302a20..e52c1709 100644
--- a/leaf-server/minecraft-patches/features/0029-Variable-entity-wake-up-duration.patch
+++ b/leaf-server/minecraft-patches/features/0029-Variable-entity-wake-up-duration.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
-index 602ed4c5556723e54a80ccc3481af31109d5a0a6..bdbbbc5e0c06c71584e7514623d0c8be168befd7 100644
+index eee9c41e40402e52b73f34a734b4cbdeb6cfbc22..63ff39f3db2e695c8a14b021045c17f6d3d2f23d 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
-@@ -53,27 +53,41 @@ public final class ActivationRange {
+@@ -59,27 +59,41 @@ public final class ActivationRange {
if (entity.activationType == ActivationType.VILLAGER) {
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
world.wakeupInactiveRemainingVillagers--;
diff --git a/leaf-server/minecraft-patches/features/0030-Do-not-process-chat-commands-before-player-has-joine.patch b/leaf-server/minecraft-patches/features/0030-Do-not-process-chat-commands-before-player-has-joine.patch
index 6c4203db..ec2db5e7 100644
--- a/leaf-server/minecraft-patches/features/0030-Do-not-process-chat-commands-before-player-has-joine.patch
+++ b/leaf-server/minecraft-patches/features/0030-Do-not-process-chat-commands-before-player-has-joine.patch
@@ -13,10 +13,10 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index 6f60f5e92628e744a22b3d3f83c2010d8a4661be..6d1542dc07fdf1f3384e8e6d1dacca5f8c3f0b69 100644
+index ffae3e45ba88e8b733e77b87a45cc27b9ecf8c19..684a15babe984c84703e2c6af7a461f75959312d 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -414,6 +414,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -425,6 +425,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
public boolean sentListPacket = false;
public boolean supressTrackerForLogin = false; // Paper - Fire PlayerJoinEvent when Player is actually ready
// CraftBukkit end
@@ -25,10 +25,10 @@ index 6f60f5e92628e744a22b3d3f83c2010d8a4661be..6d1542dc07fdf1f3384e8e6d1dacca5f
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 3c5b1cf6d47738d232282abe7f7f24c40b7bb387..99670d9b8450f8c5a04927a18720468d4ddc1bec 100644
+index 383652f0bd32fca3551db85fb6ac42a0e326836e..29466047936ed44f57cb4bcb8f1bff0bdad81827 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2399,7 +2399,7 @@ public class ServerGamePacketListenerImpl
+@@ -2433,7 +2433,7 @@ public class ServerGamePacketListenerImpl
this.disconnectAsync(Component.translatable("multiplayer.disconnect.illegal_characters"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_CHARACTERS); // Paper - add proper async disconnect
} else if (this.player.isRemoved() || this.player.getChatVisibility() == ChatVisiblity.HIDDEN) { // CraftBukkit - dead men tell no tales
this.send(new ClientboundSystemChatPacket(Component.translatable("chat.disabled.options").withStyle(ChatFormatting.RED), false));
@@ -38,15 +38,15 @@ index 3c5b1cf6d47738d232282abe7f7f24c40b7bb387..99670d9b8450f8c5a04927a18720468d
// CraftBukkit start
if (sync) {
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index a0949d8256823731f6f7da30e74dfd0205dde380..2c025382d041c43486ae975a3f687bc4cddf8d62 100644
+index 898d9ab963a6cf1db8edf4657a65335d15f271c4..77dbd115d99d8f8e2c01ea69ca297ced06b19c12 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -334,6 +334,8 @@ public abstract class PlayerList {
- return;
- }
+@@ -335,6 +335,8 @@ public abstract class PlayerList {
+ return;
+ }
-+ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
++ player.didPlayerJoinEvent = true; // Gale - EMC - do not process chat/commands before player has joined
+
- final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
+ final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
- if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
+ if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
diff --git a/leaf-server/minecraft-patches/features/0031-Do-not-log-invalid-statistics.patch b/leaf-server/minecraft-patches/features/0031-Do-not-log-invalid-statistics.patch
index 0b132f1b..cc94aa67 100644
--- a/leaf-server/minecraft-patches/features/0031-Do-not-log-invalid-statistics.patch
+++ b/leaf-server/minecraft-patches/features/0031-Do-not-log-invalid-statistics.patch
@@ -13,28 +13,31 @@ As part of: EmpireCraft (https://github.com/starlis/empirecraft)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/stats/ServerStatsCounter.java b/net/minecraft/stats/ServerStatsCounter.java
-index b147df7479da03fae19294587cded62c210ea590..dfaead7716ac718bcdbf4c3021aed1b57676af50 100644
+index 16e06085ed3c0f6a0b35c730b63b75824f44a905..195ff539c9cb4b2a0640555fc4b59df39e06c90d 100644
--- a/net/minecraft/stats/ServerStatsCounter.java
+++ b/net/minecraft/stats/ServerStatsCounter.java
-@@ -117,16 +117,18 @@ public class ServerStatsCounter extends StatsCounter {
- this.stats
- .putAll(
- STATS_CODEC.parse(dynamic.get("stats").orElseEmptyMap())
-- .resultOrPartial(string -> LOGGER.error("Failed to parse statistics for {}: {}", this.file, string))
-+ .resultOrPartial(string -> {
-+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Failed to parse statistics for {}: {}", this.file, string); // Gale - EMC - do not log invalid statistics
-+ })
- .orElse(Map.of())
- );
- return;
- }
-
+@@ -108,7 +108,7 @@ public class ServerStatsCounter extends StatsCounter {
+ try {
+ JsonElement jsonElement = StrictJsonParser.parse(json);
+ if (jsonElement.isJsonNull()) {
- LOGGER.error("Unable to parse Stat data from {}", this.file);
-+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file); // Gale - EMC - do not log invalid statistics
++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file);
+ return;
}
- } catch (IOException | JsonParseException var8) {
-- LOGGER.error("Unable to parse Stat data from {}", this.file, var8);
-+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file, var8); // Gale - EMC - do not log invalid statistics
+
+@@ -117,11 +117,13 @@ public class ServerStatsCounter extends StatsCounter {
+ this.stats
+ .putAll(
+ STATS_CODEC.parse(dynamic.get("stats").orElseEmptyMap())
+- .resultOrPartial(string -> LOGGER.error("Failed to parse statistics for {}: {}", this.file, string))
++ .resultOrPartial(string -> {
++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Failed to parse statistics for {}: {}", this.file, string); // Gale - EMC - do not log invalid statistics
++ })
+ .orElse(Map.of())
+ );
+ } catch (JsonParseException var5) {
+- LOGGER.error("Unable to parse Stat data from {}", this.file, var5);
++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.invalidStatistics) LOGGER.error("Unable to parse Stat data from {}", this.file, var5);
}
}
diff --git a/leaf-server/minecraft-patches/features/0032-Do-not-log-empty-message-warnings.patch b/leaf-server/minecraft-patches/features/0032-Do-not-log-empty-message-warnings.patch
index ae1a99da..b337d1d7 100644
--- a/leaf-server/minecraft-patches/features/0032-Do-not-log-empty-message-warnings.patch
+++ b/leaf-server/minecraft-patches/features/0032-Do-not-log-empty-message-warnings.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 99670d9b8450f8c5a04927a18720468d4ddc1bec..c06d9ae722455cd2315097b2b0333d2adb51f9ad 100644
+index 29466047936ed44f57cb4bcb8f1bff0bdad81827..767dfc71ad9aafffa01ed27fdeac2c19bbba6f37 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2481,7 +2481,7 @@ public class ServerGamePacketListenerImpl
+@@ -2515,7 +2515,7 @@ public class ServerGamePacketListenerImpl
// CraftBukkit start
String rawMessage = message.signedContent();
if (rawMessage.isEmpty()) {
diff --git a/leaf-server/minecraft-patches/features/0033-Do-not-log-ignored-advancements.patch b/leaf-server/minecraft-patches/features/0033-Do-not-log-ignored-advancements.patch
index 7d9c06a7..59a14d2e 100644
--- a/leaf-server/minecraft-patches/features/0033-Do-not-log-ignored-advancements.patch
+++ b/leaf-server/minecraft-patches/features/0033-Do-not-log-ignored-advancements.patch
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
-index 52e0ae233a7b1c88bfbbc27707ef5f18453ec865..741894ed6df81fce41d9f906d6198d038aab44a8 100644
+index fdeca41d40705f28864ce4443d01cd872c9d51b0..63c32ae544d87177c9b3e1f1b73eeb9be904eebf 100644
--- a/net/minecraft/server/PlayerAdvancements.java
+++ b/net/minecraft/server/PlayerAdvancements.java
-@@ -148,7 +148,7 @@ public class PlayerAdvancements {
+@@ -147,7 +147,7 @@ public class PlayerAdvancements {
AdvancementHolder advancementHolder = advancementManager.get(path);
if (advancementHolder == null) {
if (!path.getNamespace().equals(ResourceLocation.DEFAULT_NAMESPACE)) return; // CraftBukkit
diff --git a/leaf-server/minecraft-patches/features/0035-Do-not-log-unrecognized-recipes.patch b/leaf-server/minecraft-patches/features/0035-Do-not-log-unrecognized-recipes.patch
index 30e52b66..8a366998 100644
--- a/leaf-server/minecraft-patches/features/0035-Do-not-log-unrecognized-recipes.patch
+++ b/leaf-server/minecraft-patches/features/0035-Do-not-log-unrecognized-recipes.patch
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/stats/ServerRecipeBook.java b/net/minecraft/stats/ServerRecipeBook.java
-index 2158b20458de63897131db3d425d1efcc358cace..40944806284921bd084901c94595fefa78b2c20b 100644
+index 7e1a06b97ab0c744e910df1c82454ce5686c1870..5e12e021d6e3b01f0d209c23255fab0a232f69cb 100644
--- a/net/minecraft/stats/ServerRecipeBook.java
+++ b/net/minecraft/stats/ServerRecipeBook.java
-@@ -133,7 +133,7 @@ public class ServerRecipeBook extends RecipeBook {
+@@ -102,7 +102,7 @@ public class ServerRecipeBook extends RecipeBook {
private void loadRecipes(List>> recipes, Consumer>> output, Predicate>> isRecognized) {
for (ResourceKey> resourceKey : recipes) {
if (!isRecognized.test(resourceKey)) {
diff --git a/leaf-server/minecraft-patches/features/0037-Do-not-log-Not-Secure-marker.patch b/leaf-server/minecraft-patches/features/0037-Do-not-log-Not-Secure-marker.patch
index be2fe680..fdc2b986 100644
--- a/leaf-server/minecraft-patches/features/0037-Do-not-log-Not-Secure-marker.patch
+++ b/leaf-server/minecraft-patches/features/0037-Do-not-log-Not-Secure-marker.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 2c025382d041c43486ae975a3f687bc4cddf8d62..2a4e52ba074dfd6dce98669282de729eae7d272a 100644
+index 8017266123a91e5bd46ae0d39a35cf2e6cbb390f..c5ab58c890c7c55f2ad75560269663d3fd5a6aa3 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -1278,7 +1278,7 @@ public abstract class PlayerList {
+@@ -1274,7 +1274,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function unsignedFunction) {
// Paper end
boolean flag = this.verifyChatTrusted(message);
diff --git a/leaf-server/minecraft-patches/features/0044-Make-arrow-movement-resetting-despawn-counter-config.patch b/leaf-server/minecraft-patches/features/0044-Make-arrow-movement-resetting-despawn-counter-config.patch
index 91ac3100..3873ff46 100644
--- a/leaf-server/minecraft-patches/features/0044-Make-arrow-movement-resetting-despawn-counter-config.patch
+++ b/leaf-server/minecraft-patches/features/0044-Make-arrow-movement-resetting-despawn-counter-config.patch
@@ -42,10 +42,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
-index 595cdb7d013eb0b9282b133a22f51ee865d18623..b8f04b98d2117cfb274a5888d34b9836d3390ae9 100644
+index 11adb3eacce9d46f15e6c5216e9b2494df158baf..fe738894f82480c6a7c2ff8fde895daaa0ba8bc6 100644
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
-@@ -352,7 +352,7 @@ public abstract class AbstractArrow extends Projectile {
+@@ -349,7 +349,7 @@ public abstract class AbstractArrow extends Projectile {
this.setInGround(false);
Vec3 deltaMovement = this.getDeltaMovement();
this.setDeltaMovement(deltaMovement.multiply(this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F, this.random.nextFloat() * 0.2F));
diff --git a/leaf-server/minecraft-patches/features/0045-Make-logging-login-locations-configurable.patch b/leaf-server/minecraft-patches/features/0045-Make-logging-login-locations-configurable.patch
index 7bd5bede..75163b53 100644
--- a/leaf-server/minecraft-patches/features/0045-Make-logging-login-locations-configurable.patch
+++ b/leaf-server/minecraft-patches/features/0045-Make-logging-login-locations-configurable.patch
@@ -13,20 +13,21 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 2a4e52ba074dfd6dce98669282de729eae7d272a..be324f5085c1cceb3d4c37bc73d0ee5ac761a99c 100644
+index b30d4d49edb36cefe6d59bf23440091cb789a6ac..292895796388df9f753c4423fffea35174df5c0b 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -402,7 +402,13 @@ public abstract class PlayerList {
- scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
- }
- // Paper end - Configurable player collision
-+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
-+ // Gale start - JettPack - make logging login location configurable
-+ } else {
-+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId());
-+ }
-+ // Gale end - JettPack - make logging login location configurable
- // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
- if (player.isDeadOrDying()) {
- net.minecraft.core.Holder plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
+@@ -403,7 +403,13 @@ public abstract class PlayerList {
+ scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
+ }
+ // Paper end - Configurable player collision
+- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
++ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
++ PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
++ // Gale start - JettPack - make logging login location configurable
++ } else {
++ PlayerList.LOGGER.info("{}[{}] logged in with entity id {}", player.getName().getString(), loggableAddress, player.getId());
++ }
++ // Gale end - JettPack - make logging login location configurable
+ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
+ if (player.isDeadOrDying()) {
+ net.minecraft.core.Holder plains = serverLevel.registryAccess().lookupOrThrow(net.minecraft.core.registries.Registries.BIOME)
diff --git a/leaf-server/minecraft-patches/features/0046-Reduce-array-allocations.patch b/leaf-server/minecraft-patches/features/0046-Reduce-array-allocations.patch
index 180ecf90..a45f86c4 100644
--- a/leaf-server/minecraft-patches/features/0046-Reduce-array-allocations.patch
+++ b/leaf-server/minecraft-patches/features/0046-Reduce-array-allocations.patch
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
-index ba20e87d2105ce53cdaf4049de2388d05fcd1b56..7b686d834e4eb36be5758b0e0a846a70d1e2294b 100644
+index b2bcfb3557a0326fd7ec1059f95d6da4568dfd80..fee4a7452178c274eb835d758b718d8e874d79d0 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/ChunkEntitySlices.java
-@@ -378,7 +378,6 @@ public final class ChunkEntitySlices {
+@@ -400,7 +400,6 @@ public final class ChunkEntitySlices {
private static final class BasicEntityList {
@@ -24,7 +24,7 @@ index ba20e87d2105ce53cdaf4049de2388d05fcd1b56..7b686d834e4eb36be5758b0e0a846a70
private static final int DEFAULT_CAPACITY = 4;
private E[] storage;
-@@ -389,7 +388,7 @@ public final class ChunkEntitySlices {
+@@ -411,7 +410,7 @@ public final class ChunkEntitySlices {
}
public BasicEntityList(final int cap) {
@@ -33,7 +33,7 @@ index ba20e87d2105ce53cdaf4049de2388d05fcd1b56..7b686d834e4eb36be5758b0e0a846a70
}
public boolean isEmpty() {
-@@ -401,7 +400,7 @@ public final class ChunkEntitySlices {
+@@ -423,7 +422,7 @@ public final class ChunkEntitySlices {
}
private void resize() {
@@ -43,10 +43,10 @@ index ba20e87d2105ce53cdaf4049de2388d05fcd1b56..7b686d834e4eb36be5758b0e0a846a70
} else {
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
-index 26207443b1223119c03db478d7e816d9cdf8e618..bbd1c262674b42eb9ea2830acb8bf94182f971f9 100644
+index 82824ae7ffbced513a8bcace684af94916135e84..47a600204ae1a1e7f166284dc26a1a7afc1dbecc 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/level/entity/server/ServerEntityLookup.java
-@@ -14,10 +14,8 @@ import net.minecraft.world.level.entity.LevelCallback;
+@@ -19,10 +19,8 @@ import net.minecraft.world.level.entity.LevelCallback;
public final class ServerEntityLookup extends EntityLookup {
@@ -56,8 +56,8 @@ index 26207443b1223119c03db478d7e816d9cdf8e618..bbd1c262674b42eb9ea2830acb8bf941
- public final ReferenceList trackerEntities = new ReferenceList<>(EMPTY_ENTITY_ARRAY); // Moonrise - entity tracker
+ public final ReferenceList trackerEntities = new ReferenceList<>(me.titaniumtown.ArrayConstants.emptyEntityArray); // Moonrise - entity tracker // Gale - JettPack - reduce array allocations
- public ServerEntityLookup(final ServerLevel world, final LevelCallback worldCallback) {
- super(world, worldCallback);
+ // Vanilla does not increment ticket timeouts if the chunk is progressing in generation. They made this change in 1.21.6 so that the ender pearl
+ // ticket does not expire if the chunk fails to generate before the timeout expires. Rather than blindly adjusting the entire system behavior
diff --git a/net/minecraft/nbt/ByteArrayTag.java b/net/minecraft/nbt/ByteArrayTag.java
index 6fbb131b472a3093b137d8ced9889777a133bd5b..cecfd48f57bc11b84c18b4e5a723228fd3c18e23 100644
--- a/net/minecraft/nbt/ByteArrayTag.java
@@ -125,11 +125,24 @@ index 8ef16f98996b1ec0c9c3f158248ac95f1b07328f..6780b2493d625603b74e635c4996bb83
private static final Codec PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments);
private static final Codec ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC)
.xmap(
+diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
+index 5df8ee3955593e70f0e67e91431e464d177bdeeb..b7581796dda77bca66c03e421f2a83a920f44ef1 100644
+--- a/net/minecraft/server/level/ServerEntity.java
++++ b/net/minecraft/server/level/ServerEntity.java
+@@ -366,7 +366,7 @@ public class ServerEntity {
+ if (this.entity instanceof LivingEntity livingEntityx) {
+ List> list = Lists.newArrayList();
+
+- for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) {
++ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
+ ItemStack itemBySlot = livingEntityx.getItemBySlot(equipmentSlot);
+ if (!itemBySlot.isEmpty()) {
+ list.add(Pair.of(equipmentSlot, itemBySlot.copy()));
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index f14aab66d200828952b647fa8424caec757a9e9c..4da7c02024a5ad8ba34bad2adfd8228f11f39eee 100644
+index a9c2f419200483673f6743ed94af110a8e875e71..617eb1b9d30d499124576c5d7cb5152571cc6b84 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -1220,7 +1220,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1228,7 +1228,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public static List getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
@@ -138,11 +151,24 @@ index f14aab66d200828952b647fa8424caec757a9e9c..4da7c02024a5ad8ba34bad2adfd8228f
return ret;
}
+diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
+index 45e4a7356e51e9c50d440782b55d1cbfc4b76f96..f752dceea48ed8264ae4cb60fdf2390f0e5019e1 100644
+--- a/net/minecraft/server/level/ServerPlayer.java
++++ b/net/minecraft/server/level/ServerPlayer.java
+@@ -1166,7 +1166,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ this.getInventory().getNonEquipmentItems().set(i, net.minecraft.world.item.ItemStack.EMPTY);
+ }
+ }
+- for (final EquipmentSlot value : EquipmentSlot.VALUES) {
++ for (final EquipmentSlot value : EquipmentSlot.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
+ if (this.getInventory().equipment.has(value) && !shouldKeepDeathEventItem(event, this.getInventory().equipment.get(value))) {
+ this.getInventory().equipment.set(value, net.minecraft.world.item.ItemStack.EMPTY);
+ }
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index c06d9ae722455cd2315097b2b0333d2adb51f9ad..68368928035ffa8fb7b12a7e3c6a7f9686379933 100644
+index f953fa6adb112bc9da34cfb72045975f87c5f021..a07310aebd8406af27864358e15715fcc7694329 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2771,7 +2771,7 @@ public class ServerGamePacketListenerImpl
+@@ -2784,7 +2784,7 @@ public class ServerGamePacketListenerImpl
// SPIGOT-7136 - Allays
if (target instanceof net.minecraft.world.entity.animal.allay.Allay || target instanceof net.minecraft.world.entity.animal.horse.AbstractHorse) { // Paper - Fix horse armor desync
ServerGamePacketListenerImpl.this.send(new net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket(
@@ -177,6 +203,32 @@ index 09fd99c9cbd23b5f3c899bfb00c9b89651948ed8..5c1103ef028e5ffe6ce0eadc861dd3b2
private final int size;
public ZeroBitStorage(int size) {
+diff --git a/net/minecraft/world/entity/ConversionType.java b/net/minecraft/world/entity/ConversionType.java
+index 3eea236bd1fd401fefdf7c5cc553a3db335029c7..3739272cbc73b7c4f15a2fbe874905cf06175f64 100644
+--- a/net/minecraft/world/entity/ConversionType.java
++++ b/net/minecraft/world/entity/ConversionType.java
+@@ -37,7 +37,7 @@ public enum ConversionType {
+ }
+
+ if (conversionParams.keepEquipment()) {
+- for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) {
++ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
+ ItemStack itemBySlot = oldMob.getItemBySlot(equipmentSlot);
+ if (!itemBySlot.isEmpty()) {
+ newMob.setItemSlot(equipmentSlot, itemBySlot.copyAndClear());
+diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
+index 31a939facfd4b506a2cff3cee6e4b86a12b1d343..e8cd21863aff0aa37b2e6c23a3c60335a3d279cb 100644
+--- a/net/minecraft/world/entity/Entity.java
++++ b/net/minecraft/world/entity/Entity.java
+@@ -3077,7 +3077,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ }
+
+ private boolean attemptToShearEquipment(Player player, InteractionHand hand, ItemStack stack, Mob mob) {
+- for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES) {
++ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
+ ItemStack itemBySlot = mob.getItemBySlot(equipmentSlot);
+ Equippable equippable = itemBySlot.get(DataComponents.EQUIPPABLE);
+ if (equippable != null
diff --git a/net/minecraft/world/entity/EquipmentSlot.java b/net/minecraft/world/entity/EquipmentSlot.java
index 0e44397c9d53ff30a96c9e8e392a363fa9ae0c55..dbf31389f0e9796c80afbffddf6a20cbaf184e6e 100644
--- a/net/minecraft/world/entity/EquipmentSlot.java
@@ -198,7 +250,7 @@ index 0e44397c9d53ff30a96c9e8e392a363fa9ae0c55..dbf31389f0e9796c80afbffddf6a20cb
private final EquipmentSlot.Type type;
private final int index;
diff --git a/net/minecraft/world/entity/EquipmentSlotGroup.java b/net/minecraft/world/entity/EquipmentSlotGroup.java
-index 381e0a1c0af7e339713ed1df1c2f21121c1bbd0f..4e847c3f9d761da5dda11dec60582d9d9e630b37 100644
+index 381e0a1c0af7e339713ed1df1c2f21121c1bbd0f..1ebcab2ee9898a618ad76b18491be19859629192 100644
--- a/net/minecraft/world/entity/EquipmentSlotGroup.java
+++ b/net/minecraft/world/entity/EquipmentSlotGroup.java
@@ -24,6 +24,7 @@ public enum EquipmentSlotGroup implements StringRepresentable, Iterable BY_ID = ByIdMap.continuous(
equipmentSlotGroup -> equipmentSlotGroup.id, values(), ByIdMap.OutOfBoundsStrategy.ZERO
);
+@@ -38,7 +39,7 @@ public enum EquipmentSlotGroup implements StringRepresentable, Iterable lootTable, Map createForAllSlots(float dropChance) {
+- return createForAllSlots(List.of(EquipmentSlot.values()), dropChance);
++ return createForAllSlots(List.of(EquipmentSlot.VALUES_ARRAY), dropChance); // Gale - JettPack - reduce array allocations
+ }
+
+ private static Map createForAllSlots(List equipmentSlots, float dropChance) {
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
-index 24ecca78dc1140b6fc47d59f2acefca6bc2b0220..18bddc3db6f0e06f1811f2c409f207db2f462f63 100644
+index cf283389d9263ba29720bf296a778be9eaf308a7..8803c03846828b532bd2b6e164c589995907c96b 100644
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
-@@ -1173,7 +1173,7 @@ public final class ItemStack implements DataComponentHolder {
+@@ -1153,7 +1153,7 @@ public final class ItemStack implements DataComponentHolder {
private void addAttributeTooltips(Consumer tooltipAdder, TooltipDisplay tooltipDisplay, @Nullable Player player) {
if (tooltipDisplay.shows(DataComponents.ATTRIBUTE_MODIFIERS)) {
- for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.values()) {
+ for (EquipmentSlotGroup equipmentSlotGroup : EquipmentSlotGroup.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
MutableBoolean mutableBoolean = new MutableBoolean(true);
- this.forEachModifier(equipmentSlotGroup, (attribute, modifier) -> {
- if (mutableBoolean.isTrue()) {
+ this.forEachModifier(
+ equipmentSlotGroup,
diff --git a/net/minecraft/world/item/crafting/ShapedRecipePattern.java b/net/minecraft/world/item/crafting/ShapedRecipePattern.java
index bfda76974ea8d4397e2c2ebf5bdcb5d7e5f0bab5..cabbc93409ca99180d115e2f23419ee1824d5801 100644
--- a/net/minecraft/world/item/crafting/ShapedRecipePattern.java
@@ -236,10 +310,10 @@ index bfda76974ea8d4397e2c2ebf5bdcb5d7e5f0bab5..cabbc93409ca99180d115e2f23419ee1
String[] strings = new String[pattern.size() - i3 - i2];
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index 9e72ed6ed0c5acb69f23652dce473e914455c412..439b8619e9f0ed3dc1974ba2ee6214b63447ea96 100644
+index b62ee276e2176da439ac2f4da4501861da746004..97d227249405c8648b8b5e9bcca5a3f202f7b903 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
-@@ -1832,7 +1832,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -1825,7 +1825,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
public org.bukkit.entity.Entity[] getChunkEntities(int chunkX, int chunkZ) {
ca.spottedleaf.moonrise.patches.chunk_system.level.entity.ChunkEntitySlices slices = ((ServerLevel)this).moonrise$getEntityLookup().getChunk(chunkX, chunkZ);
if (slices == null) {
@@ -248,7 +322,7 @@ index 9e72ed6ed0c5acb69f23652dce473e914455c412..439b8619e9f0ed3dc1974ba2ee6214b6
}
List ret = new java.util.ArrayList<>();
-@@ -1843,7 +1843,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -1836,7 +1836,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
}
}
@@ -289,7 +363,7 @@ index a647d76d365a60b95a3eb7927ac426bf70d417f3..7977ecd013c55359f179b4b7f895099b
@Override
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-index c5b3b5e5f621f8db152aa190374ae0fe567d6828..f6c3dac2a2a17760ab7015fe75c5a4dd04c11319 100644
+index 36a72a11d28f99bfe85868461925b778cc01478e..ca2cab797fc16f0961ce994fcb45029589b3c370 100644
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -44,7 +44,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -301,3 +375,16 @@ index c5b3b5e5f621f8db152aa190374ae0fe567d6828..f6c3dac2a2a17760ab7015fe75c5a4dd
private static final int[] SLOTS_FOR_DOWN = new int[]{2, 1};
private static final int[] SLOTS_FOR_SIDES = new int[]{1};
public static final int DATA_LIT_DURATION = 1;
+diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+index c8f23011a8942a5be970c606f67142cbd202b97e..98971a07757d29d6926a0aa05f229b8020af42b6 100644
+--- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
++++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+@@ -258,7 +258,7 @@ public class MapItemSavedData extends SavedData {
+ }
+
+ private static boolean hasMapInvisibilityItemEquipped(Player player) {
+- for (EquipmentSlot equipmentSlot : EquipmentSlot.values()) {
++ for (EquipmentSlot equipmentSlot : EquipmentSlot.VALUES_ARRAY) { // Gale - JettPack - reduce array allocations
+ if (equipmentSlot != EquipmentSlot.MAINHAND
+ && equipmentSlot != EquipmentSlot.OFFHAND
+ && player.getItemBySlot(equipmentSlot).is(ItemTags.MAP_INVISIBILITY_EQUIPMENT)) {
diff --git a/leaf-server/minecraft-patches/features/0047-Optimize-sun-burn-tick.patch b/leaf-server/minecraft-patches/features/0047-Optimize-sun-burn-tick.patch
index 271b77b8..eec9b97c 100644
--- a/leaf-server/minecraft-patches/features/0047-Optimize-sun-burn-tick.patch
+++ b/leaf-server/minecraft-patches/features/0047-Optimize-sun-burn-tick.patch
@@ -13,10 +13,10 @@ As part of: JettPack (https://gitlab.com/Titaniumtown/JettPack)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index e84081f571190fc00db07bdc9da349b9cfae142a..90f80877f25fd10a62d6ed273aa2ebb4b390f292 100644
+index 6714668563e3a7543765064d9824b93ec3924473..147b57bec7646eda5b9f3b1119ce7b9dfd7c328c 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -2017,10 +2017,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -2087,10 +2087,20 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@Deprecated
public float getLightLevelDependentMagicValue() {
@@ -39,10 +39,10 @@ index e84081f571190fc00db07bdc9da349b9cfae142a..90f80877f25fd10a62d6ed273aa2ebb4
public void absSnapTo(double x, double y, double z, float yRot, float xRot) {
this.absSnapTo(x, y, z);
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 7f5981f71e6380c09e40a0c80db6a77e74d5113d..6cc000611dc58a5487034ad87af4156059dd37d7 100644
+index 4d4b58b684ca115f4d8f672362d4c8252ef9481a..dcea538d00d3751b887c71450026ce2ced0093b1 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -1474,20 +1474,31 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1500,20 +1500,31 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
protected void playAttackSound() {
}
diff --git a/leaf-server/minecraft-patches/features/0049-Replace-game-rules-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0049-Replace-game-rules-map-with-optimized-collection.patch
index fd79f95c..5018a2ff 100644
--- a/leaf-server/minecraft-patches/features/0049-Replace-game-rules-map-with-optimized-collection.patch
+++ b/leaf-server/minecraft-patches/features/0049-Replace-game-rules-map-with-optimized-collection.patch
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java
-index 02bc5d83b92a594ec519f0a02b0517fdb4b9e954..a3a2d51cf53ce4dba8caaaf73967ae714ed16a36 100644
+index d5536dd40a1e9a2e05967652f690abbbca287852..966ca1e0e828e4176e12cbcf8c4a6b16489708de 100644
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
-@@ -277,7 +277,7 @@ public class GameRules {
+@@ -288,7 +288,7 @@ public class GameRules {
}
private GameRules(Map, GameRules.Value>> rules, FeatureFlagSet enabledFeatures) {
diff --git a/leaf-server/minecraft-patches/features/0050-Replace-AI-attributes-with-optimized-collections.patch b/leaf-server/minecraft-patches/features/0050-Replace-AI-attributes-with-optimized-collections.patch
index c2c4cae2..27225a8b 100644
--- a/leaf-server/minecraft-patches/features/0050-Replace-AI-attributes-with-optimized-collections.patch
+++ b/leaf-server/minecraft-patches/features/0050-Replace-AI-attributes-with-optimized-collections.patch
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
-index bed9b564c493cd84bf53fc49368fda736f3fbc2b..c61071e0019a18eb73223ed9b64619c9cb691896 100644
+index fdb02fc40579866167e8cc9bcefbd961588b53a6..58d8424262db14b2dca0b2c5a40748b6c0c18e83 100644
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
-@@ -14,9 +14,11 @@ import net.minecraft.nbt.ListTag;
+@@ -14,9 +14,11 @@ import net.minecraft.core.Holder;
import net.minecraft.resources.ResourceLocation;
public class AttributeMap {
diff --git a/leaf-server/minecraft-patches/features/0059-Check-frozen-ticks-before-landing-block.patch b/leaf-server/minecraft-patches/features/0059-Check-frozen-ticks-before-landing-block.patch
index b695ab4c..b4fad295 100644
--- a/leaf-server/minecraft-patches/features/0059-Check-frozen-ticks-before-landing-block.patch
+++ b/leaf-server/minecraft-patches/features/0059-Check-frozen-ticks-before-landing-block.patch
@@ -13,10 +13,10 @@ As part of: Lithium (https://github.com/CaffeineMC/lithium-fabric)
Licensed under: LGPL-3.0 (https://www.gnu.org/licenses/lgpl-3.0.html)
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index 85759f8fe3892e0af3cbbd836defc9ee4b2705f6..a542e1dfa41ec2ea1a979dc27d0155d5c08fd7cc 100644
+index dc7d53e93a49297e3a5e1204025b3a50e73fba4e..586b79bc844b098336c6d3bf342b570396e6af88 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -521,10 +521,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -535,10 +535,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
protected void tryAddFrost() {
@@ -28,7 +28,7 @@ index 85759f8fe3892e0af3cbbd836defc9ee4b2705f6..a542e1dfa41ec2ea1a979dc27d0155d5
if (attribute == null) {
return;
}
-@@ -532,7 +531,6 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -546,7 +545,6 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
float f = -0.05F * this.getPercentFrozen();
attribute.addTransientModifier(new AttributeModifier(SPEED_MODIFIER_POWDER_SNOW_ID, f, AttributeModifier.Operation.ADD_VALUE));
}
diff --git a/leaf-server/minecraft-patches/features/0060-Faster-chunk-serialization.patch b/leaf-server/minecraft-patches/features/0060-Faster-chunk-serialization.patch
index 99bab90a..d23bd021 100644
--- a/leaf-server/minecraft-patches/features/0060-Faster-chunk-serialization.patch
+++ b/leaf-server/minecraft-patches/features/0060-Faster-chunk-serialization.patch
@@ -88,10 +88,10 @@ index 5c1103ef028e5ffe6ce0eadc861dd3b2c8f3ed9f..828ced8aa5665c6f5d0b121947719c4e
+ @Override public void compact(net.minecraft.world.level.chunk.Palette srcPalette, net.minecraft.world.level.chunk.Palette dstPalette, short[] out) {} // Gale - Lithium - faster chunk serialization
}
diff --git a/net/minecraft/world/level/chunk/PalettedContainer.java b/net/minecraft/world/level/chunk/PalettedContainer.java
-index 7da7ce0fd19896593e63edc88b492c02f926bba0..f6bb9bd4d000958610ec3e6733b54c5f7a020da5 100644
+index a251ba67644cd02a0b00d7c8b0e2c64aa5e26291..59d48e7dc0911557c57a7e07f5f9013c010165bd 100644
--- a/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/net/minecraft/world/level/chunk/PalettedContainer.java
-@@ -25,6 +25,22 @@ import net.minecraft.util.ThreadingDetector;
+@@ -24,6 +24,22 @@ import net.minecraft.util.ThreadingDetector;
import net.minecraft.util.ZeroBitStorage;
public class PalettedContainer implements PaletteResize, PalettedContainerRO {
@@ -114,7 +114,7 @@ index 7da7ce0fd19896593e63edc88b492c02f926bba0..f6bb9bd4d000958610ec3e6733b54c5f
private static final int MIN_PALETTE_BITS = 0;
private final PaletteResize dummyPaletteResize = (bits, objectAdded) -> 0;
public final IdMap registry;
-@@ -344,28 +360,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer
+@@ -343,28 +359,54 @@ public class PalettedContainer implements PaletteResize, PalettedContainer
public synchronized PalettedContainerRO.PackedData pack(IdMap registry, PalettedContainer.Strategy strategy) { // Paper - synchronize
this.acquire();
@@ -184,7 +184,7 @@ index 7da7ce0fd19896593e63edc88b492c02f926bba0..f6bb9bd4d000958610ec3e6733b54c5f
}
private static void swapPalette(int[] bits, IntUnaryOperator operator) {
-@@ -405,13 +447,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer
+@@ -404,13 +446,33 @@ public class PalettedContainer implements PaletteResize, PalettedContainer
@Override
public void count(PalettedContainer.CountConsumer countConsumer) {
diff --git a/leaf-server/minecraft-patches/features/0063-Skip-entity-move-if-movement-is-zero.patch b/leaf-server/minecraft-patches/features/0063-Skip-entity-move-if-movement-is-zero.patch
index ca65b368..bd8bcd23 100644
--- a/leaf-server/minecraft-patches/features/0063-Skip-entity-move-if-movement-is-zero.patch
+++ b/leaf-server/minecraft-patches/features/0063-Skip-entity-move-if-movement-is-zero.patch
@@ -13,10 +13,10 @@ As part of: VMP (https://github.com/RelativityMC/VMP-fabric)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 90f80877f25fd10a62d6ed273aa2ebb4b390f292..c0a75b84360cdaf89bb23380210de7c39f51ab2b 100644
+index 147b57bec7646eda5b9f3b1119ce7b9dfd7c328c..cb444ab1a3bef2ee5544b99dd513229a1aae4b84 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -240,6 +240,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -260,6 +260,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public float yRotO;
public float xRotO;
private AABB bb = INITIAL_AABB;
@@ -24,7 +24,7 @@ index 90f80877f25fd10a62d6ed273aa2ebb4b390f292..c0a75b84360cdaf89bb23380210de7c3
public boolean onGround;
public boolean horizontalCollision;
public boolean verticalCollision;
-@@ -1064,6 +1065,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1086,6 +1087,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// Paper end - detailed watchdog information
public void move(MoverType type, Vec3 movement) {
@@ -36,7 +36,7 @@ index 90f80877f25fd10a62d6ed273aa2ebb4b390f292..c0a75b84360cdaf89bb23380210de7c3
final Vec3 originalMovement = movement; // Paper - Expose pre-collision velocity
// Paper start - detailed watchdog information
ca.spottedleaf.moonrise.common.util.TickThread.ensureTickThread("Cannot move an entity off-main");
-@@ -4155,6 +4161,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4376,6 +4382,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public final void setBoundingBox(AABB bb) {
diff --git a/leaf-server/minecraft-patches/features/0068-Hide-flames-on-entities-with-fire-resistance.patch b/leaf-server/minecraft-patches/features/0068-Hide-flames-on-entities-with-fire-resistance.patch
index 18fa2c99..4a989f55 100644
--- a/leaf-server/minecraft-patches/features/0068-Hide-flames-on-entities-with-fire-resistance.patch
+++ b/leaf-server/minecraft-patches/features/0068-Hide-flames-on-entities-with-fire-resistance.patch
@@ -13,10 +13,10 @@ As part of: Slice (https://github.com/Cryptite/Slice)
Licensed under: MIT (https://opensource.org/licenses/MIT)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index c0a75b84360cdaf89bb23380210de7c39f51ab2b..e7c9b51a115d975ea4a6aaa8e051ac7daf58395e 100644
+index cb444ab1a3bef2ee5544b99dd513229a1aae4b84..ffdeaab1fa7540eddea5997d9ab1eb6faddb7128 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -864,7 +864,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -886,7 +886,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.checkBelowWorld();
if (!this.level().isClientSide) {
diff --git a/leaf-server/minecraft-patches/features/0070-Reduce-block-destruction-packet-allocations.patch b/leaf-server/minecraft-patches/features/0070-Reduce-block-destruction-packet-allocations.patch
index bdbbd494..15a83d16 100644
--- a/leaf-server/minecraft-patches/features/0070-Reduce-block-destruction-packet-allocations.patch
+++ b/leaf-server/minecraft-patches/features/0070-Reduce-block-destruction-packet-allocations.patch
@@ -13,10 +13,10 @@ As part of: SportPaper (https://github.com/Electroid/SportPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 4da7c02024a5ad8ba34bad2adfd8228f11f39eee..d99ac6eb59e10ff6af841c4496ee46fbfbf57c22 100644
+index 617eb1b9d30d499124576c5d7cb5152571cc6b84..ad114ca013e0d09d40755acbe916586868a519ed 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -1557,6 +1557,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1579,6 +1579,15 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@Override
public void destroyBlockProgress(int breakerId, BlockPos pos, int progress) {
@@ -32,7 +32,7 @@ index 4da7c02024a5ad8ba34bad2adfd8228f11f39eee..d99ac6eb59e10ff6af841c4496ee46fb
// CraftBukkit start
Player breakerPlayer = null;
Entity entity = this.getEntity(breakerId);
-@@ -1573,7 +1582,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1595,7 +1604,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
.callEvent();
}
// Paper end - Add BlockBreakProgressUpdateEvent
@@ -41,7 +41,7 @@ index 4da7c02024a5ad8ba34bad2adfd8228f11f39eee..d99ac6eb59e10ff6af841c4496ee46fb
if (serverPlayer != null && serverPlayer.level() == this && serverPlayer.getId() != breakerId) {
double d = pos.getX() - serverPlayer.getX();
double d1 = pos.getY() - serverPlayer.getY();
-@@ -1584,7 +1593,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1606,7 +1615,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
}
// CraftBukkit end
if (d * d + d1 * d1 + d2 * d2 < 1024.0) {
diff --git a/leaf-server/minecraft-patches/features/0071-Spread-out-sending-all-player-info.patch b/leaf-server/minecraft-patches/features/0071-Spread-out-sending-all-player-info.patch
index 586228b5..da79e576 100644
--- a/leaf-server/minecraft-patches/features/0071-Spread-out-sending-all-player-info.patch
+++ b/leaf-server/minecraft-patches/features/0071-Spread-out-sending-all-player-info.patch
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index be324f5085c1cceb3d4c37bc73d0ee5ac761a99c..1ea70e63db1d5f05cdbace8be48160b26a480fee 100644
+index 186e0a6e565d29572f5d4771a68e4a9cb2bd45de..91d4a5f7685296e397c1c341813542fd13eaf168 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -114,6 +114,7 @@ public abstract class PlayerList {
+@@ -113,6 +113,7 @@ public abstract class PlayerList {
private final MinecraftServer server;
public final List players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
private final Map playersByUUID = Maps.newHashMap();
@@ -48,15 +48,15 @@ index be324f5085c1cceb3d4c37bc73d0ee5ac761a99c..1ea70e63db1d5f05cdbace8be48160b2
private final UserBanList bans = new UserBanList(USERBANLIST_FILE);
private final IpBanList ipBans = new IpBanList(IPBANLIST_FILE);
private final ServerOpList ops = new ServerOpList(OPLIST_FILE);
-@@ -311,6 +312,7 @@ public abstract class PlayerList {
- this.players.add(player);
- this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
- this.playersByUUID.put(player.getUUID(), player);
-+ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
- // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below
- // Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
- player.supressTrackerForLogin = true;
-@@ -582,6 +584,7 @@ public abstract class PlayerList {
+@@ -312,6 +313,7 @@ public abstract class PlayerList {
+ this.players.add(player);
+ this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
+ this.playersByUUID.put(player.getUUID(), player);
++ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
+ // this.broadcastAll(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(List.of(player))); // CraftBukkit - replaced with loop below
+ // Paper start - Fire PlayerJoinEvent when Player is actually ready; correctly register player BEFORE PlayerJoinEvent, so the entity is valid and doesn't require tick delay hacks
+ player.supressTrackerForLogin = true;
+@@ -585,6 +587,7 @@ public abstract class PlayerList {
player.getAdvancements().stopListening();
this.players.remove(player);
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
@@ -64,15 +64,15 @@ index be324f5085c1cceb3d4c37bc73d0ee5ac761a99c..1ea70e63db1d5f05cdbace8be48160b2
this.server.getCustomBossEvents().onPlayerDisconnect(player);
UUID uuid = player.getUUID();
ServerPlayer serverPlayer = this.playersByUUID.get(uuid);
-@@ -724,6 +727,7 @@ public abstract class PlayerList {
+@@ -720,6 +723,7 @@ public abstract class PlayerList {
player.stopRiding(); // CraftBukkit
this.players.remove(player);
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
+ this.removeFromSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
- player.serverLevel().removePlayerImmediately(player, reason);
+ player.level().removePlayerImmediately(player, reason);
// TeleportTransition teleportTransition = player.findRespawnPositionAndUseSpawnBlock(!keepInventory, TeleportTransition.DO_NOTHING);
// ServerLevel level = teleportTransition.newLevel();
-@@ -802,6 +806,7 @@ public abstract class PlayerList {
+@@ -798,6 +802,7 @@ public abstract class PlayerList {
this.players.add(serverPlayer);
this.playersByName.put(serverPlayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT), serverPlayer); // Spigot
this.playersByUUID.put(serverPlayer.getUUID(), serverPlayer);
@@ -80,7 +80,7 @@ index be324f5085c1cceb3d4c37bc73d0ee5ac761a99c..1ea70e63db1d5f05cdbace8be48160b2
}
// serverPlayer.initInventoryMenu();
serverPlayer.setHealth(serverPlayer.getHealth());
-@@ -904,18 +909,58 @@ public abstract class PlayerList {
+@@ -900,18 +905,58 @@ public abstract class PlayerList {
}
public void tick() {
@@ -145,16 +145,16 @@ index be324f5085c1cceb3d4c37bc73d0ee5ac761a99c..1ea70e63db1d5f05cdbace8be48160b2
public void broadcastAll(Packet packet, net.minecraft.world.entity.player.Player entityhuman) {
for (ServerPlayer entityplayer : this.players) { // Paper - replace for i with for each for thread safety
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
-index 248ee263a853d1d3148746a63ba422115853f6a1..8032eae3256625e90313edb4fa132b19d52ba0a0 100644
+index abb19f08c736151fa5c6986e31eb4cf545073586..5e01ae7c5d11777868d72589019ad11305c9acdd 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
-@@ -221,9 +221,12 @@ public abstract class Player extends LivingEntity {
+@@ -230,9 +230,12 @@ public abstract class Player extends LivingEntity {
}
// CraftBukkit end
+ public final int sendAllPlayerInfoBucketIndex; // Gale - Purpur - spread out sending all player info
+
- public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
+ public Player(Level level, GameProfile gameProfile) {
super(EntityType.PLAYER, level);
this.setUUID(gameProfile.getId());
+ this.sendAllPlayerInfoBucketIndex = Math.floorMod(this.uuid.hashCode(), net.minecraft.server.players.PlayerList.SEND_PLAYER_INFO_INTERVAL); // Gale - Purpur - spread out sending all player info
diff --git a/leaf-server/minecraft-patches/features/0072-Optimize-player-list-for-sending-player-info.patch b/leaf-server/minecraft-patches/features/0072-Optimize-player-list-for-sending-player-info.patch
index 278fe12e..9f290372 100644
--- a/leaf-server/minecraft-patches/features/0072-Optimize-player-list-for-sending-player-info.patch
+++ b/leaf-server/minecraft-patches/features/0072-Optimize-player-list-for-sending-player-info.patch
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 1ea70e63db1d5f05cdbace8be48160b26a480fee..4a3f06a4677348c1277669514f9acef7a4334f1d 100644
+index 91d4a5f7685296e397c1c341813542fd13eaf168..8e7c77174750807bc0e925b100ff73a7bedd76e9 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -913,10 +913,19 @@ public abstract class PlayerList {
+@@ -909,10 +909,19 @@ public abstract class PlayerList {
ServerPlayer[] sendAllPlayerInfoBucket = this.sendAllPlayerInfoBuckets[this.sendAllPlayerInfoIn];
if (sendAllPlayerInfoBucket != null) {
diff --git a/leaf-server/minecraft-patches/features/0073-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch b/leaf-server/minecraft-patches/features/0073-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch
index c9f8a4a5..1e7dd2aa 100644
--- a/leaf-server/minecraft-patches/features/0073-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch
+++ b/leaf-server/minecraft-patches/features/0073-Skip-PlayerCommandSendEvent-if-there-are-no-listener.patch
@@ -37,22 +37,22 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
-index f1a637272a8e4ec9c46209ca6b58a4905c925a86..006b5502eda66909a971278aa5751ec187bb8a3c 100644
+index f6017445c495c65fc71b10d2a8ed4f5d3d225668..e00624a738e65ab14ec68a8d0e7861522fa32e82 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
-@@ -496,6 +496,7 @@ public class Commands {
- private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) {
+@@ -498,6 +498,7 @@ public class Commands {
+ private void runSync(ServerPlayer player, java.util.Collection bukkit, RootCommandNode rootCommandNode) {
// Paper end - Perf: Async command map building
new com.destroystokyo.paper.event.brigadier.AsyncPlayerSendCommandsEvent(player.getBukkitEntity(), (RootCommandNode) rootCommandNode, true).callEvent(); // Paper - Brigadier API
+ if (org.bukkit.event.player.PlayerCommandSendEvent.getHandlerList().getRegisteredListeners().length > 0) { // Gale - Purpur - skip PlayerCommandSendEvent if there are no listeners
org.bukkit.event.player.PlayerCommandSendEvent event = new org.bukkit.event.player.PlayerCommandSendEvent(player.getBukkitEntity(), new java.util.LinkedHashSet<>(bukkit));
event.getPlayer().getServer().getPluginManager().callEvent(event);
-@@ -506,6 +507,7 @@ public class Commands {
+@@ -508,6 +509,7 @@ public class Commands {
}
}
// CraftBukkit end
+ } // Gale - Purpur - skip PlayerCommandSendEvent if there are no listeners
-
- player.connection.send(new ClientboundCommandsPacket(rootCommandNode));
+ player.connection.send(new ClientboundCommandsPacket(rootCommandNode, COMMAND_NODE_INSPECTOR));
}
+
diff --git a/leaf-server/minecraft-patches/features/0074-Send-multiple-keep-alive-packets.patch b/leaf-server/minecraft-patches/features/0074-Send-multiple-keep-alive-packets.patch
index fe676a4b..085254bb 100644
--- a/leaf-server/minecraft-patches/features/0074-Send-multiple-keep-alive-packets.patch
+++ b/leaf-server/minecraft-patches/features/0074-Send-multiple-keep-alive-packets.patch
@@ -37,18 +37,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-index 776ff13b399fa01bf3900280cf1b5782370732a0..c4f4c21f32e2aba79e15315d73124c803bb1223a 100644
+index ccbf60f546974692c2c840f4bce87e2c95d1866c..ddc89e8960f7dc2f75f0e03ccbe6eda96a0499e2 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-@@ -40,6 +40,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
- private long keepAliveChallenge;
+@@ -38,10 +38,11 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ public final Connection connection; // Paper
+ private final boolean transferred;
+ //private long keepAliveTime; // Paper - improve keepalives
+- //private boolean keepAlivePending; // Paper - improve keepalives
++ private boolean keepAlivePending; // Paper - improve keepalives // Purpur - Alternative Keepalive Handling
+ //private long keepAliveChallenge; // Paper - improve keepalives
private long closedListenerTime;
private boolean closed = false;
+ private it.unimi.dsi.fastutil.longs.LongList keepAlives = new it.unimi.dsi.fastutil.longs.LongArrayList(); // Gale - Purpur - send multiple keep-alive packets
- private int latency;
+ private volatile int latency; // Paper - improve keepalives - make volatile
private volatile boolean suspendFlushingOnServerThread = false;
// CraftBukkit start
-@@ -48,7 +49,10 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -50,7 +51,10 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
public boolean processedDisconnect;
// CraftBukkit end
public final java.util.Map packCallbacks = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - adventure resource pack callbacks
@@ -60,55 +65,59 @@ index 776ff13b399fa01bf3900280cf1b5782370732a0..c4f4c21f32e2aba79e15315d73124c80
protected static final net.minecraft.resources.ResourceLocation MINECRAFT_BRAND = net.minecraft.resources.ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
public ServerCommonPacketListenerImpl(MinecraftServer server, Connection connection, CommonListenerCookie cookie, net.minecraft.server.level.ServerPlayer player) { // CraftBukkit
-@@ -117,6 +121,16 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
-
- @Override
- public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
+@@ -122,6 +126,18 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ // Paper start - improve keepalives
+ long now = System.nanoTime();
+ net.minecraft.server.level.ServerPlayer.PendingKeepAlive pending = this.player.pendingKeepAlives.peek();
+ // Gale start - Purpur - send multiple keep-alive packets
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().misc.keepalive.sendMultiple) {
+ if (this.keepAlivePending && !keepAlives.isEmpty() && keepAlives.contains(packet.getId())) {
+ int ping = (int) (Util.getMillis() - packet.getId());
-+ this.latency = (this.latency * 3 + ping) / 4;
++ int updatedLatency = (this.latency * 3 + ping) / 4;
++ this.latency = updatedLatency;
+ this.keepAlivePending = false;
+ this.keepAlives.clear(); // We got a valid response, let's roll with it and forget the rest
+ }
++ return;
+ } else {
+ // Gale end - Purpur - send multiple keep-alive packets
- if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
- int i = (int)(Util.getMillis() - this.keepAliveTime);
- this.latency = (this.latency * 3 + i) / 4;
-@@ -124,6 +138,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
- } else if (!this.isSingleplayerOwner()) {
- this.disconnectAsync(TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT); // Paper - add proper async disconnect
+ if (pending != null && pending.challengeId() == packet.getId()) {
+ this.player.pendingKeepAlives.remove(pending);
+
+@@ -133,6 +149,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ this.latency = this.player.pingCalculator5s.getAvgLatencyMS();
+ return;
}
+ } // Gale - Purpur - send multiple keep-alive packets
- }
- @Override
-@@ -240,6 +255,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
- // Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
- // This should effectively place the keepalive handling back to "as it was" before 1.12.2
- final long elapsedTime = millis - this.keepAliveTime;
+ for (java.util.Iterator itr = this.player.pendingKeepAlives.iterator(); itr.hasNext();) {
+ net.minecraft.server.level.ServerPlayer.PendingKeepAlive ka = itr.next();
+@@ -274,6 +291,23 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ protected void keepConnectionAlive() {
+ long millis = Util.getMillis();
+ // Paper start - improve keepalives
+ // Gale start - Purpur - send multiple keep-alive packets
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().misc.keepalive.sendMultiple) {
-+ if (elapsedTime >= 1000L) { // 1 second
-+ if (this.keepAlivePending && !this.processedDisconnect && this.keepAlives.size() >= KEEPALIVE_LIMIT_IN_SECONDS) {
-+ LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName());
-+ this.disconnect(TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
-+ } else if (this.checkIfClosed(millis)) {
-+ this.keepAlivePending = true;
-+ this.keepAliveTime = millis; // hijack this field for 1 second intervals
-+ this.keepAlives.add(millis); // millis is ID
-+ this.send(new ClientboundKeepAlivePacket(millis));
++ if (this.checkIfClosed(millis) && !this.processedDisconnect) {
++ long currTime = System.nanoTime();
++ if ((currTime - this.player.lastKeepAliveTx) >= java.util.concurrent.TimeUnit.SECONDS.toNanos(1L)) { // 1 second
++ this.player.lastKeepAliveTx = currTime;
++ if (this.keepAlivePending && !this.processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
++ this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
++ } else if (this.checkIfClosed(millis)) {
++ this.keepAlivePending = true;
++ this.keepAlives.add(millis); // currentTime is ID
++ this.send(new ClientboundKeepAlivePacket(millis));
++ }
+ }
+ }
+ } else {
+ // Gale end - Purpur - send multiple keep-alive packets
- if (!this.isSingleplayerOwner() && elapsedTime >= 15000L) { // use vanilla's 15000L between keep alive packets
- if (this.keepAlivePending) {
- if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
-@@ -253,6 +283,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
- this.send(new ClientboundKeepAlivePacket(this.keepAliveChallenge));
+ if (this.checkIfClosed(millis) && !this.processedDisconnect) {
+ long currTime = System.nanoTime();
+
+@@ -292,6 +326,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+ // Paper end - improve keepalives
}
}
+ } // Gale - Purpur - send multiple keep-alive packets
diff --git a/leaf-server/minecraft-patches/features/0077-Don-t-load-chunks-to-activate-climbing-entities.patch b/leaf-server/minecraft-patches/features/0077-Don-t-load-chunks-to-activate-climbing-entities.patch
index 35a945b0..72b85ebc 100644
--- a/leaf-server/minecraft-patches/features/0077-Don-t-load-chunks-to-activate-climbing-entities.patch
+++ b/leaf-server/minecraft-patches/features/0077-Don-t-load-chunks-to-activate-climbing-entities.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index e7c9b51a115d975ea4a6aaa8e051ac7daf58395e..430dec39410c4445326488b537dcd103715b16f4 100644
+index ffdeaab1fa7540eddea5997d9ab1eb6faddb7128..cf13f3956ddcf350e6b2ea3b34d9a2bae214cb22 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -4665,6 +4665,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4874,6 +4874,16 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return this.inBlockState;
}
@@ -28,10 +28,10 @@ index e7c9b51a115d975ea4a6aaa8e051ac7daf58395e..430dec39410c4445326488b537dcd103
return this.chunkPosition;
}
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index a542e1dfa41ec2ea1a979dc27d0155d5c08fd7cc..ed96755b15e9a9d3dc05ccc8afc730437fe035ff 100644
+index 586b79bc844b098336c6d3bf342b570396e6af88..af6633b8b3efceeb3bf101e069ddc1c65c7f6bfb 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -2097,8 +2097,17 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -2129,8 +2129,17 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
public boolean onClimbableCached() {
if (!this.blockPosition().equals(this.lastClimbingPosition)) {
@@ -51,7 +51,7 @@ index a542e1dfa41ec2ea1a979dc27d0155d5c08fd7cc..ed96755b15e9a9d3dc05ccc8afc73043
}
return this.cachedOnClimbable;
-@@ -2106,11 +2115,28 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -2138,11 +2147,28 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
// Gale end - Airplane - cache on climbable check
public boolean onClimbable() {
diff --git a/leaf-server/minecraft-patches/features/0078-Broadcast-crit-animations-as-the-entity-being-critte.patch b/leaf-server/minecraft-patches/features/0078-Broadcast-crit-animations-as-the-entity-being-critte.patch
index e40061fd..f1edc252 100644
--- a/leaf-server/minecraft-patches/features/0078-Broadcast-crit-animations-as-the-entity-being-critte.patch
+++ b/leaf-server/minecraft-patches/features/0078-Broadcast-crit-animations-as-the-entity-being-critte.patch
@@ -13,25 +13,25 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index 6d1542dc07fdf1f3384e8e6d1dacca5f8c3f0b69..13ab4a70f8208c998edeeddffea0b694d2b1347f 100644
+index f752dceea48ed8264ae4cb60fdf2390f0e5019e1..9b715b5848b33dd023feccfa93c08924c92fbe13 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -2079,12 +2079,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2181,12 +2181,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@Override
public void crit(Entity entityHit) {
-- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 4));
+- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 4));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
-+ var level = this.serverLevel();
++ var level = this.level();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 4));
-+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
++ // Gale end - MultiPaper - broadcast crit animations as the entity being critte
}
@Override
public void magicCrit(Entity entityHit) {
-- this.serverLevel().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 5));
+- this.level().getChunkSource().broadcastAndSend(this, new ClientboundAnimatePacket(entityHit, 5));
+ // Gale start - MultiPaper - broadcast crit animations as the entity being critted
-+ var level = this.serverLevel();
++ var level = this.level();
+ level.getChunkSource().broadcastAndSend(level.galeConfig().gameplayMechanics.fixes.broadcastCritAnimationsAsTheEntityBeingCritted ? entityHit : this, new ClientboundAnimatePacket(entityHit, 5));
+ // Gale end - MultiPaper - broadcast crit animations as the entity being critted
}
diff --git a/leaf-server/minecraft-patches/features/0081-Do-not-place-player-in-world-if-kicked-before-being-.patch b/leaf-server/minecraft-patches/features/0081-Do-not-place-player-in-world-if-kicked-before-being-.patch
index 51431019..ed7ad9ea 100644
--- a/leaf-server/minecraft-patches/features/0081-Do-not-place-player-in-world-if-kicked-before-being-.patch
+++ b/leaf-server/minecraft-patches/features/0081-Do-not-place-player-in-world-if-kicked-before-being-.patch
@@ -14,20 +14,20 @@ As part of: MultiPaper (https://github.com/MultiPaper/MultiPaper)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 4a3f06a4677348c1277669514f9acef7a4334f1d..d2dc48d5a42506716bcbe0854a860b1eaa3b5705 100644
+index ec9a9f87615e2130282551f9cc85d339c58bcbb1..0acfb86df4a350e41ea1646a38dad14d43f2cb1d 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -235,6 +235,13 @@ public abstract class PlayerList {
- org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation());
- this.cserver.getPluginManager().callEvent(ev);
+@@ -236,6 +236,13 @@ public abstract class PlayerList {
+ org.spigotmc.event.player.PlayerSpawnLocationEvent ev = new org.spigotmc.event.player.PlayerSpawnLocationEvent(spawnPlayer, spawnPlayer.getLocation());
+ this.cserver.getPluginManager().callEvent(ev);
-+ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in
-+ if (!connection.isConnected() || player.quitReason != null) {
-+ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - MultiPaper - do not place player in world if kicked before being spawned in - this patch was removed from Paper but might be useful later
-+ return;
-+ }
-+ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in
++ // Gale start - MultiPaper - do not place player in world if kicked before being spawned in
++ if (!connection.isConnected() || player.quitReason != null) {
++ /*pendingPlayers.remove(player.getUUID(), player);*/ // Gale - MultiPaper - do not place player in world if kicked before being spawned in - this patch was removed from Paper but might be useful later
++ return;
++ }
++ // Gale end - MultiPaper - do not place player in world if kicked before being spawned in
+
- org.bukkit.Location loc = ev.getSpawnLocation();
- serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle();
+ org.bukkit.Location loc = ev.getSpawnLocation();
+ serverLevel = ((org.bukkit.craftbukkit.CraftWorld) loc.getWorld()).getHandle();
diff --git a/leaf-server/minecraft-patches/features/0083-5-second-TPS-average.patch b/leaf-server/minecraft-patches/features/0083-5-second-TPS-average.patch
index e730af9b..d9edc767 100644
--- a/leaf-server/minecraft-patches/features/0083-5-second-TPS-average.patch
+++ b/leaf-server/minecraft-patches/features/0083-5-second-TPS-average.patch
@@ -37,10 +37,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 923fc9d611d46017cf7ac8e6de6cf0966e0ce9f9..32b8613c62971bc7481d5242ee15b84cb1b361a7 100644
+index f4daf7ed86e5987ca9da8229402a154b69599f56..3cab16e4fef4acc7e56d60e1f2221806ad7ef355 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1091,6 +1091,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop DATA_PLAYER_MAIN_HAND = SynchedEntityData.defineId(Player.class, EntityDataSerializers.BYTE);
protected static final EntityDataAccessor DATA_SHOULDER_LEFT = SynchedEntityData.defineId(Player.class, EntityDataSerializers.COMPOUND_TAG);
protected static final EntityDataAccessor DATA_SHOULDER_RIGHT = SynchedEntityData.defineId(Player.class, EntityDataSerializers.COMPOUND_TAG);
@@ -56,7 +56,7 @@ index 8032eae3256625e90313edb4fa132b19d52ba0a0..2aca22f978daa826bf7ac2b25f13bf30
public static final int CLIENT_LOADED_TIMEOUT_TIME = 60;
private static final short DEFAULT_SLEEP_TIMER = 0;
private static final float DEFAULT_EXPERIENCE_PROGRESS = 0.0F;
-@@ -322,19 +323,23 @@ public abstract class Player extends LivingEntity {
+@@ -332,19 +333,23 @@ public abstract class Player extends LivingEntity {
this.moveCloak();
if (this instanceof ServerPlayer serverPlayer) {
this.foodData.tick(serverPlayer);
diff --git a/leaf-server/minecraft-patches/features/0086-For-collision-check-has-physics-before-same-vehicle.patch b/leaf-server/minecraft-patches/features/0086-For-collision-check-has-physics-before-same-vehicle.patch
index f1ccc1a9..d5dab9ac 100644
--- a/leaf-server/minecraft-patches/features/0086-For-collision-check-has-physics-before-same-vehicle.patch
+++ b/leaf-server/minecraft-patches/features/0086-For-collision-check-has-physics-before-same-vehicle.patch
@@ -16,10 +16,10 @@ As part of: Akarin (https://github.com/Akarin-project/Akarin)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 430dec39410c4445326488b537dcd103715b16f4..4a0650cfe07bfafff46c20aeb9e78c92b7f9ca13 100644
+index cf13f3956ddcf350e6b2ea3b34d9a2bae214cb22..09115720a4e5573960eaeeb16c96888c44e19a95 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -2161,8 +2161,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -2231,8 +2231,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public void push(Entity entity) {
diff --git a/leaf-server/minecraft-patches/features/0087-Skip-negligible-planar-movement-multiplication.patch b/leaf-server/minecraft-patches/features/0087-Skip-negligible-planar-movement-multiplication.patch
index fd41088e..0af097fd 100644
--- a/leaf-server/minecraft-patches/features/0087-Skip-negligible-planar-movement-multiplication.patch
+++ b/leaf-server/minecraft-patches/features/0087-Skip-negligible-planar-movement-multiplication.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 4a0650cfe07bfafff46c20aeb9e78c92b7f9ca13..8508f4b94f3e4532ce36baff4e68189540b0b59a 100644
+index 09115720a4e5573960eaeeb16c96888c44e19a95..e457dc20f76d813c32225733af0b29646d501202 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -1206,8 +1206,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1218,8 +1218,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
}
diff --git a/leaf-server/minecraft-patches/features/0088-Optimize-matching-item-checks.patch b/leaf-server/minecraft-patches/features/0088-Optimize-matching-item-checks.patch
index 05a718bb..6096cc1e 100644
--- a/leaf-server/minecraft-patches/features/0088-Optimize-matching-item-checks.patch
+++ b/leaf-server/minecraft-patches/features/0088-Optimize-matching-item-checks.patch
@@ -7,10 +7,10 @@ License: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
Gale - https://galemc.org
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
-index 18bddc3db6f0e06f1811f2c409f207db2f462f63..3ec4e0aa0777009b4ee75f6ae94732bd7e125619 100644
+index 8803c03846828b532bd2b6e164c589995907c96b..3acc2ae8533f19a6f9b2b6a1d96271f1047384a4 100644
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
-@@ -888,11 +888,11 @@ public final class ItemStack implements DataComponentHolder {
+@@ -868,11 +868,11 @@ public final class ItemStack implements DataComponentHolder {
}
public static boolean isSameItem(ItemStack stack, ItemStack other) {
diff --git a/leaf-server/minecraft-patches/features/0091-Reduce-RandomSource-instances.patch b/leaf-server/minecraft-patches/features/0091-Reduce-RandomSource-instances.patch
index f4a62b56..dac5e4e2 100644
--- a/leaf-server/minecraft-patches/features/0091-Reduce-RandomSource-instances.patch
+++ b/leaf-server/minecraft-patches/features/0091-Reduce-RandomSource-instances.patch
@@ -13,7 +13,7 @@ As part of: Patina (https://github.com/PatinaMC/Patina)
Licensed under: GPL-3.0 (https://www.gnu.org/licenses/gpl-3.0.html)
diff --git a/net/minecraft/server/commands/SpreadPlayersCommand.java b/net/minecraft/server/commands/SpreadPlayersCommand.java
-index d381800ad054be6b054dcca43fbe80d3f0c0c771..5904b9d985487ff8bd1f330667c43096aa298b98 100644
+index 92a820d48057ffe2ef35919341b6cdf605ca939e..b9b1bf351070cd2a744cdb683974fb2aa048d0d2 100644
--- a/net/minecraft/server/commands/SpreadPlayersCommand.java
+++ b/net/minecraft/server/commands/SpreadPlayersCommand.java
@@ -107,7 +107,7 @@ public class SpreadPlayersCommand {
@@ -26,10 +26,10 @@ index d381800ad054be6b054dcca43fbe80d3f0c0c771..5904b9d985487ff8bd1f330667c43096
double d1 = center.y - maxRange;
double d2 = center.x + maxRange;
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index 13ab4a70f8208c998edeeddffea0b694d2b1347f..b3ffb2afda9ea5cafbab9f775d526af1940cfdca 100644
+index 9b715b5848b33dd023feccfa93c08924c92fbe13..99eaa04bfcd2d37d3e49513e20bb5037119ef84d 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -488,7 +488,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -562,7 +562,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
long l1 = l * l;
int i = l1 > 2147483647L ? Integer.MAX_VALUE : (int)l1;
int coprime = this.getCoprime(i);
@@ -52,10 +52,10 @@ index 0b8d279a53196f3998b1f6901738ca8e02ef7311..9add567d2ec2f5e9cd5bee84423c5a44
}
diff --git a/net/minecraft/world/entity/projectile/FishingHook.java b/net/minecraft/world/entity/projectile/FishingHook.java
-index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..6cfd384aea8c8e90b4e4ae08ece86d52640c95d7 100644
+index 5f3abbe943be394e9cb987945a238208940b5015..5b831ecd8f094bcae2ff50b96ccfc0d75b43a495 100644
--- a/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/net/minecraft/world/entity/projectile/FishingHook.java
-@@ -48,7 +48,7 @@ import org.slf4j.Logger;
+@@ -51,7 +51,7 @@ import org.slf4j.Logger;
public class FishingHook extends Projectile {
private static final Logger LOGGER = LogUtils.getLogger();
@@ -64,7 +64,7 @@ index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..6cfd384aea8c8e90b4e4ae08ece86d52
private boolean biting;
public int outOfWaterTime;
private static final int MAX_OUT_OF_WATER_TIME = 10;
-@@ -86,6 +86,7 @@ public class FishingHook extends Projectile {
+@@ -90,6 +90,7 @@ public class FishingHook extends Projectile {
this.minWaitTime = level.paperConfig().fishingTimeRange.minimum;
this.maxWaitTime = level.paperConfig().fishingTimeRange.maximum;
// Paper end - Configurable fishing time ranges
@@ -73,7 +73,7 @@ index ca5cd9354d53c6c05bd7ba50c6e1dbd1ed548f67..6cfd384aea8c8e90b4e4ae08ece86d52
public FishingHook(EntityType extends FishingHook> entityType, Level level) {
diff --git a/net/minecraft/world/entity/raid/Raid.java b/net/minecraft/world/entity/raid/Raid.java
-index 71166fbf93d62e8e1bff3db8161932ee2fc5ea86..c7ca8a71070f15c573a5748f1df9810af23febdb 100644
+index afcf185c4e2c0648c96a872fbe1fbebb6012d513..aaa990b01e886812cc1dbad819e922b23d08889c 100644
--- a/net/minecraft/world/entity/raid/Raid.java
+++ b/net/minecraft/world/entity/raid/Raid.java
@@ -121,7 +121,7 @@ public class Raid {
@@ -104,10 +104,10 @@ index 71166fbf93d62e8e1bff3db8161932ee2fc5ea86..c7ca8a71070f15c573a5748f1df9810a
for (int i3 = 0; i3 < i1; i3++) {
diff --git a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-index 8bb0926130a14351507b2b74feca42278c080381..f7884610d5a94bb1680c1ec8bd4f3ec917b8bc8a 100644
+index c8b577a5d5f059aed368fa082bc4518cc2dbd0b0..ac5ab4ae88c8188635f5784a10002a6cdcad49b6 100644
--- a/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
-@@ -246,7 +246,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
+@@ -248,7 +248,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
}
private static void spawnGatewayPortal(ServerLevel level, BlockPos pos, EndGatewayConfiguration config) {
diff --git a/leaf-server/minecraft-patches/features/0092-Reduce-skull-ItemStack-lookups-for-reduced-visibilit.patch b/leaf-server/minecraft-patches/features/0092-Reduce-skull-ItemStack-lookups-for-reduced-visibilit.patch
index 81fd4d23..c328a97e 100644
--- a/leaf-server/minecraft-patches/features/0092-Reduce-skull-ItemStack-lookups-for-reduced-visibilit.patch
+++ b/leaf-server/minecraft-patches/features/0092-Reduce-skull-ItemStack-lookups-for-reduced-visibilit.patch
@@ -18,10 +18,10 @@ this patch is focused around the sensors used for ai
delete the line of sight cache less often and use a faster nearby comparison
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index ed96755b15e9a9d3dc05ccc8afc730437fe035ff..befed81ecf698d27971d18fe2743562742e4e1d3 100644
+index af6633b8b3efceeb3bf101e069ddc1c65c7f6bfb..5025e1eb7be566c21b6228038fd6596f4ac53e9a 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -1008,15 +1008,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1033,15 +1033,16 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
if (lookingEntity != null) {
diff --git a/leaf-server/minecraft-patches/features/0095-Pufferfish-Optimize-mob-spawning.patch b/leaf-server/minecraft-patches/features/0095-Pufferfish-Optimize-mob-spawning.patch
index cc8eca55..390d99d6 100644
--- a/leaf-server/minecraft-patches/features/0095-Pufferfish-Optimize-mob-spawning.patch
+++ b/leaf-server/minecraft-patches/features/0095-Pufferfish-Optimize-mob-spawning.patch
@@ -22,18 +22,18 @@ and, in my opinion, worth the low risk of minor mob-spawning-related
inconsistencies.
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index c1b3d2b4c56b657ff51c8b27b4b80e0c0d01ddbe..18a0bf81562f61fd6ede72d51d836ae28e9226c3 100644
+index 25eaae9a6ba26f7b8e318526b1fb94c301e68c9d..45db35e085161b724a19c0d6f0a558c217fba9cd 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -285,6 +285,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
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
public static S spin(Function threadFunction) {
- AtomicReference atomicReference = new AtomicReference<>();
-@@ -1046,6 +1047,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop filteredSpawningCategories;
-@@ -557,7 +612,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -558,7 +613,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
// Paper end - PlayerNaturallySpawnCreaturesEvent
boolean flag = this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) != 0L && this.level.getLevelData().getGameTime() % this.level.ticksPerSpawnCategory.getLong(org.bukkit.entity.SpawnCategory.ANIMAL) == 0L; // CraftBukkit
@@ -159,7 +159,7 @@ index 3d7d336c2043b533012ee390e6da02ac4f64e1f2..e67196b815dad6baa823822285cff838
} else {
filteredSpawningCategories = List.of();
}
-@@ -572,7 +627,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -573,7 +628,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// Paper end - chunk tick iteration optimisation
for (LevelChunk levelChunk : list) {
@@ -168,7 +168,7 @@ index 3d7d336c2043b533012ee390e6da02ac4f64e1f2..e67196b815dad6baa823822285cff838
}
} finally {
list.clear();
-@@ -592,7 +647,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -593,7 +648,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
if (!spawnCategories.isEmpty()) {
diff --git a/leaf-server/minecraft-patches/features/0096-Pufferfish-Dynamic-Activation-of-Brain.patch b/leaf-server/minecraft-patches/features/0096-Pufferfish-Dynamic-Activation-of-Brain.patch
index f6d2ac4f..71c0dcd7 100644
--- a/leaf-server/minecraft-patches/features/0096-Pufferfish-Dynamic-Activation-of-Brain.patch
+++ b/leaf-server/minecraft-patches/features/0096-Pufferfish-Dynamic-Activation-of-Brain.patch
@@ -32,10 +32,10 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
-index bdbbbc5e0c06c71584e7514623d0c8be168befd7..f3ca86e09a4a076d143fb21eac529967ff004df4 100644
+index 63ff39f3db2e695c8a14b021045c17f6d3d2f23d..3c3fe6d2e46a811932143a782bb50f9a7c87c4d2 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
-@@ -173,6 +173,22 @@ public final class ActivationRange {
+@@ -179,6 +179,22 @@ public final class ActivationRange {
}
ActivationRange.activateEntity(entity);
@@ -58,7 +58,7 @@ index bdbbbc5e0c06c71584e7514623d0c8be168befd7..f3ca86e09a4a076d143fb21eac529967
}
}
}
-@@ -184,11 +200,11 @@ public final class ActivationRange {
+@@ -190,11 +206,11 @@ public final class ActivationRange {
*/
private static void activateEntity(final Entity entity) {
if (MinecraftServer.currentTick > entity.activatedTick) {
@@ -73,10 +73,10 @@ index bdbbbc5e0c06c71584e7514623d0c8be168befd7..f3ca86e09a4a076d143fb21eac529967
}
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index d99ac6eb59e10ff6af841c4496ee46fbfbf57c22..074869245407abb32775b17140e1ffadabc5fcd5 100644
+index ad114ca013e0d09d40755acbe916586868a519ed..3f70fca36f67fa421314ff92d372a97112a19025 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -771,6 +771,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -775,6 +775,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.entityTickList
.forEach(
entity -> {
@@ -85,10 +85,10 @@ index d99ac6eb59e10ff6af841c4496ee46fbfbf57c22..074869245407abb32775b17140e1ffad
if (!tickRateManager.isEntityFrozen(entity)) {
entity.checkDespawn();
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 8508f4b94f3e4532ce36baff4e68189540b0b59a..8370be95e4f0d1d3b99274fea415f77845ad5712 100644
+index e457dc20f76d813c32225733af0b29646d501202..57e669eeb2a05805b8ed81311344bc27292608f3 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -343,6 +343,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -364,6 +364,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public boolean fixedPose = false; // Paper - Expand Pose API
private final int despawnTime; // Paper - entity despawn time limit
public int totalEntityAge; // Paper - age-like counter for all entities
@@ -98,10 +98,10 @@ index 8508f4b94f3e4532ce36baff4e68189540b0b59a..8370be95e4f0d1d3b99274fea415f778
// Paper start - EAR 2
public final boolean defaultActivationState;
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
-index ed11697d81789ee6cd48ee2de2c9fcb8ff2be0d4..a1379aa8eaf84868ceb8b3762f7ca3b87a2d7785 100644
+index b87c6da5272becfa1159e8352f5be5491824f66f..9dc5a7e9fdb83d98c3554fea064b06f022da4496 100644
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
-@@ -1075,6 +1075,7 @@ public class EntityType implements FeatureElement, EntityTypeT
+@@ -1085,6 +1085,7 @@ public class EntityType implements FeatureElement, EntityTypeT
private final boolean canSpawnFarFromPlayer;
private final int clientTrackingRange;
private final int updateInterval;
@@ -110,10 +110,10 @@ index ed11697d81789ee6cd48ee2de2c9fcb8ff2be0d4..a1379aa8eaf84868ceb8b3762f7ca3b8
@Nullable
private Component description;
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 6cc000611dc58a5487034ad87af4156059dd37d7..7e466022af0f023b409462ed4d4f3a8aa80c4183 100644
+index dcea538d00d3751b887c71450026ce2ced0093b1..968422c673e23774f6b162ed9cdb02b9bb67f9a8 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -205,10 +205,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -208,10 +208,10 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Override
public void inactiveTick() {
super.inactiveTick();
@@ -126,7 +126,7 @@ index 6cc000611dc58a5487034ad87af4156059dd37d7..7e466022af0f023b409462ed4d4f3a8a
this.targetSelector.tick();
}
}
-@@ -717,10 +717,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -734,10 +734,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
this.sensing.tick();
int i = this.tickCount + this.getId();
if (i % 2 != 0 && this.tickCount > 1) {
@@ -159,10 +159,10 @@ index f6c673b1abe53afcb14fd68d590431027ed29f67..21deb221b87ecb70c8a0dc963ab79124
}
}
diff --git a/net/minecraft/world/entity/ai/goal/GoalSelector.java b/net/minecraft/world/entity/ai/goal/GoalSelector.java
-index b816b2de8eb327060ca6ea7c4afc17373fa77ff6..e82e32407cec6109b9c3b0106295217f4a3f4aa2 100644
+index 653c58c7637c46c8b46a5082f671324a2221d431..55f1c138039b80894f655d180192f5cb95e32778 100644
--- a/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/net/minecraft/world/entity/ai/goal/GoalSelector.java
-@@ -36,9 +36,13 @@ public class GoalSelector {
+@@ -34,9 +34,13 @@ public class GoalSelector {
}
// Paper start - EAR 2
@@ -179,10 +179,10 @@ index b816b2de8eb327060ca6ea7c4afc17373fa77ff6..e82e32407cec6109b9c3b0106295217f
public boolean hasTasks() {
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index fc2290a62c0a01cfa3143e77384f30e17d94f039..2ab261bba5f9e0babfc9072afd2ebbee0536041c 100644
+index de3bf0b62371f06ecb5d2035638e352ca0c06182..69500fa0b207fc3d5b1bc2bd665fa39f6725d23d 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -237,8 +237,10 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -222,8 +222,10 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
return 0.4F;
}
@@ -194,10 +194,10 @@ index fc2290a62c0a01cfa3143e77384f30e17d94f039..2ab261bba5f9e0babfc9072afd2ebbee
AllayAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-index d3d4d8b025480f9e2202157591319df3af43f9de..f54b854adedd58a37b5c38c63abc3fc94ed9ba80 100644
+index 6a5e9e9582e322aaa1555933de97e545ba74f8f4..3475ecbd95fac6c6b6e792a23cb15cdb3395985f 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-@@ -323,8 +323,10 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -325,8 +325,10 @@ public class Axolotl extends Animal implements Bucketable {
return true;
}
@@ -209,11 +209,11 @@ index d3d4d8b025480f9e2202157591319df3af43f9de..f54b854adedd58a37b5c38c63abc3fc9
AxolotlAi.updateActivity(this);
if (!this.isNoAi()) {
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index fdf40dc10aad108db6ca68fcfec9ecf48f76a9c1..bd80e58179fe577693fa419a77989b0db39abb04 100644
+index b8703409dd3dc8e3020ed81b44ce4812984c88c3..f5c9ef8909f3852fc7a203265ae057232fa403ad 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -199,8 +199,10 @@ public class Frog extends Animal {
- VariantUtils.readVariant(compound, this.registryAccess(), Registries.FROG_VARIANT).ifPresent(this::setVariant);
+@@ -200,8 +200,10 @@ public class Frog extends Animal {
+ VariantUtils.readVariant(input, Registries.FROG_VARIANT).ifPresent(this::setVariant);
}
+ private int behaviorTick = 0; // Pufferfish
@@ -224,10 +224,10 @@ index fdf40dc10aad108db6ca68fcfec9ecf48f76a9c1..bd80e58179fe577693fa419a77989b0d
FrogAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index faaa8197e8421c2bbdc2a8bbaae4f4d0820dbbe7..72c4403a4b5fa817f91dbcd842d4b7939a4834ab 100644
+index c1510a6f1146f446ed65a1f08984af6c29de439a..5392cb211a3dc841ab38710a4ef688bde7fbe067 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
-@@ -94,8 +94,10 @@ public class Tadpole extends AbstractFish {
+@@ -96,8 +96,10 @@ public class Tadpole extends AbstractFish {
return SoundEvents.TADPOLE_FLOP;
}
@@ -239,10 +239,10 @@ index faaa8197e8421c2bbdc2a8bbaae4f4d0820dbbe7..72c4403a4b5fa817f91dbcd842d4b793
TadpoleAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
-index 9047e75a5edf9fec2b73aec272284d8003793eaa..048e62b361e33b3edd5122fd4a47c5627491bcaf 100644
+index bdac4929db71a39fc02985109cedc9cd316ec3cc..2a72d7f422c340dabef11a6dc680358207bee637 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
-@@ -185,8 +185,10 @@ public class Goat extends Animal {
+@@ -186,8 +186,10 @@ public class Goat extends Animal {
return (Brain)super.getBrain();
}
@@ -254,10 +254,10 @@ index 9047e75a5edf9fec2b73aec272284d8003793eaa..048e62b361e33b3edd5122fd4a47c562
GoatAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-index 2989add9a4746646f06ec3f6c386ac5df4a64726..6691dc90c35d05a7c28c4e3ac887ed9d3bb88de9 100644
+index bde6f9d9d1cc7a5ee8334ee9207afae304ddcfa9..084f82a7baaa309aa80cc33b4c01e54cf6da4b42 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-@@ -157,8 +157,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -158,8 +158,10 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
return (Brain)super.getBrain();
}
@@ -269,10 +269,10 @@ index 2989add9a4746646f06ec3f6c386ac5df4a64726..6691dc90c35d05a7c28c4e3ac887ed9d
HoglinAi.updateActivity(this);
if (this.isConverting()) {
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
-index 27052ded60db7c3916de3f4c8b48227f53fd7249..634c518c105c8dc50838a4a6690641d82fd637fb 100644
+index 689f200554d8c03313b3d194f209c527f315c29a..3e6cbf0166486995f7adcbd7b99a8b8c919956cd 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
-@@ -315,8 +315,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -316,8 +316,10 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
return !this.cannotHunt;
}
@@ -284,10 +284,10 @@ index 27052ded60db7c3916de3f4c8b48227f53fd7249..634c518c105c8dc50838a4a6690641d8
PiglinAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index 67fdcbe05e8d5f4000255f753565591825f54f67..42ca4243d86ef4a14a9ce70da4b79f6c8eeb3a7d 100644
+index dd6666bd8b8df4148a1557627ce2a6ddab245ed6..6a9d3b749e251d3dac6fda13318bf5a0bf21f82b 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -277,8 +277,10 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -275,8 +275,10 @@ public class Warden extends Monster implements VibrationSystem {
}
}
@@ -299,10 +299,10 @@ index 67fdcbe05e8d5f4000255f753565591825f54f67..42ca4243d86ef4a14a9ce70da4b79f6c
super.customServerAiStep(level);
if ((this.tickCount + this.getId()) % 120 == 0) {
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
-index c62eee45d661b6f9d2b862a709b4d23645ed41e6..202bcb28218b0d9a2a5e211fee173ecd5f625896 100644
+index 73214ccad93ccd186c149e8ce8913eb0e3fa324a..9b9514362f32ab79816678ce4be25a4a87fe49aa 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
-@@ -177,6 +177,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -178,6 +178,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
(villager, poiType) -> poiType.is(PoiTypes.MEETING)
);
@@ -311,7 +311,7 @@ index c62eee45d661b6f9d2b862a709b4d23645ed41e6..202bcb28218b0d9a2a5e211fee173ecd
public Villager(EntityType extends Villager> entityType, Level level) {
this(entityType, level, VillagerType.PLAINS);
}
-@@ -285,6 +287,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -286,6 +288,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
// Paper end - EAR 2
@@ -319,7 +319,7 @@ index c62eee45d661b6f9d2b862a709b4d23645ed41e6..202bcb28218b0d9a2a5e211fee173ecd
@Override
protected void customServerAiStep(ServerLevel level) {
// Paper start - EAR 2
-@@ -292,7 +295,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -293,7 +296,11 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
protected void customServerAiStep(ServerLevel level, final boolean inactive) {
// Paper end - EAR 2
diff --git a/leaf-server/minecraft-patches/features/0097-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch b/leaf-server/minecraft-patches/features/0097-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch
index 2f0e4f92..4ab26276 100644
--- a/leaf-server/minecraft-patches/features/0097-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch
+++ b/leaf-server/minecraft-patches/features/0097-Pufferfish-Throttle-goal-selector-during-inactive-ti.patch
@@ -7,10 +7,10 @@ Original license: GPL v3
Original project: https://github.com/pufferfish-gg/Pufferfish
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 7e466022af0f023b409462ed4d4f3a8aa80c4183..92ebc61aa7f6f70292a384b56bd8ef77a15e485c 100644
+index 968422c673e23774f6b162ed9cdb02b9bb67f9a8..275f8697031251f7e106ac3fcc165e42af362434 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -201,11 +201,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -204,11 +204,13 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
return this.lookControl;
}
diff --git a/leaf-server/minecraft-patches/features/0098-Purpur-Server-Minecraft-Changes.patch b/leaf-server/minecraft-patches/features/0098-Purpur-Server-Minecraft-Changes.patch
index 4b458780..9b822fb1 100644
--- a/leaf-server/minecraft-patches/features/0098-Purpur-Server-Minecraft-Changes.patch
+++ b/leaf-server/minecraft-patches/features/0098-Purpur-Server-Minecraft-Changes.patch
@@ -1,12 +1,12 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Github Actions
-Date: Sun, 6 Apr 2025 06:33:24 +0000
+Date: Fri, 13 Jun 2025 14:00:13 +0000
Subject: [PATCH] Purpur Server Minecraft Changes
Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
-Commit: 61d7f5590e79909caba55e9f00cefdd51006d015
+Commit: dfd8a7ad14f436ea9c4704a758305e7145923c2d
Patches listed below are removed in this patch, They exists in Gale or Leaf:
* "net/minecraft/CrashReport.java.patch"
@@ -44,10 +44,10 @@ Patches listed below are removed in this patch, They exists in Gale or Leaf:
- Rebrand
diff --git a/io/papermc/paper/entity/activation/ActivationRange.java b/io/papermc/paper/entity/activation/ActivationRange.java
-index f3ca86e09a4a076d143fb21eac529967ff004df4..fff12ee449878b7a6eab2edef9476bd90bafef45 100644
+index 3c3fe6d2e46a811932143a782bb50f9a7c87c4d2..b866bef893dfb4e65a6c4c48125e6d8a1c3ede64 100644
--- a/io/papermc/paper/entity/activation/ActivationRange.java
+++ b/io/papermc/paper/entity/activation/ActivationRange.java
-@@ -155,6 +155,8 @@ public final class ActivationRange {
+@@ -161,6 +161,8 @@ public final class ActivationRange {
continue;
}
@@ -56,7 +56,7 @@ index f3ca86e09a4a076d143fb21eac529967ff004df4..fff12ee449878b7a6eab2edef9476bd9
final int worldHeight = world.getHeight();
ActivationRange.maxBB = player.getBoundingBox().inflate(maxRange, worldHeight, maxRange);
ActivationType.MISC.boundingBox = player.getBoundingBox().inflate(miscActivationRange, worldHeight, miscActivationRange);
-@@ -312,6 +314,7 @@ public final class ActivationRange {
+@@ -318,6 +320,7 @@ public final class ActivationRange {
* @return
*/
public static boolean checkIfActive(final Entity entity) {
@@ -65,10 +65,10 @@ index f3ca86e09a4a076d143fb21eac529967ff004df4..fff12ee449878b7a6eab2edef9476bd9
if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Needed for item gravity, see ItemEntity tick
return true;
diff --git a/net/minecraft/commands/CommandSourceStack.java b/net/minecraft/commands/CommandSourceStack.java
-index cb63e4c264a31788cd1405428af70f7a018910e9..4d06587cd55af988eecdda5186577ab72ca3d533 100644
+index 3acfb2a78845dd8081dc3c01d653034232c76e60..51caf352e77df49fc04bf84f1fab29b6f4f4fc14 100644
--- a/net/minecraft/commands/CommandSourceStack.java
+++ b/net/minecraft/commands/CommandSourceStack.java
-@@ -455,6 +455,19 @@ public class CommandSourceStack implements ExecutionCommandSource> {
+@@ -578,11 +578,20 @@ public class Connection extends SimpleChannelInboundHandler> {
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
private static int currTick; // Paper - Buffer joins to world
@@ -305,10 +305,10 @@ index 4ed9611994c5c8da01fede690197527c5b3a5731..00a82873d226f113278632a53c0faca4
}
// Paper end - Buffer joins to world
diff --git a/net/minecraft/server/Main.java b/net/minecraft/server/Main.java
-index 6c65122fe15e08c352885c7dfd3ddf496f0c00c4..bff3da0fba99532889976281dba70d6500ef432e 100644
+index b16f3f515a76ddbbd74d73464396cf094cb30599..dd6ae338fa48d52962ee0af5b1572077ba6dff91 100644
--- a/net/minecraft/server/Main.java
+++ b/net/minecraft/server/Main.java
-@@ -108,6 +108,12 @@ public class Main {
+@@ -109,6 +109,12 @@ public class Main {
JvmProfiler.INSTANCE.start(Environment.SERVER);
}
@@ -322,10 +322,10 @@ index 6c65122fe15e08c352885c7dfd3ddf496f0c00c4..bff3da0fba99532889976281dba70d65
io.papermc.paper.plugin.PluginInitializerManager.load(optionSet); // Paper
Bootstrap.bootStrap();
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 18a0bf81562f61fd6ede72d51d836ae28e9226c3..271233087ad8a0ef8e90e1d518907e166f8235a2 100644
+index 9ab4e38d6dd278b9ed7c43bf448c32983135a547..f05fa801f35f4afcc93fcace6a98cee0fa3ec531 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -265,6 +265,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop processQueue = new java.util.concurrent.ConcurrentLinkedQueue();
public int autosavePeriod;
// Paper - don't store the vanilla dispatcher
-@@ -286,6 +287,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
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
@@ -341,8 +341,8 @@ index 18a0bf81562f61fd6ede72d51d836ae28e9226c3..271233087ad8a0ef8e90e1d518907e16
+ protected boolean upnp = false; // Purpur - UPnP Port Forwarding
public static S spin(Function threadFunction) {
- AtomicReference atomicReference = new AtomicReference<>();
-@@ -975,6 +978,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper - Add EntityMoveEvent
serverLevel.updateLagCompensationTick(); // Paper - lag compensation
net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = serverLevel.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper - Perf: Optimize Hoppers
@@ -423,19 +423,19 @@ index 18a0bf81562f61fd6ede72d51d836ae28e9226c3..271233087ad8a0ef8e90e1d518907e16
if (this.tickCount % 20 == 0) {
this.synchronizeTime(serverLevel);
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
-index 741894ed6df81fce41d9f906d6198d038aab44a8..edf115439c630a4471460db02109bbce7868de81 100644
+index 63c32ae544d87177c9b3e1f1b73eeb9be904eebf..9ecc19b8a7d4e6b27335b542308f78e5005b0e15 100644
--- a/net/minecraft/server/PlayerAdvancements.java
+++ b/net/minecraft/server/PlayerAdvancements.java
-@@ -195,6 +195,7 @@ public class PlayerAdvancements {
+@@ -194,6 +194,7 @@ public class PlayerAdvancements {
advancement.value().display().ifPresent(displayInfo -> {
// Paper start - Add Adventure message to PlayerAdvancementDoneEvent
- if (event.message() != null && this.player.serverLevel().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) {
+ if (event.message() != null && this.player.level().getGameRules().getBoolean(GameRules.RULE_ANNOUNCE_ADVANCEMENTS)) {
+ if (org.purpurmc.purpur.PurpurConfig.advancementOnlyBroadcastToAffectedPlayer) this.player.sendMessage(message); else // Purpur - Configurable broadcast settings
this.playerList.broadcastSystemMessage(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.message()), false);
// Paper end
}
diff --git a/net/minecraft/server/commands/EnchantCommand.java b/net/minecraft/server/commands/EnchantCommand.java
-index 709690044ec506c50a73197f5ba43e89f3403a5e..60baf9a5dc4a583d08007acb68bbed61768270d5 100644
+index 6f4fcee9fdba2248227708fcced1ce0f40aff6af..13f1dbd0d09428e9e0a42f99d0553283e0065f6f 100644
--- a/net/minecraft/server/commands/EnchantCommand.java
+++ b/net/minecraft/server/commands/EnchantCommand.java
@@ -70,7 +70,7 @@ public class EnchantCommand {
@@ -457,10 +457,10 @@ index 709690044ec506c50a73197f5ba43e89f3403a5e..60baf9a5dc4a583d08007acb68bbed61
i++;
} else if (targets.size() == 1) {
diff --git a/net/minecraft/server/commands/GameModeCommand.java b/net/minecraft/server/commands/GameModeCommand.java
-index c44cdbbdc06b25bd20a208386545a10af9b96df8..a88b8f999b181071ebb492bc1afa2d72fff3748e 100644
+index 9da9ab3b835a8dcc7e1da286be1de88a3f0240fa..4b8c9aaf1d143bc38f52f646e4e73b56013eda8c 100644
--- a/net/minecraft/server/commands/GameModeCommand.java
+++ b/net/minecraft/server/commands/GameModeCommand.java
-@@ -51,6 +51,18 @@ public class GameModeCommand {
+@@ -53,6 +53,18 @@ public class GameModeCommand {
}
private static int setMode(CommandContext source, Collection players, GameType gameType) {
@@ -480,19 +480,19 @@ index c44cdbbdc06b25bd20a208386545a10af9b96df8..a88b8f999b181071ebb492bc1afa2d72
for (ServerPlayer serverPlayer : players) {
diff --git a/net/minecraft/server/commands/GiveCommand.java b/net/minecraft/server/commands/GiveCommand.java
-index f04bc30a836b6eec80b0e2cf76831b0fdccd8149..5e48519f1669ddecaca479126270012373879752 100644
+index ea9db57a1fe2f11739ceb062ea7cce15776f959a..a919d91eeaaeef0f79190cc5e78e4f8b2fb468dd 100644
--- a/net/minecraft/server/commands/GiveCommand.java
+++ b/net/minecraft/server/commands/GiveCommand.java
-@@ -66,6 +66,7 @@ public class GiveCommand {
+@@ -69,6 +69,7 @@ public class GiveCommand {
i1 -= min;
ItemStack itemStack1 = item.createItemStack(min, false);
boolean flag = serverPlayer.getInventory().add(itemStack1);
+ if (org.purpurmc.purpur.PurpurConfig.disableGiveCommandDrops) continue; // Purpur - add config option for toggling give command dropping
if (flag && itemStack1.isEmpty()) {
- ItemEntity itemEntity = serverPlayer.drop(itemStack, false, false, false, null); // Paper - do not fire PlayerDropItemEvent for /give command
+ ItemEntity itemEntity = serverPlayer.drop(itemStack, false);
if (itemEntity != null) {
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
-index 349eafa321c955c6bda7a5aa6931311d85867565..cdfb9004dd4f4ea1bbb77895b7fc020d628c485d 100644
+index ca1406178cfb1a5a10947872585e2dcf3059b460..87fc8861948b50361ec04c5a23406d3abdec6eac 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
@@ -105,6 +105,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -560,10 +560,10 @@ index 349eafa321c955c6bda7a5aa6931311d85867565..cdfb9004dd4f4ea1bbb77895b7fc020d
return true;
}
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
-index f6518e29f805018c72222f5aaa7b662071665b65..5748658abf0b90812005ae9d426df92daf5532f0 100644
+index 4a01088da91fc6d620cb804a9ab6d6eb1630b473..b286dc17cda16fca3af9374d2a4a8bd137c24450 100644
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
-@@ -49,6 +49,7 @@ public class DedicatedServerProperties extends Settings pointOfInterestType.is(PoiTypes.LIGHTNING_ROD),
blockPos -> blockPos.getY() == this.getHeight(Heightmap.Types.WORLD_SURFACE, blockPos.getX(), blockPos.getZ()) - 1,
pos,
@@ -874,7 +874,7 @@ index 074869245407abb32775b17140e1ffadabc5fcd5..e6730996dfd4c2422b6c13f10309fc58
PoiManager.Occupancy.ANY
);
return optional.map(blockPos -> blockPos.above(1));
-@@ -1033,8 +1109,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1037,8 +1113,26 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
int _int = this.getGameRules().getInt(GameRules.RULE_PLAYERS_SLEEPING_PERCENTAGE);
Component component;
if (this.sleepStatus.areEnoughSleeping(_int)) {
@@ -901,7 +901,7 @@ index 074869245407abb32775b17140e1ffadabc5fcd5..e6730996dfd4c2422b6c13f10309fc58
component = Component.translatable("sleep.players_sleeping", this.sleepStatus.amountSleeping(), this.sleepStatus.sleepersNeeded(_int));
}
-@@ -1167,6 +1261,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1175,6 +1269,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
@VisibleForTesting
public void resetWeatherCycle() {
// CraftBukkit start
@@ -909,7 +909,7 @@ index 074869245407abb32775b17140e1ffadabc5fcd5..e6730996dfd4c2422b6c13f10309fc58
this.serverLevelData.setRaining(false, org.bukkit.event.weather.WeatherChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
// Not that everyone ever manages to get the whole server to sleep at the same time....
-@@ -1174,6 +1269,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -1182,6 +1277,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.serverLevelData.setRainTime(0);
}
// CraftBukkit end
@@ -917,7 +917,7 @@ index 074869245407abb32775b17140e1ffadabc5fcd5..e6730996dfd4c2422b6c13f10309fc58
this.serverLevelData.setThundering(false, org.bukkit.event.weather.ThunderChangeEvent.Cause.SLEEP); // Paper - Add cause to Weather/ThunderChangeEvents
// CraftBukkit start
// If we stop due to everyone sleeping we should reset the weather duration to some other random value.
-@@ -2652,7 +2748,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -2705,7 +2801,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// Spigot start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start - Fix merchant inventory not closing on entity removal
@@ -927,10 +927,10 @@ index 074869245407abb32775b17140e1ffadabc5fcd5..e6730996dfd4c2422b6c13f10309fc58
}
// Paper end - Fix merchant inventory not closing on entity removal
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b234c579f26 100644
+index 99eaa04bfcd2d37d3e49513e20bb5037119ef84d..c6fafc3cb31d0a3dbbeaf8a9493d70de502110cc 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -419,6 +419,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -430,6 +430,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
public @Nullable com.destroystokyo.paper.event.entity.PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper - PlayerNaturallySpawnCreaturesEvent
public @Nullable String clientBrandName = null; // Paper - Brand support
public @Nullable org.bukkit.event.player.PlayerQuitEvent.QuitReason quitReason = null; // Paper - Add API for quit reason; there are a lot of changes to do if we change all methods leading to the event
@@ -941,28 +941,28 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
-@@ -552,6 +556,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
- this.respawnConfig = compound.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
- this.spawnExtraParticlesOnFall = compound.getBooleanOr("spawn_extra_particles_on_fall", false);
- this.raidOmenPosition = compound.read("raid_omen_position", BlockPos.CODEC).orElse(null);
+@@ -627,6 +631,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ this.respawnConfig = input.read("respawn", ServerPlayer.RespawnConfig.CODEC).orElse(null);
+ this.spawnExtraParticlesOnFall = input.getBooleanOr("spawn_extra_particles_on_fall", false);
+ this.raidOmenPosition = input.read("raid_omen_position", BlockPos.CODEC).orElse(null);
+
-+ this.tpsBar = compound.getBooleanOr("Purpur.TPSBar", false); // Purpur - Implement TPSBar
-+ this.compassBar = compound.getBooleanOr("Purpur.CompassBar", false); // Purpur - Add compass command
-+ this.ramBar = compound.getBooleanOr("Purpur.RamBar", false); // Purpur - Implement rambar command
++ this.tpsBar = input.getBooleanOr("Purpur.TPSBar", false); // Purpur - Implement TPSBar
++ this.compassBar = input.getBooleanOr("Purpur.CompassBar", false); // Purpur - Add compass command
++ this.ramBar = input.getBooleanOr("Purpur.RamBar", false); // Purpur - Implement rambar command
}
@Override
-@@ -569,6 +577,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
- compound.storeNullable("raid_omen_position", BlockPos.CODEC, this.raidOmenPosition);
- this.saveEnderPearls(compound);
- this.getBukkitEntity().setExtraData(compound); // CraftBukkit
-+ compound.putBoolean("Purpur.TPSBar", this.tpsBar); // Purpur - Implement TPSBar
-+ compound.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur - Add compass command
-+ compound.putBoolean("Purpur.RamBar", this.ramBar); // Purpur - Add rambar command
+@@ -644,6 +652,9 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ output.storeNullable("raid_omen_position", BlockPos.CODEC, this.raidOmenPosition);
+ this.saveEnderPearls(output);
+ this.getBukkitEntity().setExtraData(output); // CraftBukkit
++ output.putBoolean("Purpur.TPSBar", this.tpsBar); // Purpur - Implement TPSBar
++ output.putBoolean("Purpur.CompassBar", this.compassBar); // Purpur - Add compass command
++ output.putBoolean("Purpur.RamBar", this.ramBar); // Purpur - Add rambar command
}
- private void saveParentVehicle(CompoundTag tag) {
-@@ -780,6 +791,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ private void saveParentVehicle(ValueOutput output) {
+@@ -849,6 +860,15 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.trackEnteredOrExitedLavaOnVehicle();
this.updatePlayerAttributes();
this.advancements.flushDirty(this, true);
@@ -978,7 +978,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
}
private void updatePlayerAttributes() {
-@@ -1062,6 +1082,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1140,6 +1160,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
// Paper - moved up to sendClientboundPlayerCombatKillPacket()
sendClientboundPlayerCombatKillPacket(event.getShowDeathMessages(), deathScreenMessage); // Paper - Expand PlayerDeathEvent
Team team = this.getTeam();
@@ -986,7 +986,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
if (team == null || team.getDeathMessageVisibility() == Team.Visibility.ALWAYS) {
this.server.getPlayerList().broadcastSystemMessage(deathMessage, false);
} else if (team.getDeathMessageVisibility() == Team.Visibility.HIDE_FOR_OTHER_TEAMS) {
-@@ -1168,6 +1189,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1246,6 +1267,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
if (this.isInvulnerableTo(level, damageSource)) {
return false;
} else {
@@ -1005,7 +1005,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
Entity entity = damageSource.getEntity();
if (!( // Paper - split the if statement. If below statement is false, hurtServer would not have been evaluated. Return false.
!(entity instanceof Player player && !this.canHarmPlayer(player))
-@@ -1390,6 +1423,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1486,6 +1519,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
serverLevel.removePlayerImmediately(this, Entity.RemovalReason.CHANGED_DIMENSION);
this.unsetRemoved();
// CraftBukkit end
@@ -1013,19 +1013,19 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
this.setServerLevel(level);
this.connection.internalTeleport(PositionMoveRotation.of(teleportTransition), teleportTransition.relatives()); // CraftBukkit - use internal teleport without event
this.connection.resetPosition();
-@@ -1506,7 +1540,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1601,7 +1635,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
new AABB(vec3.x() - 8.0, vec3.y() - 5.0, vec3.z() - 8.0, vec3.x() + 8.0, vec3.y() + 5.0, vec3.z() + 8.0),
- monster -> monster.isPreventingPlayerRest(this.serverLevel(), this)
+ monster -> monster.isPreventingPlayerRest(this.level(), this)
);
- if (!entitiesOfClass.isEmpty()) {
+ if (!this.level().purpurConfig.playerSleepNearMonsters && !entitiesOfClass.isEmpty()) { // Purpur - Config to ignore nearby mobs when sleeping
return Either.left(Player.BedSleepingProblem.NOT_SAFE);
}
}
-@@ -1543,7 +1577,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -1638,7 +1672,19 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
CriteriaTriggers.SLEPT_IN_BED.trigger(this);
});
- if (!this.serverLevel().canSleepThroughNights()) {
+ if (!this.level().canSleepThroughNights()) {
- this.displayClientMessage(Component.translatable("sleep.not_possible"), true);
+ // Purpur start - Customizable sleeping actionbar messages
+ Component clientMessage;
@@ -1042,8 +1042,8 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
+ // Purpur end - Customizable sleeping actionbar messages
}
- ((ServerLevel)this.level()).updateSleepingPlayerList();
-@@ -1635,6 +1681,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ this.level().updateSleepingPlayerList();
+@@ -1730,6 +1776,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
@Override
public void openTextEdit(SignBlockEntity signEntity, boolean isFrontText) {
@@ -1051,7 +1051,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
this.connection.send(new ClientboundBlockUpdatePacket(this.level(), signEntity.getBlockPos()));
this.connection.send(new ClientboundOpenSignEditorPacket(signEntity.getBlockPos(), isFrontText));
}
-@@ -1937,6 +1984,26 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2039,6 +2086,26 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
this.lastSentExp = -1; // CraftBukkit - Added to reset
}
@@ -1078,7 +1078,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
@Override
public void displayClientMessage(Component chatComponent, boolean actionBar) {
this.sendSystemMessage(chatComponent, actionBar);
-@@ -2160,6 +2227,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2263,6 +2330,20 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
);
}
@@ -1099,7 +1099,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
public void sendSystemMessage(Component mesage) {
this.sendSystemMessage(mesage, false);
}
-@@ -2298,8 +2379,68 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2401,8 +2482,68 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
public void resetLastActionTime() {
this.lastActionTime = Util.getMillis();
@@ -1160,15 +1160,15 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
+ }
+
+ @Override
-+ public boolean canBeCollidedWith() {
-+ return !this.isAfk() && super.canBeCollidedWith();
++ public boolean canBeCollidedWith(Entity entity) {
++ return !this.isAfk() && super.canBeCollidedWith(entity);
+ }
+ // Purpur end - AFK API
+
public ServerStatsCounter getStats() {
return this.stats;
}
-@@ -2926,4 +3067,56 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -3029,4 +3170,56 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
return (org.bukkit.craftbukkit.entity.CraftPlayer) super.getBukkitEntity();
}
// CraftBukkit end
@@ -1226,7 +1226,7 @@ index b3ffb2afda9ea5cafbab9f775d526af1940cfdca..834829427f3388c6cd94b5ceadc18b23
+ // Purpur end - Add rambar command
}
diff --git a/net/minecraft/server/level/ServerPlayerGameMode.java b/net/minecraft/server/level/ServerPlayerGameMode.java
-index b604cba2490a747661d6819251bc3b9a1d35c7d4..3a596650feb96123c5684bb5065e20c5b005c0b9 100644
+index 6734756d7a51e635a50a47577f9e6b6f8111db51..c4a4f08272b34f72dea4feaaeb66d153b2aab8c8 100644
--- a/net/minecraft/server/level/ServerPlayerGameMode.java
+++ b/net/minecraft/server/level/ServerPlayerGameMode.java
@@ -348,6 +348,7 @@ public class ServerPlayerGameMode {
@@ -1274,10 +1274,10 @@ index b604cba2490a747661d6819251bc3b9a1d35c7d4..3a596650feb96123c5684bb5065e20c5
+ // Purpur end - Shift right click to use exp for mending
}
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-index c4f4c21f32e2aba79e15315d73124c803bb1223a..d2e8adccf33c6b842fac615006b782b09cfa7a1a 100644
+index ddc89e8960f7dc2f75f0e03ccbe6eda96a0499e2..8a4c8e2fb86274b5bf95bda510029f4c5077d836 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-@@ -54,6 +54,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -56,6 +56,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
private static final long KEEPALIVE_LIMIT = KEEPALIVE_LIMIT_IN_SECONDS * 1000;
// Gale end - Purpur - send multiple keep-alive packets
protected static final net.minecraft.resources.ResourceLocation MINECRAFT_BRAND = net.minecraft.resources.ResourceLocation.withDefaultNamespace("brand"); // Paper - Brand support
@@ -1285,7 +1285,7 @@ index c4f4c21f32e2aba79e15315d73124c803bb1223a..d2e8adccf33c6b842fac615006b782b0
public ServerCommonPacketListenerImpl(MinecraftServer server, Connection connection, CommonListenerCookie cookie, net.minecraft.server.level.ServerPlayer player) { // CraftBukkit
this.server = server;
-@@ -183,6 +184,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -215,6 +216,12 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
return;
}
@@ -1299,10 +1299,10 @@ index c4f4c21f32e2aba79e15315d73124c803bb1223a..d2e8adccf33c6b842fac615006b782b0
this.player.clientBrandName = new net.minecraft.network.FriendlyByteBuf(io.netty.buffer.Unpooled.wrappedBuffer(data)).readUtf(256);
}
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010491b64aa 100644
+index a07310aebd8406af27864358e15715fcc7694329..72292ee9620ee369ccee00dd0280bf6041d3afca 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -321,6 +321,20 @@ public class ServerGamePacketListenerImpl
+@@ -324,6 +324,20 @@ public class ServerGamePacketListenerImpl
this.tickEndEvent = new io.papermc.paper.event.packet.ClientTickEndEvent(player.getBukkitEntity()); // Paper - add client tick end event
}
@@ -1323,7 +1323,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
@Override
public void tick() {
if (this.ackBlockChangesUpTo > -1) {
-@@ -379,6 +393,12 @@ public class ServerGamePacketListenerImpl
+@@ -382,6 +396,12 @@ public class ServerGamePacketListenerImpl
if (this.player.getLastActionTime() > 0L
&& this.server.getPlayerIdleTimeout() > 0
&& Util.getMillis() - this.player.getLastActionTime() > this.server.getPlayerIdleTimeout() * 1000L * 60L && !this.player.wonGame) { // Paper - Prevent AFK kick while watching end credits
@@ -1336,7 +1336,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
this.player.resetLastActionTime(); // CraftBukkit - SPIGOT-854
this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
}
-@@ -624,6 +644,8 @@ public class ServerGamePacketListenerImpl
+@@ -651,6 +671,8 @@ public class ServerGamePacketListenerImpl
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
@@ -1345,15 +1345,15 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event);
-@@ -703,6 +725,7 @@ public class ServerGamePacketListenerImpl
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
+@@ -730,6 +752,7 @@ public class ServerGamePacketListenerImpl
+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
if (packet.getId() == this.awaitingTeleport) {
if (this.awaitingPositionFromClient == null) {
+ ServerGamePacketListenerImpl.LOGGER.warn("Disconnected on accept teleport packet. Was not expecting position data from client at this time"); // Purpur - Add more logger output for invalid movement kicks
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
return;
}
-@@ -1238,6 +1261,10 @@ public class ServerGamePacketListenerImpl
+@@ -1268,6 +1291,10 @@ public class ServerGamePacketListenerImpl
final int maxBookPageSize = pageMax.intValue();
final double multiplier = Math.clamp(io.papermc.paper.configuration.GlobalConfiguration.get().itemValidation.bookSize.totalMultiplier, 0.3D, 1D);
long byteAllowed = maxBookPageSize;
@@ -1364,7 +1364,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
for (final String page : pageList) {
final int byteLength = page.getBytes(java.nio.charset.StandardCharsets.UTF_8).length;
byteTotal += byteLength;
-@@ -1262,7 +1289,8 @@ public class ServerGamePacketListenerImpl
+@@ -1292,7 +1319,8 @@ public class ServerGamePacketListenerImpl
}
if (byteTotal > byteAllowed) {
@@ -1374,7 +1374,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
}
-@@ -1281,31 +1309,45 @@ public class ServerGamePacketListenerImpl
+@@ -1311,31 +1339,45 @@ public class ServerGamePacketListenerImpl
Optional optional = packet.title();
optional.ifPresent(list::add);
list.addAll(packet.pages());
@@ -1424,7 +1424,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
itemStack.set(
DataComponents.WRITTEN_BOOK_CONTENT,
new WrittenBookContent(this.filterableFromOutgoing(title), this.player.getName().getString(), 0, list, true)
-@@ -1319,6 +1361,16 @@ public class ServerGamePacketListenerImpl
+@@ -1349,6 +1391,16 @@ public class ServerGamePacketListenerImpl
return this.player.isTextFilteringEnabled() ? Filterable.passThrough(filteredText.filteredOrEmpty()) : Filterable.from(filteredText);
}
@@ -1440,11 +1440,11 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
+
@Override
public void handleEntityTagQuery(ServerboundEntityTagQueryPacket packet) {
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
-@@ -1354,7 +1406,15 @@ public class ServerGamePacketListenerImpl
+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
+@@ -1388,7 +1440,15 @@ public class ServerGamePacketListenerImpl
@Override
public void handleMovePlayer(ServerboundMovePlayerPacket packet) {
- PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
+ PacketUtils.ensureRunningOnSameThread(packet, this, this.player.level());
- if (containsInvalidValues(packet.getX(0.0), packet.getY(0.0), packet.getZ(0.0), packet.getYRot(0.0F), packet.getXRot(0.0F))) {
+ // Purpur start - Add more logger output for invalid movement kicks
+ boolean invalidX = Double.isNaN(packet.getX(0.0));
@@ -1457,8 +1457,8 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
+ // Purpur end - Add more logger output for invalid movement kicks
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_player_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_PLAYER_MOVEMENT); // Paper - kick event cause
} else {
- ServerLevel serverLevel = this.player.serverLevel();
-@@ -1536,7 +1596,7 @@ public class ServerGamePacketListenerImpl
+ ServerLevel serverLevel = this.player.level();
+@@ -1570,7 +1630,7 @@ public class ServerGamePacketListenerImpl
movedWrongly = true;
if (event.getLogWarning())
// Paper end
@@ -1467,7 +1467,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
} // Paper
}
-@@ -1602,6 +1662,8 @@ public class ServerGamePacketListenerImpl
+@@ -1635,6 +1695,8 @@ public class ServerGamePacketListenerImpl
this.lastYaw = to.getYaw();
this.lastPitch = to.getPitch();
@@ -1476,13 +1476,13 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
Location oldTo = to.clone();
PlayerMoveEvent event = new PlayerMoveEvent(player, from, to);
this.cserver.getPluginManager().callEvent(event);
-@@ -1657,6 +1719,13 @@ public class ServerGamePacketListenerImpl
+@@ -1690,6 +1752,13 @@ public class ServerGamePacketListenerImpl
this.player.tryResetCurrentImpulseContext();
}
+ // Purpur start - Dont run with scissors!
-+ if (this.player.serverLevel().purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.serverLevel().purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.serverLevel().purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissors(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissors(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) {
-+ this.player.hurtServer(this.player.serverLevel(), this.player.damageSources().scissors(), (float) this.player.serverLevel().purpurConfig.scissorsRunningDamage);
++ if (this.player.level().purpurConfig.dontRunWithScissors && this.player.isSprinting() && !(this.player.level().purpurConfig.ignoreScissorsInWater && this.player.isInWater()) && !(this.player.level().purpurConfig.ignoreScissorsInLava && this.player.isInLava()) && (isScissors(this.player.getItemInHand(InteractionHand.MAIN_HAND)) || isScissors(this.player.getItemInHand(InteractionHand.OFF_HAND))) && (int) (Math.random() * 10) == 0) {
++ this.player.hurtServer(this.player.level(), this.player.damageSources().scissors(), (float) this.player.level().purpurConfig.scissorsRunningDamage);
+ if (!org.purpurmc.purpur.PurpurConfig.dontRunWithScissors.isBlank()) this.player.sendActionBarMessage(org.purpurmc.purpur.PurpurConfig.dontRunWithScissors);
+ }
+ // Purpur end - Dont run with scissors!
@@ -1490,7 +1490,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
this.player.checkMovementStatistics(this.player.getX() - x, this.player.getY() - y, this.player.getZ() - z);
this.lastGoodX = this.player.getX();
this.lastGoodY = this.player.getY();
-@@ -1674,6 +1743,17 @@ public class ServerGamePacketListenerImpl
+@@ -1707,6 +1776,17 @@ public class ServerGamePacketListenerImpl
}
}
@@ -1499,7 +1499,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
+ if (!stack.is(Items.SHEARS)) return false;
+
+ ResourceLocation itemModelReference = stack.get(net.minecraft.core.component.DataComponents.ITEM_MODEL);
-+ if (itemModelReference != null && itemModelReference.equals(this.player.serverLevel().purpurConfig.dontRunWithScissorsItemModelReference)) return true;
++ if (itemModelReference != null && itemModelReference.equals(this.player.level().purpurConfig.dontRunWithScissorsItemModelReference)) return true;
+
+ return stack.getOrDefault(DataComponents.CUSTOM_MODEL_DATA, net.minecraft.world.item.component.CustomModelData.EMPTY).equals(net.minecraft.world.item.component.CustomModelData.EMPTY);
+ }
@@ -1508,7 +1508,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
private boolean shouldCheckPlayerMovement(boolean isElytraMovement) {
if (this.isSingleplayerOwner()) {
return false;
-@@ -2070,6 +2150,7 @@ public class ServerGamePacketListenerImpl
+@@ -2104,6 +2184,7 @@ public class ServerGamePacketListenerImpl
boolean cancelled;
if (hitResult == null || hitResult.getType() != HitResult.Type.BLOCK) {
@@ -1516,7 +1516,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
org.bukkit.event.player.PlayerInteractEvent event = CraftEventFactory.callPlayerInteractEvent(this.player, Action.RIGHT_CLICK_AIR, itemInHand, hand);
cancelled = event.useItemInHand() == Event.Result.DENY;
} else {
-@@ -2742,6 +2823,7 @@ public class ServerGamePacketListenerImpl
+@@ -2755,6 +2836,7 @@ public class ServerGamePacketListenerImpl
AABB boundingBox = target.getBoundingBox();
if (this.player.canInteractWithEntity(boundingBox, io.papermc.paper.configuration.GlobalConfiguration.get().misc.clientInteractionLeniencyDistance.or(3.0))) { // Paper - configurable lenience value for interact range
@@ -1524,7 +1524,7 @@ index 68368928035ffa8fb7b12a7e3c6a7f9686379933..35ca166964e8436154891708f69ac010
packet.dispatch(
new ServerboundInteractPacket.Handler() {
private void performInteraction(InteractionHand hand, ServerGamePacketListenerImpl.EntityInteraction entityInteraction, PlayerInteractEntityEvent event) { // CraftBukkit
-@@ -2754,6 +2836,8 @@ public class ServerGamePacketListenerImpl
+@@ -2767,6 +2849,8 @@ public class ServerGamePacketListenerImpl
ServerGamePacketListenerImpl.this.cserver.getPluginManager().callEvent(event);
@@ -1547,26 +1547,26 @@ index dc225eaa0daf238e091a0cf63a42158a30ecb7f0..c61a94a08486cdeba84ccfbc58ef3cab
}
} catch (AuthenticationUnavailableException var4) {
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index d2dc48d5a42506716bcbe0854a860b1eaa3b5705..bfcc40c09f80b5405cc414969693c195769bcb98 100644
+index 0acfb86df4a350e41ea1646a38dad14d43f2cb1d..0f02eef9bcae59bf3df6471b10dbfa8252337140 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -411,6 +411,7 @@ public abstract class PlayerList {
- scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
- }
- // Paper end - Configurable player collision
-+ org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - Implement TPSBar
- if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
- PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
- // Gale start - JettPack - make logging login location configurable
-@@ -522,6 +523,7 @@ public abstract class PlayerList {
+@@ -412,6 +412,7 @@ public abstract class PlayerList {
+ scoreboard.addPlayerToTeam(player.getScoreboardName(), collideRuleTeam);
+ }
+ // Paper end - Configurable player collision
++ org.purpurmc.purpur.task.BossBarTask.addToAll(player); // Purpur - Implement TPSBar
+ if (org.galemc.gale.configuration.GaleGlobalConfiguration.get().logToConsole.playerLoginLocations) { // Gale - JettPack - make logging login location configurable
+ PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ([{}]{}, {}, {})", player.getName().getString(), loggableAddress, player.getId(), serverLevel.serverLevelData.getLevelName(), player.getX(), player.getY(), player.getZ());
+ // Gale start - JettPack - make logging login location configurable
+@@ -525,6 +526,7 @@ public abstract class PlayerList {
}
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player, net.kyori.adventure.text.Component leaveMessage) {
// Paper end - Fix kick event leave message not being sent
+ org.purpurmc.purpur.task.BossBarTask.removeFromAll(player.getBukkitEntity()); // Purpur - Implement TPSBar
- ServerLevel serverLevel = player.serverLevel();
+ ServerLevel serverLevel = player.level();
player.awardStat(Stats.LEAVE_GAME);
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
-@@ -681,7 +683,7 @@ public abstract class PlayerList {
+@@ -684,7 +686,7 @@ public abstract class PlayerList {
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameProfile)
// ? Component.translatable("multiplayer.disconnect.server_full")
// : null;
@@ -1575,7 +1575,7 @@ index d2dc48d5a42506716bcbe0854a860b1eaa3b5705..bfcc40c09f80b5405cc414969693c195
event.disallow(org.bukkit.event.player.PlayerLoginEvent.Result.KICK_FULL, net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacySection().deserialize(org.spigotmc.SpigotConfig.serverFullMessage)); // Spigot // Paper - Adventure
}
}
-@@ -1001,6 +1003,20 @@ public abstract class PlayerList {
+@@ -997,6 +999,20 @@ public abstract class PlayerList {
}
}
@@ -1596,7 +1596,7 @@ index d2dc48d5a42506716bcbe0854a860b1eaa3b5705..bfcc40c09f80b5405cc414969693c195
public void broadcastAll(Packet> packet, ResourceKey dimension) {
for (ServerPlayer serverPlayer : this.players) {
if (serverPlayer.level().dimension() == dimension) {
-@@ -1085,6 +1101,7 @@ public abstract class PlayerList {
+@@ -1081,6 +1097,7 @@ public abstract class PlayerList {
} else {
b = (byte)(24 + permLevel);
}
@@ -1604,7 +1604,7 @@ index d2dc48d5a42506716bcbe0854a860b1eaa3b5705..bfcc40c09f80b5405cc414969693c195
player.connection.send(new ClientboundEntityEventPacket(player, b));
}
-@@ -1093,6 +1110,27 @@ public abstract class PlayerList {
+@@ -1089,6 +1106,27 @@ public abstract class PlayerList {
player.getBukkitEntity().recalculatePermissions(); // CraftBukkit
this.server.getCommands().sendCommands(player);
} // Paper - Add sendOpLevel API
@@ -1903,18 +1903,18 @@ index 1fc9e1ad541c46124183a401b2a7d99aea69cecf..881271f0bc77a8a8a7d31daad9a8188b
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a504172a1e 100644
+index 28e2ad1238651b8adb47b77763b0c8ae8172fe8a..fb387919e51504beafd2e7947faa41795df18100 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -139,6 +139,7 @@ import net.minecraft.world.scores.Team;
- import org.jetbrains.annotations.Contract;
+@@ -146,6 +146,7 @@ import org.jetbrains.annotations.Contract;
+ import org.slf4j.Logger;
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, DataComponentGetter, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
+ public static javax.script.ScriptEngine scriptEngine = new javax.script.ScriptEngineManager().getEngineByName("rhino"); // Purpur - Configurable entity base attributes
// CraftBukkit start
- private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
private static final int CURRENT_LEVEL = 2;
-@@ -259,8 +260,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first snapTo
+@@ -279,8 +280,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public double xOld;
public double yOld;
public double zOld;
@@ -1923,9 +1923,9 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
- public final RandomSource random = SHARED_RANDOM; // Paper - Share random for entities to make them more random
+ public final RandomSource random; // Paper - Share random for entities to make them more random // Add toggle for RNG manipulation
public int tickCount;
- private int remainingFireTicks = -this.getFireImmuneTicks();
+ private int remainingFireTicks;
public boolean wasTouchingWater;
-@@ -294,8 +296,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -314,8 +316,8 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public PortalProcessor portalProcess;
public int portalCooldown;
private boolean invulnerable;
@@ -1936,7 +1936,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
private boolean hasGlowingTag;
private final Set tags = new io.papermc.paper.util.SizeLimitedSet<>(new it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<>(), MAX_ENTITY_TAG_COUNT); // Paper - fully limit tag size - replace set impl
private final double[] pistonDeltas = new double[]{0.0, 0.0, 0.0};
-@@ -351,6 +353,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -372,6 +374,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public long activatedTick = Integer.MIN_VALUE;
public boolean isTemporarilyActive;
public long activatedImmunityTick = Integer.MIN_VALUE;
@@ -1944,7 +1944,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
public void inactiveTick() {
}
-@@ -517,10 +520,39 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -534,10 +537,39 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// Paper end - optimise entity tracker
@@ -1984,7 +1984,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
this.position = Vec3.ZERO;
this.blockPosition = BlockPos.ZERO;
this.chunkPosition = ChunkPos.ZERO;
-@@ -892,6 +924,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -914,6 +946,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
&& this.level.paperConfig().environment.netherCeilingVoidDamageHeight.test(v -> this.getY() >= v)
&& (!(this instanceof Player player) || !player.getAbilities().invulnerable))) {
// Paper end - Configurable nether ceiling damage
@@ -1992,7 +1992,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
this.onBelowWorld();
}
}
-@@ -1845,7 +1878,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -1900,7 +1933,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public boolean fireImmune() {
@@ -2001,52 +2001,37 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
}
public boolean causeFallDamage(double fallDistance, float damageMultiplier, DamageSource damageSource) {
-@@ -1905,7 +1938,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- return this.isInWater() || flag;
- }
-
-- public void updateInWaterStateAndDoWaterCurrentPushing() {
-+ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - Movement options for armor stands - package-private -> public - TODO: use AT file
- if (this.getVehicle() instanceof AbstractBoat abstractBoat && !abstractBoat.isUnderWater()) {
- this.wasTouchingWater = false;
- } else if (this.updateFluidHeightAndDoFluidPushing(FluidTags.WATER, 0.014)) {
-@@ -2541,6 +2574,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- compound.putBoolean("Paper.FreezeLock", true);
+@@ -2606,6 +2639,11 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ output.putBoolean("Paper.FreezeLock", true);
}
// Paper end
-+
+ // Purpur start - Fire immune API
+ if (immuneToFire != null) {
-+ compound.putBoolean("Purpur.FireImmune", immuneToFire);
++ output.putBoolean("Purpur.FireImmune", immuneToFire);
+ }
+ // Purpur end - Fire immune API
-+
- return compound;
- } catch (Throwable var8) {
- CrashReport crashReport = CrashReport.forThrowable(var8, "Saving entity NBT");
-@@ -2671,6 +2711,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- freezeLocked = compound.getBooleanOr("Paper.FreezeLock", false);
+ } catch (Throwable var7) {
+ CrashReport crashReport = CrashReport.forThrowable(var7, "Saving entity NBT");
+ CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being saved");
+@@ -2726,6 +2764,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
+ freezeLocked = input.getBooleanOr("Paper.FreezeLock", false);
// Paper end
+
-+ // Purpur start - Fire immune API
-+ if (compound.contains("Purpur.FireImmune")) {
-+ immuneToFire = compound.getBoolean("Purpur.FireImmune").orElse(null);
-+ }
-+ // Purpur end - Fire immune API
++ immuneToFire = input.read("Purpur.FireImmune", com.mojang.serialization.Codec.BOOL).orElse(null); // Purpur - Fire immune API
+
- } catch (Throwable var8) {
- CrashReport crashReport = CrashReport.forThrowable(var8, "Loading entity NBT");
+ } catch (Throwable var7) {
+ CrashReport crashReport = CrashReport.forThrowable(var7, "Loading entity NBT");
CrashReportCategory crashReportCategory = crashReport.addCategory("Entity being loaded");
-@@ -2899,6 +2946,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
- if (this.isAlive() && this instanceof Leashable leashable) {
- if (leashable.getLeashHolder() == player) {
- if (!this.level().isClientSide()) {
-+ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers
- // CraftBukkit start - fire PlayerUnleashEntityEvent
- // Paper start - Expand EntityUnleashEvent
- org.bukkit.event.player.PlayerUnleashEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerUnleashEntityEvent(this, player, hand, !player.hasInfiniteMaterials());
-@@ -3105,6 +3153,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3004,6 +3045,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+ if (this.isAlive() && this instanceof Leashable leashable2) {
+ if (leashable2.getLeashHolder() == player) {
+ if (!this.level().isClientSide()) {
++ if (hand == InteractionHand.OFF_HAND && (level().purpurConfig.villagerCanBeLeashed || level().purpurConfig.wanderingTraderCanBeLeashed) && this instanceof net.minecraft.world.entity.npc.AbstractVillager) return InteractionResult.CONSUME; // Purpur - Allow leashing villagers
+ // Paper start - EntityUnleashEvent
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerUnleashEntityEvent(
+ leashable2, player, hand, !player.hasInfiniteMaterials(), true
+@@ -3300,6 +3342,13 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
this.passengers = ImmutableList.copyOf(list);
}
@@ -2060,7 +2045,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
this.gameEvent(GameEvent.ENTITY_MOUNT, passenger);
}
}
-@@ -3146,6 +3201,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3341,6 +3390,14 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return false;
}
// CraftBukkit end
@@ -2075,7 +2060,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
if (this.passengers.size() == 1 && this.passengers.get(0) == passenger) {
this.passengers = ImmutableList.of();
} else {
-@@ -3215,15 +3278,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3410,15 +3467,18 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return Vec3.directionFromRotation(this.getRotationVector());
}
@@ -2095,7 +2080,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
}
}
}
-@@ -3425,7 +3491,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -3620,7 +3680,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public int getMaxAirSupply() {
@@ -2104,7 +2089,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
}
public int getAirSupply() {
-@@ -3946,7 +4012,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4167,7 +4227,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
// CraftBukkit end
public boolean canUsePortal(boolean allowPassengers) {
@@ -2113,7 +2098,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
}
public boolean canTeleport(Level fromLevel, Level toLevel) {
-@@ -4488,6 +4554,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -4697,6 +4757,12 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return Mth.lerp(partialTick, this.yRotO, this.yRot);
}
@@ -2126,7 +2111,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
// Paper start - optimise collisions
public boolean updateFluidHeightAndDoFluidPushing(final TagKey fluid, final double flowScale) {
if (this.touchingUnloadedChunk()) {
-@@ -4906,7 +4978,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -5133,7 +5199,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
public float maxUpStep() {
@@ -2135,7 +2120,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
}
public void onExplosionHit(@Nullable Entity entity) {
-@@ -5144,4 +5216,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -5391,4 +5457,44 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
return ((ServerLevel) this.level()).isPositionEntityTicking(this.blockPosition());
}
// Paper end - Expose entity id counter
@@ -2181,7 +2166,7 @@ index 8370be95e4f0d1d3b99274fea415f77845ad5712..d8c83a449a1f33031aa671f3bbe366a5
+ // Purpur end - Ridables
}
diff --git a/net/minecraft/world/entity/EntitySelector.java b/net/minecraft/world/entity/EntitySelector.java
-index bfd58eb04eee606ac0a8071de9bf75f46c35decb..0c1953754220ff72e18f0396134507d93ba7b1b8 100644
+index 15daba9062d54a5bdf335c3645a3227ccb5a8e06..1842cbe25cc0f9be937caf0a78e915bd3d6ea1e5 100644
--- a/net/minecraft/world/entity/EntitySelector.java
+++ b/net/minecraft/world/entity/EntitySelector.java
@@ -28,6 +28,8 @@ public final class EntitySelector {
@@ -2194,10 +2179,10 @@ index bfd58eb04eee606ac0a8071de9bf75f46c35decb..0c1953754220ff72e18f0396134507d9
public static final Predicate PLAYER_AFFECTS_SPAWNING = (entity) -> {
return !entity.isSpectator() && entity.isAlive() && entity instanceof Player player && player.affectsSpawning;
diff --git a/net/minecraft/world/entity/EntityType.java b/net/minecraft/world/entity/EntityType.java
-index a1379aa8eaf84868ceb8b3762f7ca3b87a2d7785..d92045528d1a63799322418d86fab0bc580b7a99 100644
+index 388689c44cf63ade939e271d490051c9b3fe8034..e65b1818c49e1b7d04d5bcc912804c821f00bdbc 100644
--- a/net/minecraft/world/entity/EntityType.java
+++ b/net/minecraft/world/entity/EntityType.java
-@@ -1096,6 +1096,16 @@ public class EntityType implements FeatureElement, EntityTypeT
+@@ -1106,6 +1106,16 @@ public class EntityType implements FeatureElement, EntityTypeT
return register(vanillaEntityId(key), builder);
}
@@ -2214,7 +2199,7 @@ index a1379aa8eaf84868ceb8b3762f7ca3b87a2d7785..d92045528d1a63799322418d86fab0bc
public static ResourceLocation getKey(EntityType> entityType) {
return BuiltInRegistries.ENTITY_TYPE.getKey(entityType);
}
-@@ -1326,6 +1336,16 @@ public class EntityType implements FeatureElement, EntityTypeT
+@@ -1336,6 +1346,16 @@ public class EntityType implements FeatureElement, EntityTypeT
return this.category;
}
@@ -2231,24 +2216,24 @@ index a1379aa8eaf84868ceb8b3762f7ca3b87a2d7785..d92045528d1a63799322418d86fab0bc
public String getDescriptionId() {
return this.descriptionId;
}
-@@ -1385,7 +1405,11 @@ public class EntityType implements FeatureElement, EntityTypeT
- entity.load(tag);
- },
- // Paper end - Don't fire sync event during generation
-- () -> LOGGER.warn("Skipping Entity with id {}", tag.getStringOr("id", "[invalid]"))
+@@ -1395,7 +1415,11 @@ public class EntityType implements FeatureElement, EntityTypeT
+ entity.load(input);
+ },
+ // Paper end - Don't fire sync event during generation
+- () -> LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"))
+ // Purpur start - log skipped entity's position
-+ () -> {LOGGER.warn("Skipping Entity with id {}", tag.getStringOr("id", "[invalid]"));
-+ EntityType.LOGGER.warn("Location: {} {}", level.getWorld().getName(), tag.read("Pos", net.minecraft.world.phys.Vec3.CODEC).orElse(net.minecraft.world.phys.Vec3.ZERO));
++ () -> {LOGGER.warn("Skipping Entity with id {}", input.getStringOr("id", "[invalid]"));
++ EntityType.LOGGER.warn("Location: {} {}", level.getWorld().getName(), input.read("Pos", net.minecraft.world.phys.Vec3.CODEC).orElse(net.minecraft.world.phys.Vec3.ZERO));
+ }
+ // Purpur end - log skipped entity's position
);
}
diff --git a/net/minecraft/world/entity/ExperienceOrb.java b/net/minecraft/world/entity/ExperienceOrb.java
-index c97a0e500e889b406cb2d679a3870715775f5393..81aa1a91a2ecda3053b22c2eb9e59f0ea2faf7b5 100644
+index a62edee768c30c99213baa6bd736d67ae52b558c..c8354d46ed909090f7c15f396863bf7d73afcefa 100644
--- a/net/minecraft/world/entity/ExperienceOrb.java
+++ b/net/minecraft/world/entity/ExperienceOrb.java
-@@ -328,7 +328,7 @@ public class ExperienceOrb extends Entity {
+@@ -358,7 +358,7 @@ public class ExperienceOrb extends Entity {
public void playerTouch(Player entity) {
if (entity instanceof ServerPlayer serverPlayer) {
if (entity.takeXpDelay == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(serverPlayer.getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - PlayerPickupExperienceEvent
@@ -2257,7 +2242,7 @@ index c97a0e500e889b406cb2d679a3870715775f5393..81aa1a91a2ecda3053b22c2eb9e59f0e
entity.take(this, 1);
int i = this.repairPlayerItems(serverPlayer, this.getValue());
if (i > 0) {
-@@ -344,7 +344,7 @@ public class ExperienceOrb extends Entity {
+@@ -374,7 +374,7 @@ public class ExperienceOrb extends Entity {
}
private int repairPlayerItems(ServerPlayer player, int value) {
@@ -2267,10 +2252,10 @@ index c97a0e500e889b406cb2d679a3870715775f5393..81aa1a91a2ecda3053b22c2eb9e59f0e
);
if (randomItemWith.isPresent()) {
diff --git a/net/minecraft/world/entity/GlowSquid.java b/net/minecraft/world/entity/GlowSquid.java
-index 3f351fdb3cb76612d88bde713a2639d4319a7c6d..745f73e1f80d9c433630e31769b404eeeb63cb88 100644
+index aab9adb8313c4b18279c7fd7500ef04bda09c6c1..86a694b94045b47f6e98c480645f75738b8a052c 100644
--- a/net/minecraft/world/entity/GlowSquid.java
+++ b/net/minecraft/world/entity/GlowSquid.java
-@@ -26,6 +26,47 @@ public class GlowSquid extends Squid {
+@@ -27,6 +27,47 @@ public class GlowSquid extends Squid {
super(entityType, level);
}
@@ -2319,10 +2304,10 @@ index 3f351fdb3cb76612d88bde713a2639d4319a7c6d..745f73e1f80d9c433630e31769b404ee
protected ParticleOptions getInkParticle() {
return ParticleTypes.GLOW_SQUID_INK;
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d89868a9f7bd1 100644
+index 5025e1eb7be566c21b6228038fd6596f4ac53e9a..d7d6e0543dc26694891e4a9049b8162caadbf5e6 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -224,9 +224,9 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -236,9 +236,9 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
protected int noActionTime;
public float lastHurt;
public boolean jumping;
@@ -2335,7 +2320,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
protected InterpolationHandler interpolation = new InterpolationHandler(this);
protected double lerpYHeadRot;
protected int lerpHeadSteps;
-@@ -271,11 +271,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -284,11 +284,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
public boolean silentDeath = false; // Paper - mark entity as dying silently for cancellable death event
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
public int shieldBlockingDelay = this.level().paperConfig().misc.shieldBlockingDelay; // Paper - Make shield blocking delay configurable
@@ -2350,7 +2335,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
this.craftAttributes = new org.bukkit.craftbukkit.attribute.CraftAttributeMap(this.attributes); // CraftBukkit
// CraftBukkit - this.setHealth(this.getMaxHealth()) inlined and simplified to skip the instanceof check for Player, as getBukkitEntity() is not initialized in constructor
this.entityData.set(LivingEntity.DATA_HEALTH_ID, this.getMaxHealth());
-@@ -295,6 +297,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -307,6 +309,8 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
return new EntityEquipment();
}
@@ -2359,15 +2344,15 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
public Brain> getBrain() {
return this.brain;
}
-@@ -348,6 +352,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
- .add(Attributes.MOVEMENT_EFFICIENCY)
- .add(Attributes.ATTACK_KNOCKBACK);
+@@ -362,6 +366,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
+ .add(Attributes.CAMERA_DISTANCE)
+ .add(Attributes.WAYPOINT_TRANSMIT_RANGE);
}
+ public boolean shouldSendAttribute(Attribute attribute) { return true; } // Purpur - Ridables
@Override
protected void checkFallDamage(double y, boolean onGround, BlockState state, BlockPos pos) {
-@@ -429,6 +434,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -443,6 +448,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (d < 0.0) {
double damagePerBlock = serverLevel1.getWorldBorder().getDamagePerBlock();
if (damagePerBlock > 0.0) {
@@ -2380,7 +2365,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
this.hurtServer(serverLevel1, this.damageSources().outOfBorder(), Math.max(1, Mth.floor(-d * damagePerBlock)));
}
}
-@@ -441,10 +452,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -455,10 +466,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
&& (!flag || !((Player)this).getAbilities().invulnerable);
if (flag1) {
this.setAirSupply(this.decreaseAirSupply(this.getAirSupply()));
@@ -2393,23 +2378,23 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
}
} else if (this.getAirSupply() < this.getMaxAirSupply()) {
this.setAirSupply(this.increaseAirSupply(this.getAirSupply()));
-@@ -754,6 +765,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
- this.getSleepingPos().ifPresent(pos -> compound.store("sleeping_pos", BlockPos.CODEC, pos));
- DataResult dataResult = this.brain.serializeStart(NbtOps.INSTANCE);
- dataResult.resultOrPartial(LOGGER::error).ifPresent(tag -> compound.put("Brain", tag));
-+ compound.putBoolean("Purpur.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - API for any mob to burn daylight
+@@ -775,6 +786,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
+ this.getSleepingPos().ifPresent(blockPos -> output.store("sleeping_pos", BlockPos.CODEC, blockPos));
+ DataResult> dataResult = this.brain.serializeStart(NbtOps.INSTANCE).map(tag -> new Dynamic<>(NbtOps.INSTANCE, tag));
+ dataResult.resultOrPartial(LOGGER::error).ifPresent(dynamic -> output.store("Brain", Codec.PASSTHROUGH, (Dynamic>)dynamic));
++ output.putBoolean("Purpur.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - API for any mob to burn daylight
if (this.lastHurtByPlayer != null) {
- this.lastHurtByPlayer.store(compound, "last_hurt_by_player");
- compound.putInt("last_hurt_by_player_memory_time", this.lastHurtByPlayerMemoryTime);
-@@ -877,6 +889,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ this.lastHurtByPlayer.store(output, "last_hurt_by_player");
+ output.putInt("last_hurt_by_player_memory_time", this.lastHurtByPlayerMemoryTime);
+@@ -901,6 +913,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
} // Paper - The sleeping pos will always also set the actual pos, so a desync suggests something is wrong
}, this::clearSleepingPos);
- compound.getCompound("Brain").ifPresent(compoundTag -> this.brain = this.makeBrain(new Dynamic<>(NbtOps.INSTANCE, compoundTag)));
-+ this.shouldBurnInDay = compound.getBooleanOr("Purpur.ShouldBurnInDay", false); // Purpur - API for any mob to burn daylight
- this.lastHurtByPlayer = EntityReference.read(compound, "last_hurt_by_player");
- this.lastHurtByPlayerMemoryTime = compound.getIntOr("last_hurt_by_player_memory_time", 0);
- this.lastHurtByMob = EntityReference.read(compound, "last_hurt_by_mob");
-@@ -1010,16 +1023,31 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ input.read("Brain", Codec.PASSTHROUGH).ifPresent(dynamic -> this.brain = this.makeBrain((Dynamic>)dynamic));
++ this.shouldBurnInDay = input.getBooleanOr("Purpur.ShouldBurnInDay", false); // Purpur - API for any mob to burn daylight
+ this.lastHurtByPlayer = EntityReference.read(input, "last_hurt_by_player");
+ this.lastHurtByPlayerMemoryTime = input.getIntOr("last_hurt_by_player_memory_time", 0);
+ this.lastHurtByMob = EntityReference.read(input, "last_hurt_by_mob");
+@@ -1035,16 +1048,31 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (lookingEntity != null) {
// Gale start - Petal - reduce skull ItemStack lookups for reduced visibility
EntityType> type = lookingEntity.getType();
@@ -2448,7 +2433,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
return d;
}
-@@ -1065,6 +1093,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1090,6 +1118,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
Iterator iterator = this.activeEffects.values().iterator();
while (iterator.hasNext()) {
MobEffectInstance effect = iterator.next();
@@ -2456,7 +2441,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
EntityPotionEffectEvent event = CraftEventFactory.callEntityPotionEffectChangeEvent(this, effect, null, cause, EntityPotionEffectEvent.Action.CLEARED);
if (event.isCancelled()) {
continue;
-@@ -1388,6 +1417,24 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1420,6 +1449,24 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.stopSleeping();
}
@@ -2481,7 +2466,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
this.noActionTime = 0;
if (amount < 0.0F) {
amount = 0.0F;
-@@ -1649,10 +1696,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1681,10 +1728,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
protected Player resolvePlayerResponsibleForDamage(DamageSource damageSource) {
Entity entity = damageSource.getEntity();
if (entity instanceof Player player) {
@@ -2494,7 +2479,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
} else {
this.lastHurtByPlayer = null;
this.lastHurtByPlayerMemoryTime = 0;
-@@ -1703,6 +1750,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1735,6 +1782,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
}
@@ -2513,7 +2498,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
final org.bukkit.inventory.EquipmentSlot handSlot = (hand != null) ? org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand) : null;
final EntityResurrectEvent event = new EntityResurrectEvent((org.bukkit.entity.LivingEntity) this.getBukkitEntity(), handSlot);
event.setCancelled(itemStack == null);
-@@ -1848,7 +1907,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1880,7 +1939,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
if (this.level() instanceof ServerLevel serverLevel) {
boolean var6 = false;
if (this.dead && entitySource instanceof WitherBoss) { // Paper
@@ -2522,7 +2507,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
BlockPos blockPos = this.blockPosition();
BlockState blockState = Blocks.WITHER_ROSE.defaultBlockState();
if (this.level().getBlockState(blockPos).isAir() && blockState.canSurvive(this.level(), blockPos)) {
-@@ -1878,6 +1937,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1910,6 +1969,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
boolean flag = this.lastHurtByPlayerMemoryTime > 0;
this.dropEquipment(level); // CraftBukkit - from below
if (this.shouldDropLoot() && level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
@@ -2530,7 +2515,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
this.dropFromLootTable(level, damageSource, flag);
// Paper start
final boolean prev = this.clearEquipmentSlots;
-@@ -1886,6 +1946,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1918,6 +1978,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
// Paper end
this.dropCustomDeathLoot(level, damageSource, flag);
this.clearEquipmentSlots = prev; // Paper
@@ -2538,7 +2523,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
}
// CraftBukkit start - Call death event // Paper start - call advancement triggers with correct entity equipment
-@@ -3101,6 +3162,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3153,6 +3214,7 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
float f = (float)(d * 10.0 - 3.0);
if (f > 0.0F) {
this.playSound(this.getFallDamageSound((int)f), 1.0F, 1.0F);
@@ -2546,7 +2531,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
this.hurt(this.damageSources().flyIntoWall(), f);
}
}
-@@ -3544,8 +3606,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3596,8 +3658,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.pushEntities();
// Paper start - Add EntityMoveEvent
@@ -2559,7 +2544,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
Location from = new Location(this.level().getWorld(), this.xo, this.yo, this.zo, this.yRotO, this.xRotO);
Location to = new Location(this.level().getWorld(), this.getX(), this.getY(), this.getZ(), this.getYRot(), this.getXRot());
io.papermc.paper.event.entity.EntityMoveEvent event = new io.papermc.paper.event.entity.EntityMoveEvent(this.getBukkitLivingEntity(), from, to.clone());
-@@ -3555,11 +3619,52 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3607,11 +3671,52 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
this.absSnapTo(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ(), event.getTo().getYaw(), event.getTo().getPitch());
}
}
@@ -2612,7 +2597,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
}
protected void applyInput() {
-@@ -3589,7 +3694,18 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3645,7 +3750,18 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
.filter(equipmentSlot1 -> canGlideUsing(this.getItemBySlot(equipmentSlot1), equipmentSlot1))
.toList();
EquipmentSlot equipmentSlot = Util.getRandom(list, this.random);
@@ -2632,7 +2617,7 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
}
this.gameEvent(GameEvent.ELYTRA_GLIDE);
-@@ -4477,6 +4593,12 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -4533,6 +4649,12 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
: slot == equippable.slot() && this.canUseSlot(equippable.slot()) && equippable.canBeEquippedBy(this.getType());
}
@@ -2646,12 +2631,12 @@ index befed81ecf698d27971d18fe2743562742e4e1d3..cd8c764f9aa2321c6e157abe958d8986
return slot != EquipmentSlot.HEAD && slot != EquipmentSlot.MAINHAND && slot != EquipmentSlot.OFFHAND
? SlotAccess.forEquipmentSlot(entity, slot, itemStack -> itemStack.isEmpty() || entity.getEquipmentSlotForItem(itemStack) == slot)
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12824a8a0f 100644
+index 275f8697031251f7e106ac3fcc165e42af362434..6d8e7d23640707ba0d771174f65e58df75243f77 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -134,13 +134,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
- private BlockPos restrictCenter = BlockPos.ZERO;
- private float restrictRadius = -1.0F;
+@@ -137,13 +137,14 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+ private BlockPos homePosition = BlockPos.ZERO;
+ private int homeRadius = -1;
public boolean aware = true; // CraftBukkit
+ public int ticksSinceLastInteraction; // Purpur - Entity lifespan
@@ -2666,7 +2651,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
this.jumpControl = new JumpControl(this);
this.bodyRotationControl = this.createBodyControl();
this.navigation = this.createNavigation(level);
-@@ -281,6 +282,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -284,6 +285,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
target = null;
}
}
@@ -2674,7 +2659,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
this.target = target;
return true;
// CraftBukkit end
-@@ -320,8 +322,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -323,8 +325,28 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
this.resetAmbientSoundTime();
this.playAmbientSound();
}
@@ -2703,23 +2688,23 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
@Override
protected void playHurtSound(DamageSource source) {
this.resetAmbientSoundTime();
-@@ -416,6 +438,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
- compound.putBoolean("NoAI", this.isNoAi());
+@@ -423,6 +445,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+ output.putBoolean("NoAI", this.isNoAi());
}
- compound.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit
-+ compound.putInt("Purpur.ticksSinceLastInteraction", this.ticksSinceLastInteraction); // Purpur - Entity lifespan
+ output.putBoolean("Bukkit.Aware", this.aware); // CraftBukkit
++ output.putInt("Purpur.ticksSinceLastInteraction", this.ticksSinceLastInteraction); // Purpur - Entity lifespan
}
@Override
-@@ -439,6 +462,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
- this.lootTableSeed = compound.getLongOr("DeathLootTableSeed", 0L);
- this.setNoAi(compound.getBooleanOr("NoAI", false));
- this.aware = compound.getBooleanOr("Bukkit.Aware", true); // CraftBukkit
-+ this.ticksSinceLastInteraction = compound.getIntOr("Purpur.ticksSinceLastInteraction", 0); // Purpur- Entity lifespan
+@@ -450,6 +473,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+ this.lootTableSeed = input.getLongOr("DeathLootTableSeed", 0L);
+ this.setNoAi(input.getBooleanOr("NoAI", false));
+ this.aware = input.getBooleanOr("Bukkit.Aware", true); // CraftBukkit
++ this.ticksSinceLastInteraction = input.getIntOr("Purpur.ticksSinceLastInteraction", 0); // Purpur- Entity lifespan
}
@Override
-@@ -489,7 +513,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -502,7 +526,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
&& this.canPickUpLoot()
&& this.isAlive()
&& !this.dead
@@ -2728,7 +2713,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
Vec3i pickupReach = this.getPickupReach();
for (ItemEntity itemEntity : this.level()
-@@ -1142,7 +1166,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1163,7 +1187,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
);
}
@@ -2737,7 +2722,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
return spawnGroupData;
}
-@@ -1230,7 +1254,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1251,7 +1275,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
}
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
@@ -2745,8 +2730,8 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
+ return tryRide(player, hand); // Purpur - Ridables
}
- public boolean isWithinRestriction() {
-@@ -1474,6 +1498,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+ public boolean isWithinHome() {
+@@ -1500,6 +1524,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
this.playAttackSound();
}
@@ -2754,7 +2739,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
return flag;
}
-@@ -1485,26 +1510,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1511,26 +1536,8 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
private net.minecraft.world.phys.Vec3 cached_position;
// Gale end - JettPack - optimize sun burn tick - cache eye blockpos
public boolean isSunBurnTick() {
@@ -2783,7 +2768,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
}
@Override
-@@ -1552,4 +1559,58 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1578,4 +1585,58 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
this.getNavigation().updatePathfinderMaxVisitedNodes();
}
}
@@ -2843,7 +2828,7 @@ index 92ebc61aa7f6f70292a384b56bd8ef77a15e485c..6a94f42c8e048985b94db64fa0405e12
+ // Purpur end - Ridables
}
diff --git a/net/minecraft/world/entity/ai/attributes/AttributeMap.java b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
-index c61071e0019a18eb73223ed9b64619c9cb691896..909c9b5b82f1a41087a594fe5b5c021feb22f5e3 100644
+index 58d8424262db14b2dca0b2c5a40748b6c0c18e83..0ac398b8b10aae5e67a797b2991c66874003f282 100644
--- a/net/minecraft/world/entity/ai/attributes/AttributeMap.java
+++ b/net/minecraft/world/entity/ai/attributes/AttributeMap.java
@@ -20,14 +20,21 @@ public class AttributeMap {
@@ -2880,10 +2865,10 @@ index c61071e0019a18eb73223ed9b64619c9cb691896..909c9b5b82f1a41087a594fe5b5c021f
@Nullable
diff --git a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
-index e6fd15c3172a951d6551cf3fb42f92f39f1cf7b8..9952eed6a8ac31c757d5c27e043b85d7a949b481 100644
+index 26ffe98c94b2aaf61bf1693e86e8e7962e892a09..e6ef56d94e29a6629c9b672ed4ac4ef29ad6a286 100644
--- a/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
+++ b/net/minecraft/world/entity/ai/attributes/DefaultAttributes.java
-@@ -126,12 +126,12 @@ public class DefaultAttributes {
+@@ -128,12 +128,12 @@ public class DefaultAttributes {
.put(EntityType.IRON_GOLEM, IronGolem.createAttributes().build())
.put(EntityType.LLAMA, Llama.createAttributes().build())
.put(EntityType.MAGMA_CUBE, MagmaCube.createAttributes().build())
@@ -2898,7 +2883,7 @@ index e6fd15c3172a951d6551cf3fb42f92f39f1cf7b8..9952eed6a8ac31c757d5c27e043b85d7
.put(EntityType.PIG, Pig.createAttributes().build())
.put(EntityType.PIGLIN, Piglin.createAttributes().build())
.put(EntityType.PIGLIN_BRUTE, PiglinBrute.createAttributes().build())
-@@ -162,7 +162,7 @@ public class DefaultAttributes {
+@@ -164,7 +164,7 @@ public class DefaultAttributes {
.put(EntityType.VILLAGER, Villager.createAttributes().build())
.put(EntityType.VINDICATOR, Vindicator.createAttributes().build())
.put(EntityType.WARDEN, Warden.createAttributes().build())
@@ -3096,7 +3081,7 @@ index 2591e4bbd234e51ff2c6b00db888d3b158f5a07d..e3d48c7c6615185f8a14bc96476a665b
// CraftBukkit end - call EntityBreedEvent
level.broadcastEntityEvent(breedOffspring, (byte)12);
diff --git a/net/minecraft/world/entity/ai/control/MoveControl.java b/net/minecraft/world/entity/ai/control/MoveControl.java
-index cdd85c11a214db4829305eb54e0de9670a9241ac..88adfbb7998515f1f64b2d4121549179dc719375 100644
+index b6921582adef6f4c48de4dcffd6873ac0f909a08..89ee325b26ec3a647f55e45c9122ff4196433a43 100644
--- a/net/minecraft/world/entity/ai/control/MoveControl.java
+++ b/net/minecraft/world/entity/ai/control/MoveControl.java
@@ -29,6 +29,20 @@ public class MoveControl implements Control {
@@ -3243,10 +3228,10 @@ index 243a552f6f0c8c2bd25c0209c95e3bca08734711..38fd0196a0f5a90e39fa4eb8592f89bf
}
}
diff --git a/net/minecraft/world/entity/ai/goal/TemptGoal.java b/net/minecraft/world/entity/ai/goal/TemptGoal.java
-index 438d6347778a94b4fe430320b268a2d67afa209a..f88f618d34fb343b31de3af1a875d6633703df71 100644
+index dae935cc68e2e571d50e56ac8913c099a11cf771..a805c9426630c2c46db9d0dd536f1d16769395d3 100644
--- a/net/minecraft/world/entity/ai/goal/TemptGoal.java
+++ b/net/minecraft/world/entity/ai/goal/TemptGoal.java
-@@ -58,7 +58,7 @@ public class TemptGoal extends Goal {
+@@ -71,7 +71,7 @@ public class TemptGoal extends Goal {
}
private boolean shouldFollow(LivingEntity entity) {
@@ -3311,10 +3296,10 @@ index 17a08a3af468093668a41f154c2beb69c6617efa..398a97a72dca785204f6b7b8fc4abe5c
if (entity == null) {
if (this.isCombat && (!target.canBeSeenAsEnemy() || level.getDifficulty() == Difficulty.PEACEFUL)) {
diff --git a/net/minecraft/world/entity/ambient/Bat.java b/net/minecraft/world/entity/ambient/Bat.java
-index 65a9ea8d4a208f447b5e78b58b10a0917e35e4f2..cfb7b21269933ff3b053fa180ae8d5d9db4f68bc 100644
+index 5dadb42fd2d2d03ef366ca83c9c4aae6c288aaa4..6aae3634d69edcda7aff326dcea6f87668db4835 100644
--- a/net/minecraft/world/entity/ambient/Bat.java
+++ b/net/minecraft/world/entity/ambient/Bat.java
-@@ -43,11 +43,87 @@ public class Bat extends AmbientCreature {
+@@ -44,11 +44,87 @@ public class Bat extends AmbientCreature {
public Bat(EntityType extends Bat> entityType, Level level) {
super(entityType, level);
@@ -3402,7 +3387,7 @@ index 65a9ea8d4a208f447b5e78b58b10a0917e35e4f2..cfb7b21269933ff3b053fa180ae8d5d9
@Override
public boolean isFlapping() {
return !this.isResting() && this.tickCount % 10.0F == 0.0F;
-@@ -99,7 +175,7 @@ public class Bat extends AmbientCreature {
+@@ -100,7 +176,7 @@ public class Bat extends AmbientCreature {
}
public static AttributeSupplier.Builder createAttributes() {
@@ -3411,7 +3396,7 @@ index 65a9ea8d4a208f447b5e78b58b10a0917e35e4f2..cfb7b21269933ff3b053fa180ae8d5d9
}
public boolean isResting() {
-@@ -130,6 +206,14 @@ public class Bat extends AmbientCreature {
+@@ -131,6 +207,14 @@ public class Bat extends AmbientCreature {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -3426,7 +3411,7 @@ index 65a9ea8d4a208f447b5e78b58b10a0917e35e4f2..cfb7b21269933ff3b053fa180ae8d5d9
super.customServerAiStep(level);
BlockPos blockPos = this.blockPosition();
BlockPos blockPos1 = blockPos.above();
-@@ -232,7 +316,7 @@ public class Bat extends AmbientCreature {
+@@ -233,7 +317,7 @@ public class Bat extends AmbientCreature {
} else {
int maxLocalRawBrightness = level.getMaxLocalRawBrightness(pos);
int i = 4;
@@ -3435,7 +3420,7 @@ index 65a9ea8d4a208f447b5e78b58b10a0917e35e4f2..cfb7b21269933ff3b053fa180ae8d5d9
i = 7;
} else if (randomSource.nextBoolean()) {
return false;
-@@ -277,6 +361,7 @@ public class Bat extends AmbientCreature {
+@@ -278,6 +362,7 @@ public class Bat extends AmbientCreature {
*/
private static long nextHalloweenEnd = 0;
@@ -3554,10 +3539,10 @@ index dd8ea03ba823996a5c97562e357650ab34d0e32e..61e7300bbf272398b2faebf5e537d9c2
+ // Purpur end - Cows eat mushrooms
}
diff --git a/net/minecraft/world/entity/animal/AbstractFish.java b/net/minecraft/world/entity/animal/AbstractFish.java
-index 363582056339f64dbe7e686b61451c095c538c00..2cf95769ec3a1662443ea31e1bc2ba01cb7b523e 100644
+index b18765bb91b4015bef326663dbc8966945929996..0002e39e2670ad92849ccc0aada163b174fe1ec2 100644
--- a/net/minecraft/world/entity/animal/AbstractFish.java
+++ b/net/minecraft/world/entity/animal/AbstractFish.java
-@@ -88,6 +88,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
+@@ -90,6 +90,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
@Override
protected void registerGoals() {
super.registerGoals();
@@ -3565,7 +3550,7 @@ index 363582056339f64dbe7e686b61451c095c538c00..2cf95769ec3a1662443ea31e1bc2ba01
this.goalSelector.addGoal(0, new PanicGoal(this, 1.25));
this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 1.6, 1.4, EntitySelector.NO_SPECTATORS::test));
this.goalSelector.addGoal(4, new AbstractFish.FishSwimGoal(this));
-@@ -101,7 +102,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
+@@ -103,7 +104,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
@Override
public void travel(Vec3 travelVector) {
if (this.isInWater()) {
@@ -3574,7 +3559,7 @@ index 363582056339f64dbe7e686b61451c095c538c00..2cf95769ec3a1662443ea31e1bc2ba01
this.move(MoverType.SELF, this.getDeltaMovement());
this.setDeltaMovement(this.getDeltaMovement().scale(0.9));
if (this.getTarget() == null) {
-@@ -161,7 +162,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
+@@ -163,7 +164,7 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
protected void playStepSound(BlockPos pos, BlockState block) {
}
@@ -3583,7 +3568,7 @@ index 363582056339f64dbe7e686b61451c095c538c00..2cf95769ec3a1662443ea31e1bc2ba01
private final AbstractFish fish;
FishMoveControl(AbstractFish mob) {
-@@ -169,14 +170,22 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
+@@ -171,14 +172,22 @@ public abstract class AbstractFish extends WaterAnimal implements Bucketable {
this.fish = mob;
}
@@ -3609,27 +3594,27 @@ index 363582056339f64dbe7e686b61451c095c538c00..2cf95769ec3a1662443ea31e1bc2ba01
double d = this.wantedX - this.fish.getX();
double d1 = this.wantedY - this.fish.getY();
diff --git a/net/minecraft/world/entity/animal/Animal.java b/net/minecraft/world/entity/animal/Animal.java
-index b851f94d63a049292a3657009d68bc1641222104..1cae770340e969ec4f037b9121142878894102d3 100644
+index cdf44c2586db396f1afdcbae4174b8b4fb00f48e..4d99a1bf2dc141630a76942ccbf1f60824cf7495 100644
--- a/net/minecraft/world/entity/animal/Animal.java
+++ b/net/minecraft/world/entity/animal/Animal.java
-@@ -42,6 +42,7 @@ public abstract class Animal extends AgeableMob {
+@@ -43,6 +43,7 @@ public abstract class Animal extends AgeableMob {
@Nullable
- public UUID loveCause;
+ public EntityReference loveCause;
public @Nullable ItemStack breedItem; // CraftBukkit - Add breedItem variable
+ public abstract int getPurpurBreedTime(); // Purpur - Make entity breeding times configurable
protected Animal(EntityType extends Animal> entityType, Level level) {
super(entityType, level);
-@@ -142,7 +143,7 @@ public abstract class Animal extends AgeableMob {
+@@ -143,7 +144,7 @@ public abstract class Animal extends AgeableMob {
ItemStack itemInHand = player.getItemInHand(hand);
if (this.isFood(itemInHand)) {
int age = this.getAge();
-- if (!this.level().isClientSide && age == 0 && this.canFallInLove()) {
-+ if (!this.level().isClientSide && age == 0 && this.canFallInLove() && (this.level().purpurConfig.animalBreedingCooldownSeconds <= 0 || !this.level().hasBreedingCooldown(player.getUUID(), this.getClass()))) { // Purpur - Add adjustable breeding cooldown to config
+- if (player instanceof ServerPlayer serverPlayer && age == 0 && this.canFallInLove()) {
++ if (player instanceof ServerPlayer serverPlayer && age == 0 && this.canFallInLove() && (this.level().purpurConfig.animalBreedingCooldownSeconds <= 0 || !this.level().hasBreedingCooldown(player.getUUID(), this.getClass()))) { // Purpur - Add adjustable breeding cooldown to config
final ItemStack breedCopy = itemInHand.copy(); // Paper - Fix EntityBreedEvent copying
this.usePlayerItem(player, hand, itemInHand);
- this.setInLove(player, breedCopy); // Paper - Fix EntityBreedEvent copying
-@@ -239,10 +240,20 @@ public abstract class Animal extends AgeableMob {
+ this.setInLove(serverPlayer, breedCopy); // Paper - Fix EntityBreedEvent copying
+@@ -235,10 +236,20 @@ public abstract class Animal extends AgeableMob {
public void spawnChildFromBreeding(ServerLevel level, Animal mate) {
AgeableMob breedOffspring = this.getBreedOffspring(level, mate);
if (breedOffspring != null) {
@@ -3652,7 +3637,7 @@ index b851f94d63a049292a3657009d68bc1641222104..1cae770340e969ec4f037b9121142878
int experience = this.getRandom().nextInt(7) + 1;
org.bukkit.event.entity.EntityBreedEvent entityBreedEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(breedOffspring, this, mate, breeder, this.breedItem, experience);
if (entityBreedEvent.isCancelled()) {
-@@ -273,8 +284,10 @@ public abstract class Animal extends AgeableMob {
+@@ -269,8 +280,10 @@ public abstract class Animal extends AgeableMob {
player.awardStat(Stats.ANIMALS_BRED);
CriteriaTriggers.BRED_ANIMALS.trigger(player, this, animal, baby);
} // Paper - Call EntityBreedEvent
@@ -3666,10 +3651,10 @@ index b851f94d63a049292a3657009d68bc1641222104..1cae770340e969ec4f037b9121142878
animal.resetLove();
level.broadcastEntityEvent(this, (byte)18);
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
-index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d 100644
+index d40954f03c865bfbc5beb308bbcf7b7c9ac48eb9..ca5651f15552f91fba650747d28a75c00fa11442 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
-@@ -149,6 +149,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -150,6 +150,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
public Bee(EntityType extends Bee> entityType, Level level) {
super(entityType, level);
@@ -3677,7 +3662,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
// Paper start - Fix MC-167279
class BeeFlyingMoveControl extends FlyingMoveControl {
public BeeFlyingMoveControl(final Mob entity, final int maxPitchChange, final boolean noGravity) {
-@@ -157,22 +158,69 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -158,22 +159,69 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
public void tick() {
@@ -3748,7 +3733,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -187,6 +235,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -188,6 +236,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
protected void registerGoals() {
@@ -3756,7 +3741,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
this.goalSelector.addGoal(0, new Bee.BeeAttackGoal(this, 1.4F, true));
this.goalSelector.addGoal(1, new Bee.BeeEnterHiveGoal());
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
-@@ -204,6 +253,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -205,6 +254,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.goalSelector.addGoal(7, new Bee.BeeGrowCropGoal());
this.goalSelector.addGoal(8, new Bee.BeeWanderGoal());
this.goalSelector.addGoal(9, new FloatGoal(this));
@@ -3764,7 +3749,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
this.targetSelector.addGoal(1, new Bee.BeeHurtByOtherGoal(this).setAlertOthers(new Class[0]));
this.targetSelector.addGoal(2, new Bee.BeeBecomeAngryTargetGoal(this));
this.targetSelector.addGoal(3, new ResetUniversalAngerTargetGoal<>(this, true));
-@@ -365,7 +415,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -366,7 +416,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
public static boolean isNightOrRaining(Level level) {
@@ -3773,7 +3758,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
}
public void setStayOutOfHiveCountdown(int stayOutOfHiveCountdown) {
-@@ -388,7 +438,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -389,7 +439,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
protected void customServerAiStep(ServerLevel level) {
boolean hasStung = this.hasStung();
@@ -3782,7 +3767,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
this.underWaterTicks++;
} else {
this.underWaterTicks = 0;
-@@ -398,6 +448,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -399,6 +449,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.hurtServer(level, this.damageSources().drown(), 1.0F);
}
@@ -3790,7 +3775,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
if (hasStung) {
this.timeSinceSting++;
if (this.timeSinceSting % 5 == 0 && this.random.nextInt(Mth.clamp(1200 - this.timeSinceSting, 1, 1200)) == 0) {
-@@ -421,6 +472,35 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -422,6 +473,35 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
return beehiveBlockEntity != null && beehiveBlockEntity.isFireNearby();
}
@@ -3826,7 +3811,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
@Override
public int getRemainingPersistentAngerTime() {
return this.entityData.get(DATA_REMAINING_ANGER_TIME);
-@@ -1082,15 +1162,15 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -1080,15 +1160,15 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
}
}
@@ -3845,7 +3830,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
}
}
-@@ -1135,6 +1215,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -1133,6 +1213,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
Bee.this.savedFlowerPos = optional.get();
Bee.this.navigation
.moveTo(Bee.this.savedFlowerPos.getX() + 0.5, Bee.this.savedFlowerPos.getY() + 0.5, Bee.this.savedFlowerPos.getZ() + 0.5, 1.2F);
@@ -3853,7 +3838,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
return true;
} else {
Bee.this.remainingCooldownBeforeLocatingNewFlower = Mth.nextInt(Bee.this.random, 20, 60);
-@@ -1181,6 +1262,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -1179,6 +1260,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.pollinating = false;
Bee.this.navigation.stop();
Bee.this.remainingCooldownBeforeLocatingNewFlower = 200;
@@ -3861,7 +3846,7 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
}
@Override
-@@ -1227,6 +1309,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -1225,6 +1307,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
this.setWantedPos();
}
@@ -3870,10 +3855,10 @@ index edca2fa21e600fa1e7ef91af673adaae7d4c86c4..e9dfff7e3726cd2229f89bb39fa1ca48
if (Bee.this.random.nextFloat() < 0.05F && this.successfulPollinatingTicks > this.lastSoundPlayedTick + 60) {
this.lastSoundPlayedTick = this.successfulPollinatingTicks;
diff --git a/net/minecraft/world/entity/animal/Cat.java b/net/minecraft/world/entity/animal/Cat.java
-index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b449f4c0cfb 100644
+index 7d20de1741e5e9219dea84fe5692f31c05fa82a2..09d518a59fe93afbeacb2d41a0c9d287f4a74443 100644
--- a/net/minecraft/world/entity/animal/Cat.java
+++ b/net/minecraft/world/entity/animal/Cat.java
-@@ -91,10 +91,65 @@ public class Cat extends TamableAnimal {
+@@ -92,10 +92,65 @@ public class Cat extends TamableAnimal {
this.reassessTameGoals();
}
@@ -3939,7 +3924,7 @@ index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b44
this.goalSelector.addGoal(1, new TamableAnimal.TamableAnimalPanicGoal(1.5));
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(3, new Cat.CatRelaxOnOwnerGoal(this));
-@@ -107,6 +162,7 @@ public class Cat extends TamableAnimal {
+@@ -108,6 +163,7 @@ public class Cat extends TamableAnimal {
this.goalSelector.addGoal(10, new BreedGoal(this, 0.8));
this.goalSelector.addGoal(11, new WaterAvoidingRandomStrollGoal(this, 0.8, 1.0000001E-5F));
this.goalSelector.addGoal(12, new LookAtPlayerGoal(this, Player.class, 10.0F));
@@ -3947,7 +3932,7 @@ index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b44
this.targetSelector.addGoal(1, new NonTameRandomTargetGoal<>(this, Rabbit.class, false, null));
this.targetSelector.addGoal(1, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
}
-@@ -353,6 +409,14 @@ public class Cat extends TamableAnimal {
+@@ -354,6 +410,14 @@ public class Cat extends TamableAnimal {
return this.isTame() && otherAnimal instanceof Cat cat && cat.isTame() && super.canMate(otherAnimal);
}
@@ -3962,7 +3947,7 @@ index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b44
@Nullable
@Override
public SpawnGroupData finalizeSpawn(
-@@ -365,6 +429,7 @@ public class Cat extends TamableAnimal {
+@@ -366,6 +430,7 @@ public class Cat extends TamableAnimal {
@Override
public InteractionResult mobInteract(Player player, InteractionHand hand) {
@@ -3970,7 +3955,7 @@ index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b44
ItemStack itemInHand = player.getItemInHand(hand);
Item item = itemInHand.getItem();
if (this.isTame()) {
-@@ -451,7 +516,7 @@ public class Cat extends TamableAnimal {
+@@ -452,7 +517,7 @@ public class Cat extends TamableAnimal {
}
private void tryToTame(Player player) {
@@ -3980,10 +3965,10 @@ index 9c60140ef1ae9973ce39643c5253ddb0eac1c97b..db536a60f3f370d163e4429865634b44
this.setOrderedToSit(true);
this.level().broadcastEntityEvent(this, (byte)7);
diff --git a/net/minecraft/world/entity/animal/Chicken.java b/net/minecraft/world/entity/animal/Chicken.java
-index 351c29ffe842cc1406c36361520057ab046ca649..75cccc11019c5c6587d441e2c759d351dcb56153 100644
+index da408c313d898413dee928e9c80501ddf56d75e8..eaf913805195a580e3aa816dc28053abb9bdc246 100644
--- a/net/minecraft/world/entity/animal/Chicken.java
+++ b/net/minecraft/world/entity/animal/Chicken.java
-@@ -71,16 +71,76 @@ public class Chicken extends Animal {
+@@ -72,16 +72,76 @@ public class Chicken extends Animal {
this.setPathfindingMalus(PathType.WATER, 0.0F);
}
@@ -4061,7 +4046,7 @@ index 351c29ffe842cc1406c36361520057ab046ca649..75cccc11019c5c6587d441e2c759d351
}
@Override
-@@ -89,7 +149,7 @@ public class Chicken extends Animal {
+@@ -90,7 +150,7 @@ public class Chicken extends Animal {
}
public static AttributeSupplier.Builder createAttributes() {
@@ -4115,11 +4100,11 @@ index 75509be5b9162c1f7f91f2290ef2d80171ae61df..7e08573cba6efcd78fcce37bccc2923f
public ItemStack getBucketItemStack() {
return new ItemStack(Items.COD_BUCKET);
diff --git a/net/minecraft/world/entity/animal/Cow.java b/net/minecraft/world/entity/animal/Cow.java
-index 42c79a88679d2100528150d490554a75589e1ad8..6b504c2fdde020e086b0d01139cb56d65b7f9ad1 100644
+index 176425cbacea381990386d440059b768a583af98..b2fa170b14bc3037e5c143d320d0a1ef24738f1c 100644
--- a/net/minecraft/world/entity/animal/Cow.java
+++ b/net/minecraft/world/entity/animal/Cow.java
-@@ -22,12 +22,68 @@ import net.minecraft.world.level.Level;
- import net.minecraft.world.level.ServerLevelAccessor;
+@@ -23,12 +23,68 @@ import net.minecraft.world.level.storage.ValueInput;
+ import net.minecraft.world.level.storage.ValueOutput;
public class Cow extends AbstractCow {
+ private boolean isNaturallyAggressiveToPlayers; // Purpur - Cows naturally aggressive to players chance
@@ -4187,8 +4172,8 @@ index 42c79a88679d2100528150d490554a75589e1ad8..6b504c2fdde020e086b0d01139cb56d6
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -40,6 +96,12 @@ public class Cow extends AbstractCow {
- VariantUtils.writeVariant(compound, this.getVariant());
+@@ -41,6 +97,12 @@ public class Cow extends AbstractCow {
+ VariantUtils.writeVariant(output, this.getVariant());
}
+ // Purpur start - Cows naturally aggressive to players chance
@@ -4198,21 +4183,21 @@ index 42c79a88679d2100528150d490554a75589e1ad8..6b504c2fdde020e086b0d01139cb56d6
+ // Purpur end - Cows naturally aggressive to players chance
+
@Override
- public void readAdditionalSaveData(CompoundTag compound) {
- super.readAdditionalSaveData(compound);
-@@ -61,6 +123,7 @@ public class Cow extends AbstractCow {
+ protected void readAdditionalSaveData(ValueInput input) {
+ super.readAdditionalSaveData(input);
+@@ -62,6 +124,7 @@ public class Cow extends AbstractCow {
public SpawnGroupData finalizeSpawn(
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
) {
+ this.isNaturallyAggressiveToPlayers = level.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= level.getLevel().purpurConfig.cowNaturallyAggressiveToPlayersChance; // Purpur - Cows naturally aggressive to players chance
- CowVariants.selectVariantToSpawn(this.random, this.registryAccess(), SpawnContext.create(level, this.blockPosition())).ifPresent(this::setVariant);
+ VariantUtils.selectVariantToSpawn(SpawnContext.create(level, this.blockPosition()), Registries.COW_VARIANT).ifPresent(this::setVariant);
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
diff --git a/net/minecraft/world/entity/animal/Dolphin.java b/net/minecraft/world/entity/animal/Dolphin.java
-index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e45b7802a3 100644
+index 4bb273b11dbfbc6557c6771f79aa63f5f69d03cf..23696a5e2871ea07f34d4b4f6a20e2896ac3f5bd 100644
--- a/net/minecraft/world/entity/animal/Dolphin.java
+++ b/net/minecraft/world/entity/animal/Dolphin.java
-@@ -73,14 +73,105 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -74,14 +74,105 @@ public class Dolphin extends AgeableWaterCreature {
private static final boolean DEFAULT_GOT_FISH = false;
@Nullable
public BlockPos treasurePos;
@@ -4319,7 +4304,7 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
@Nullable
@Override
public SpawnGroupData finalizeSpawn(
-@@ -89,6 +180,7 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -90,6 +181,7 @@ public class Dolphin extends AgeableWaterCreature {
this.setAirSupply(this.getMaxAirSupply());
this.setXRot(0.0F);
SpawnGroupData spawnGroupData1 = Objects.requireNonNullElseGet(spawnGroupData, () -> new AgeableMob.AgeableMobGroupData(0.1F));
@@ -4327,7 +4312,7 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData1);
}
-@@ -155,17 +247,21 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -156,17 +248,21 @@ public class Dolphin extends AgeableWaterCreature {
protected void registerGoals() {
this.goalSelector.addGoal(0, new BreathAirGoal(this));
this.goalSelector.addGoal(0, new TryFindWaterGoal(this));
@@ -4350,7 +4335,7 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
}
public static AttributeSupplier.Builder createAttributes() {
-@@ -209,7 +305,7 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -210,7 +306,7 @@ public class Dolphin extends AgeableWaterCreature {
@Override
protected boolean canRide(Entity entity) {
@@ -4359,7 +4344,7 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
}
@Override
-@@ -238,6 +334,11 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -239,6 +335,11 @@ public class Dolphin extends AgeableWaterCreature {
@Override
public void tick() {
super.tick();
@@ -4371,7 +4356,7 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
if (this.isNoAi()) {
this.setAirSupply(this.getMaxAirSupply());
} else {
-@@ -398,6 +499,7 @@ public class Dolphin extends AgeableWaterCreature {
+@@ -399,6 +500,7 @@ public class Dolphin extends AgeableWaterCreature {
@Override
public boolean canUse() {
@@ -4380,10 +4365,10 @@ index 8f2af65c58da50be2776a21b10db5eb9cb5f3076..87ba416479df56bad5d13c01e96e92e4
}
diff --git a/net/minecraft/world/entity/animal/Fox.java b/net/minecraft/world/entity/animal/Fox.java
-index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8cc19eb8e 100644
+index 517c546cfc8eca2191df57289e6a22ac64fc867c..8964bb5098c0dc36741af3656af6bc0b5b463abe 100644
--- a/net/minecraft/world/entity/animal/Fox.java
+++ b/net/minecraft/world/entity/animal/Fox.java
-@@ -141,6 +141,73 @@ public class Fox extends Animal {
+@@ -142,6 +142,73 @@ public class Fox extends Animal {
this.getNavigation().setRequiredPathLength(32.0F);
}
@@ -4457,7 +4442,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -160,6 +227,7 @@ public class Fox extends Animal {
+@@ -161,6 +228,7 @@ public class Fox extends Animal {
this, AbstractFish.class, 20, false, false, (entity, level) -> entity instanceof AbstractSchoolingFish
);
this.goalSelector.addGoal(0, new Fox.FoxFloatGoal());
@@ -4465,7 +4450,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
this.goalSelector.addGoal(0, new ClimbOnTopOfPowderSnowGoal(this, this.level()));
this.goalSelector.addGoal(1, new Fox.FaceplantGoal());
this.goalSelector.addGoal(2, new Fox.FoxPanicGoal(2.2));
-@@ -185,6 +253,7 @@ public class Fox extends Animal {
+@@ -186,6 +254,7 @@ public class Fox extends Animal {
this.goalSelector.addGoal(11, new Fox.FoxSearchForItemsGoal());
this.goalSelector.addGoal(12, new Fox.FoxLookAtPlayerGoal(this, Player.class, 24.0F));
this.goalSelector.addGoal(13, new Fox.PerchAndSearchGoal());
@@ -4473,7 +4458,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
this.targetSelector
.addGoal(
3,
-@@ -345,6 +414,11 @@ public class Fox extends Animal {
+@@ -346,6 +415,11 @@ public class Fox extends Animal {
}
private void setTargetGoals() {
@@ -4485,7 +4470,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
if (this.getVariant() == Fox.Variant.RED) {
this.targetSelector.addGoal(4, this.landTargetGoal);
this.targetSelector.addGoal(4, this.turtleEggTargetGoal);
-@@ -372,6 +446,7 @@ public class Fox extends Animal {
+@@ -373,6 +447,7 @@ public class Fox extends Animal {
public void setVariant(Fox.Variant variant) {
this.entityData.set(DATA_TYPE_ID, variant.getId());
@@ -4493,7 +4478,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
}
@Nullable
-@@ -706,6 +781,29 @@ public class Fox extends Animal {
+@@ -703,6 +778,29 @@ public class Fox extends Animal {
}
// Paper end
@@ -4523,7 +4508,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
@Override
// Paper start - Cancellable death event
protected org.bukkit.event.entity.EntityDeathEvent dropAllDeathLoot(ServerLevel level, DamageSource damageSource) {
-@@ -919,8 +1017,10 @@ public class Fox extends Animal {
+@@ -916,8 +1014,10 @@ public class Fox extends Animal {
CriteriaTriggers.BRED_ANIMALS.trigger(serverPlayer, this.animal, this.partner, fox);
}
@@ -4536,7 +4521,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
this.animal.resetLove();
this.partner.resetLove();
serverLevel.addFreshEntityWithPassengers(fox, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
-@@ -975,7 +1075,7 @@ public class Fox extends Animal {
+@@ -972,7 +1072,7 @@ public class Fox extends Animal {
}
protected void onReachedTarget() {
@@ -4545,7 +4530,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
BlockState blockState = Fox.this.level().getBlockState(this.blockPos);
if (blockState.is(Blocks.SWEET_BERRY_BUSH)) {
this.pickSweetBerries(blockState);
-@@ -1089,15 +1189,15 @@ public class Fox extends Animal {
+@@ -1086,15 +1186,15 @@ public class Fox extends Animal {
}
}
@@ -4564,7 +4549,7 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
}
}
-@@ -1133,15 +1233,15 @@ public class Fox extends Animal {
+@@ -1130,15 +1230,15 @@ public class Fox extends Animal {
}
}
@@ -4583,11 +4568,72 @@ index 5c7572b75afcfa9965fcda5965f6ae2e59babb46..ff20a6e9745c7724dfae41d5868912c8
}
}
}
+diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
+index 4e74d5b3076f50f9294553b453f5903ef32f1e8a..e04da94daced96a7eb9fdb01c551bea667b72d76 100644
+--- a/net/minecraft/world/entity/animal/HappyGhast.java
++++ b/net/minecraft/world/entity/animal/HappyGhast.java
+@@ -118,6 +118,47 @@ public class HappyGhast extends Animal {
+ this.removeAllGoals(goal -> true);
+ }
+
++ // Purpur start - Ridables
++ @Override
++ public boolean dismountsUnderwater() {
++ return level().purpurConfig.useDismountsUnderwaterTag ? super.dismountsUnderwater() : !level().purpurConfig.happyGhastRidableInWater;
++ }
++ // Purpur end - Ridables
++
++ // Purpur start - Configurable entity base attributes
++ @Override
++ public void initAttributes() {
++ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.happyGhastMaxHealth);
++ this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.happyGhastScale);
++ this.getAttribute(Attributes.TEMPT_RANGE).setBaseValue(this.level().purpurConfig.happyGhastTemptRange);
++ this.getAttribute(Attributes.FLYING_SPEED).setBaseValue(this.level().purpurConfig.happyGhastFlyingSpeed);
++ this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(this.level().purpurConfig.happyGhastMovementSpeed);
++ this.getAttribute(Attributes.FOLLOW_RANGE).setBaseValue(this.level().purpurConfig.happyGhastFollowRange);
++ this.getAttribute(Attributes.CAMERA_DISTANCE).setBaseValue(this.level().purpurConfig.happyGhastCameraDistance);
++ }
++ // Purpur end - Configurable entity base attributes
++
++ // Purpur start - Make entity breeding times configurable
++ @Override
++ public int getPurpurBreedTime() {
++ return 6000;
++ }
++ // Purpur end - Make entity breeding times configurable
++
++ // Purpur start - Toggle for water sensitive mob damage
++ @Override
++ public boolean isSensitiveToWater() {
++ return this.level().purpurConfig.happyGhastTakeDamageFromWater;
++ }
++ // Purpur end - Toggle for water sensitive mob damage
++
++ // Purpur start - Mobs always drop experience
++ @Override
++ protected boolean isAlwaysExperienceDropper() {
++ return this.level().purpurConfig.happyGhastAlwaysDropExp;
++ }
++ // Purpur end - Mobs always drop experience
++
+ @Override
+ protected void ageBoundaryReached() {
+ if (this.isBaby()) {
+@@ -141,7 +182,7 @@ public class HappyGhast extends Animal {
+
+ @Override
+ protected float sanitizeScale(float scale) {
+- return Math.min(scale, 1.0F);
++ return Math.min(scale, 1.0F); // Purpur - Configurable entity base attributes
+ }
+
+ @Override
diff --git a/net/minecraft/world/entity/animal/IronGolem.java b/net/minecraft/world/entity/animal/IronGolem.java
-index 33245f28c02c5cd42f2daec8748d615b7f5e21ec..21ed6bfcba6ea58663dc8e932814c1ac084d0402 100644
+index db309a1261778cc65da9b4bf5a962a372b83bba6..8885ab56eb72c0106ef57359ca11f70c012fc348 100644
--- a/net/minecraft/world/entity/animal/IronGolem.java
+++ b/net/minecraft/world/entity/animal/IronGolem.java
-@@ -57,13 +57,67 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
+@@ -58,13 +58,67 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
private int remainingPersistentAngerTime;
@Nullable
private UUID persistentAngerTarget;
@@ -4655,7 +4701,7 @@ index 33245f28c02c5cd42f2daec8748d615b7f5e21ec..21ed6bfcba6ea58663dc8e932814c1ac
this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(2, new MoveTowardsTargetGoal(this, 0.9, 32.0F));
this.goalSelector.addGoal(2, new MoveBackToVillageGoal(this, 0.6, false));
-@@ -71,6 +125,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
+@@ -72,6 +126,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
this.goalSelector.addGoal(5, new OfferFlowerGoal(this));
this.goalSelector.addGoal(7, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
@@ -4663,23 +4709,23 @@ index 33245f28c02c5cd42f2daec8748d615b7f5e21ec..21ed6bfcba6ea58663dc8e932814c1ac
this.targetSelector.addGoal(1, new DefendVillageTargetGoal(this));
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
-@@ -141,6 +196,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
- compound.putBoolean("PlayerCreated", this.isPlayerCreated());
-+ compound.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
- this.addPersistentAngerSaveData(compound);
+@@ -142,6 +197,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+ output.putBoolean("PlayerCreated", this.isPlayerCreated());
++ output.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
+ this.addPersistentAngerSaveData(output);
}
-@@ -148,6 +204,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
- public void readAdditionalSaveData(CompoundTag compound) {
- super.readAdditionalSaveData(compound);
- this.setPlayerCreated(compound.getBooleanOr("PlayerCreated", false));
-+ this.setSummoner(compound.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
- this.readPersistentAngerSaveData(this.level(), compound);
+@@ -149,6 +205,7 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
+ protected void readAdditionalSaveData(ValueInput input) {
+ super.readAdditionalSaveData(input);
+ this.setPlayerCreated(input.getBooleanOr("PlayerCreated", false));
++ this.setSummoner(input.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
+ this.readPersistentAngerSaveData(this.level(), input);
}
-@@ -257,16 +314,17 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
+@@ -258,16 +315,17 @@ public class IronGolem extends AbstractGolem implements NeutralMob {
protected InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemInHand = player.getItemInHand(hand);
if (!itemInHand.is(Items.IRON_INGOT)) {
@@ -4700,10 +4746,10 @@ index 33245f28c02c5cd42f2daec8748d615b7f5e21ec..21ed6bfcba6ea58663dc8e932814c1ac
}
}
diff --git a/net/minecraft/world/entity/animal/MushroomCow.java b/net/minecraft/world/entity/animal/MushroomCow.java
-index cc2fd681d2383e62191e7b380322f2e176d79f1e..91b03b8f01ff7dd3c4a00c088fd8ba2387a5b2f7 100644
+index 1f82848c97c5b52d6c4225b07a895f00d20c7d6c..cdb11eabdd246fb6c6aed11c9f1f264648b55c26 100644
--- a/net/minecraft/world/entity/animal/MushroomCow.java
+++ b/net/minecraft/world/entity/animal/MushroomCow.java
-@@ -61,6 +61,51 @@ public class MushroomCow extends AbstractCow implements Shearable {
+@@ -62,6 +62,51 @@ public class MushroomCow extends AbstractCow implements Shearable {
super(entityType, level);
}
@@ -4755,7 +4801,7 @@ index cc2fd681d2383e62191e7b380322f2e176d79f1e..91b03b8f01ff7dd3c4a00c088fd8ba23
@Override
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
return level.getBlockState(pos.below()).is(Blocks.MYCELIUM) ? 10.0F : level.getPathfindingCostFromLightLevels(pos);
-@@ -121,7 +166,7 @@ public class MushroomCow extends AbstractCow implements Shearable {
+@@ -122,7 +167,7 @@ public class MushroomCow extends AbstractCow implements Shearable {
java.util.List drops = this.generateDefaultDrops(serverLevel, itemInHand);
org.bukkit.event.player.PlayerShearEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemInHand, hand, drops);
if (event != null) {
@@ -4765,10 +4811,10 @@ index cc2fd681d2383e62191e7b380322f2e176d79f1e..91b03b8f01ff7dd3c4a00c088fd8ba23
// Paper end - custom shear drops
}
diff --git a/net/minecraft/world/entity/animal/Ocelot.java b/net/minecraft/world/entity/animal/Ocelot.java
-index 9e86a42f04d06c3dcd241f16ab876b0c8422fd81..dcfa57bc691e997969bc9fef1983088322e4e4e4 100644
+index e8b184f2e1a98e565a50ce6ae6cab248d5a6e89b..4c20569ec5c504c582575851ab1d74248289b1c0 100644
--- a/net/minecraft/world/entity/animal/Ocelot.java
+++ b/net/minecraft/world/entity/animal/Ocelot.java
-@@ -63,6 +63,52 @@ public class Ocelot extends Animal {
+@@ -64,6 +64,52 @@ public class Ocelot extends Animal {
this.reassessTrustingGoals();
}
@@ -4821,7 +4867,7 @@ index 9e86a42f04d06c3dcd241f16ab876b0c8422fd81..dcfa57bc691e997969bc9fef19830883
public boolean isTrusting() {
return this.entityData.get(DATA_TRUSTING);
}
-@@ -94,12 +140,14 @@ public class Ocelot extends Animal {
+@@ -95,12 +141,14 @@ public class Ocelot extends Animal {
protected void registerGoals() {
this.temptGoal = new Ocelot.OcelotTemptGoal(this, 0.6, itemStack -> itemStack.is(ItemTags.OCELOT_FOOD), true);
this.goalSelector.addGoal(1, new FloatGoal(this));
@@ -4836,7 +4882,7 @@ index 9e86a42f04d06c3dcd241f16ab876b0c8422fd81..dcfa57bc691e997969bc9fef19830883
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Chicken.class, false));
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, false, false, Turtle.BABY_ON_LAND_SELECTOR));
}
-@@ -233,7 +281,7 @@ public class Ocelot extends Animal {
+@@ -234,7 +282,7 @@ public class Ocelot extends Animal {
public boolean checkSpawnObstruction(LevelReader level) {
if (level.isUnobstructed(this) && !level.containsAnyLiquid(this.getBoundingBox())) {
BlockPos blockPos = this.blockPosition();
@@ -4846,10 +4892,10 @@ index 9e86a42f04d06c3dcd241f16ab876b0c8422fd81..dcfa57bc691e997969bc9fef19830883
}
diff --git a/net/minecraft/world/entity/animal/Panda.java b/net/minecraft/world/entity/animal/Panda.java
-index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884bb9e2859 100644
+index 44c12820b9b39acc5220db8b8d29a31c0e57526e..02bfa88568e635770675ea9173f2cf3ca21457fa 100644
--- a/net/minecraft/world/entity/animal/Panda.java
+++ b/net/minecraft/world/entity/animal/Panda.java
-@@ -106,6 +106,62 @@ public class Panda extends Animal {
+@@ -107,6 +107,62 @@ public class Panda extends Animal {
}
}
@@ -4912,7 +4958,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
@Override
protected boolean canDispenserEquipIntoSlot(EquipmentSlot slot) {
return slot == EquipmentSlot.MAINHAND && this.canPickUpLoot();
-@@ -259,6 +315,7 @@ public class Panda extends Animal {
+@@ -260,6 +316,7 @@ public class Panda extends Animal {
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -4920,7 +4966,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
this.goalSelector.addGoal(2, new Panda.PandaPanicGoal(this, 2.0));
this.goalSelector.addGoal(2, new Panda.PandaBreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new Panda.PandaAttackGoal(this, 1.2F, true));
-@@ -274,6 +331,7 @@ public class Panda extends Animal {
+@@ -275,6 +332,7 @@ public class Panda extends Animal {
this.goalSelector.addGoal(12, new Panda.PandaRollGoal(this));
this.goalSelector.addGoal(13, new FollowParentGoal(this, 1.25));
this.goalSelector.addGoal(14, new WaterAvoidingRandomStrollGoal(this, 1.0));
@@ -4928,7 +4974,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
this.targetSelector.addGoal(1, new Panda.PandaHurtByTargetGoal(this).setAlertOthers(new Class[0]));
}
-@@ -597,7 +655,11 @@ public class Panda extends Animal {
+@@ -598,7 +656,11 @@ public class Panda extends Animal {
public void setAttributes() {
if (this.isWeak()) {
@@ -4941,7 +4987,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
}
if (this.isLazy()) {
-@@ -617,7 +679,7 @@ public class Panda extends Animal {
+@@ -618,7 +680,7 @@ public class Panda extends Animal {
public InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemInHand = player.getItemInHand(hand);
if (this.isScared()) {
@@ -4950,7 +4996,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
} else if (this.isOnBack()) {
this.setOnBack(false);
return InteractionResult.SUCCESS;
-@@ -653,7 +715,7 @@ public class Panda extends Animal {
+@@ -654,7 +716,7 @@ public class Panda extends Animal {
return InteractionResult.SUCCESS_SERVER;
} else {
@@ -4959,7 +5005,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
}
}
-@@ -961,7 +1023,7 @@ public class Panda extends Animal {
+@@ -962,7 +1024,7 @@ public class Panda extends Animal {
}
}
@@ -4968,7 +5014,7 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
private final Panda panda;
public PandaMoveControl(Panda mob) {
-@@ -970,9 +1032,9 @@ public class Panda extends Animal {
+@@ -971,9 +1033,9 @@ public class Panda extends Animal {
}
@Override
@@ -4981,10 +5027,10 @@ index ecd85f3e33f80084b9ee06c9ff1f57b73399be50..99d99d59ec0eb13dc40bc88bd70ad884
}
}
diff --git a/net/minecraft/world/entity/animal/Parrot.java b/net/minecraft/world/entity/animal/Parrot.java
-index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b0669828912f1e4214 100644
+index 22d1e36dadd6a8cbf615335074426aaab6ea7d01..dddf3a2e372bd0d483c1da01d36fe59b17b3d4e2 100644
--- a/net/minecraft/world/entity/animal/Parrot.java
+++ b/net/minecraft/world/entity/animal/Parrot.java
-@@ -129,12 +129,97 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -131,12 +131,97 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
public Parrot(EntityType extends Parrot> entityType, Level level) {
super(entityType, level);
@@ -5083,7 +5129,7 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
@Nullable
@Override
public SpawnGroupData finalizeSpawn(
-@@ -155,8 +240,11 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -157,8 +242,11 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
@Override
protected void registerGoals() {
@@ -5096,7 +5142,7 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
this.goalSelector.addGoal(1, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this));
this.goalSelector.addGoal(2, new FollowOwnerGoal(this, 1.0, 5.0F, 1.0F));
-@@ -262,7 +350,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -264,7 +352,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
}
if (!this.level().isClientSide) {
@@ -5105,7 +5151,7 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
this.tame(player);
this.level().broadcastEntityEvent(this, (byte)7);
} else {
-@@ -270,6 +358,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -272,6 +360,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
}
}
@@ -5113,7 +5159,7 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
return InteractionResult.SUCCESS;
} else if (!itemInHand.is(ItemTags.PARROT_POISONOUS_FOOD)) {
if (!this.isFlying() && this.isTame() && this.isOwnedBy(player)) {
-@@ -294,7 +383,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -296,7 +385,7 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
@Override
public boolean isFood(ItemStack stack) {
@@ -5122,7 +5168,7 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
}
public static boolean checkParrotSpawnRules(
-@@ -309,13 +398,13 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
+@@ -311,13 +400,13 @@ public class Parrot extends ShoulderRidingEntity implements FlyingAnimal {
@Override
public boolean canMate(Animal otherAnimal) {
@@ -5139,10 +5185,10 @@ index cff10bb74a216238288280399910ab1fa85cb1a5..1b8350a09a9f2a708c8cd1b066982891
@Nullable
diff --git a/net/minecraft/world/entity/animal/Pig.java b/net/minecraft/world/entity/animal/Pig.java
-index ec2074741b52cf8f1ac3c0276bcfc9b8806b71bf..5bc370d45fc6e0a37cc77ac1b36e0caad959741c 100644
+index 155a51233895955d01c2ee73416e2daefc4dfd0f..adbbe938c14d14a628d9963acec57c32661957cd 100644
--- a/net/minecraft/world/entity/animal/Pig.java
+++ b/net/minecraft/world/entity/animal/Pig.java
-@@ -65,9 +65,56 @@ public class Pig extends Animal implements ItemSteerable {
+@@ -66,9 +66,56 @@ public class Pig extends Animal implements ItemSteerable {
super(entityType, level);
}
@@ -5199,7 +5245,7 @@ index ec2074741b52cf8f1ac3c0276bcfc9b8806b71bf..5bc370d45fc6e0a37cc77ac1b36e0caa
this.goalSelector.addGoal(1, new PanicGoal(this, 1.25));
this.goalSelector.addGoal(3, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(4, new TemptGoal(this, 1.2, itemStack -> itemStack.is(Items.CARROT_ON_A_STICK), false));
-@@ -141,6 +188,19 @@ public class Pig extends Animal implements ItemSteerable {
+@@ -142,6 +189,19 @@ public class Pig extends Animal implements ItemSteerable {
@Override
public InteractionResult mobInteract(Player player, InteractionHand hand) {
boolean isFood = this.isFood(player.getItemInHand(hand));
@@ -5220,10 +5266,10 @@ index ec2074741b52cf8f1ac3c0276bcfc9b8806b71bf..5bc370d45fc6e0a37cc77ac1b36e0caa
if (!this.level().isClientSide) {
player.startRiding(this);
diff --git a/net/minecraft/world/entity/animal/PolarBear.java b/net/minecraft/world/entity/animal/PolarBear.java
-index fcdaaed31c38acb55e66599cd3314606d223cd67..ab08e5e589dac3341c006876378903f7cf1db25f 100644
+index d727e8e93e466b9bb91cbb43b9c1bbbccc56d486..e0b51b482607ec5a9f5b4d13d918d79b2f52f9c0 100644
--- a/net/minecraft/world/entity/animal/PolarBear.java
+++ b/net/minecraft/world/entity/animal/PolarBear.java
-@@ -59,11 +59,92 @@ public class PolarBear extends Animal implements NeutralMob {
+@@ -60,11 +60,92 @@ public class PolarBear extends Animal implements NeutralMob {
private int remainingPersistentAngerTime;
@Nullable
private UUID persistentAngerTarget;
@@ -5316,7 +5362,7 @@ index fcdaaed31c38acb55e66599cd3314606d223cd67..ab08e5e589dac3341c006876378903f7
@Nullable
@Override
public AgeableMob getBreedOffspring(ServerLevel level, AgeableMob otherParent) {
-@@ -72,19 +153,27 @@ public class PolarBear extends Animal implements NeutralMob {
+@@ -73,19 +154,27 @@ public class PolarBear extends Animal implements NeutralMob {
@Override
public boolean isFood(ItemStack stack) {
@@ -5345,7 +5391,7 @@ index fcdaaed31c38acb55e66599cd3314606d223cd67..ab08e5e589dac3341c006876378903f7
this.targetSelector.addGoal(1, new PolarBear.PolarBearHurtByTargetGoal());
this.targetSelector.addGoal(2, new PolarBear.PolarBearAttackPlayersGoal());
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, this::isAngryAt));
-@@ -203,6 +292,12 @@ public class PolarBear extends Animal implements NeutralMob {
+@@ -204,6 +293,12 @@ public class PolarBear extends Animal implements NeutralMob {
if (!this.level().isClientSide) {
this.updatePersistentAnger((ServerLevel)this.level(), true);
}
@@ -5358,7 +5404,7 @@ index fcdaaed31c38acb55e66599cd3314606d223cd67..ab08e5e589dac3341c006876378903f7
}
@Override
-@@ -222,6 +317,7 @@ public class PolarBear extends Animal implements NeutralMob {
+@@ -223,6 +318,7 @@ public class PolarBear extends Animal implements NeutralMob {
public void setStanding(boolean standing) {
this.entityData.set(DATA_STANDING_ID, standing);
@@ -5367,10 +5413,10 @@ index fcdaaed31c38acb55e66599cd3314606d223cd67..ab08e5e589dac3341c006876378903f7
public float getStandingAnimationScale(float partialTick) {
diff --git a/net/minecraft/world/entity/animal/Pufferfish.java b/net/minecraft/world/entity/animal/Pufferfish.java
-index 4a7201fe9e946fc20ed04e729d00f7986a748bad..3b815f3ad9068eb2bdf93eac1c1aff38dffdb850 100644
+index e67f9b26444e3af42feeb0223c1b7c1e536646ba..685176ce37538cbbc614401db568acdb0ad264bb 100644
--- a/net/minecraft/world/entity/animal/Pufferfish.java
+++ b/net/minecraft/world/entity/animal/Pufferfish.java
-@@ -46,6 +46,39 @@ public class Pufferfish extends AbstractFish {
+@@ -47,6 +47,39 @@ public class Pufferfish extends AbstractFish {
this.refreshDimensions();
}
@@ -5411,10 +5457,10 @@ index 4a7201fe9e946fc20ed04e729d00f7986a748bad..3b815f3ad9068eb2bdf93eac1c1aff38
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
diff --git a/net/minecraft/world/entity/animal/Rabbit.java b/net/minecraft/world/entity/animal/Rabbit.java
-index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bbad20b0fdf 100644
+index ac99590dad689f2cfffb9b9e2465f6a252d41e9c..1af1b33702296f9aa74c33436ea2904c5e5ae43d 100644
--- a/net/minecraft/world/entity/animal/Rabbit.java
+++ b/net/minecraft/world/entity/animal/Rabbit.java
-@@ -90,6 +90,7 @@ public class Rabbit extends Animal {
+@@ -91,6 +91,7 @@ public class Rabbit extends Animal {
private boolean wasOnGround;
private int jumpDelayTicks;
public int moreCarrotTicks = 0;
@@ -5422,7 +5468,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
public Rabbit(EntityType extends Rabbit> entityType, Level level) {
super(entityType, level);
-@@ -98,9 +99,84 @@ public class Rabbit extends Animal {
+@@ -99,9 +100,84 @@ public class Rabbit extends Animal {
//this.setSpeedModifier(0.0); // CraftBukkit
}
@@ -5507,7 +5553,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
this.goalSelector.addGoal(1, new ClimbOnTopOfPowderSnowGoal(this, this.level()));
this.goalSelector.addGoal(1, new Rabbit.RabbitPanicGoal(this, 2.2));
this.goalSelector.addGoal(2, new BreedGoal(this, 0.8));
-@@ -115,6 +191,14 @@ public class Rabbit extends Animal {
+@@ -116,6 +192,14 @@ public class Rabbit extends Animal {
@Override
protected float getJumpPower() {
@@ -5522,7 +5568,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
float f = 0.3F;
if (this.moveControl.getSpeedModifier() <= 0.6) {
f = 0.2F;
-@@ -182,6 +266,12 @@ public class Rabbit extends Animal {
+@@ -183,6 +267,12 @@ public class Rabbit extends Animal {
@Override
public void customServerAiStep(ServerLevel level) {
@@ -5535,7 +5581,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
if (this.jumpDelayTicks > 0) {
this.jumpDelayTicks--;
}
-@@ -403,10 +493,23 @@ public class Rabbit extends Animal {
+@@ -404,10 +494,23 @@ public class Rabbit extends Animal {
}
this.setVariant(randomRabbitVariant);
@@ -5559,7 +5605,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
Holder biome = level.getBiome(pos);
int randomInt = level.getRandom().nextInt(100);
if (biome.is(BiomeTags.SPAWNS_WHITE_RABBITS)) {
-@@ -497,7 +600,7 @@ public class Rabbit extends Animal {
+@@ -498,7 +601,7 @@ public class Rabbit extends Animal {
}
}
@@ -5568,7 +5614,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
private final Rabbit rabbit;
private double nextJumpSpeed;
-@@ -507,14 +610,14 @@ public class Rabbit extends Animal {
+@@ -508,14 +611,14 @@ public class Rabbit extends Animal {
}
@Override
@@ -5585,7 +5631,7 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
}
@Override
-@@ -558,7 +661,7 @@ public class Rabbit extends Animal {
+@@ -559,7 +662,7 @@ public class Rabbit extends Animal {
@Override
public boolean canUse() {
if (this.nextStartTick <= 0) {
@@ -5595,10 +5641,10 @@ index cc7d990f271af1371aa62e8a2ee2ee1bfffb621a..fd8026cf1d884e95e8260ad52d4e0bba
}
diff --git a/net/minecraft/world/entity/animal/Salmon.java b/net/minecraft/world/entity/animal/Salmon.java
-index 1786205346bb02835b10676155b65d2f11f0c221..25811130990e680174a0e930a6d066ad2d580f60 100644
+index 8a3e1d420263ac53b87ffed026380dcdc4a48285..d2679beaa3be6de36227c5b66609e0df393c4376 100644
--- a/net/minecraft/world/entity/animal/Salmon.java
+++ b/net/minecraft/world/entity/animal/Salmon.java
-@@ -38,6 +38,39 @@ public class Salmon extends AbstractSchoolingFish {
+@@ -39,6 +39,39 @@ public class Salmon extends AbstractSchoolingFish {
this.refreshDimensions();
}
@@ -5639,10 +5685,10 @@ index 1786205346bb02835b10676155b65d2f11f0c221..25811130990e680174a0e930a6d066ad
public int getMaxSchoolSize() {
return 5;
diff --git a/net/minecraft/world/entity/animal/SnowGolem.java b/net/minecraft/world/entity/animal/SnowGolem.java
-index 7d73f02efb37aeafe41c23325a02d641d57bdaf4..291769d23d43f3e601d460bded72799dd6f97288 100644
+index 1b3a020e35fb2f9a28be718415c51fde5b52d399..8984a4fc0aae9fd72bc3f7222003c7593810ab77 100644
--- a/net/minecraft/world/entity/animal/SnowGolem.java
+++ b/net/minecraft/world/entity/animal/SnowGolem.java
-@@ -45,17 +45,63 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
+@@ -46,17 +46,63 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
private static final EntityDataAccessor DATA_PUMPKIN_ID = SynchedEntityData.defineId(SnowGolem.class, EntityDataSerializers.BYTE);
private static final byte PUMPKIN_FLAG = 16;
private static final boolean DEFAULT_PUMPKIN = true;
@@ -5708,18 +5754,18 @@ index 7d73f02efb37aeafe41c23325a02d641d57bdaf4..291769d23d43f3e601d460bded72799d
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Mob.class, 10, true, false, (entity, level) -> entity instanceof Enemy));
}
-@@ -73,17 +119,19 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
- compound.putBoolean("Pumpkin", this.hasPumpkin());
-+ compound.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
+@@ -74,17 +120,19 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+ output.putBoolean("Pumpkin", this.hasPumpkin());
++ output.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
}
@Override
- public void readAdditionalSaveData(CompoundTag compound) {
- super.readAdditionalSaveData(compound);
- this.setPumpkin(compound.getBooleanOr("Pumpkin", true));
-+ this.setSummoner(compound.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
+ protected void readAdditionalSaveData(ValueInput input) {
+ super.readAdditionalSaveData(input);
+ this.setPumpkin(input.getBooleanOr("Pumpkin", true));
++ this.setSummoner(input.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
}
@Override
@@ -5729,7 +5775,7 @@ index 7d73f02efb37aeafe41c23325a02d641d57bdaf4..291769d23d43f3e601d460bded72799d
}
@Override
-@@ -94,10 +142,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
+@@ -95,10 +143,11 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
this.hurtServer(serverLevel, this.damageSources().onFire().knownCause(org.bukkit.event.entity.EntityDamageEvent.DamageCause.MELTING), 1.0F); // CraftBukkit
}
@@ -5742,7 +5788,7 @@ index 7d73f02efb37aeafe41c23325a02d641d57bdaf4..291769d23d43f3e601d460bded72799d
BlockState blockState = Blocks.SNOW.defaultBlockState();
for (int i = 0; i < 4; i++) {
-@@ -140,7 +189,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
+@@ -141,7 +190,7 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
org.bukkit.event.player.PlayerShearEntityEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.handlePlayerShearEntityEvent(player, this, itemInHand, hand, drops);
if (event != null) {
if (event.isCancelled()) {
@@ -5751,7 +5797,7 @@ index 7d73f02efb37aeafe41c23325a02d641d57bdaf4..291769d23d43f3e601d460bded72799d
}
drops = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(event.getDrops());
// Paper end - custom shear drops
-@@ -152,8 +201,16 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
+@@ -153,8 +202,16 @@ public class SnowGolem extends AbstractGolem implements Shearable, RangedAttackM
}
return InteractionResult.SUCCESS;
@@ -5904,10 +5950,10 @@ index 58e1bc90cbc32669fa6c66d214119f0c459ff38c..8371f3892e50150db018f0b265986ffa
this.squid.movementVector = new Vec3(Mth.cos(f) * 0.2F, -0.1F + this.squid.getRandom().nextFloat() * 0.2F, Mth.sin(f) * 0.2F);
}
diff --git a/net/minecraft/world/entity/animal/TropicalFish.java b/net/minecraft/world/entity/animal/TropicalFish.java
-index 89e14f04328995e6491c01321789be0bf9ddd438..f3c7e8b244eb7ba3d99cc0d29e388bab8e743351 100644
+index 806fb2561d1eb0fba56dc40ba5c1f306c3105880..8d1fa86c6f4881c05f11fa80018b8de7f4920006 100644
--- a/net/minecraft/world/entity/animal/TropicalFish.java
+++ b/net/minecraft/world/entity/animal/TropicalFish.java
-@@ -76,6 +76,39 @@ public class TropicalFish extends AbstractSchoolingFish {
+@@ -77,6 +77,39 @@ public class TropicalFish extends AbstractSchoolingFish {
super(entityType, level);
}
@@ -5948,10 +5994,10 @@ index 89e14f04328995e6491c01321789be0bf9ddd438..f3c7e8b244eb7ba3d99cc0d29e388bab
return "entity.minecraft.tropical_fish.predefined." + variantId;
}
diff --git a/net/minecraft/world/entity/animal/Turtle.java b/net/minecraft/world/entity/animal/Turtle.java
-index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde858b9b4e 100644
+index 8738424b92726f45de2c166a063d46e1071e8b29..9bdc1f10e3b40672449ad166f130ecabdacc75d3 100644
--- a/net/minecraft/world/entity/animal/Turtle.java
+++ b/net/minecraft/world/entity/animal/Turtle.java
-@@ -85,6 +85,52 @@ public class Turtle extends Animal {
+@@ -86,6 +86,52 @@ public class Turtle extends Animal {
this.moveControl = new Turtle.TurtleMoveControl(this);
}
@@ -6004,7 +6050,7 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
public void setHomePos(BlockPos homePos) {
this.homePos = homePos;
}
-@@ -144,6 +190,7 @@ public class Turtle extends Animal {
+@@ -145,6 +191,7 @@ public class Turtle extends Animal {
@Override
protected void registerGoals() {
@@ -6012,7 +6058,7 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
this.goalSelector.addGoal(0, new Turtle.TurtlePanicGoal(this, 1.2));
this.goalSelector.addGoal(1, new Turtle.TurtleBreedGoal(this, 1.0));
this.goalSelector.addGoal(1, new Turtle.TurtleLayEggGoal(this, 1.0));
-@@ -324,8 +371,10 @@ public class Turtle extends Animal {
+@@ -325,8 +372,10 @@ public class Turtle extends Animal {
}
this.turtle.setHasEgg(true);
@@ -6025,7 +6071,7 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
this.animal.resetLove();
this.partner.resetLove();
RandomSource random = this.animal.getRandom();
-@@ -492,12 +541,14 @@ public class Turtle extends Animal {
+@@ -493,12 +542,14 @@ public class Turtle extends Animal {
}
}
@@ -6041,7 +6087,7 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
}
private void updateSpeed() {
-@@ -516,7 +567,7 @@ public class Turtle extends Animal {
+@@ -517,7 +568,7 @@ public class Turtle extends Animal {
}
@Override
@@ -6050,7 +6096,7 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
this.updateSpeed();
if (this.operation == MoveControl.Operation.MOVE_TO && !this.turtle.getNavigation().isDone()) {
double d = this.wantedX - this.turtle.getX();
-@@ -530,7 +581,7 @@ public class Turtle extends Animal {
+@@ -531,7 +582,7 @@ public class Turtle extends Animal {
float f = (float)(Mth.atan2(d2, d) * 180.0F / (float)Math.PI) - 90.0F;
this.turtle.setYRot(this.rotlerp(this.turtle.getYRot(), f, 90.0F));
this.turtle.yBodyRot = this.turtle.getYRot();
@@ -6060,10 +6106,10 @@ index d24ddf8a585395c0f7b1cd5a61aaea0516636d93..c84f63f064a7769761f75cdedaceacde
this.turtle.setDeltaMovement(this.turtle.getDeltaMovement().add(0.0, this.turtle.getSpeed() * d1 * 0.1, 0.0));
}
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index 2ab261bba5f9e0babfc9072afd2ebbee0536041c..441287e74243a413c97a98b7898bab7833ac6458 100644
+index 69500fa0b207fc3d5b1bc2bd665fa39f6725d23d..7127d8e5fff81be017f0aa04606cb8404ad7b2fd 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -115,10 +115,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -112,10 +112,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
private float spinningAnimationTicks;
private float spinningAnimationTicks0;
public boolean forceDancing = false; // CraftBukkit
@@ -6088,7 +6134,7 @@ index 2ab261bba5f9e0babfc9072afd2ebbee0536041c..441287e74243a413c97a98b7898bab78
this.setCanPickUpLoot(this.canPickUpLoot());
this.vibrationUser = new Allay.VibrationUser();
this.vibrationData = new VibrationSystem.Data();
-@@ -134,6 +147,36 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -131,6 +144,36 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
}
// CraftBukkit end
@@ -6125,7 +6171,7 @@ index 2ab261bba5f9e0babfc9072afd2ebbee0536041c..441287e74243a413c97a98b7898bab78
@Override
protected Brain.Provider brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
-@@ -240,6 +283,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -225,6 +268,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -6134,10 +6180,10 @@ index 2ab261bba5f9e0babfc9072afd2ebbee0536041c..441287e74243a413c97a98b7898bab78
this.getBrain().tick(level, this);
AllayAi.updateActivity(this);
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-index 657f4b56699c33590a0494ef860275e952794c2a..aea96e036846c66d411fdea55fbbf0efb60d467d 100644
+index ee2c6c86631ba50a4e8503131c678596bc2c0363..6fbeaff7178a21338920d6738767033260b7a726 100644
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-@@ -79,6 +79,38 @@ public class Armadillo extends Animal {
+@@ -80,6 +80,38 @@ public class Armadillo extends Animal {
return Animal.createAnimalAttributes().add(Attributes.MAX_HEALTH, 12.0).add(Attributes.MOVEMENT_SPEED, 0.14);
}
@@ -6177,10 +6223,10 @@ index 657f4b56699c33590a0494ef860275e952794c2a..aea96e036846c66d411fdea55fbbf0ef
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-index f54b854adedd58a37b5c38c63abc3fc94ed9ba80..de207d747026453fabe2e6e725d2aa8504fbc9a1 100644
+index 3475ecbd95fac6c6b6e792a23cb15cdb3395985f..02db38fa315ecb9d5bdba74848012710106b662e 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-@@ -118,6 +118,52 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -120,6 +120,52 @@ public class Axolotl extends Animal implements Bucketable {
this.lookControl = new Axolotl.AxolotlLookControl(this, 20);
}
@@ -6233,7 +6279,7 @@ index f54b854adedd58a37b5c38c63abc3fc94ed9ba80..de207d747026453fabe2e6e725d2aa85
@Override
public float getWalkTargetValue(BlockPos pos, LevelReader level) {
return 0.0F;
-@@ -326,6 +372,7 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -328,6 +374,7 @@ public class Axolotl extends Animal implements Bucketable {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -6241,7 +6287,7 @@ index f54b854adedd58a37b5c38c63abc3fc94ed9ba80..de207d747026453fabe2e6e725d2aa85
if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
this.getBrain().tick(level, this);
AxolotlAi.updateActivity(this);
-@@ -573,23 +620,31 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -575,23 +622,31 @@ public class Axolotl extends Animal implements Bucketable {
}
@Override
@@ -6276,10 +6322,10 @@ index f54b854adedd58a37b5c38c63abc3fc94ed9ba80..de207d747026453fabe2e6e725d2aa85
super.tick();
}
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
-index b63b32bac1872db7be64fcb645acd0a0a4290cee..101931ff4474ab4445be3fa1a241a731ad3ac1da 100644
+index adc336c6cec601b8855c1013adf1eebf018597f0..949b6c563658e6e46ac5842d6f088ecae6d4cd0c 100644
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
-@@ -87,6 +87,20 @@ public class Camel extends AbstractHorse {
+@@ -89,6 +89,20 @@ public class Camel extends AbstractHorse {
groundPathNavigation.setCanWalkOverFences(true);
}
@@ -6298,9 +6344,9 @@ index b63b32bac1872db7be64fcb645acd0a0a4290cee..101931ff4474ab4445be3fa1a241a731
+ // Purpur end - Make entity breeding times configurable
+
@Override
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
-@@ -320,6 +334,23 @@ public class Camel extends AbstractHorse {
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+@@ -322,6 +336,23 @@ public class Camel extends AbstractHorse {
return this.dashCooldown;
}
@@ -6325,10 +6371,10 @@ index b63b32bac1872db7be64fcb645acd0a0a4290cee..101931ff4474ab4445be3fa1a241a731
public SoundEvent getAmbientSound() {
return SoundEvents.CAMEL_AMBIENT;
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index bd80e58179fe577693fa419a77989b0db39abb04..89fa6a785ff73b30effd58dde4fbcbf99fdad168 100644
+index f5c9ef8909f3852fc7a203265ae057232fa403ad..c4db078db0b7bb2bd8f6757a8bd13d60a7a4fa14 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -103,6 +103,8 @@ public class Frog extends Animal {
+@@ -104,6 +104,8 @@ public class Frog extends Animal {
public final AnimationState croakAnimationState = new AnimationState();
public final AnimationState tongueAnimationState = new AnimationState();
public final AnimationState swimIdleAnimationState = new AnimationState();
@@ -6337,7 +6383,7 @@ index bd80e58179fe577693fa419a77989b0db39abb04..89fa6a785ff73b30effd58dde4fbcbf9
public Frog(EntityType extends Animal> entityType, Level level) {
super(entityType, level);
-@@ -110,7 +112,62 @@ public class Frog extends Animal {
+@@ -111,7 +113,62 @@ public class Frog extends Animal {
this.setPathfindingMalus(PathType.WATER, 4.0F);
this.setPathfindingMalus(PathType.TRAPDOOR, -1.0F);
this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.02F, 0.1F, true);
@@ -6400,7 +6446,7 @@ index bd80e58179fe577693fa419a77989b0db39abb04..89fa6a785ff73b30effd58dde4fbcbf9
@Override
protected Brain.Provider brainProvider() {
-@@ -202,6 +259,7 @@ public class Frog extends Animal {
+@@ -203,6 +260,7 @@ public class Frog extends Animal {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -6408,7 +6454,7 @@ index bd80e58179fe577693fa419a77989b0db39abb04..89fa6a785ff73b30effd58dde4fbcbf9
if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
this.getBrain().tick(level, this);
FrogAi.updateActivity(this);
-@@ -384,7 +442,7 @@ public class Frog extends Animal {
+@@ -385,7 +443,7 @@ public class Frog extends Animal {
return level.getBlockState(pos.below()).is(BlockTags.FROGS_SPAWNABLE_ON) && isBrightEnoughToSpawn(level, pos);
}
@@ -6418,10 +6464,10 @@ index bd80e58179fe577693fa419a77989b0db39abb04..89fa6a785ff73b30effd58dde4fbcbf9
super(mob);
}
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index 72c4403a4b5fa817f91dbcd842d4b7939a4834ab..a445bbe84d919ffadd8f3f0006b12140cd8060fd 100644
+index 5392cb211a3dc841ab38710a4ef688bde7fbe067..a3858465569c40fcfc7c8c4c4735335ac83cb078 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
-@@ -62,13 +62,50 @@ public class Tadpole extends AbstractFish {
+@@ -64,13 +64,50 @@ public class Tadpole extends AbstractFish {
MemoryModuleType.IS_PANICKING
);
public boolean ageLocked; // Paper
@@ -6473,7 +6519,7 @@ index 72c4403a4b5fa817f91dbcd842d4b7939a4834ab..a445bbe84d919ffadd8f3f0006b12140
@Override
protected PathNavigation createNavigation(Level level) {
return new WaterBoundPathNavigation(this, level);
-@@ -97,6 +134,7 @@ public class Tadpole extends AbstractFish {
+@@ -99,6 +136,7 @@ public class Tadpole extends AbstractFish {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -6482,10 +6528,10 @@ index 72c4403a4b5fa817f91dbcd842d4b7939a4834ab..a445bbe84d919ffadd8f3f0006b12140
this.getBrain().tick(level, this);
TadpoleAi.updateActivity(this);
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
-index 048e62b361e33b3edd5122fd4a47c5627491bcaf..40ba2e6dc6b1efbd17dba582561c133f6b41df25 100644
+index 2a72d7f422c340dabef11a6dc680358207bee637..11b020704a673c69bd2d4ab6313ea32e8e97cc23 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
-@@ -112,6 +112,44 @@ public class Goat extends Animal {
+@@ -113,6 +113,44 @@ public class Goat extends Animal {
.orElseGet(() -> new ItemStack(Items.GOAT_HORN));
}
@@ -6530,7 +6576,7 @@ index 048e62b361e33b3edd5122fd4a47c5627491bcaf..40ba2e6dc6b1efbd17dba582561c133f
@Override
protected Brain.Provider brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
-@@ -188,6 +226,7 @@ public class Goat extends Animal {
+@@ -189,6 +227,7 @@ public class Goat extends Animal {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -6538,7 +6584,7 @@ index 048e62b361e33b3edd5122fd4a47c5627491bcaf..40ba2e6dc6b1efbd17dba582561c133f
if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
this.getBrain().tick(level, this);
GoatAi.updateActivity(this);
-@@ -390,6 +429,7 @@ public class Goat extends Animal {
+@@ -391,6 +430,7 @@ public class Goat extends Animal {
// Paper start - Goat ram API
public void ram(net.minecraft.world.entity.LivingEntity entity) {
@@ -6547,10 +6593,10 @@ index 048e62b361e33b3edd5122fd4a47c5627491bcaf..40ba2e6dc6b1efbd17dba582561c133f
brain.setMemory(MemoryModuleType.RAM_TARGET, entity.position());
brain.eraseMemory(MemoryModuleType.RAM_COOLDOWN_TICKS);
diff --git a/net/minecraft/world/entity/animal/horse/AbstractHorse.java b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
-index 7c473eea481f5e055cc70512027726f41f0c6f67..601e2912790759487c8d2f270f30a82689c52236 100644
+index 31ed5d7cfbda1a1f98ebfc89f5cbc65332cabdae..e78ef459d6eecb7f69882ed95cd9f9967f53989f 100644
--- a/net/minecraft/world/entity/animal/horse/AbstractHorse.java
+++ b/net/minecraft/world/entity/animal/horse/AbstractHorse.java
-@@ -126,11 +126,61 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
+@@ -127,11 +127,61 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
protected AbstractHorse(EntityType extends AbstractHorse> entityType, Level level) {
super(entityType, level);
@@ -6612,7 +6658,7 @@ index 7c473eea481f5e055cc70512027726f41f0c6f67..601e2912790759487c8d2f270f30a826
this.goalSelector.addGoal(1, new PanicGoal(this, 1.2));
this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0, AbstractHorse.class));
-@@ -141,6 +191,7 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
+@@ -142,6 +192,7 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
if (this.canPerformRearing()) {
this.goalSelector.addGoal(9, new RandomStandGoal(this));
}
@@ -6620,7 +6666,7 @@ index 7c473eea481f5e055cc70512027726f41f0c6f67..601e2912790759487c8d2f270f30a826
this.addBehaviourGoals();
}
-@@ -1043,7 +1094,7 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
+@@ -1040,7 +1091,7 @@ public abstract class AbstractHorse extends Animal implements HasCustomInventory
spawnGroupData = new AgeableMob.AgeableMobGroupData(0.2F);
}
@@ -6686,10 +6732,10 @@ index 5dff98b5b2e4bba5f874d6a99d034a3905775c9b..0783d41a6c4622b03d9d368c1af949af
public SoundEvent getAmbientSound() {
return SoundEvents.DONKEY_AMBIENT;
diff --git a/net/minecraft/world/entity/animal/horse/Horse.java b/net/minecraft/world/entity/animal/horse/Horse.java
-index a0d85cd6c5306385b074a636166ff8eee2b320ce..206f911d1184a22f401d217f713495e6e85263be 100644
+index 2a1d720557c0bd4895a32723e34512c0a557e4f2..f1080a40f759b30b921b88b4f6edd35f4795406f 100644
--- a/net/minecraft/world/entity/animal/horse/Horse.java
+++ b/net/minecraft/world/entity/animal/horse/Horse.java
-@@ -46,6 +46,51 @@ public class Horse extends AbstractHorse {
+@@ -47,6 +47,51 @@ public class Horse extends AbstractHorse {
super(entityType, level);
}
@@ -6742,10 +6788,10 @@ index a0d85cd6c5306385b074a636166ff8eee2b320ce..206f911d1184a22f401d217f713495e6
protected void randomizeAttributes(RandomSource random) {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(generateMaxHealth(random::nextInt));
diff --git a/net/minecraft/world/entity/animal/horse/Llama.java b/net/minecraft/world/entity/animal/horse/Llama.java
-index 6916adb865ff8fea498d3a61c2b5560472a223f4..e300a1284fd98791871ba1780bb7352cd848766a 100644
+index 1e2b629641e5fa1040307461dbbf03ad2d75ba00..1bef43f42aee02a0a00556318607072ce9814860 100644
--- a/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/net/minecraft/world/entity/animal/horse/Llama.java
-@@ -77,12 +77,95 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+@@ -78,12 +78,95 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
private Llama caravanHead;
@Nullable
public Llama caravanTail; // Paper
@@ -6841,19 +6887,19 @@ index 6916adb865ff8fea498d3a61c2b5560472a223f4..e300a1284fd98791871ba1780bb7352c
public boolean isTraderLlama() {
return false;
-@@ -111,6 +194,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
- super.addAdditionalSaveData(compound);
- compound.store("Variant", Llama.Variant.LEGACY_CODEC, this.getVariant());
- compound.putInt("Strength", this.getStrength());
-+ compound.putBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan); // Purpur - Llama API
+@@ -112,6 +195,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+ super.addAdditionalSaveData(output);
+ output.store("Variant", Llama.Variant.LEGACY_CODEC, this.getVariant());
+ output.putInt("Strength", this.getStrength());
++ output.putBoolean("Purpur.ShouldJoinCaravan", shouldJoinCaravan); // Purpur - Llama API
}
@Override
-@@ -118,11 +202,13 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
- this.setStrength(compound.getIntOr("Strength", 0));
- super.readAdditionalSaveData(compound);
- this.setVariant(compound.read("Variant", Llama.Variant.LEGACY_CODEC).orElse(Llama.Variant.DEFAULT));
-+ this.shouldJoinCaravan = compound.getBooleanOr("Purpur.ShouldJoinCaravan", true); // Purpur - Llama API
+@@ -119,11 +203,13 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+ this.setStrength(input.getIntOr("Strength", 0));
+ super.readAdditionalSaveData(input);
+ this.setVariant(input.read("Variant", Llama.Variant.LEGACY_CODEC).orElse(Llama.Variant.DEFAULT));
++ this.shouldJoinCaravan = input.getBooleanOr("Purpur.ShouldJoinCaravan", true); // Purpur - Llama API
}
@Override
@@ -6863,7 +6909,7 @@ index 6916adb865ff8fea498d3a61c2b5560472a223f4..e300a1284fd98791871ba1780bb7352c
this.goalSelector.addGoal(1, new RunAroundLikeCrazyGoal(this, 1.2));
this.goalSelector.addGoal(2, new LlamaFollowCaravanGoal(this, 2.1F));
this.goalSelector.addGoal(3, new RangedAttackGoal(this, 1.25, 40, 20.0F));
-@@ -133,6 +219,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+@@ -134,6 +220,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 0.7));
this.goalSelector.addGoal(8, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(9, new RandomLookAroundGoal(this));
@@ -6871,7 +6917,7 @@ index 6916adb865ff8fea498d3a61c2b5560472a223f4..e300a1284fd98791871ba1780bb7352c
this.targetSelector.addGoal(1, new Llama.LlamaHurtByTargetGoal(this));
this.targetSelector.addGoal(2, new Llama.LlamaAttackWolfGoal(this));
}
-@@ -399,6 +486,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+@@ -400,6 +487,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
public void leaveCaravan() {
if (this.caravanHead != null) {
@@ -6879,7 +6925,7 @@ index 6916adb865ff8fea498d3a61c2b5560472a223f4..e300a1284fd98791871ba1780bb7352c
this.caravanHead.caravanTail = null;
}
-@@ -406,6 +494,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
+@@ -407,6 +495,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
}
public void joinCaravan(Llama caravanHead) {
@@ -6944,10 +6990,10 @@ index 39725b7a6bac9390406733cd51d7341d0cb363d1..6e0b1c83a6a03d12296e0e3b2c805b64
public SoundEvent getAmbientSound() {
return SoundEvents.MULE_AMBIENT;
diff --git a/net/minecraft/world/entity/animal/horse/SkeletonHorse.java b/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
-index 797405b187bb8102aafbf880552accd82e2c9af2..b02ca00ff18484947aa2f4ff90ab9dda2196a679 100644
+index 580134c5a075c7efdc7c2f86a179df2fa336eba9..f6ab6ecc10486694d77905239a82bda4dec94936 100644
--- a/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
+++ b/net/minecraft/world/entity/animal/horse/SkeletonHorse.java
-@@ -41,6 +41,51 @@ public class SkeletonHorse extends AbstractHorse {
+@@ -42,6 +42,51 @@ public class SkeletonHorse extends AbstractHorse {
super(entityType, level);
}
@@ -6999,7 +7045,7 @@ index 797405b187bb8102aafbf880552accd82e2c9af2..b02ca00ff18484947aa2f4ff90ab9dda
public static AttributeSupplier.Builder createAttributes() {
return createBaseHorseAttributes().add(Attributes.MAX_HEALTH, 15.0).add(Attributes.MOVEMENT_SPEED, 0.2F);
}
-@@ -60,6 +105,7 @@ public class SkeletonHorse extends AbstractHorse {
+@@ -61,6 +106,7 @@ public class SkeletonHorse extends AbstractHorse {
@Override
protected void addBehaviourGoals() {
@@ -7008,10 +7054,10 @@ index 797405b187bb8102aafbf880552accd82e2c9af2..b02ca00ff18484947aa2f4ff90ab9dda
@Override
diff --git a/net/minecraft/world/entity/animal/horse/TraderLlama.java b/net/minecraft/world/entity/animal/horse/TraderLlama.java
-index 38a5554d6e28ab73c225625531c94592a46d50a8..6c6cc0261123ba6a78c8f509715c738d629de253 100644
+index 2cd1b988f44caf271a7d2dfccf118be53b77caba..a8540e491161d82a6b72262e4414f8bb16705d47 100644
--- a/net/minecraft/world/entity/animal/horse/TraderLlama.java
+++ b/net/minecraft/world/entity/animal/horse/TraderLlama.java
-@@ -30,6 +30,66 @@ public class TraderLlama extends Llama {
+@@ -31,6 +31,66 @@ public class TraderLlama extends Llama {
super(entityType, level);
}
@@ -7148,10 +7194,10 @@ index ee327bdec37df5197c35aef60cf456bb81f8d048..e59172ea2fafbab673dc3e9bdc25055f
@Override
diff --git a/net/minecraft/world/entity/animal/sheep/Sheep.java b/net/minecraft/world/entity/animal/sheep/Sheep.java
-index bb51adb44cbff3e7feaa80421f5f1a01c119aa00..c53ab665a0c87d342adbe395c87e15a3f5f49708 100644
+index 4e4887cd2c6d6d22966395d68ed59da090f609a3..500c87f5f7b2eda637103125d6e541f7c9fb385f 100644
--- a/net/minecraft/world/entity/animal/sheep/Sheep.java
+++ b/net/minecraft/world/entity/animal/sheep/Sheep.java
-@@ -84,10 +84,57 @@ public class Sheep extends Animal implements Shearable {
+@@ -62,10 +62,57 @@ public class Sheep extends Animal implements Shearable {
super(entityType, level);
}
@@ -7210,10 +7256,10 @@ index bb51adb44cbff3e7feaa80421f5f1a01c119aa00..c53ab665a0c87d342adbe395c87e15a3
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.1, stack -> stack.is(ItemTags.SHEEP_FOOD), false));
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-index 622c2eac70c81ed7ccf605069b8dd68508bebf76..0565b37dd5320b49efb11cf28f064d6a970048aa 100644
+index 05d269b51715a71fa653900e7187b07d001afdb7..a762fc8a4616c4e48e11accdca2129fd47f300e6 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-@@ -86,6 +86,38 @@ public class Sniffer extends Animal {
+@@ -87,6 +87,38 @@ public class Sniffer extends Animal {
this.setPathfindingMalus(PathType.DAMAGE_CAUTIOUS, -1.0F);
}
@@ -7253,10 +7299,10 @@ index 622c2eac70c81ed7ccf605069b8dd68508bebf76..0565b37dd5320b49efb11cf28f064d6a
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
diff --git a/net/minecraft/world/entity/animal/wolf/Wolf.java b/net/minecraft/world/entity/animal/wolf/Wolf.java
-index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248243e9c4e 100644
+index dca01e7e6af74bc6e26d4968ccdf0c34f8707b94..7e7cb9db1c84bdb173b444bec90663a93fb3b549 100644
--- a/net/minecraft/world/entity/animal/wolf/Wolf.java
+++ b/net/minecraft/world/entity/animal/wolf/Wolf.java
-@@ -100,6 +100,37 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -99,6 +99,37 @@ public class Wolf extends TamableAnimal implements NeutralMob {
EntityType> type = entity.getType();
return type == EntityType.SHEEP || type == EntityType.RABBIT || type == EntityType.FOX;
};
@@ -7294,7 +7340,7 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
private static final float START_HEALTH = 8.0F;
private static final float TAME_HEALTH = 40.0F;
private static final float ARMOR_REPAIR_UNIT = 0.125F;
-@@ -122,12 +153,99 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -121,12 +152,99 @@ public class Wolf extends TamableAnimal implements NeutralMob {
this.setPathfindingMalus(PathType.DANGER_POWDER_SNOW, -1.0F);
}
@@ -7394,7 +7440,7 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F));
this.goalSelector.addGoal(5, new MeleeAttackGoal(this, 1.0, true));
this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F));
-@@ -136,11 +254,12 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -135,11 +253,12 @@ public class Wolf extends TamableAnimal implements NeutralMob {
this.goalSelector.addGoal(9, new BegGoal(this, 8.0F));
this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(10, new RandomLookAroundGoal(this));
@@ -7408,29 +7454,29 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR));
this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false));
this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true));
-@@ -231,6 +350,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
- compound.store("CollarColor", DyeColor.LEGACY_ID_CODEC, this.getCollarColor());
-+ compound.putBoolean("Purpur.IsRabid", this.isRabid); // Purpur - Configurable chance for wolves to spawn rabid
- VariantUtils.writeVariant(compound, this.getVariant());
- this.addPersistentAngerSaveData(compound);
+@@ -230,6 +349,7 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+ output.store("CollarColor", DyeColor.LEGACY_ID_CODEC, this.getCollarColor());
++ output.putBoolean("Purpur.IsRabid", this.isRabid); // Purpur - Configurable chance for wolves to spawn rabid
+ VariantUtils.writeVariant(output, this.getVariant());
+ this.addPersistentAngerSaveData(output);
this.getSoundVariant()
-@@ -245,6 +365,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
- super.readAdditionalSaveData(compound);
- VariantUtils.readVariant(compound, this.registryAccess(), Registries.WOLF_VARIANT).ifPresent(this::setVariant);
- this.setCollarColor(compound.read("CollarColor", DyeColor.LEGACY_ID_CODEC).orElse(DEFAULT_COLLAR_COLOR));
+@@ -244,6 +364,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+ super.readAdditionalSaveData(input);
+ VariantUtils.readVariant(input, Registries.WOLF_VARIANT).ifPresent(this::setVariant);
+ this.setCollarColor(input.read("CollarColor", DyeColor.LEGACY_ID_CODEC).orElse(DEFAULT_COLLAR_COLOR));
+ // Purpur start - Configurable chance for wolves to spawn rabid
-+ this.isRabid = compound.getBooleanOr("Purpur.IsRabid", false);
++ this.isRabid = input.getBooleanOr("Purpur.IsRabid", false);
+ this.updatePathfinders(false);
+ // Purpur end - Configurable chance for wolves to spawn rabid
- this.readPersistentAngerSaveData(this.level(), compound);
- compound.read("sound_variant", ResourceKey.codec(Registries.WOLF_SOUND_VARIANT))
+ this.readPersistentAngerSaveData(this.level(), input);
+ input.read("sound_variant", ResourceKey.codec(Registries.WOLF_SOUND_VARIANT))
.flatMap(resourceKey -> this.registryAccess().lookupOrThrow(Registries.WOLF_SOUND_VARIANT).get((ResourceKey)resourceKey))
-@@ -269,6 +393,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -268,6 +392,10 @@ public class Wolf extends TamableAnimal implements NeutralMob {
}
- this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), this.random));
+ this.setSoundVariant(WolfSoundVariants.pickRandomSoundVariant(this.registryAccess(), level.getRandom()));
+ // Purpur start - Configurable chance for wolves to spawn rabid
+ this.isRabid = level.getLevel().purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= level.getLevel().purpurConfig.wolfNaturalRabid;
+ this.updatePathfinders(false);
@@ -7438,7 +7484,7 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
-@@ -319,6 +447,11 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -318,6 +446,11 @@ public class Wolf extends TamableAnimal implements NeutralMob {
public void tick() {
super.tick();
if (this.isAlive()) {
@@ -7450,7 +7496,7 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
this.interestedAngleO = this.interestedAngle;
if (this.isInterested()) {
this.interestedAngle = this.interestedAngle + (1.0F - this.interestedAngle) * 0.4F;
-@@ -532,13 +665,27 @@ public class Wolf extends TamableAnimal implements NeutralMob {
+@@ -519,13 +652,27 @@ public class Wolf extends TamableAnimal implements NeutralMob {
itemInHand.consume(1, player);
this.tryToTame(player);
return InteractionResult.SUCCESS_SERVER;
@@ -7480,10 +7526,10 @@ index d926ecd041ca2a421057bc22efe66a8b811ee649..936ee9e80239ad965be75ceeb38d5248
this.navigation.stop();
this.setTarget(null);
diff --git a/net/minecraft/world/entity/boss/EnderDragonPart.java b/net/minecraft/world/entity/boss/EnderDragonPart.java
-index 31f064267514e590944ad809c95915b481e65aaa..c8bc09c3fe27e69360027698c41fd51a111ffa66 100644
+index c9443cbde85109b19e6c84274c562d83a229c763..ec82bd00f7be253beac1dfbe00a36d25daa11775 100644
--- a/net/minecraft/world/entity/boss/EnderDragonPart.java
+++ b/net/minecraft/world/entity/boss/EnderDragonPart.java
-@@ -27,6 +27,13 @@ public class EnderDragonPart extends Entity {
+@@ -28,6 +28,13 @@ public class EnderDragonPart extends Entity {
this.name = name;
}
@@ -7498,10 +7544,10 @@ index 31f064267514e590944ad809c95915b481e65aaa..c8bc09c3fe27e69360027698c41fd51a
protected void defineSynchedData(SynchedEntityData.Builder builder) {
}
diff --git a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
-index d813427cf20117014bc42af0eb7cdee037fbcd9c..90ac1e4bdca5b6233eeae9bc84549770bed383da 100644
+index a0e0fad40838fa7d835f31e5ce4ae3ab40e0bfa4..220a828717e1933a44c5282b56713ba0053d2440 100644
--- a/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
-@@ -26,6 +26,12 @@ public class EndCrystal extends Entity {
+@@ -27,6 +27,12 @@ public class EndCrystal extends Entity {
private static final boolean DEFAULT_SHOW_BOTTOM = true;
public int time;
public boolean generatedByDragonFight = false; // Paper - Fix invulnerable end crystals
@@ -7514,7 +7560,7 @@ index d813427cf20117014bc42af0eb7cdee037fbcd9c..90ac1e4bdca5b6233eeae9bc84549770
public EndCrystal(EntityType extends EndCrystal> entityType, Level level) {
super(entityType, level);
-@@ -38,6 +44,24 @@ public class EndCrystal extends Entity {
+@@ -39,6 +45,24 @@ public class EndCrystal extends Entity {
this.setPos(x, y, z);
}
@@ -7539,7 +7585,7 @@ index d813427cf20117014bc42af0eb7cdee037fbcd9c..90ac1e4bdca5b6233eeae9bc84549770
@Override
protected Entity.MovementEmission getMovementEmission() {
return Entity.MovementEmission.NONE;
-@@ -74,6 +98,51 @@ public class EndCrystal extends Entity {
+@@ -75,6 +99,51 @@ public class EndCrystal extends Entity {
}
}
// Paper end - Fix invulnerable end crystals
@@ -7591,7 +7637,7 @@ index d813427cf20117014bc42af0eb7cdee037fbcd9c..90ac1e4bdca5b6233eeae9bc84549770
}
@Override
-@@ -114,15 +183,17 @@ public class EndCrystal extends Entity {
+@@ -115,15 +184,17 @@ public class EndCrystal extends Entity {
}
// CraftBukkit end
if (!damageSource.is(DamageTypeTags.IS_EXPLOSION)) {
@@ -7612,10 +7658,10 @@ index d813427cf20117014bc42af0eb7cdee037fbcd9c..90ac1e4bdca5b6233eeae9bc84549770
this.remove(Entity.RemovalReason.KILLED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DEATH); // Paper - add Bukkit remove cause
// CraftBukkit end
diff --git a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c1dd87f4e 100644
+index 84d215a498d9bf6f1232bf4af5a4a98d3ba9b131..de09a91b89661118e460842453e33f383ea08a94 100644
--- a/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
+++ b/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
-@@ -91,6 +91,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -92,6 +92,7 @@ public class EnderDragon extends Mob implements Enemy {
private final net.minecraft.world.level.Explosion explosionSource; // Paper - reusable source for CraftTNTPrimed.getSource()
@Nullable private BlockPos podium;
// Paper end
@@ -7623,7 +7669,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
public EnderDragon(EntityType extends EnderDragon> entityType, Level level) {
super(EntityType.ENDER_DRAGON, level);
-@@ -107,6 +108,37 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -108,6 +109,37 @@ public class EnderDragon extends Mob implements Enemy {
this.noPhysics = true;
this.phaseManager = new EnderDragonPhaseManager(this);
this.explosionSource = new net.minecraft.world.level.ServerExplosion(level.getMinecraftWorld(), this, null, null, new Vec3(Double.NaN, Double.NaN, Double.NaN), Float.NaN, true, net.minecraft.world.level.Explosion.BlockInteraction.DESTROY); // Paper
@@ -7661,7 +7707,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
}
public void setDragonFight(EndDragonFight dragonFight) {
-@@ -121,6 +153,31 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -122,6 +154,31 @@ public class EnderDragon extends Mob implements Enemy {
return this.fightOrigin;
}
@@ -7691,9 +7737,9 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
+ // Purpur end - Toggle for water sensitive mob damage
+
public static AttributeSupplier.Builder createAttributes() {
- return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0);
+ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0).add(Attributes.CAMERA_DISTANCE, 16.0);
}
-@@ -170,6 +227,37 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -171,6 +228,37 @@ public class EnderDragon extends Mob implements Enemy {
@Override
public void aiStep() {
@@ -7731,7 +7777,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
this.processFlappingMovement();
if (this.level().isClientSide) {
this.setHealth(this.getHealth());
-@@ -198,6 +286,8 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -199,6 +287,8 @@ public class EnderDragon extends Mob implements Enemy {
this.oFlapTime = this.flapTime;
if (this.isDeadOrDying()) {
@@ -7740,7 +7786,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
float f = (this.random.nextFloat() - 0.5F) * 8.0F;
float f1 = (this.random.nextFloat() - 0.5F) * 4.0F;
float f2 = (this.random.nextFloat() - 0.5F) * 8.0F;
-@@ -207,9 +297,9 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -208,9 +298,9 @@ public class EnderDragon extends Mob implements Enemy {
Vec3 deltaMovement = this.getDeltaMovement();
float f1 = 0.2F / ((float)deltaMovement.horizontalDistance() * 10.0F + 1.0F);
f1 *= (float)Math.pow(2.0, deltaMovement.y);
@@ -7752,7 +7798,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
this.flapTime += f1 * 0.5F;
} else {
this.flapTime += f1;
-@@ -220,7 +310,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -221,7 +311,7 @@ public class EnderDragon extends Mob implements Enemy {
this.flapTime = 0.5F;
} else {
this.flightHistory.record(this.getY(), this.getYRot());
@@ -7761,7 +7807,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
DragonPhaseInstance currentPhase = this.phaseManager.getCurrentPhase();
currentPhase.doServerTick(serverLevel1);
if (this.phaseManager.getCurrentPhase() != currentPhase) {
-@@ -295,7 +385,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -296,7 +386,7 @@ public class EnderDragon extends Mob implements Enemy {
this.tickPart(this.body, sin1 * 0.5F, 0.0, -cos1 * 0.5F);
this.tickPart(this.wing1, cos1 * 4.5F, 2.0, sin1 * 4.5F);
this.tickPart(this.wing2, cos1 * -4.5F, 2.0, sin1 * -4.5F);
@@ -7770,7 +7816,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
this.knockBack(
serverLevel2,
serverLevel2.getEntities(
-@@ -345,9 +435,9 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -346,9 +436,9 @@ public class EnderDragon extends Mob implements Enemy {
}
if (this.level() instanceof ServerLevel serverLevel3) {
@@ -7782,7 +7828,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
if (this.dragonFight != null) {
this.dragonFight.updateDragon(this);
}
-@@ -460,7 +550,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -461,7 +551,7 @@ public class EnderDragon extends Mob implements Enemy {
BlockPos blockPos = new BlockPos(i, i1, i2);
BlockState blockState = level.getBlockState(blockPos);
if (!blockState.isAir() && !blockState.is(BlockTags.DRAGON_TRANSPARENT)) {
@@ -7791,7 +7837,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
// CraftBukkit start - Add blocks to list rather than destroying them
//flag1 = level.removeBlock(blockPos, false) || flag1;
flag1 = true;
-@@ -960,6 +1050,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -961,6 +1051,7 @@ public class EnderDragon extends Mob implements Enemy {
@Override
protected boolean canRide(Entity entity) {
@@ -7799,7 +7845,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
return false;
}
-@@ -985,7 +1076,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -986,7 +1077,7 @@ public class EnderDragon extends Mob implements Enemy {
@Override
protected float sanitizeScale(float scale) {
@@ -7808,7 +7854,7 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
}
// CraftBukkit start - SPIGOT-2420: Special case, the ender dragon drops 12000 xp for the first kill and 500 xp for every other kill and this over time.
-@@ -995,7 +1086,7 @@ public class EnderDragon extends Mob implements Enemy {
+@@ -996,7 +1087,7 @@ public class EnderDragon extends Mob implements Enemy {
boolean flag = level.getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT);
int i = 500;
@@ -7818,10 +7864,10 @@ index 0f3c88601357399d3b8efd2f0e3a531482bc1f3d..6305e56f38e25f330b0eaf8ab5b9258c
}
diff --git a/net/minecraft/world/entity/boss/wither/WitherBoss.java b/net/minecraft/world/entity/boss/wither/WitherBoss.java
-index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06051659bd 100644
+index 787b74c5aa02afc4ba95fa1cdaf6cc21b6554b56..0613d80561f50e32dc4d1c471521f001659d017d 100644
--- a/net/minecraft/world/entity/boss/wither/WitherBoss.java
+++ b/net/minecraft/world/entity/boss/wither/WitherBoss.java
-@@ -70,6 +70,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -71,6 +71,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
private final int[] nextHeadUpdate = new int[2];
private final int[] idleHeadUpdates = new int[2];
private int destroyBlocksTick;
@@ -7829,7 +7875,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
private boolean canPortal = false; // Paper
public final ServerBossEvent bossEvent = (ServerBossEvent)new ServerBossEvent(
this.getDisplayName(), BossEvent.BossBarColor.PURPLE, BossEvent.BossBarOverlay.PROGRESS
-@@ -78,14 +79,161 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -79,14 +80,161 @@ public class WitherBoss extends Monster implements RangedAttackMob {
private static final TargetingConditions.Selector LIVING_ENTITY_SELECTOR = (entity, level) -> !entity.getType().is(EntityTypeTags.WITHER_FRIENDS)
&& entity.attackable();
private static final TargetingConditions TARGETING_CONDITIONS = TargetingConditions.forCombat().range(20.0).selector(LIVING_ENTITY_SELECTOR);
@@ -7991,7 +8037,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
@Override
protected PathNavigation createNavigation(Level level) {
FlyingPathNavigation flyingPathNavigation = new FlyingPathNavigation(this, level);
-@@ -96,11 +244,13 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -97,11 +245,13 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@Override
protected void registerGoals() {
@@ -8005,23 +8051,23 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
this.targetSelector.addGoal(1, new HurtByTargetGoal(this));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, LivingEntity.class, 0, false, false, LIVING_ENTITY_SELECTOR));
}
-@@ -118,6 +268,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
- compound.putInt("Invul", this.getInvulnerableTicks());
-+ compound.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
+@@ -119,6 +269,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+ output.putInt("Invul", this.getInvulnerableTicks());
++ output.storeNullable("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC, getSummoner()); // Purpur - Summoner API
}
@Override
-@@ -127,6 +278,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -128,6 +279,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
if (this.hasCustomName()) {
this.bossEvent.setName(this.getDisplayName());
}
-+ this.setSummoner(compound.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
++ this.setSummoner(input.read("Purpur.Summoner", net.minecraft.core.UUIDUtil.CODEC).orElse(null)); // Purpur - Summoner API
}
@Override
-@@ -258,6 +410,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -259,6 +411,15 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -8037,7 +8083,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
if (this.getInvulnerableTicks() > 0) {
int i = this.getInvulnerableTicks() - 1;
this.bossEvent.setProgress(1.0F - i / 220.0F);
-@@ -270,7 +431,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -271,7 +432,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
level.explode(this, this.getX(), this.getEyeY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB);
}
// CraftBukkit end
@@ -8046,7 +8092,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
// CraftBukkit start - Use relative location for far away sounds
// level.globalLevelEvent(1023, this.blockPosition(), 0);
int viewDistance = level.getCraftServer().getViewDistance() * 16;
-@@ -295,7 +456,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -296,7 +457,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
this.setInvulnerableTicks(i);
if (this.tickCount % 10 == 0) {
@@ -8055,7 +8101,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
}
} else {
super.customServerAiStep(level);
-@@ -347,7 +508,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -348,7 +509,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
if (this.destroyBlocksTick > 0) {
this.destroyBlocksTick--;
@@ -8064,7 +8110,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
boolean flag = false;
int alternativeTarget = Mth.floor(this.getBbWidth() / 2.0F + 1.0F);
int floor = Mth.floor(this.getBbHeight());
-@@ -377,8 +538,10 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -378,8 +539,10 @@ public class WitherBoss extends Monster implements RangedAttackMob {
}
}
@@ -8077,7 +8123,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
}
this.bossEvent.setProgress(this.getHealth() / this.getMaxHealth());
-@@ -562,11 +725,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -563,11 +726,11 @@ public class WitherBoss extends Monster implements RangedAttackMob {
}
public int getAlternativeTarget(int head) {
@@ -8091,7 +8137,7 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
}
public boolean isPowered() {
-@@ -575,6 +738,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
+@@ -576,6 +739,7 @@ public class WitherBoss extends Monster implements RangedAttackMob {
@Override
protected boolean canRide(Entity entity) {
@@ -8100,11 +8146,11 @@ index 09924cccf9208abda22cc7e1635b567ed166e95a..633a3d351fe613a4e4e531cd9e891f06
}
diff --git a/net/minecraft/world/entity/decoration/ArmorStand.java b/net/minecraft/world/entity/decoration/ArmorStand.java
-index 1297f585753c53275e8e54e41b2e718b44aee1bf..0417175c7beabbca53cd080d158001eabe3941f0 100644
+index 5ee368580d878a3845349c3d50cc0dc549c42cab..83fdd22eeb141079e05018ebf5cef70e7eb78726 100644
--- a/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/net/minecraft/world/entity/decoration/ArmorStand.java
-@@ -95,10 +95,13 @@ public class ArmorStand extends LivingEntity {
- private boolean noTickPoseDirty = false;
+@@ -91,10 +91,13 @@ public class ArmorStand extends LivingEntity {
+ public boolean canTickSetByAPI = false;
public boolean noTickEquipmentDirty = false;
// Paper end - Allow ArmorStands not to tick
+ public boolean canMovementTick = true; // Purpur - Movement options for armor stands
@@ -8117,7 +8163,7 @@ index 1297f585753c53275e8e54e41b2e718b44aee1bf..0417175c7beabbca53cd080d158001ea
}
public ArmorStand(Level level, double x, double y, double z) {
-@@ -489,6 +492,7 @@ public class ArmorStand extends LivingEntity {
+@@ -447,6 +450,7 @@ public class ArmorStand extends LivingEntity {
private org.bukkit.event.entity.EntityDeathEvent brokenByPlayer(ServerLevel level, DamageSource damageSource) { // Paper
ItemStack itemStack = new ItemStack(Items.ARMOR_STAND);
@@ -8125,15 +8171,15 @@ index 1297f585753c53275e8e54e41b2e718b44aee1bf..0417175c7beabbca53cd080d158001ea
itemStack.set(DataComponents.CUSTOM_NAME, this.getCustomName());
this.drops.add(new DefaultDrop(itemStack, stack -> Block.popResource(this.level(), this.blockPosition(), stack))); // CraftBukkit - add to drops // Paper - Restore vanilla drops behavior
return this.brokenByAnything(level, damageSource); // Paper
-@@ -546,6 +550,7 @@ public class ArmorStand extends LivingEntity {
-
+@@ -521,6 +525,7 @@ public class ArmorStand extends LivingEntity {
+ // Paper start - Allow ArmorStands not to tick
@Override
public void tick() {
+ maxUpStep = level().purpurConfig.armorstandStepHeight; // Purpur - Add option to set armorstand step height
- // Paper start - Allow ArmorStands not to tick
if (!this.canTick) {
- if (this.noTickPoseDirty) {
-@@ -875,4 +880,18 @@ public class ArmorStand extends LivingEntity {
+ if (this.noTickEquipmentDirty) {
+ this.noTickEquipmentDirty = false;
+@@ -811,4 +816,18 @@ public class ArmorStand extends LivingEntity {
}
}
// Paper end
@@ -8153,10 +8199,10 @@ index 1297f585753c53275e8e54e41b2e718b44aee1bf..0417175c7beabbca53cd080d158001ea
+ // Purpur end - Movement options for armor stands
}
diff --git a/net/minecraft/world/entity/decoration/ItemFrame.java b/net/minecraft/world/entity/decoration/ItemFrame.java
-index f9a97000b75db7999b1cbe1f72d680d4d7b803b7..9dfadb5639e840e69274b35f3366322141527104 100644
+index 90fd3ca5ecd29befa9237222e9f86a8a79a011e4..7e96617f0d5e8777873b4c2cccd012d656612f96 100644
--- a/net/minecraft/world/entity/decoration/ItemFrame.java
+++ b/net/minecraft/world/entity/decoration/ItemFrame.java
-@@ -232,7 +232,11 @@ public class ItemFrame extends HangingEntity {
+@@ -237,7 +237,11 @@ public class ItemFrame extends HangingEntity {
this.removeFramedMap(item);
} else {
if (dropItem) {
@@ -8170,10 +8216,10 @@ index f9a97000b75db7999b1cbe1f72d680d4d7b803b7..9dfadb5639e840e69274b35f33663221
if (!item.isEmpty()) {
diff --git a/net/minecraft/world/entity/decoration/Painting.java b/net/minecraft/world/entity/decoration/Painting.java
-index 3f13bb1ad260d250efe2622297e432dc300e73a0..b1ee059501532cc2df5f0824e5becbd2bc6727b2 100644
+index cc34cadac8896a5f546d0879e795fea08d0c3f98..26a08b16de2318d5080be59a29c5f11e3597426d 100644
--- a/net/minecraft/world/entity/decoration/Painting.java
+++ b/net/minecraft/world/entity/decoration/Painting.java
-@@ -179,7 +179,11 @@ public class Painting extends HangingEntity {
+@@ -182,7 +182,11 @@ public class Painting extends HangingEntity {
if (level.getGameRules().getBoolean(GameRules.RULE_DOENTITYDROPS)) {
this.playSound(SoundEvents.PAINTING_BREAK, 1.0F, 1.0F);
if (!(entity instanceof Player player && player.hasInfiniteMaterials())) {
@@ -8187,10 +8233,10 @@ index 3f13bb1ad260d250efe2622297e432dc300e73a0..b1ee059501532cc2df5f0824e5becbd2
}
}
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
-index bf2f81232ac40218c6d0241b7a0a26cb2272e06b..883a053d025e74f73556a0affa2340e42365df59 100644
+index fcb1f6806908eb66592dc52f2b57286498cf7032..7dc97fccfd329253e0f6532d1cc2c06264674e15 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
-@@ -59,6 +59,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -56,6 +56,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
public boolean canMobPickup = true; // Paper - Item#canEntityPickup
private int despawnRate = -1; // Paper - Alternative item-despawn-rate
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
@@ -8203,7 +8249,7 @@ index bf2f81232ac40218c6d0241b7a0a26cb2272e06b..883a053d025e74f73556a0affa2340e4
public ItemEntity(EntityType extends ItemEntity> entityType, Level level) {
super(entityType, level);
-@@ -372,7 +378,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -370,7 +376,16 @@ public class ItemEntity extends Entity implements TraceableEntity {
@Override
public final boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
@@ -8221,7 +8267,7 @@ index bf2f81232ac40218c6d0241b7a0a26cb2272e06b..883a053d025e74f73556a0affa2340e4
return false;
} else if (!level.getGameRules().getBoolean(GameRules.RULE_MOBGRIEFING) && damageSource.getEntity() instanceof Mob) {
return false;
-@@ -556,6 +571,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -549,6 +564,12 @@ public class ItemEntity extends Entity implements TraceableEntity {
public void setItem(ItemStack stack) {
this.getEntityData().set(DATA_ITEM, stack);
this.despawnRate = this.level().paperConfig().entities.spawning.altItemDespawnRate.enabled ? this.level().paperConfig().entities.spawning.altItemDespawnRate.items.getOrDefault(stack.getItem(), this.level().spigotConfig.itemDespawnRate) : this.level().spigotConfig.itemDespawnRate; // Paper - Alternative item-despawn-rate
@@ -8235,10 +8281,10 @@ index bf2f81232ac40218c6d0241b7a0a26cb2272e06b..883a053d025e74f73556a0affa2340e4
@Override
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
-index 5d23d8754b304d5e2fd54400cc81c7fe5c14a804..9a00aead39e194de076ee651d2f75b29673cad1e 100644
+index 17d54d38dcec39eefeb989cd576cc640a36e82f5..ef070f8a9ab3a4676e2141f7c0bc20a000d0cc3a 100644
--- a/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
-@@ -253,4 +253,32 @@ public class PrimedTnt extends Entity implements TraceableEntity {
+@@ -238,4 +238,32 @@ public class PrimedTnt extends Entity implements TraceableEntity {
return !this.level().paperConfig().fixes.preventTntFromMovingInWater && super.isPushedByFluid();
}
// Paper end - Option to prevent TNT from moving in water
@@ -8272,7 +8318,7 @@ index 5d23d8754b304d5e2fd54400cc81c7fe5c14a804..9a00aead39e194de076ee651d2f75b29
+ // Purpur end - Shears can defuse TNT
}
diff --git a/net/minecraft/world/entity/monster/AbstractSkeleton.java b/net/minecraft/world/entity/monster/AbstractSkeleton.java
-index 22d5ccb271fc19255e99afa5d1ff10549a20dc31..21cf84f1d037e3e387a3e254599673125f89ba9c 100644
+index 894a3d988d0530d42d3a282b61cdb445a0f820ad..482de769f1b1fc0eac176cbc41a96f639dcc2d2d 100644
--- a/net/minecraft/world/entity/monster/AbstractSkeleton.java
+++ b/net/minecraft/world/entity/monster/AbstractSkeleton.java
@@ -64,21 +64,24 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
@@ -8342,29 +8388,29 @@ index 22d5ccb271fc19255e99afa5d1ff10549a20dc31..21cf84f1d037e3e387a3e25459967312
this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
this.setDropChance(EquipmentSlot.HEAD, 0.0F);
}
-@@ -217,7 +197,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
- if (event.getProjectile() == arrow.getBukkitEntity()) {
- // CraftBukkit end
- Projectile.spawnProjectileUsingShoot(
+@@ -209,7 +189,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
+ double squareRoot = Math.sqrt(d * d + d2 * d2);
+ if (this.level() instanceof ServerLevel serverLevel) {
+ Projectile.Delayed delayedEntity = Projectile.spawnProjectileUsingShootDelayed( // Paper - delayed
- arrow, serverLevel, projectile, d, d1 + squareRoot * 0.2F, d2, 1.6F, 14 - serverLevel.getDifficulty().getId() * 4
-+ arrow, serverLevel, projectile, d, d1 + squareRoot * 0.2F, d2, 1.6F, serverLevel.purpurConfig.skeletonBowAccuracyMap.getOrDefault(serverLevel.getDifficulty().getId(), (float) (14 - serverLevel.getDifficulty().getId() * 4)) // Purpur - skeleton bow accuracy option
++ arrow, serverLevel, projectile, d, d1 + squareRoot * 0.2F, d2, 1.6F, serverLevel.purpurConfig.skeletonBowAccuracyMap.getOrDefault(serverLevel.getDifficulty().getId(), (float) (14 - serverLevel.getDifficulty().getId() * 4)) // Purpur - skeleton bow accuracy option
);
- } // CraftBukkit
- }
-@@ -243,14 +223,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
- public void readAdditionalSaveData(CompoundTag compound) {
- super.readAdditionalSaveData(compound);
+
+ // Paper start - call EntityShootBowEvent
+@@ -246,14 +226,14 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
+ protected void readAdditionalSaveData(ValueInput input) {
+ super.readAdditionalSaveData(input);
this.reassessWeaponGoal();
-- this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API
-+ //this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API
++ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - shouldBurnInDay API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
}
// Paper start - shouldBurnInDay API
@Override
- public void addAdditionalSaveData(final net.minecraft.nbt.CompoundTag nbt) {
- super.addAdditionalSaveData(nbt);
-- nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
-+ //nbt.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+ protected void addAdditionalSaveData(final net.minecraft.world.level.storage.ValueOutput output) {
+ super.addAdditionalSaveData(output);
+- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
++ //output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
}
// Paper end - shouldBurnInDay API
@@ -8474,10 +8520,10 @@ index 4ab7072b4290db7fbe72f81b89d3c428b05f737c..fa21b7dba208d5ba6ecf1d2b68965bb5
if (this.nextHeightOffsetChangeTick <= 0) {
this.nextHeightOffsetChangeTick = 100;
diff --git a/net/minecraft/world/entity/monster/Bogged.java b/net/minecraft/world/entity/monster/Bogged.java
-index c279d38ed8d5d0fef6dea4afdc3ab308456f31a7..bc8f46b656895d916e44a9e1dc9175da96c2fde8 100644
+index afb4cee70d0feecab93d943baf7ddfd83ad7f3b5..cace310ad4ad320a8a5745c6af3ec4b57e75b6a5 100644
--- a/net/minecraft/world/entity/monster/Bogged.java
+++ b/net/minecraft/world/entity/monster/Bogged.java
-@@ -42,6 +42,31 @@ public class Bogged extends AbstractSkeleton implements Shearable {
+@@ -43,6 +43,31 @@ public class Bogged extends AbstractSkeleton implements Shearable {
super(entityType, level);
}
@@ -8560,10 +8606,10 @@ index 2e32567fca7a2a4cd87bc078a6eeb30e3ffabfce..7eca4b751d900c6d6ee34993c3e23681
public boolean doHurtTarget(ServerLevel level, Entity source) {
if (super.doHurtTarget(level, source)) {
diff --git a/net/minecraft/world/entity/monster/Creeper.java b/net/minecraft/world/entity/monster/Creeper.java
-index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8bcb825b74 100644
+index eabc778ba06c14f3020391b9850ae1a283ecf106..2839c755e5ca58896bc14f95ce4889d48ec415b3 100644
--- a/net/minecraft/world/entity/monster/Creeper.java
+++ b/net/minecraft/world/entity/monster/Creeper.java
-@@ -54,21 +54,107 @@ public class Creeper extends Monster {
+@@ -55,21 +55,107 @@ public class Creeper extends Monster {
public int explosionRadius = 3;
private int droppedSkulls;
public @Nullable Entity entityIgniter; // CraftBukkit
@@ -8671,7 +8717,7 @@ index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8b
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(2, new HurtByTargetGoal(this));
}
-@@ -157,6 +243,41 @@ public class Creeper extends Monster {
+@@ -158,6 +244,41 @@ public class Creeper extends Monster {
return false; // CraftBukkit
}
@@ -8713,7 +8759,7 @@ index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8b
@Override
public SoundEvent getHurtSound(DamageSource damageSource) {
return SoundEvents.CREEPER_HURT;
-@@ -239,14 +360,16 @@ public class Creeper extends Monster {
+@@ -240,14 +361,16 @@ public class Creeper extends Monster {
}
public void explodeCreeper() {
@@ -8732,7 +8778,7 @@ index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8b
this.spawnLingeringCloud();
this.triggerOnDeathMobEffects(serverLevel, Entity.RemovalReason.KILLED);
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.EXPLODE); // CraftBukkit - add Bukkit remove cause
-@@ -257,6 +380,7 @@ public class Creeper extends Monster {
+@@ -258,6 +381,7 @@ public class Creeper extends Monster {
}
// CraftBukkit end
}
@@ -8740,7 +8786,7 @@ index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8b
}
private void spawnLingeringCloud() {
-@@ -285,6 +409,7 @@ public class Creeper extends Monster {
+@@ -286,6 +410,7 @@ public class Creeper extends Monster {
com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited);
if (event.callEvent()) {
this.entityData.set(DATA_IS_IGNITED, event.isIgnited());
@@ -8749,10 +8795,10 @@ index 3f5e1e98802e5dd1cfc9075559e1102046605a04..567e1bc0bb2e96f831206e70612dfe8b
}
}
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
-index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba89c4397e 100644
+index f42f9c232fa588835654de0fdea36b9cdfa34571..2e6d0f035a01277aa28bbe912d5df8dc4cf04547 100644
--- a/net/minecraft/world/entity/monster/Drowned.java
+++ b/net/minecraft/world/entity/monster/Drowned.java
-@@ -75,6 +75,67 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -71,11 +71,72 @@ public class Drowned extends Zombie implements RangedAttackMob {
return Zombie.createAttributes().add(Attributes.STEP_HEIGHT, 1.0);
}
@@ -8773,6 +8819,11 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
+ }
+ // Purpur end - Ridables
+
+ @Override
+ protected PathNavigation createNavigation(Level level) {
+ return new AmphibiousPathNavigation(this, level);
+ }
+
+ // Purpur start - Configurable entity base attributes
+ @Override
+ public void initAttributes() {
@@ -8820,7 +8871,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
@Override
protected void addBehaviourGoals() {
this.goalSelector.addGoal(1, new Drowned.DrownedGoToWaterGoal(this, 1.0));
-@@ -82,10 +143,23 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -83,10 +144,23 @@ public class Drowned extends Zombie implements RangedAttackMob {
this.goalSelector.addGoal(2, new Drowned.DrownedAttackGoal(this, 1.0, false));
this.goalSelector.addGoal(5, new Drowned.DrownedGoToBeachGoal(this, 1.0));
this.goalSelector.addGoal(6, new Drowned.DrownedSwimUpGoal(this, 1.0, this.level().getSeaLevel()));
@@ -8845,7 +8896,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Axolotl.class, true, false));
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
-@@ -398,7 +472,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -392,7 +466,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
}
}
@@ -8854,7 +8905,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
private final Drowned drowned;
public DrownedMoveControl(Drowned mob) {
-@@ -407,7 +481,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -401,7 +475,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
}
@Override
@@ -8863,7 +8914,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
LivingEntity target = this.drowned.getTarget();
if (this.drowned.wantsToSwim() && this.drowned.isInWater()) {
if (target != null && target.getY() > this.drowned.getY() || this.drowned.searchingForLand) {
-@@ -427,7 +501,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -421,7 +495,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
float f = (float)(Mth.atan2(d2, d) * 180.0F / (float)Math.PI) - 90.0F;
this.drowned.setYRot(this.rotlerp(this.drowned.getYRot(), f, 90.0F));
this.drowned.yBodyRot = this.drowned.getYRot();
@@ -8872,7 +8923,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
float f2 = Mth.lerp(0.125F, this.drowned.getSpeed(), f1);
this.drowned.setSpeed(f2);
this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(f2 * d * 0.005, f2 * d1 * 0.1, f2 * d2 * 0.005));
-@@ -436,7 +510,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -430,7 +504,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
this.drowned.setDeltaMovement(this.drowned.getDeltaMovement().add(0.0, -0.008, 0.0));
}
@@ -8882,7 +8933,7 @@ index 4978cd2a7a84130fc0de1cc481b39d61f388c812..b85d1e196d2bf61ac4896205afb08eba
}
}
diff --git a/net/minecraft/world/entity/monster/ElderGuardian.java b/net/minecraft/world/entity/monster/ElderGuardian.java
-index fd33a8b59f40299ab644a4c52921b66a9b6552ca..a708692a71014aabc1fc842837e1c0a82fd3a343 100644
+index 7eef05b988d52391ab061382fd8898705c705e03..ab1c050ff326a072e817a05958b8f4ec803af063 100644
--- a/net/minecraft/world/entity/monster/ElderGuardian.java
+++ b/net/minecraft/world/entity/monster/ElderGuardian.java
@@ -31,6 +31,40 @@ public class ElderGuardian extends Guardian {
@@ -8927,10 +8978,10 @@ index fd33a8b59f40299ab644a4c52921b66a9b6552ca..a708692a71014aabc1fc842837e1c0a8
return Guardian.createAttributes().add(Attributes.MOVEMENT_SPEED, 0.3F).add(Attributes.ATTACK_DAMAGE, 8.0).add(Attributes.MAX_HEALTH, 80.0);
}
diff --git a/net/minecraft/world/entity/monster/EnderMan.java b/net/minecraft/world/entity/monster/EnderMan.java
-index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b6fa473e0 100644
+index 9b0235c50426accde002cbb0a09a992f13b05cd7..58887b2cc931892f96793edd7a7d1db22cb8686c 100644
--- a/net/minecraft/world/entity/monster/EnderMan.java
+++ b/net/minecraft/world/entity/monster/EnderMan.java
-@@ -88,12 +88,45 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -86,12 +86,45 @@ public class EnderMan extends Monster implements NeutralMob {
public EnderMan(EntityType extends EnderMan> entityType, Level level) {
super(entityType, level);
@@ -8977,7 +9028,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
this.goalSelector.addGoal(1, new EnderMan.EndermanFreezeWhenLookedAt(this));
this.goalSelector.addGoal(2, new MeleeAttackGoal(this, 1.0, false));
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0, 0.0F));
-@@ -101,9 +134,10 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -99,9 +132,10 @@ public class EnderMan extends Monster implements NeutralMob {
this.goalSelector.addGoal(8, new RandomLookAroundGoal(this));
this.goalSelector.addGoal(10, new EnderMan.EndermanLeaveBlockGoal(this));
this.goalSelector.addGoal(11, new EnderMan.EndermanTakeBlockGoal(this));
@@ -8989,7 +9040,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
this.targetSelector.addGoal(4, new ResetUniversalAngerTargetGoal<>(this, false));
}
-@@ -220,7 +254,7 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -216,7 +250,7 @@ public class EnderMan extends Monster implements NeutralMob {
boolean isBeingStaredBy(Player player) {
// Paper start - EndermanAttackPlayerEvent
@@ -8998,7 +9049,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
final com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent event = new com.destroystokyo.paper.event.entity.EndermanAttackPlayerEvent((org.bukkit.entity.Enderman) getBukkitEntity(), (org.bukkit.entity.Player) player.getBukkitEntity());
event.setCancelled(!shouldAttack);
return event.callEvent();
-@@ -258,12 +292,12 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -254,12 +288,12 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean isSensitiveToWater() {
@@ -9013,7 +9064,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
float lightLevelDependentMagicValue = this.getLightLevelDependentMagicValue();
if (lightLevelDependentMagicValue > 0.5F
&& level.canSeeSky(this.blockPosition())
-@@ -384,6 +418,8 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -380,6 +414,8 @@ public class EnderMan extends Monster implements NeutralMob {
public boolean hurtServer(ServerLevel level, DamageSource damageSource, float amount) {
if (this.isInvulnerableTo(level, damageSource)) {
return false;
@@ -9022,7 +9073,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
} else {
AbstractThrownPotion abstractThrownPotion1 = damageSource.getDirectEntity() instanceof AbstractThrownPotion abstractThrownPotion
? abstractThrownPotion
-@@ -400,6 +436,7 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -396,6 +432,7 @@ public class EnderMan extends Monster implements NeutralMob {
} else {
boolean flag = abstractThrownPotion1 != null && this.hurtWithCleanWater(level, damageSource, abstractThrownPotion1, amount);
@@ -9030,7 +9081,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - EndermanEscapeEvent
for (int i = 0; i < 64; i++) {
if (this.teleport()) {
-@@ -443,7 +480,7 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -439,7 +476,7 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean requiresCustomPersistence() {
@@ -9039,7 +9090,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
}
static class EndermanFreezeWhenLookedAt extends Goal {
-@@ -487,8 +524,9 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -483,8 +520,9 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean canUse() {
@@ -9050,7 +9101,7 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
&& this.enderman.getRandom().nextInt(reducedTickDelay(2000)) == 0;
}
-@@ -636,8 +674,9 @@ public class EnderMan extends Monster implements NeutralMob {
+@@ -632,8 +670,9 @@ public class EnderMan extends Monster implements NeutralMob {
@Override
public boolean canUse() {
@@ -9062,10 +9113,10 @@ index 84a9dbf5898fb519fad5fdc3ea1d9a2054d1e0eb..16886178079a096329d06f40d502012b
}
diff --git a/net/minecraft/world/entity/monster/Endermite.java b/net/minecraft/world/entity/monster/Endermite.java
-index 7fad96756972308e71fd38033f06148467a7aecd..7d3932dcb263500357e9aad28881229418a0d458 100644
+index f448aac89c6125246c730a71e7ee21c8168d7003..4ea0e5f24664a1c8f2c8bdae559784434374adf6 100644
--- a/net/minecraft/world/entity/monster/Endermite.java
+++ b/net/minecraft/world/entity/monster/Endermite.java
-@@ -29,20 +29,72 @@ public class Endermite extends Monster {
+@@ -30,20 +30,72 @@ public class Endermite extends Monster {
private static final int MAX_LIFE = 2400;
private static final int DEFAULT_LIFE = 0;
public int life = 0;
@@ -9138,26 +9189,26 @@ index 7fad96756972308e71fd38033f06148467a7aecd..7d3932dcb263500357e9aad288812294
this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers());
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
}
-@@ -80,12 +132,14 @@ public class Endermite extends Monster {
- public void readAdditionalSaveData(CompoundTag compound) {
- super.readAdditionalSaveData(compound);
- this.life = compound.getIntOr("Lifetime", 0);
-+ this.isPlayerSpawned = compound.getBooleanOr("PlayerSpawned", false); // Purpur - Add back player spawned endermite API
+@@ -81,12 +133,14 @@ public class Endermite extends Monster {
+ protected void readAdditionalSaveData(ValueInput input) {
+ super.readAdditionalSaveData(input);
+ this.life = input.getIntOr("Lifetime", 0);
++ this.isPlayerSpawned = input.getBooleanOr("PlayerSpawned", false); // Purpur - Add back player spawned endermite API
}
@Override
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
- compound.putInt("Lifetime", this.life);
-+ compound.putBoolean("PlayerSpawned", this.isPlayerSpawned); // Purpur - Add back player spawned endermite API
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+ output.putInt("Lifetime", this.life);
++ output.putBoolean("PlayerSpawned", this.isPlayerSpawned); // Purpur - Add back player spawned endermite API
}
@Override
diff --git a/net/minecraft/world/entity/monster/Evoker.java b/net/minecraft/world/entity/monster/Evoker.java
-index cf9f0c60efc4f7cbc275ed9b154c979e82b4d50c..76b1886e78918eccb8e2ecfe6dca033fcad5f9e1 100644
+index 7efa39ab1fb34da41a04cd6816f2571c6eba98f5..5c1992a7fd5d7c5fe23ebfad35a828263d0ff93c 100644
--- a/net/minecraft/world/entity/monster/Evoker.java
+++ b/net/minecraft/world/entity/monster/Evoker.java
-@@ -50,10 +50,50 @@ public class Evoker extends SpellcasterIllager {
+@@ -48,10 +48,50 @@ public class Evoker extends SpellcasterIllager {
this.xpReward = 10;
}
@@ -9208,7 +9259,7 @@ index cf9f0c60efc4f7cbc275ed9b154c979e82b4d50c..76b1886e78918eccb8e2ecfe6dca033f
this.goalSelector.addGoal(1, new Evoker.EvokerCastingSpellGoal());
this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, Player.class, 8.0F, 0.6, 1.0));
this.goalSelector.addGoal(3, new AvoidEntityGoal<>(this, Creaking.class, 8.0F, 0.6, 1.0));
-@@ -63,6 +103,7 @@ public class Evoker extends SpellcasterIllager {
+@@ -61,6 +101,7 @@ public class Evoker extends SpellcasterIllager {
this.goalSelector.addGoal(8, new RandomStrollGoal(this, 0.6));
this.goalSelector.addGoal(9, new LookAtPlayerGoal(this, Player.class, 3.0F, 1.0F));
this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Mob.class, 8.0F));
@@ -9216,7 +9267,7 @@ index cf9f0c60efc4f7cbc275ed9b154c979e82b4d50c..76b1886e78918eccb8e2ecfe6dca033f
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Raider.class).setAlertOthers());
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true).setUnseenMemoryTicks(300));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false).setUnseenMemoryTicks(300));
-@@ -296,7 +337,7 @@ public class Evoker extends SpellcasterIllager {
+@@ -279,7 +320,7 @@ public class Evoker extends SpellcasterIllager {
return false;
} else {
ServerLevel serverLevel = getServerLevel(Evoker.this.level());
@@ -9226,11 +9277,11 @@ index cf9f0c60efc4f7cbc275ed9b154c979e82b4d50c..76b1886e78918eccb8e2ecfe6dca033f
} else {
List nearbyEntities = serverLevel.getNearbyEntities(
diff --git a/net/minecraft/world/entity/monster/Ghast.java b/net/minecraft/world/entity/monster/Ghast.java
-index 97b4352671910d2deedc6d280f3ce6e645597f3c..c2e6e2f4a2c1e72521f0afd1664d9ba02ef08d7d 100644
+index bbdff8b4043f27045684a2aa5687e2b7ca7afbb5..6f312f0b8ab60c839129ea671f2d9c128fa58e58 100644
--- a/net/minecraft/world/entity/monster/Ghast.java
+++ b/net/minecraft/world/entity/monster/Ghast.java
-@@ -43,11 +43,69 @@ public class Ghast extends FlyingMob implements Enemy {
- this.moveControl = new Ghast.GhastMoveControl(this);
+@@ -52,11 +52,57 @@ public class Ghast extends Mob implements Enemy {
+ this.moveControl = new Ghast.GhastMoveControl(this, false, () -> false);
}
+ // Purpur start - Ridables
@@ -9253,18 +9304,6 @@ index 97b4352671910d2deedc6d280f3ce6e645597f3c..c2e6e2f4a2c1e72521f0afd1664d9ba0
+ public double getMaxY() {
+ return level().purpurConfig.ghastMaxY;
+ }
-+
-+ @Override
-+ public void travel(Vec3 vec3) {
-+ super.travel(vec3);
-+ if (getRider() != null && this.isControllable() && !onGround) {
-+ float speed = (float) getAttributeValue(Attributes.FLYING_SPEED);
-+ setSpeed(speed);
-+ Vec3 mot = getDeltaMovement();
-+ move(net.minecraft.world.entity.MoverType.SELF, mot.multiply(speed, 1.0, speed));
-+ setDeltaMovement(mot.scale(0.9D));
-+ }
-+ }
+ // Purpur end - Ridables
+
+ // Purpur start - Configurable entity base attributes
@@ -9299,38 +9338,45 @@ index 97b4352671910d2deedc6d280f3ce6e645597f3c..c2e6e2f4a2c1e72521f0afd1664d9ba0
this.targetSelector
.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entity, level) -> Math.abs(entity.getY() - this.getY()) <= 4.0));
}
-@@ -102,7 +160,7 @@ public class Ghast extends FlyingMob implements Enemy {
- }
-
- public static AttributeSupplier.Builder createAttributes() {
-- return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0).add(Attributes.FOLLOW_RANGE, 100.0);
-+ return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 10.0).add(Attributes.FOLLOW_RANGE, 100.0).add(Attributes.FLYING_SPEED, 0.6D); // Purpur - Ridables
+@@ -106,6 +152,15 @@ public class Ghast extends Mob implements Enemy {
+ @Override
+ public void travel(Vec3 travelVector) {
+ this.travelFlying(travelVector, 0.02F);
++ // Purpur start - Ridables
++ if (getRider() != null && this.isControllable() && !onGround) {
++ float speed = (float) getAttributeValue(Attributes.FLYING_SPEED);
++ setSpeed(speed);
++ Vec3 mot = getDeltaMovement();
++ move(net.minecraft.world.entity.MoverType.SELF, mot.multiply(speed, 1.0, speed));
++ setDeltaMovement(mot.scale(0.9D));
++ }
++ // Purpur end - Ridables
}
@Override
-@@ -190,7 +248,7 @@ public class Ghast extends FlyingMob implements Enemy {
+@@ -236,7 +291,7 @@ public class Ghast extends Mob implements Enemy {
}
}
-- static class GhastMoveControl extends MoveControl {
-+ static class GhastMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur - Ridables
- private final Ghast ghast;
+- public static class GhastMoveControl extends MoveControl {
++ public static class GhastMoveControl extends org.purpurmc.purpur.controller.FlyingMoveControllerWASD { // Purpur - Ridables
+ private final Mob ghast;
private int floatDuration;
-
-@@ -200,7 +258,7 @@ public class Ghast extends FlyingMob implements Enemy {
+ private final boolean careful;
+@@ -250,7 +305,7 @@ public class Ghast extends Mob implements Enemy {
}
@Override
- public void tick() {
+ public void vanillaTick() { // Purpur - Ridables
- if (this.operation == MoveControl.Operation.MOVE_TO) {
- if (this.floatDuration-- <= 0) {
- this.floatDuration = this.floatDuration + this.ghast.getRandom().nextInt(5) + 2;
+ if (this.shouldBeStopped.getAsBoolean()) {
+ this.operation = MoveControl.Operation.WAIT;
+ this.ghast.stopInPlace();
diff --git a/net/minecraft/world/entity/monster/Giant.java b/net/minecraft/world/entity/monster/Giant.java
-index 969eb604851d1cce50f0f99ed479189061d5de0c..3f575abee4c8933d1642400d134b0fc915215a1a 100644
+index ab0b44fd3e20fcab4e2fea985e7471575b619069..f4ec41a74b13be98f3ac78521fdd357842bc9ebd 100644
--- a/net/minecraft/world/entity/monster/Giant.java
+++ b/net/minecraft/world/entity/monster/Giant.java
-@@ -12,12 +12,104 @@ public class Giant extends Monster {
+@@ -12,6 +12,70 @@ public class Giant extends Monster {
super(entityType, level);
}
@@ -9399,7 +9445,10 @@ index 969eb604851d1cce50f0f99ed479189061d5de0c..3f575abee4c8933d1642400d134b0fc9
+ // Purpur end - Mobs always drop experience
+
public static AttributeSupplier.Builder createAttributes() {
- return Monster.createMonsterAttributes().add(Attributes.MAX_HEALTH, 100.0).add(Attributes.MOVEMENT_SPEED, 0.5).add(Attributes.ATTACK_DAMAGE, 50.0);
+ return Monster.createMonsterAttributes()
+ .add(Attributes.MAX_HEALTH, 100.0)
+@@ -20,8 +84,36 @@ public class Giant extends Monster {
+ .add(Attributes.CAMERA_DISTANCE, 16.0);
}
+ // Purpur - Giants AI settings
@@ -9636,7 +9685,7 @@ index 8d6def85583a111841b28f20f58ddb8b8cbd7bc1..a4ce65911a5d778f60bcedb3acd9fe59
@Override
diff --git a/net/minecraft/world/entity/monster/Illusioner.java b/net/minecraft/world/entity/monster/Illusioner.java
-index ec090d191969983c31950b8376bbb36ee8fce922..93eaafe260312f26840a2afee8375b8a95d97ba2 100644
+index 7441b019f669653e3e738f27c866270c30acffd4..2ea8c8480dcc15eb5b4bc9686554ec912ef1f3f4 100644
--- a/net/minecraft/world/entity/monster/Illusioner.java
+++ b/net/minecraft/world/entity/monster/Illusioner.java
@@ -57,10 +57,52 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
@@ -9797,10 +9846,10 @@ index 5ef9566b16a4d0300ee45a993c46e734db156416..04d5910d736dee2a88a2602f4a984954
return false;
} else {
diff --git a/net/minecraft/world/entity/monster/Phantom.java b/net/minecraft/world/entity/monster/Phantom.java
-index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b4263b1a6f1 100644
+index ffcfdbc80df2a9e6c546348b86e7615e6109eb49..d25392babee8cb8eea9f5d6fef4529a952644e52 100644
--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
-@@ -48,19 +48,123 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -49,19 +49,111 @@ public class Phantom extends Mob implements Enemy {
@Nullable
public BlockPos anchorPoint;
Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
@@ -9841,18 +9890,6 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
+ return level().purpurConfig.phantomMaxY;
+ }
+
-+ @Override
-+ public void travel(Vec3 vec3) {
-+ super.travel(vec3);
-+ if (getRider() != null && this.isControllable() && !onGround) {
-+ float speed = (float) getAttributeValue(Attributes.FLYING_SPEED);
-+ setSpeed(speed);
-+ Vec3 mot = getDeltaMovement();
-+ move(net.minecraft.world.entity.MoverType.SELF, mot.multiply(speed, speed, speed));
-+ setDeltaMovement(mot.scale(0.9D));
-+ }
-+ }
-+
+ public static net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder createAttributes() {
+ return Monster.createMonsterAttributes().add(Attributes.FLYING_SPEED, 3.0D);
+ }
@@ -9924,7 +9961,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
@Override
public boolean isFlapping() {
return (this.getUniqueFlapTickOffset() + this.tickCount) % TICKS_PER_FLAP == 0;
-@@ -73,9 +177,17 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -74,9 +166,17 @@ public class Phantom extends Mob implements Enemy {
@Override
protected void registerGoals() {
@@ -9945,7 +9982,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
this.targetSelector.addGoal(1, new Phantom.PhantomAttackPlayerTargetGoal());
}
-@@ -91,7 +203,11 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -92,7 +192,11 @@ public class Phantom extends Mob implements Enemy {
private void updatePhantomSizeInfo() {
this.refreshDimensions();
@@ -9958,7 +9995,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
}
public int getPhantomSize() {
-@@ -116,6 +232,23 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -117,6 +221,23 @@ public class Phantom extends Mob implements Enemy {
return true;
}
@@ -9982,7 +10019,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
@Override
public void tick() {
super.tick();
-@@ -147,10 +280,7 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -148,10 +269,7 @@ public class Phantom extends Mob implements Enemy {
@Override
public void aiStep() {
@@ -9994,7 +10031,23 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
super.aiStep();
}
-@@ -159,7 +289,11 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -167,6 +285,15 @@ public class Phantom extends Mob implements Enemy {
+ @Override
+ public void travel(Vec3 travelVector) {
+ this.travelFlying(travelVector, 0.2F);
++ // Purpur start - Ridables
++ if (this.getRider() != null && this.isControllable() && !this.onGround) {
++ float speed = (float) this.getAttributeValue(Attributes.FLYING_SPEED);
++ this.setSpeed(speed);
++ Vec3 mot = this.getDeltaMovement();
++ this.move(net.minecraft.world.entity.MoverType.SELF, mot.multiply(speed, speed, speed));
++ this.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO);
++ }
++ // Purpur end - Ridables
+ }
+
+ @Override
+@@ -174,7 +301,11 @@ public class Phantom extends Mob implements Enemy {
ServerLevelAccessor level, DifficultyInstance difficulty, EntitySpawnReason spawnReason, @Nullable SpawnGroupData spawnGroupData
) {
this.anchorPoint = this.blockPosition().above(5);
@@ -10007,25 +10060,25 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
return super.finalizeSpawn(level, difficulty, spawnReason, spawnGroupData);
}
-@@ -170,7 +304,7 @@ public class Phantom extends FlyingMob implements Enemy {
- this.setPhantomSize(compound.getIntOr("size", 0));
+@@ -185,7 +316,7 @@ public class Phantom extends Mob implements Enemy {
+ this.setPhantomSize(input.getIntOr("size", 0));
// Paper start
- this.spawningEntity = compound.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
-- this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true);
-+ //this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+ this.spawningEntity = input.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
+- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true);
++ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
// Paper end
}
-@@ -181,7 +315,7 @@ public class Phantom extends FlyingMob implements Enemy {
- compound.putInt("size", this.getPhantomSize());
+@@ -196,7 +327,7 @@ public class Phantom extends Mob implements Enemy {
+ output.putInt("size", this.getPhantomSize());
// Paper start
- compound.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
-- compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
-+ //compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+ output.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
+- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
++ output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Purpur - implemented in LivingEntity - API for any mob to burn daylight
// Paper end
}
-@@ -251,6 +385,7 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -266,6 +397,7 @@ public class Phantom extends Mob implements Enemy {
List nearbyPlayers = serverLevel.getNearbyPlayers(
this.attackTargeting, Phantom.this, Phantom.this.getBoundingBox().inflate(16.0, 64.0, 16.0)
);
@@ -10033,7 +10086,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
if (!nearbyPlayers.isEmpty()) {
nearbyPlayers.sort(Comparator.comparing(Entity::getY).reversed());
-@@ -400,25 +535,160 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -415,25 +547,160 @@ public class Phantom extends Mob implements Enemy {
}
}
@@ -10197,7 +10250,7 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
if (Phantom.this.horizontalCollision) {
Phantom.this.setYRot(Phantom.this.getYRot() + 180.0F);
this.speed = 0.1F;
-@@ -485,6 +755,12 @@ public class Phantom extends FlyingMob implements Enemy {
+@@ -500,6 +767,12 @@ public class Phantom extends Mob implements Enemy {
return false;
} else if (!target.isAlive()) {
return false;
@@ -10211,10 +10264,10 @@ index 483b0499f1f70b3aa8862e6cd8e512748492bee0..2e1e7cf0fe1bc25437cf2f429ff33b42
return false;
} else if (!this.canUse()) {
diff --git a/net/minecraft/world/entity/monster/Pillager.java b/net/minecraft/world/entity/monster/Pillager.java
-index d7b05fed206cfb63a75fab94f687d69fb230de9c..3d12b509a9b57f0326ec48eed93b2962f6f0e493 100644
+index 4f72db7e6f99844761de2f749e52cda156b08ad7..2ed473468032bb6edbd03882b5f5405b90a2f0f4 100644
--- a/net/minecraft/world/entity/monster/Pillager.java
+++ b/net/minecraft/world/entity/monster/Pillager.java
-@@ -63,16 +63,57 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve
+@@ -64,16 +64,57 @@ public class Pillager extends AbstractIllager implements CrossbowAttackMob, Inve
super(entityType, level);
}
@@ -10273,10 +10326,10 @@ index d7b05fed206cfb63a75fab94f687d69fb230de9c..3d12b509a9b57f0326ec48eed93b2962
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, false));
diff --git a/net/minecraft/world/entity/monster/Ravager.java b/net/minecraft/world/entity/monster/Ravager.java
-index ca1856b18878b94ebfb566395e5eee13cf3c1cd5..a9a2d38b896ea3620e557a5fd12149557c33c6a8 100644
+index 9d84bf2cffee25404eebbefdc9cc3f37ebc386b0..2b85cedf235e673d6030c2a649abf60b5792b242 100644
--- a/net/minecraft/world/entity/monster/Ravager.java
+++ b/net/minecraft/world/entity/monster/Ravager.java
-@@ -69,14 +69,62 @@ public class Ravager extends Raider {
+@@ -70,14 +70,62 @@ public class Ravager extends Raider {
this.setPathfindingMalus(PathType.LEAVES, 0.0F);
}
@@ -10339,7 +10392,7 @@ index ca1856b18878b94ebfb566395e5eee13cf3c1cd5..a9a2d38b896ea3620e557a5fd1214955
this.targetSelector.addGoal(2, new HurtByTargetGoal(this, Raider.class).setAlertOthers());
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true, (entity, level) -> !entity.isBaby()));
-@@ -133,7 +181,7 @@ public class Ravager extends Raider {
+@@ -134,7 +182,7 @@ public class Ravager extends Raider {
@Override
public void aiStep() {
super.aiStep();
@@ -10348,7 +10401,7 @@ index ca1856b18878b94ebfb566395e5eee13cf3c1cd5..a9a2d38b896ea3620e557a5fd1214955
if (this.isImmobile()) {
this.getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.0);
} else {
-@@ -144,7 +192,7 @@ public class Ravager extends Raider {
+@@ -145,7 +193,7 @@ public class Ravager extends Raider {
if (this.level() instanceof ServerLevel serverLevel
&& this.horizontalCollision
@@ -10357,7 +10410,7 @@ index ca1856b18878b94ebfb566395e5eee13cf3c1cd5..a9a2d38b896ea3620e557a5fd1214955
boolean flag = false;
AABB aabb = this.getBoundingBox().inflate(0.2);
-@@ -153,7 +201,7 @@ public class Ravager extends Raider {
+@@ -154,7 +202,7 @@ public class Ravager extends Raider {
)) {
BlockState blockState = serverLevel.getBlockState(blockPos);
Block block = blockState.getBlock();
@@ -10367,18 +10420,10 @@ index ca1856b18878b94ebfb566395e5eee13cf3c1cd5..a9a2d38b896ea3620e557a5fd1214955
if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this, blockPos, blockState.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
continue;
diff --git a/net/minecraft/world/entity/monster/Shulker.java b/net/minecraft/world/entity/monster/Shulker.java
-index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b857646bf18f88 100644
+index f667fc5ff1ea4149cb25608e0d12f9f73f86095e..a46ca09f661a4f8f3ede6550d613e0c704a9389b 100644
--- a/net/minecraft/world/entity/monster/Shulker.java
+++ b/net/minecraft/world/entity/monster/Shulker.java
-@@ -53,6 +53,7 @@ import net.minecraft.world.level.Level;
- import net.minecraft.world.level.ServerLevelAccessor;
- import net.minecraft.world.level.block.Blocks;
- import net.minecraft.world.level.block.state.BlockState;
-+import net.minecraft.world.level.entity.EntityTypeTest;
- import net.minecraft.world.level.gameevent.GameEvent;
- import net.minecraft.world.phys.AABB;
- import net.minecraft.world.phys.Vec3;
-@@ -93,12 +94,68 @@ public class Shulker extends AbstractGolem implements Enemy {
+@@ -94,12 +94,68 @@ public class Shulker extends AbstractGolem implements Enemy {
this.lookControl = new Shulker.ShulkerLookControl(this);
}
@@ -10447,7 +10492,7 @@ index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b85764
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, this.getClass()).setAlertOthers());
this.targetSelector.addGoal(2, new Shulker.ShulkerNearestAttackGoal(this));
this.targetSelector.addGoal(3, new Shulker.ShulkerDefenseAttackGoal(this));
-@@ -460,11 +517,21 @@ public class Shulker extends AbstractGolem implements Enemy {
+@@ -461,11 +517,21 @@ public class Shulker extends AbstractGolem implements Enemy {
private void hitByShulkerBullet() {
Vec3 vec3 = this.position();
AABB boundingBox = this.getBoundingBox();
@@ -10459,7 +10504,7 @@ index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b85764
+ if ((!this.level().purpurConfig.shulkerSpawnFromBulletRequireOpenLid || !this.isClosed()) && this.teleportSomewhere()) {
+ float chance = this.level().purpurConfig.shulkerSpawnFromBulletBaseChance;
+ if (!this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation.isBlank()) {
-+ int nearby = this.level().getEntities((EntityTypeTest) EntityType.SHULKER, boundingBox.inflate(this.level().purpurConfig.shulkerSpawnFromBulletNearbyRange), Entity::isAlive).size();
++ int nearby = this.level().getEntities((net.minecraft.world.level.entity.EntityTypeTest) EntityType.SHULKER, boundingBox.inflate(this.level().purpurConfig.shulkerSpawnFromBulletNearbyRange), Entity::isAlive).size();
+ try {
+ chance -= ((Number) scriptEngine.eval("let nearby = " + nearby + "; " + this.level().purpurConfig.shulkerSpawnFromBulletNearbyEquation)).floatValue();
+ } catch (javax.script.ScriptException e) {
@@ -10473,7 +10518,7 @@ index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b85764
if (shulker != null) {
shulker.setVariant(this.getVariant());
shulker.snapTo(vec3);
-@@ -564,7 +631,7 @@ public class Shulker extends AbstractGolem implements Enemy {
+@@ -565,7 +631,7 @@ public class Shulker extends AbstractGolem implements Enemy {
@Override
protected float sanitizeScale(float scale) {
@@ -10482,7 +10527,7 @@ index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b85764
}
private void setVariant(Optional variant) {
-@@ -572,7 +639,7 @@ public class Shulker extends AbstractGolem implements Enemy {
+@@ -573,7 +639,7 @@ public class Shulker extends AbstractGolem implements Enemy {
}
public Optional getVariant() {
@@ -10491,7 +10536,7 @@ index 1b8a4c548c1376d9cdd16a10d434da070c85f41d..56401c993d9a4c41b0782831a8b85764
}
@Nullable
-@@ -692,7 +759,7 @@ public class Shulker extends AbstractGolem implements Enemy {
+@@ -693,7 +759,7 @@ public class Shulker extends AbstractGolem implements Enemy {
}
}
@@ -10581,10 +10626,10 @@ index 4e34833ea5c71b817c9f42a58320fe100981ec93..bcae390578519fef362a126fbcf2b5cf
continue;
}
diff --git a/net/minecraft/world/entity/monster/Skeleton.java b/net/minecraft/world/entity/monster/Skeleton.java
-index 48f26ed693b43e3f65f1559ba69b3d7249664f71..48cbc3cb983da08cfec78828b15f148459a22b44 100644
+index 743bc2986b962d4aaef00d2e457117f375ca65c7..c6ab31fa5204220f4c89dd48dd0966036a4975cf 100644
--- a/net/minecraft/world/entity/monster/Skeleton.java
+++ b/net/minecraft/world/entity/monster/Skeleton.java
-@@ -26,6 +26,44 @@ public class Skeleton extends AbstractSkeleton {
+@@ -27,6 +27,44 @@ public class Skeleton extends AbstractSkeleton {
super(entityType, level);
}
@@ -10629,7 +10674,7 @@ index 48f26ed693b43e3f65f1559ba69b3d7249664f71..48cbc3cb983da08cfec78828b15f1484
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -139,4 +177,64 @@ public class Skeleton extends AbstractSkeleton {
+@@ -140,4 +178,64 @@ public class Skeleton extends AbstractSkeleton {
this.spawnAtLocation(level, Items.SKELETON_SKULL);
}
}
@@ -10695,10 +10740,10 @@ index 48f26ed693b43e3f65f1559ba69b3d7249664f71..48cbc3cb983da08cfec78828b15f1484
+ // Purpur end - Skeletons eat wither roses
}
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
-index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c8de4548c 100644
+index 7b9105cc38380d60892647e52608787dbde28f0d..b299fc08fe900b4d48ce3e6986bcea000253053e 100644
--- a/net/minecraft/world/entity/monster/Slime.java
+++ b/net/minecraft/world/entity/monster/Slime.java
-@@ -58,6 +58,7 @@ public class Slime extends Mob implements Enemy {
+@@ -59,6 +59,7 @@ public class Slime extends Mob implements Enemy {
public float oSquish;
private boolean wasOnGround = false;
private boolean canWander = true; // Paper - Slime pathfinder events
@@ -10706,7 +10751,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
public Slime(EntityType extends Slime> entityType, Level level) {
super(entityType, level);
-@@ -65,12 +66,95 @@ public class Slime extends Mob implements Enemy {
+@@ -66,12 +67,95 @@ public class Slime extends Mob implements Enemy {
this.moveControl = new Slime.SlimeMoveControl(this);
}
@@ -10802,7 +10847,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
this.targetSelector
.addGoal(1, new NearestAttackableTargetGoal<>(this, Player.class, 10, true, false, (entity, level) -> Math.abs(entity.getY() - this.getY()) <= 4.0));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
-@@ -93,9 +177,9 @@ public class Slime extends Mob implements Enemy {
+@@ -94,9 +178,9 @@ public class Slime extends Mob implements Enemy {
this.entityData.set(ID_SIZE, i);
this.reapplyPosition();
this.refreshDimensions();
@@ -10814,7 +10859,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
if (resetHealth) {
this.setHealth(this.getMaxHealth());
}
-@@ -359,6 +443,7 @@ public class Slime extends Mob implements Enemy {
+@@ -360,6 +444,7 @@ public class Slime extends Mob implements Enemy {
Vec3 deltaMovement = this.getDeltaMovement();
this.setDeltaMovement(deltaMovement.x, this.getJumpPower(), deltaMovement.z);
this.hasImpulse = true;
@@ -10822,7 +10867,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
}
@Nullable
-@@ -523,7 +608,7 @@ public class Slime extends Mob implements Enemy {
+@@ -524,7 +609,7 @@ public class Slime extends Mob implements Enemy {
}
}
@@ -10831,7 +10876,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
private float yRot;
private int jumpDelay;
private final Slime slime;
-@@ -541,21 +626,33 @@ public class Slime extends Mob implements Enemy {
+@@ -542,21 +627,33 @@ public class Slime extends Mob implements Enemy {
}
public void setWantedMovement(double speed) {
@@ -10868,7 +10913,7 @@ index 5a81172c88f5699f1440b69b331a8ea353c1950a..9a157a2bdbbeab89dbfcd23be8bdc62c
if (this.jumpDelay-- <= 0) {
this.jumpDelay = this.slime.getJumpDelay();
if (this.isAggressive) {
-@@ -572,7 +669,7 @@ public class Slime extends Mob implements Enemy {
+@@ -573,7 +670,7 @@ public class Slime extends Mob implements Enemy {
this.mob.setSpeed(0.0F);
}
} else {
@@ -11091,10 +11136,10 @@ index afa584e2aba6bebfb2dd343215b043c983281853..fe31c4a45afd61be8b74efe9d0858ccd
if (isFood && !this.isSilent()) {
this.level()
diff --git a/net/minecraft/world/entity/monster/Vex.java b/net/minecraft/world/entity/monster/Vex.java
-index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c779d0ff25b 100644
+index a621e08fe4f88fcfa8da83bc44b23fc2ffaa5918..ab320cf5a8c68fd239e81172a2f3909a67931105 100644
--- a/net/minecraft/world/entity/monster/Vex.java
+++ b/net/minecraft/world/entity/monster/Vex.java
-@@ -58,6 +58,72 @@ public class Vex extends Monster implements TraceableEntity {
+@@ -60,6 +60,72 @@ public class Vex extends Monster implements TraceableEntity {
this.xpReward = 3;
}
@@ -11167,7 +11212,7 @@ index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c77
@Override
public boolean isFlapping() {
return this.tickCount % TICKS_PER_FLAP == 0;
-@@ -70,7 +136,7 @@ public class Vex extends Monster implements TraceableEntity {
+@@ -72,7 +138,7 @@ public class Vex extends Monster implements TraceableEntity {
@Override
public void tick() {
@@ -11176,7 +11221,7 @@ index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c77
super.tick();
this.noPhysics = false;
this.setNoGravity(true);
-@@ -84,17 +150,19 @@ public class Vex extends Monster implements TraceableEntity {
+@@ -86,17 +152,19 @@ public class Vex extends Monster implements TraceableEntity {
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(0, new FloatGoal(this));
@@ -11197,7 +11242,7 @@ index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c77
}
@Override
-@@ -291,13 +359,13 @@ public class Vex extends Monster implements TraceableEntity {
+@@ -298,13 +366,13 @@ public class Vex extends Monster implements TraceableEntity {
}
}
@@ -11213,7 +11258,7 @@ index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c77
if (this.operation == MoveControl.Operation.MOVE_TO) {
Vec3 vec3 = new Vec3(this.wantedX - Vex.this.getX(), this.wantedY - Vex.this.getY(), this.wantedZ - Vex.this.getZ());
double len = vec3.length();
-@@ -305,7 +373,7 @@ public class Vex extends Monster implements TraceableEntity {
+@@ -312,7 +380,7 @@ public class Vex extends Monster implements TraceableEntity {
this.operation = MoveControl.Operation.WAIT;
Vex.this.setDeltaMovement(Vex.this.getDeltaMovement().scale(0.5));
} else {
@@ -11223,10 +11268,10 @@ index bc74bdc3e13f1d51ed6d31470f3ac6f9855778c9..488e0605e9769d52faffecbc86c28c77
Vec3 deltaMovement = Vex.this.getDeltaMovement();
Vex.this.setYRot(-((float)Mth.atan2(deltaMovement.x, deltaMovement.z)) * (180.0F / (float)Math.PI));
diff --git a/net/minecraft/world/entity/monster/Vindicator.java b/net/minecraft/world/entity/monster/Vindicator.java
-index d02b4bfc3834cdfae37983ec616ee3cbcd9f0988..8ba772d9f5f53dc0dea269c5089e742f20dbc308 100644
+index e12643c0a1aa9608c34cab96d5c04abc60428322..df95c6be4469eeefa248e5ef18cfaba3d4cdeea6 100644
--- a/net/minecraft/world/entity/monster/Vindicator.java
+++ b/net/minecraft/world/entity/monster/Vindicator.java
-@@ -56,15 +56,56 @@ public class Vindicator extends AbstractIllager {
+@@ -57,15 +57,56 @@ public class Vindicator extends AbstractIllager {
super(entityType, level);
}
@@ -11283,7 +11328,7 @@ index d02b4bfc3834cdfae37983ec616ee3cbcd9f0988..8ba772d9f5f53dc0dea269c5089e742f
this.targetSelector.addGoal(1, new HurtByTargetGoal(this, Raider.class).setAlertOthers());
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillager.class, true));
-@@ -131,6 +172,11 @@ public class Vindicator extends AbstractIllager {
+@@ -132,6 +173,11 @@ public class Vindicator extends AbstractIllager {
RandomSource random = level.getRandom();
this.populateDefaultEquipmentSlots(random, difficulty);
this.populateDefaultEquipmentEnchantments(level, random, difficulty);
@@ -11409,10 +11454,10 @@ index 3ff71ba1bd29faa4d8380dad9397ab34ef930234..b3f5b2e3e2cfc378de948c0e186727d5
protected void registerGoals() {
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractPiglin.class, true));
diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
-index 33c7081c2aee7a31c4dd143f9d1a36cadcfcb29f..743946e69af541f6d5fe626108c70f96fe7fce65 100644
+index 662b95d27f6630ec27fd88ca279e395438faa96b..2a905e8cdf22f9d7f38cc41c1474e80f704d0cb1 100644
--- a/net/minecraft/world/entity/monster/Zoglin.java
+++ b/net/minecraft/world/entity/monster/Zoglin.java
-@@ -84,6 +84,45 @@ public class Zoglin extends Monster implements HoglinBase {
+@@ -85,6 +85,45 @@ public class Zoglin extends Monster implements HoglinBase {
this.xpReward = 5;
}
@@ -11458,7 +11503,7 @@ index 33c7081c2aee7a31c4dd143f9d1a36cadcfcb29f..743946e69af541f6d5fe626108c70f96
@Override
protected Brain.Provider brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
-@@ -247,6 +286,7 @@ public class Zoglin extends Monster implements HoglinBase {
+@@ -248,6 +287,7 @@ public class Zoglin extends Monster implements HoglinBase {
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -11467,10 +11512,10 @@ index 33c7081c2aee7a31c4dd143f9d1a36cadcfcb29f..743946e69af541f6d5fe626108c70f96
this.updateActivity();
}
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
-index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3c6ddf8f5 100644
+index a23607874a72723914cbfeea0ad1c51236c044d8..ab4dc7b3a7593d255dbd7d1df667fce3504af3ed 100644
--- a/net/minecraft/world/entity/monster/Zombie.java
+++ b/net/minecraft/world/entity/monster/Zombie.java
-@@ -93,22 +93,78 @@ public class Zombie extends Monster {
+@@ -92,22 +92,78 @@ public class Zombie extends Monster {
private boolean canBreakDoors = false;
private int inWaterTime = 0;
public int conversionTime;
@@ -11550,7 +11595,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
this.addBehaviourGoals();
}
-@@ -118,7 +174,19 @@ public class Zombie extends Monster {
+@@ -117,7 +173,19 @@ public class Zombie extends Monster {
this.goalSelector.addGoal(7, new WaterAvoidingRandomStrollGoal(this, 1.0));
this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(ZombifiedPiglin.class));
this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, Player.class, true));
@@ -11571,7 +11616,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolem.class, true));
this.targetSelector.addGoal(5, new NearestAttackableTargetGoal<>(this, Turtle.class, 10, true, false, Turtle.BABY_ON_LAND_SELECTOR));
}
-@@ -234,29 +302,7 @@ public class Zombie extends Monster {
+@@ -233,29 +301,7 @@ public class Zombie extends Monster {
@Override
public void aiStep() {
@@ -11602,7 +11647,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
super.aiStep();
}
-@@ -315,6 +361,7 @@ public class Zombie extends Monster {
+@@ -314,6 +360,7 @@ public class Zombie extends Monster {
// CraftBukkit end
}
@@ -11610,25 +11655,25 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
public boolean isSunSensitive() {
return this.shouldBurnInDay; // Paper - Add more Zombie API
}
-@@ -452,7 +499,7 @@ public class Zombie extends Monster {
- compound.putBoolean("CanBreakDoors", this.canBreakDoors());
- compound.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
- compound.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
-- compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API
-+ //compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+@@ -451,7 +498,7 @@ public class Zombie extends Monster {
+ output.putBoolean("CanBreakDoors", this.canBreakDoors());
+ output.putInt("InWaterTime", this.isInWater() ? this.inWaterTime : -1);
+ output.putInt("DrownedConversionTime", this.isUnderWaterConverting() ? this.conversionTime : -1);
+- output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API
++ //output.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
}
@Override
-@@ -467,7 +514,7 @@ public class Zombie extends Monster {
+@@ -466,7 +513,7 @@ public class Zombie extends Monster {
} else {
this.getEntityData().set(DATA_DROWNED_CONVERSION_ID, false);
}
-- this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API
-+ //this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
+- this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API
++ //this.shouldBurnInDay = input.getBooleanOr("Paper.ShouldBurnInDay", true); // Paper - Add more Zombie API // Purpur - implemented in LivingEntity - API for any mob to burn daylight
}
@Override
-@@ -519,19 +566,18 @@ public class Zombie extends Monster {
+@@ -518,19 +565,18 @@ public class Zombie extends Monster {
}
if (spawnGroupData instanceof Zombie.ZombieGroupData zombieGroupData) {
@@ -11654,7 +11699,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
Chicken chicken1 = EntityType.CHICKEN.create(this.level(), EntitySpawnReason.JOCKEY);
if (chicken1 != null) {
chicken1.snapTo(this.getX(), this.getY(), this.getZ(), this.getYRot(), 0.0F);
-@@ -540,6 +586,7 @@ public class Zombie extends Monster {
+@@ -539,6 +585,7 @@ public class Zombie extends Monster {
this.startRiding(chicken1);
level.addFreshEntity(chicken1, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.MOUNT); // CraftBukkit
}
@@ -11662,7 +11707,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
}
}
}
-@@ -552,10 +599,7 @@ public class Zombie extends Monster {
+@@ -551,10 +598,7 @@ public class Zombie extends Monster {
}
if (this.getItemBySlot(EquipmentSlot.HEAD).isEmpty()) {
@@ -11674,7 +11719,7 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
this.setItemSlot(EquipmentSlot.HEAD, new ItemStack(random.nextFloat() < 0.1F ? Blocks.JACK_O_LANTERN : Blocks.CARVED_PUMPKIN));
this.setDropChance(EquipmentSlot.HEAD, 0.0F);
}
-@@ -605,7 +649,7 @@ public class Zombie extends Monster {
+@@ -604,7 +648,7 @@ public class Zombie extends Monster {
}
protected void randomizeReinforcementsChance() {
@@ -11684,11 +11729,11 @@ index 39b65970a48568c95ff482b9636e7391f300ffa8..783f8b9a05939b9f42fc77065f6347e3
@Override
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
-index a8cd7103e636b57be1270d0f3549c709330b5536..ae5939c940bdd93977fa882360fc31e46479554f 100644
+index bc80d5b302f24974ce89db502b41d659457dd98c..e218e5d5f146ec996a6f5ce7e76b1d6506ac1cb9 100644
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
-@@ -77,6 +77,66 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
- .ifPresent(profession -> this.setVillagerData(this.getVillagerData().withProfession(profession)));
+@@ -76,6 +76,66 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
+ super(entityType, level);
}
+ // Purpur start - Ridables
@@ -11754,7 +11799,7 @@ index a8cd7103e636b57be1270d0f3549c709330b5536..ae5939c940bdd93977fa882360fc31e4
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -130,10 +190,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
+@@ -129,10 +189,10 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
public InteractionResult mobInteract(Player player, InteractionHand hand) {
ItemStack itemInHand = player.getItemInHand(hand);
if (itemInHand.is(Items.GOLDEN_APPLE)) {
@@ -11768,10 +11813,10 @@ index a8cd7103e636b57be1270d0f3549c709330b5536..ae5939c940bdd93977fa882360fc31e4
return InteractionResult.SUCCESS_SERVER;
diff --git a/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
-index 05de183ce7b0be9b41f005b2ca36807a109fc634..39489c8a347031fb4f73faca46039786e35762ac 100644
+index 822712eaff2f6c579d982734ab14a00c02182770..f58c48d9de85fda3d13079f3e56b31af75b3c725 100644
--- a/net/minecraft/world/entity/monster/ZombifiedPiglin.java
+++ b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
-@@ -63,6 +63,62 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -64,6 +64,62 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
this.setPathfindingMalus(PathType.LAVA, 8.0F);
}
@@ -11834,7 +11879,7 @@ index 05de183ce7b0be9b41f005b2ca36807a109fc634..39489c8a347031fb4f73faca46039786
@Override
public void setPersistentAngerTarget(@Nullable UUID target) {
this.persistentAngerTarget = target;
-@@ -112,6 +168,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -113,6 +169,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
this.maybeAlertOthers();
}
@@ -11847,7 +11892,7 @@ index 05de183ce7b0be9b41f005b2ca36807a109fc634..39489c8a347031fb4f73faca46039786
super.customServerAiStep(level);
}
-@@ -159,6 +221,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -160,6 +222,12 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
this.ticksUntilNextAlert = ALERT_INTERVAL.sample(this.random);
}
@@ -11860,7 +11905,7 @@ index 05de183ce7b0be9b41f005b2ca36807a109fc634..39489c8a347031fb4f73faca46039786
return super.setTarget(livingEntity, reason); // CraftBukkit
}
-@@ -236,7 +304,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -237,7 +305,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
@Override
protected void randomizeReinforcementsChance() {
@@ -11870,10 +11915,10 @@ index 05de183ce7b0be9b41f005b2ca36807a109fc634..39489c8a347031fb4f73faca46039786
@Nullable
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
-index 2183f5aaf6cf7a4df8c659f0766af40289761987..c9404d72de59e18dc809b8dec107f1f23d50f441 100644
+index f66bd6cc4aab828e847b990b193be54cd0d0dc01..775c11f658b81379784f7e5bdfdc8105b3410480 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
-@@ -100,6 +100,37 @@ public class Creaking extends Monster {
+@@ -101,6 +101,37 @@ public class Creaking extends Monster {
return this.getHomePos() != null;
}
@@ -11911,7 +11956,7 @@ index 2183f5aaf6cf7a4df8c659f0766af40289761987..c9404d72de59e18dc809b8dec107f1f2
@Override
protected BodyRotationControl createBodyControl() {
return new Creaking.CreakingBodyRotationControl(this);
-@@ -566,28 +597,28 @@ public class Creaking extends Monster {
+@@ -567,28 +598,28 @@ public class Creaking extends Monster {
}
}
@@ -11947,10 +11992,10 @@ index 2183f5aaf6cf7a4df8c659f0766af40289761987..c9404d72de59e18dc809b8dec107f1f2
}
}
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-index 6691dc90c35d05a7c28c4e3ac887ed9d3bb88de9..584955d151e95727406bc68d6a6f15a33c0f920c 100644
+index 084f82a7baaa309aa80cc33b4c01e54cf6da4b42..3c126b1610718a407c16775a935b295ecbaab533 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-@@ -93,6 +93,52 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -94,6 +94,52 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
this.xpReward = 5;
}
@@ -12003,7 +12048,7 @@ index 6691dc90c35d05a7c28c4e3ac887ed9d3bb88de9..584955d151e95727406bc68d6a6f15a3
@VisibleForTesting
public void setTimeInOverworld(int timeInOverworld) {
this.timeInOverworld = timeInOverworld;
-@@ -160,6 +206,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -161,6 +207,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -12012,10 +12057,10 @@ index 6691dc90c35d05a7c28c4e3ac887ed9d3bb88de9..584955d151e95727406bc68d6a6f15a3
this.getBrain().tick(level, this);
HoglinAi.updateActivity(this);
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
-index 634c518c105c8dc50838a4a6690641d82fd637fb..0afdfdc07764a26316c171c2a6722caf786875f2 100644
+index 3e6cbf0166486995f7adcbd7b99a8b8c919956cd..fb58af763cf75c80703360a5c668168775b1458c 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
-@@ -134,6 +134,45 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -135,6 +135,45 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
this.xpReward = 5;
}
@@ -12059,9 +12104,9 @@ index 634c518c105c8dc50838a4a6690641d82fd637fb..0afdfdc07764a26316c171c2a6722caf
+ // Purpur end - Mobs always drop experience
+
@Override
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
-@@ -318,6 +357,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+@@ -319,6 +358,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -12069,7 +12114,7 @@ index 634c518c105c8dc50838a4a6690641d82fd637fb..0afdfdc07764a26316c171c2a6722caf
if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
this.getBrain().tick(level, this);
PiglinAi.updateActivity(this);
-@@ -420,7 +460,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -421,7 +461,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
@Override
public boolean wantsToPickUp(ServerLevel level, ItemStack stack) {
@@ -12167,10 +12212,10 @@ index 589a130f8855f464c1930a0aa8b54c0326a22e23..c4eb58d0b0c51e930f9cb72e1de01039
PiglinBruteAi.updateActivity(this);
PiglinBruteAi.maybePlayActivitySound(this);
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index 42ca4243d86ef4a14a9ce70da4b79f6c8eeb3a7d..497ea5d5aad1641d5876f23f05db82ab649c0785 100644
+index 6a9d3b749e251d3dac6fda13318bf5a0bf21f82b..147fb3eecf651dcee63d63255542ef2680140f66 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -124,8 +124,32 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -122,8 +122,32 @@ public class Warden extends Monster implements VibrationSystem {
this.setPathfindingMalus(PathType.LAVA, 8.0F);
this.setPathfindingMalus(PathType.DAMAGE_FIRE, 0.0F);
this.setPathfindingMalus(PathType.DANGER_FIRE, 0.0F);
@@ -12203,7 +12248,7 @@ index 42ca4243d86ef4a14a9ce70da4b79f6c8eeb3a7d..497ea5d5aad1641d5876f23f05db82ab
@Override
public Packet getAddEntityPacket(ServerEntity entity) {
return new ClientboundAddEntityPacket(this, entity, this.hasPose(Pose.EMERGING) ? 1 : 0);
-@@ -388,6 +412,7 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -386,6 +410,7 @@ public class Warden extends Monster implements VibrationSystem {
@Contract("null->false")
public boolean canTargetEntity(@Nullable Entity entity) {
@@ -12212,10 +12257,10 @@ index 42ca4243d86ef4a14a9ce70da4b79f6c8eeb3a7d..497ea5d5aad1641d5876f23f05db82ab
&& this.level() == entity.level()
&& EntitySelector.NO_CREATIVE_OR_SPECTATOR.test(entity)
diff --git a/net/minecraft/world/entity/npc/AbstractVillager.java b/net/minecraft/world/entity/npc/AbstractVillager.java
-index 1d3381f1481bb2b192bb78462c85c2a185d94ad5..e574c38e1c1c13fc2f96340138f784697cef8c48 100644
+index f8782cdcf3015cad2693663a3c222bd60822f45b..d1a77544df7bcaa5f1dbca3139324107d687ae0d 100644
--- a/net/minecraft/world/entity/npc/AbstractVillager.java
+++ b/net/minecraft/world/entity/npc/AbstractVillager.java
-@@ -35,6 +35,7 @@ import net.minecraft.world.level.portal.TeleportTransition;
+@@ -35,6 +35,7 @@ import net.minecraft.world.level.storage.ValueOutput;
import net.minecraft.world.phys.Vec3;
public abstract class AbstractVillager extends AgeableMob implements InventoryCarrier, Npc, Merchant {
@@ -12267,10 +12312,10 @@ index e282b6ab6d0d1c11ee40f5f436bd50fa90ddc88b..d6ae13c19481ce33bfa0b6c9db632830
this.spawnCat(pos, level, true);
}
diff --git a/net/minecraft/world/entity/npc/Villager.java b/net/minecraft/world/entity/npc/Villager.java
-index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae736db5f48c 100644
+index 6ecd99adc1c22681553714ff23e557b8f7854737..165d0f50e7818b6daf834507033feaa2fabcaf19 100644
--- a/net/minecraft/world/entity/npc/Villager.java
+++ b/net/minecraft/world/entity/npc/Villager.java
-@@ -178,6 +178,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -179,6 +179,8 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
);
public long nextGolemPanic = -1; // Pufferfish
@@ -12279,7 +12324,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
public Villager(EntityType extends Villager> entityType, Level level) {
this(entityType, level, VillagerType.PLAINS);
-@@ -196,6 +198,103 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -197,6 +199,103 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
this.setVillagerData(this.getVillagerData().withType(villagerType).withProfession(level.registryAccess(), VillagerProfession.NONE));
}
@@ -12383,7 +12428,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
@Override
public Brain getBrain() {
return (Brain)super.getBrain();
-@@ -229,7 +328,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -230,7 +329,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
villagerBrain.setSchedule(Schedule.VILLAGER_DEFAULT);
villagerBrain.addActivityWithConditions(
Activity.WORK,
@@ -12392,7 +12437,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
ImmutableSet.of(Pair.of(MemoryModuleType.JOB_SITE, MemoryStatus.VALUE_PRESENT))
);
}
-@@ -261,7 +360,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -262,7 +361,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
public static AttributeSupplier.Builder createAttributes() {
@@ -12401,7 +12446,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
}
public boolean assignProfessionWhenSpawned() {
-@@ -293,12 +392,20 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -294,12 +393,21 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
// Paper start - EAR 2
this.customServerAiStep(level, false);
}
@@ -12420,12 +12465,12 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
- if (!inactive && this.behaviorTick++ % this.activatedPriority == 0) {
+ if (!inactive && (getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) { // Purpur - Ridables
this.getBrain().tick(level, this); // Paper - EAR 2
-- }
-+ } else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers
+ }
++ else if (this.isLobotomized && shouldRestock()) restock(); // Purpur - Lobotomize stuck villagers
// Pufferfish end
if (this.assignProfessionWhenSpawned) {
this.assignProfessionWhenSpawned = false;
-@@ -354,7 +461,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -355,7 +463,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
return super.mobInteract(player, hand);
} else if (this.isBaby()) {
this.setUnhappy();
@@ -12434,7 +12479,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
} else {
if (!this.level().isClientSide) {
boolean isEmpty = this.getOffers().isEmpty();
-@@ -367,9 +474,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -368,9 +476,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
if (isEmpty) {
@@ -12448,7 +12493,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
this.startTrading(player);
}
-@@ -506,7 +616,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -507,7 +618,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
public void updateDemand() {
for (MerchantOffer merchantOffer : this.getOffers()) {
@@ -12457,7 +12502,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
}
}
-@@ -699,7 +809,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -700,7 +811,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@Override
public boolean canBreed() {
@@ -12466,7 +12511,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
}
private boolean hungry() {
-@@ -866,7 +976,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -867,7 +978,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
public boolean hasFarmSeeds() {
@@ -12475,7 +12520,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
}
@Override
-@@ -921,6 +1031,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -922,6 +1033,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
public void spawnGolemIfNeeded(ServerLevel serverLevel, long gameTime, int minVillagerAmount) {
@@ -12483,7 +12528,7 @@ index 202bcb28218b0d9a2a5e211fee173ecd5f625896..acb0789b3e791cbb81c23efb9bbeae73
if (this.wantsToSpawnGolem(gameTime)) {
AABB aabb = this.getBoundingBox().inflate(10.0, 10.0, 10.0);
List entitiesOfClass = serverLevel.getEntitiesOfClass(Villager.class, aabb);
-@@ -994,6 +1105,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
+@@ -995,6 +1107,12 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
@Override
public void startSleeping(BlockPos pos) {
@@ -12510,10 +12555,10 @@ index 0b7fdbc19f8a977be8168bca198c157fbe90044b..abfc2542a486d5a64bf88eac69f7d958
registry,
FARMER,
diff --git a/net/minecraft/world/entity/npc/WanderingTrader.java b/net/minecraft/world/entity/npc/WanderingTrader.java
-index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..776e4d001bc6e6d419eb4392dc85bf4594e57058 100644
+index c2573946dd1244eb5d1ef2be7823211064daa80d..dc6b30518270486cf3b2eaab4db13a507917f37d 100644
--- a/net/minecraft/world/entity/npc/WanderingTrader.java
+++ b/net/minecraft/world/entity/npc/WanderingTrader.java
-@@ -59,6 +59,58 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+@@ -60,6 +60,58 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
super(entityType, level);
}
@@ -12572,7 +12617,7 @@ index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..776e4d001bc6e6d419eb4392dc85bf45
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
-@@ -79,7 +131,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+@@ -80,7 +132,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
this,
new ItemStack(Items.MILK_BUCKET),
SoundEvents.WANDERING_TRADER_REAPPEARED,
@@ -12581,7 +12626,7 @@ index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..776e4d001bc6e6d419eb4392dc85bf45
)
);
this.goalSelector.addGoal(1, new TradeWithPlayerGoal(this));
-@@ -93,6 +145,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+@@ -94,6 +146,7 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
this.goalSelector.addGoal(1, new PanicGoal(this, 0.5));
this.goalSelector.addGoal(1, new LookAtTradingPlayerGoal(this));
this.goalSelector.addGoal(2, new WanderingTrader.WanderToPositionGoal(this, 2.0, 0.35));
@@ -12589,7 +12634,7 @@ index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..776e4d001bc6e6d419eb4392dc85bf45
this.goalSelector.addGoal(4, new MoveTowardsRestrictionGoal(this, 0.35));
this.goalSelector.addGoal(8, new WaterAvoidingRandomStrollGoal(this, 0.35));
this.goalSelector.addGoal(9, new InteractGoal(this, Player.class, 3.0F, 1.0F));
-@@ -120,11 +173,14 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
+@@ -121,11 +174,14 @@ public class WanderingTrader extends net.minecraft.world.entity.npc.AbstractVill
if (!this.level().isClientSide) {
if (this.getOffers().isEmpty()) {
@@ -12606,7 +12651,7 @@ index 70cc20483905d3877e2ffb51afb4902bd59f0cd0..776e4d001bc6e6d419eb4392dc85bf45
return InteractionResult.SUCCESS;
diff --git a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
-index 9d9ec2bf16027b479bbc4339ad4e9dcfc2077d40..d4527765262818099dfb695d6a84b56d33888e34 100644
+index fce3f0f81d3195045cdc9ad7320f1d92f033c36d..352f55882ea77e8d89942e6c58ef3b4b78eec887 100644
--- a/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -137,7 +137,17 @@ public class WanderingTraderSpawner implements CustomSpawner {
@@ -12629,10 +12674,10 @@ index 9d9ec2bf16027b479bbc4339ad4e9dcfc2077d40..d4527765262818099dfb695d6a84b56d
blockPos = blockPos1;
break;
diff --git a/net/minecraft/world/entity/player/Player.java b/net/minecraft/world/entity/player/Player.java
-index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847a36ce9ce 100644
+index 1610ef636a0d93c1e07bad9e82ac4d9982c4e854..78dc237d5de38cff9f013d36da9bbb16104dec96 100644
--- a/net/minecraft/world/entity/player/Player.java
+++ b/net/minecraft/world/entity/player/Player.java
-@@ -211,11 +211,22 @@ public abstract class Player extends LivingEntity {
+@@ -220,17 +220,40 @@ public abstract class Player extends LivingEntity {
private int currentImpulseContextResetGraceTime = 0;
public boolean affectsSpawning = true; // Paper - Affects Spawning API
public net.kyori.adventure.util.TriState flyingFallDamage = net.kyori.adventure.util.TriState.NOT_SET; // Paper - flying fall damage
@@ -12651,13 +12696,11 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
+ return false;
+ }
+ // Purpur end - AFK API
-+
@Override
public org.bukkit.craftbukkit.entity.CraftHumanEntity getBukkitEntity() {
return (org.bukkit.craftbukkit.entity.CraftHumanEntity) super.getBukkitEntity();
-@@ -224,6 +235,19 @@ public abstract class Player extends LivingEntity {
-
- public final int sendAllPlayerInfoBucketIndex; // Gale - Purpur - spread out sending all player info
+ }
+ // CraftBukkit end
+ // Purpur start - Ridables
+ public abstract void resetLastActionTime();
@@ -12672,10 +12715,10 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
+ }
+ // Purpur end - Ridables
+
- public Player(Level level, BlockPos pos, float yRot, GameProfile gameProfile) {
- super(EntityType.PLAYER, level);
- this.setUUID(gameProfile.getId());
-@@ -281,6 +305,12 @@ public abstract class Player extends LivingEntity {
+ public final int sendAllPlayerInfoBucketIndex; // Gale - Purpur - spread out sending all player info
+
+ public Player(Level level, GameProfile gameProfile) {
+@@ -291,6 +314,12 @@ public abstract class Player extends LivingEntity {
@Override
public void tick() {
@@ -12688,7 +12731,7 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
this.noPhysics = this.isSpectator();
if (this.isSpectator() || this.isPassenger()) {
this.setOnGround(false);
-@@ -363,6 +393,17 @@ public abstract class Player extends LivingEntity {
+@@ -373,6 +402,17 @@ public abstract class Player extends LivingEntity {
this.turtleHelmetTick();
}
@@ -12706,7 +12749,7 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
this.cooldowns.tick();
this.updatePlayerPose();
if (this.currentImpulseContextResetGraceTime > 0) {
-@@ -628,7 +669,7 @@ public abstract class Player extends LivingEntity {
+@@ -638,7 +678,7 @@ public abstract class Player extends LivingEntity {
List list = Lists.newArrayList();
for (Entity entity : entities) {
@@ -12715,7 +12758,7 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
list.add(entity);
} else if (!entity.isRemoved()) {
this.touch(entity);
-@@ -1222,7 +1263,7 @@ public abstract class Player extends LivingEntity {
+@@ -1234,7 +1274,7 @@ public abstract class Player extends LivingEntity {
flag2 = flag2 && !this.level().paperConfig().entities.behavior.disablePlayerCrits; // Paper - Toggleable player crits
if (flag2) {
damageSource = damageSource.critical(); // Paper - critical damage API
@@ -12724,7 +12767,7 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
}
float f2 = f + f1;
-@@ -1819,7 +1860,23 @@ public abstract class Player extends LivingEntity {
+@@ -1831,7 +1871,23 @@ public abstract class Player extends LivingEntity {
@Override
protected int getBaseExperienceReward(ServerLevel level) {
@@ -12749,7 +12792,7 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
}
@Override
-@@ -1858,6 +1915,13 @@ public abstract class Player extends LivingEntity {
+@@ -1870,6 +1926,13 @@ public abstract class Player extends LivingEntity {
return this.inventory.add(stack);
}
@@ -12764,10 +12807,10 @@ index 2aca22f978daa826bf7ac2b25f13bf30a1bd4284..4217131b5f7aa985d5af452554849847
if (this.isPassenger() || !this.onGround() || this.isInWater() || this.isInPowderSnow) {
return false;
diff --git a/net/minecraft/world/entity/projectile/AbstractArrow.java b/net/minecraft/world/entity/projectile/AbstractArrow.java
-index b8f04b98d2117cfb274a5888d34b9836d3390ae9..6bb0653d1d033745ff419d4a59b4d89014b9cbe4 100644
+index fe738894f82480c6a7c2ff8fde895daaa0ba8bc6..9874c20c2c1b0ebdbaa58f719ddefdac463accbe 100644
--- a/net/minecraft/world/entity/projectile/AbstractArrow.java
+++ b/net/minecraft/world/entity/projectile/AbstractArrow.java
-@@ -79,6 +79,7 @@ public abstract class AbstractArrow extends Projectile {
+@@ -76,6 +76,7 @@ public abstract class AbstractArrow extends Projectile {
public ItemStack pickupItemStack = this.getDefaultPickupItem();
@Nullable
public ItemStack firedFromWeapon = null;
@@ -12775,7 +12818,7 @@ index b8f04b98d2117cfb274a5888d34b9836d3390ae9..6bb0653d1d033745ff419d4a59b4d890
protected AbstractArrow(EntityType extends AbstractArrow> entityType, Level level) {
super(entityType, level);
-@@ -576,6 +577,12 @@ public abstract class AbstractArrow extends Projectile {
+@@ -573,6 +574,12 @@ public abstract class AbstractArrow extends Projectile {
return this.firedFromWeapon;
}
@@ -12789,10 +12832,10 @@ index b8f04b98d2117cfb274a5888d34b9836d3390ae9..6bb0653d1d033745ff419d4a59b4d890
return SoundEvents.ARROW_HIT;
}
diff --git a/net/minecraft/world/entity/projectile/LargeFireball.java b/net/minecraft/world/entity/projectile/LargeFireball.java
-index db1b5bce212a5147be82504469f1fa9660812ebc..9e994953a8a8757496892441c155fba5a511c19b 100644
+index dd0ec97ea4561d2dccf735580faf0d65d6ac4b0d..779879f8d678a5e45e2752e6e033cc350acac89b 100644
--- a/net/minecraft/world/entity/projectile/LargeFireball.java
+++ b/net/minecraft/world/entity/projectile/LargeFireball.java
-@@ -19,20 +19,20 @@ public class LargeFireball extends Fireball {
+@@ -20,20 +20,20 @@ public class LargeFireball extends Fireball {
public LargeFireball(EntityType extends LargeFireball> entityType, Level level) {
super(entityType, level);
@@ -12834,10 +12877,10 @@ index f736f72b8e76dd82236badcdd2756f0d4da89aa4..0dbfbadcabcf1b719addb034e676cb51
protected double getDefaultGravity() {
return 0.06;
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
-index 84c846d2ef4990befb2891631ac5ae16d881401b..9f1c07be83999b7bafdee9238e8bad8c646d42f1 100644
+index 36124bfd4189e35208875e971733889410242641..ef960ee83adbb5e3ebfa44cd2457b23718045f61 100644
--- a/net/minecraft/world/entity/projectile/Projectile.java
+++ b/net/minecraft/world/entity/projectile/Projectile.java
-@@ -515,7 +515,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
+@@ -485,7 +485,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
@Override
public boolean mayInteract(ServerLevel level, BlockPos pos) {
Entity owner = this.getOwner();
@@ -12906,10 +12949,10 @@ index 677b4b681f9c2c09a8ae3cfdec72102265547a7b..d8f9fb603fd2e3e5c1dfc05face7f42b
protected void onHit(HitResult result) {
super.onHit(result);
diff --git a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
-index bda858b1e1c6b28cd9d5a664758b3e445eaf4f22..6575e8ef16f6011f7a799ba31531a2ebefee0c4d 100644
+index 4b04ca7d50d7a85827bd89fff24434e603e99579..2258736e6f9f52efe5bd353b8949a7a0b9a4fdb8 100644
--- a/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
+++ b/net/minecraft/world/entity/projectile/ThrownEnderpearl.java
-@@ -129,9 +129,10 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
+@@ -126,9 +126,10 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
return;
}
// CraftBukkit end
@@ -12921,20 +12964,20 @@ index bda858b1e1c6b28cd9d5a664758b3e445eaf4f22..6575e8ef16f6011f7a799ba31531a2eb
endermite.snapTo(owner.getX(), owner.getY(), owner.getZ(), owner.getYRot(), owner.getXRot());
serverLevel.addFreshEntity(endermite, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.ENDER_PEARL);
}
-@@ -151,7 +152,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
+@@ -148,7 +149,7 @@ public class ThrownEnderpearl extends ThrowableItemProjectile {
if (serverPlayer1 != null) {
serverPlayer1.resetFallDistance();
serverPlayer1.resetCurrentImpulseContext();
-- serverPlayer1.hurtServer(serverPlayer.serverLevel(), this.damageSources().enderPearl().eventEntityDamager(this), 5.0F); // CraftBukkit // Paper - fix DamageSource API
-+ serverPlayer1.hurtServer(serverPlayer.serverLevel(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
+- serverPlayer1.hurtServer(serverPlayer.level(), this.damageSources().enderPearl().eventEntityDamager(this), 5.0F); // CraftBukkit // Paper - fix DamageSource API
++ serverPlayer1.hurtServer(serverPlayer.level(), this.damageSources().enderPearl().eventEntityDamager(this), this.level().purpurConfig.enderPearlDamage); // CraftBukkit // Paper - fix DamageSource API // Purpur - Configurable Ender Pearl damage
}
this.playSound(serverLevel, vec3);
diff --git a/net/minecraft/world/entity/projectile/ThrownTrident.java b/net/minecraft/world/entity/projectile/ThrownTrident.java
-index 00f805667ea48fd8699f3cea05781739e376cedd..e814daaa10c138b1497dffbdf9224d34cd9c9926 100644
+index bc04812ec840e255c0ae8651bf7a43e0f562aa9c..b6826fc742640e7f8311bd0269aa0d8a6a9b2db4 100644
--- a/net/minecraft/world/entity/projectile/ThrownTrident.java
+++ b/net/minecraft/world/entity/projectile/ThrownTrident.java
-@@ -65,7 +65,7 @@ public class ThrownTrident extends AbstractArrow {
+@@ -66,7 +66,7 @@ public class ThrownTrident extends AbstractArrow {
Entity owner = this.getOwner();
int i = this.entityData.get(ID_LOYALTY);
@@ -12944,10 +12987,10 @@ index 00f805667ea48fd8699f3cea05781739e376cedd..e814daaa10c138b1497dffbdf9224d34
if (this.level() instanceof ServerLevel serverLevel && this.pickup == AbstractArrow.Pickup.ALLOWED) {
this.spawnAtLocation(serverLevel, this.getPickupItem(), 0.1F);
diff --git a/net/minecraft/world/entity/projectile/WitherSkull.java b/net/minecraft/world/entity/projectile/WitherSkull.java
-index a2fdc87bedd1a63064cb8c7a7615978483268fdc..8e95577de28fc4834dcfc3d4fed747d9d14b1618 100644
+index 2419c1db39c9ffbc54352c7fa5e0ac1ef813c13a..3b68e1a73da3e70f459cdc31e8447bcee37a914d 100644
--- a/net/minecraft/world/entity/projectile/WitherSkull.java
+++ b/net/minecraft/world/entity/projectile/WitherSkull.java
-@@ -93,7 +93,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
+@@ -94,7 +94,7 @@ public class WitherSkull extends AbstractHurtingProjectile {
super.onHit(result);
if (!this.level().isClientSide) {
// CraftBukkit start
@@ -12956,7 +12999,7 @@ index a2fdc87bedd1a63064cb8c7a7615978483268fdc..8e95577de28fc4834dcfc3d4fed747d9
if (event.callEvent()) {
this.level().explode(this, this.getX(), this.getY(), this.getZ(), event.getRadius(), event.getFire(), Level.ExplosionInteraction.MOB);
}
-@@ -102,6 +102,21 @@ public class WitherSkull extends AbstractHurtingProjectile {
+@@ -103,6 +103,21 @@ public class WitherSkull extends AbstractHurtingProjectile {
}
}
@@ -12979,20 +13022,20 @@ index a2fdc87bedd1a63064cb8c7a7615978483268fdc..8e95577de28fc4834dcfc3d4fed747d9
protected void defineSynchedData(SynchedEntityData.Builder builder) {
builder.define(DATA_DANGEROUS, false);
diff --git a/net/minecraft/world/entity/raid/Raider.java b/net/minecraft/world/entity/raid/Raider.java
-index e81ae747fe95c22321fc69791a6509d601826fd6..76ebbab40f5bac6d5f588410d3c5e6716cbe0679 100644
+index a495789b2d21fa9a24d5dca4ecfa196ddce49466..2254493c889b8967011c09dc448ba375d82e2035 100644
--- a/net/minecraft/world/entity/raid/Raider.java
+++ b/net/minecraft/world/entity/raid/Raider.java
-@@ -400,7 +400,7 @@ public abstract class Raider extends PatrollingMonster {
+@@ -401,7 +401,7 @@ public abstract class Raider extends PatrollingMonster {
}
private boolean cannotPickUpBanner() {
-- if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items
-+ if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride) || !this.mob.canPickUpLoot()) return false; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected
+- if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING)) return true; // Paper - respect game and entity rules for picking up items
++ if (!getServerLevel(this.mob).getGameRules().getBoolean(net.minecraft.world.level.GameRules.RULE_MOBGRIEFING, this.mob.level().purpurConfig.pillagerMobGriefingOverride)) return true; // Paper - respect game and entity rules for picking up items // Purpur - Add mobGriefing override to everything affected
if (!this.mob.hasActiveRaid()) {
return true;
} else if (this.mob.getCurrentRaid().isOver()) {
diff --git a/net/minecraft/world/entity/raid/Raids.java b/net/minecraft/world/entity/raid/Raids.java
-index 693eef486f1a3b4ea7e5fd5ecf2d25d85f424d97..5837d976abf663bd46a64f46348613db9284254d 100644
+index b8de00c5f13257d0b79b44b19fbfb88a3ca20353..fc5c1acec3cc2afed40589be6f8e159c3426c08e 100644
--- a/net/minecraft/world/entity/raid/Raids.java
+++ b/net/minecraft/world/entity/raid/Raids.java
@@ -29,6 +29,7 @@ import net.minecraft.world.phys.Vec3;
@@ -13036,10 +13079,10 @@ index 693eef486f1a3b4ea7e5fd5ecf2d25d85f424d97..5837d976abf663bd46a64f46348613db
if (!raid.isStarted() && !this.raidMap.containsValue(raid)) {
this.raidMap.put(this.getUniqueId(), raid);
diff --git a/net/minecraft/world/entity/vehicle/AbstractBoat.java b/net/minecraft/world/entity/vehicle/AbstractBoat.java
-index 4541bb5233e986d9993d8593afef9b12c935d00a..4f61c17e0a4a82773834bc21e00cac6eb75f794e 100644
+index df360ff06d10fc7f996055dce5148825539e9261..d947801b616af5b5dcdcc8bb70b36f97d6a69fdd 100644
--- a/net/minecraft/world/entity/vehicle/AbstractBoat.java
+++ b/net/minecraft/world/entity/vehicle/AbstractBoat.java
-@@ -433,6 +433,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
+@@ -436,6 +436,7 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
float groundFriction = this.getGroundFriction();
if (groundFriction > 0.0F) {
this.landFriction = groundFriction;
@@ -13047,7 +13090,7 @@ index 4541bb5233e986d9993d8593afef9b12c935d00a..4f61c17e0a4a82773834bc21e00cac6e
return AbstractBoat.Status.ON_LAND;
} else {
return AbstractBoat.Status.IN_AIR;
-@@ -821,7 +822,13 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
+@@ -824,7 +825,13 @@ public abstract class AbstractBoat extends VehicleEntity implements Leashable {
@Override
public final ItemStack getPickResult() {
@@ -13063,10 +13106,10 @@ index 4541bb5233e986d9993d8593afef9b12c935d00a..4f61c17e0a4a82773834bc21e00cac6e
public static enum Status {
diff --git a/net/minecraft/world/entity/vehicle/AbstractMinecart.java b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
-index 47490f6152cb1394a448ebc803c973b22da24149..41aac3b9985fbf76f3a4c4c3d4a7366d4759cfc4 100644
+index 7e61d68b36ca2768f70dc1fc130a8d7b95347b6b..00eb9aef52ee54f9750c44832f2b3a9321a9f81a 100644
--- a/net/minecraft/world/entity/vehicle/AbstractMinecart.java
+++ b/net/minecraft/world/entity/vehicle/AbstractMinecart.java
-@@ -103,6 +103,10 @@ public abstract class AbstractMinecart extends VehicleEntity {
+@@ -102,6 +102,10 @@ public abstract class AbstractMinecart extends VehicleEntity {
private double flyingY = 0.95;
private double flyingZ = 0.95;
public @Nullable Double maxSpeed;
@@ -13077,7 +13120,7 @@ index 47490f6152cb1394a448ebc803c973b22da24149..41aac3b9985fbf76f3a4c4c3d4a7366d
public net.kyori.adventure.util.TriState frictionState = net.kyori.adventure.util.TriState.NOT_SET; // Paper - Friction API
// CraftBukkit end
-@@ -111,8 +115,13 @@ public abstract class AbstractMinecart extends VehicleEntity {
+@@ -110,8 +114,13 @@ public abstract class AbstractMinecart extends VehicleEntity {
this.blocksBuilding = true;
if (useExperimentalMovement(level)) {
this.behavior = new NewMinecartBehavior(this);
@@ -13091,7 +13134,7 @@ index 47490f6152cb1394a448ebc803c973b22da24149..41aac3b9985fbf76f3a4c4c3d4a7366d
}
}
-@@ -277,6 +286,14 @@ public abstract class AbstractMinecart extends VehicleEntity {
+@@ -276,6 +285,14 @@ public abstract class AbstractMinecart extends VehicleEntity {
@Override
public void tick() {
@@ -13106,7 +13149,7 @@ index 47490f6152cb1394a448ebc803c973b22da24149..41aac3b9985fbf76f3a4c4c3d4a7366d
// CraftBukkit start
double prevX = this.getX();
double prevY = this.getY();
-@@ -384,15 +401,61 @@ public abstract class AbstractMinecart extends VehicleEntity {
+@@ -390,15 +407,61 @@ public abstract class AbstractMinecart extends VehicleEntity {
this.behavior.moveAlongTrack(level);
}
@@ -13197,10 +13240,10 @@ index 0d09b0809e7b224538cf5cfac9e36ec5ba10b709..4d224dc127d245556892e761fa4927a7
Vec3 deltaMovement2 = this.getDeltaMovement();
double d15 = deltaMovement2.x;
diff --git a/net/minecraft/world/food/FoodData.java b/net/minecraft/world/food/FoodData.java
-index 89d783315dab8ca469a1fa724cd59a329d4c2b55..7fa061718989365725ff49abd2d19d1ba3f935f9 100644
+index a1b99dea0fa5860a01158897006e1065050c029b..d1080acfe91bd1ca28e21ffc68a928dc0f233be3 100644
--- a/net/minecraft/world/food/FoodData.java
+++ b/net/minecraft/world/food/FoodData.java
-@@ -38,6 +38,7 @@ public class FoodData {
+@@ -39,6 +39,7 @@ public class FoodData {
int oldFoodLevel = this.foodLevel;
org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(serverPlayer, foodProperties.nutrition() + oldFoodLevel, stack);
if (!event.isCancelled()) {
@@ -13208,7 +13251,7 @@ index 89d783315dab8ca469a1fa724cd59a329d4c2b55..7fa061718989365725ff49abd2d19d1b
this.add(event.getFoodLevel() - oldFoodLevel, foodProperties.saturation());
}
serverPlayer.getBukkitEntity().sendHealthUpdate();
-@@ -86,7 +87,7 @@ public class FoodData {
+@@ -87,7 +88,7 @@ public class FoodData {
this.tickTimer++;
if (this.tickTimer >= this.starvationRate) { // CraftBukkit - add regen rate manipulation
if (player.getHealth() > 10.0F || difficulty == Difficulty.HARD || player.getHealth() > 1.0F && difficulty == Difficulty.NORMAL) {
@@ -13237,7 +13280,7 @@ index 793e4528755fa5688efbad75418188e693ad0157..20f702c8266eb54a8835861188eb937f
}
diff --git a/net/minecraft/world/inventory/AbstractContainerMenu.java b/net/minecraft/world/inventory/AbstractContainerMenu.java
-index 813417a09b4acc7d57e80a53d970767e230d75b1..c4721eb0efe34f5e313bc890b4e960144eca4fe1 100644
+index f4548edae77eb86e54ba499acbb20613fd60d7bd..1f601781643945920c7522b9c6100d0a37ad535d 100644
--- a/net/minecraft/world/inventory/AbstractContainerMenu.java
+++ b/net/minecraft/world/inventory/AbstractContainerMenu.java
@@ -65,6 +65,7 @@ public abstract class AbstractContainerMenu {
@@ -13268,10 +13311,10 @@ index b42d55c1c0c405ce3ce073138343e74fa036fa65..b86e49b09a036532e7dbd56bc52b13ce
} else if (this.isFuel(item)) {
if (!this.moveItemStackTo(item, 1, 2, false)) {
diff --git a/net/minecraft/world/inventory/AnvilMenu.java b/net/minecraft/world/inventory/AnvilMenu.java
-index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae2392590f 100644
+index 2346e1fc0c94084c3bb95c00be8aac36ae5f26ae..c75ad34d2e8b51999abbbca960bdda4973e356dc 100644
--- a/net/minecraft/world/inventory/AnvilMenu.java
+++ b/net/minecraft/world/inventory/AnvilMenu.java
-@@ -20,6 +20,12 @@ import net.minecraft.world.level.block.AnvilBlock;
+@@ -21,6 +21,12 @@ import net.minecraft.world.level.block.AnvilBlock;
import net.minecraft.world.level.block.state.BlockState;
import org.slf4j.Logger;
@@ -13284,7 +13327,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
public class AnvilMenu extends ItemCombinerMenu {
public static final int INPUT_SLOT = 0;
public static final int ADDITIONAL_SLOT = 1;
-@@ -49,6 +55,10 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -50,6 +56,10 @@ public class AnvilMenu extends ItemCombinerMenu {
private org.bukkit.craftbukkit.inventory.view.CraftAnvilView bukkitEntity;
// CraftBukkit end
public boolean bypassEnchantmentLevelRestriction = false; // Paper - bypass anvil level restrictions
@@ -13295,7 +13338,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
public AnvilMenu(int containerId, Inventory playerInventory) {
this(containerId, playerInventory, ContainerLevelAccess.NULL);
-@@ -74,12 +84,17 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -75,12 +85,17 @@ public class AnvilMenu extends ItemCombinerMenu {
@Override
protected boolean mayPickup(Player player, boolean hasStack) {
@@ -13314,7 +13357,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
player.giveExperienceLevels(-this.cost.get());
}
-@@ -126,13 +141,19 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -133,13 +148,19 @@ public class AnvilMenu extends ItemCombinerMenu {
@Override
public void createResult() {
@@ -13335,7 +13378,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
ItemStack itemStack = item.copy();
ItemStack item1 = this.inputSlots.getItem(1);
ItemEnchantments.Mutable mutable = new ItemEnchantments.Mutable(EnchantmentHelper.getEnchantmentsForCrafting(itemStack));
-@@ -190,23 +211,34 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -197,23 +218,34 @@ public class AnvilMenu extends ItemCombinerMenu {
int intValue = entry.getIntValue();
intValue = level == intValue ? intValue + 1 : Math.max(intValue, level);
Enchantment enchantment = holder.value();
@@ -13374,7 +13417,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
intValue = enchantment.getMaxLevel();
}
-@@ -235,6 +267,54 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -242,6 +274,54 @@ public class AnvilMenu extends ItemCombinerMenu {
if (!this.itemName.equals(item.getHoverName().getString())) {
i1 = 1;
i += i1;
@@ -13429,7 +13472,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
itemStack.set(DataComponents.CUSTOM_NAME, Component.literal(this.itemName));
}
} else if (item.has(DataComponents.CUSTOM_NAME)) {
-@@ -259,6 +339,12 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -266,6 +346,12 @@ public class AnvilMenu extends ItemCombinerMenu {
this.onlyRenaming = true;
}
@@ -13442,7 +13485,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
if (this.cost.get() >= this.maximumRepairCost && !this.player.hasInfiniteMaterials()) { // CraftBukkit
itemStack = ItemStack.EMPTY;
}
-@@ -279,6 +365,13 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -286,6 +372,13 @@ public class AnvilMenu extends ItemCombinerMenu {
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), itemStack); // CraftBukkit
this.broadcastChanges();
@@ -13456,7 +13499,7 @@ index 65c400444314049d5529f1f76d65fbd6b1ea7af2..bcffac9f7781ea489e8e4d778181b9ae
} else {
org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareAnvilEvent(this.getBukkitView(), ItemStack.EMPTY); // CraftBukkit
this.cost.set(AnvilMenu.DEFAULT_DENIED_COST); // CraftBukkit - use a variable for set a cost for denied item
-@@ -287,7 +380,7 @@ public class AnvilMenu extends ItemCombinerMenu {
+@@ -294,7 +387,7 @@ public class AnvilMenu extends ItemCombinerMenu {
}
public static int calculateIncreasedRepairCost(int oldRepairCost) {
@@ -13567,7 +13610,7 @@ index cf9ab4c9fba11f5a0b293978853e205de81d6fc7..d0d6ae9c9c432f8bd5d9c91113fc5491
@Override
diff --git a/net/minecraft/world/inventory/GrindstoneMenu.java b/net/minecraft/world/inventory/GrindstoneMenu.java
-index 6eaa468c90a826f9fdecf2cf672c4893122d2504..5cb69b7ffc82905e5ba8c99c76ce14348f89e21c 100644
+index 18c15a7657e6fd994a8f17d0812c822d6adc8eab..e3892bc545d614a2e9e1bbc8589f1189b1b73038 100644
--- a/net/minecraft/world/inventory/GrindstoneMenu.java
+++ b/net/minecraft/world/inventory/GrindstoneMenu.java
@@ -91,11 +91,13 @@ public class GrindstoneMenu extends AbstractContainerMenu {
@@ -13579,9 +13622,9 @@ index 6eaa468c90a826f9fdecf2cf672c4893122d2504..5cb69b7ffc82905e5ba8c99c76ce1434
// Paper start - Fire BlockExpEvent on grindstone use
org.bukkit.event.block.BlockExpEvent event = new org.bukkit.event.block.BlockExpEvent(org.bukkit.craftbukkit.block.CraftBlock.at(level, blockPos), this.getExperienceAmount(level));
event.callEvent();
-- ExperienceOrb.award((ServerLevel) level, Vec3.atCenterOf(blockPos), event.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player);
+- ExperienceOrb.awardWithDirection((ServerLevel) level, Vec3.atCenterOf(blockPos), Vec3.ZERO, event.getExpToDrop(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player, null);
+ org.purpurmc.purpur.event.inventory.GrindstoneTakeResultEvent grindstoneTakeResultEvent = new org.purpurmc.purpur.event.inventory.GrindstoneTakeResultEvent(player.getBukkitEntity(), getBukkitView(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemstack), event.getExpToDrop()); grindstoneTakeResultEvent.callEvent(); // Purpur - Grindstone API
-+ ExperienceOrb.award((ServerLevel) level, Vec3.atCenterOf(blockPos), grindstoneTakeResultEvent.getExperienceAmount(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player); // Purpur - Grindstone API
++ ExperienceOrb.awardWithDirection((ServerLevel) level, Vec3.atCenterOf(blockPos), Vec3.ZERO, grindstoneTakeResultEvent.getExperienceAmount(), org.bukkit.entity.ExperienceOrb.SpawnReason.GRINDSTONE, player, null); // Purpur - Grindstone API
// Paper end - Fire BlockExpEvent on grindstone use
}
@@ -13721,7 +13764,7 @@ index 34d52c941395645e77de810855b14012c259cf02..c605bd700fd9f5a6596a2bf964849278
return itemStack;
diff --git a/net/minecraft/world/inventory/PlayerEnderChestContainer.java b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
-index bc2b95973192069fc64581b59583b19df876f55d..b68d57eee9605dba8ecd31f82185ec3ea81d60c1 100644
+index beb74bc8398de8b48f41af7daef14d624826310e..7ae8d115b6f4af45db9309b46ed4b4fdd8e25c08 100644
--- a/net/minecraft/world/inventory/PlayerEnderChestContainer.java
+++ b/net/minecraft/world/inventory/PlayerEnderChestContainer.java
@@ -25,11 +25,18 @@ public class PlayerEnderChestContainer extends SimpleContainer {
@@ -13833,7 +13876,7 @@ index bd919b9a83f9736f02783b1ba3863fd1b77c7e89..eb8d2d6f9c65185f5fe16a13ab0cdbba
return optional;
} else {
diff --git a/net/minecraft/world/item/BlockItem.java b/net/minecraft/world/item/BlockItem.java
-index cc363ba3bc719d8b93992141d779b4c1d1bbd2fb..571a0f27a86ab24a9f8750ce1ab802bfd64d9ccf 100644
+index b5b53168755525eccaa0a4361172006522cf4e05..2860d49c072d4b9e473390a84e45171b984b198e 100644
--- a/net/minecraft/world/item/BlockItem.java
+++ b/net/minecraft/world/item/BlockItem.java
@@ -145,7 +145,16 @@ public class BlockItem extends Item {
@@ -13952,7 +13995,7 @@ index 45fc973971d00c35e5b715bfa6ae5042822ed35f..2ab3da301f7edbb811c2e055f75434a7
} else if (!player.getProjectile(itemInHand).isEmpty()) {
this.startSoundPlayed = false;
diff --git a/net/minecraft/world/item/DyeColor.java b/net/minecraft/world/item/DyeColor.java
-index 0416f4ef5c50f6579a6ef495e699a5c8c95d3878..437db0888d50654702e1fa2286a4ea9cc08d6d67 100644
+index d9c03b5e3768146bc8bcae2f86387b62ae89450b..eceb19b432d1bf5f1931568e78ab1e257ae657d1 100644
--- a/net/minecraft/world/item/DyeColor.java
+++ b/net/minecraft/world/item/DyeColor.java
@@ -216,4 +216,10 @@ public enum DyeColor implements StringRepresentable {
@@ -14014,14 +14057,13 @@ index 3becd19d3264fa631497e967656cc7ca39252586..f824f155549857d5205ba67eb5916e0b
if (player instanceof net.minecraft.server.level.ServerPlayer serverPlayer) {
serverPlayer.deregisterEnderPearl(thrownEnderpearl.projectile());
diff --git a/net/minecraft/world/item/FireworkRocketItem.java b/net/minecraft/world/item/FireworkRocketItem.java
-index 18d63d2da49451a2d5e1da7bf0c00e05e2f192bc..1f081e098ce3bec61b7f374e9b737838783657bb 100644
+index 83cfe63b0245f79d0873477ab3aae75f690ecb68..f32370217735b5e9556a0df7652682d89f23c595 100644
--- a/net/minecraft/world/item/FireworkRocketItem.java
+++ b/net/minecraft/world/item/FireworkRocketItem.java
-@@ -62,6 +62,19 @@ public class FireworkRocketItem extends Item implements ProjectileItem {
- com.destroystokyo.paper.event.player.PlayerElytraBoostEvent event = new com.destroystokyo.paper.event.player.PlayerElytraBoostEvent((org.bukkit.entity.Player) player.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(itemInHand), (org.bukkit.entity.Firework) delayed.projectile().getBukkitEntity(), org.bukkit.craftbukkit.CraftEquipmentSlot.getHand(hand));
- if (event.callEvent() && delayed.attemptSpawn()) {
- player.awardStat(Stats.ITEM_USED.get(this)); // Moved up from below
-+
+@@ -72,6 +72,17 @@ public class FireworkRocketItem extends Item implements ProjectileItem {
+ if (player.dropAllLeashConnections(null)) {
+ level.playSound(null, player, SoundEvents.LEAD_BREAK, SoundSource.NEUTRAL, 1.0F, 1.0F);
+ }
+ // Purpur start - Implement elytra settings
+ if (level.purpurConfig.elytraDamagePerFireworkBoost > 0) {
+ java.util.List list = net.minecraft.world.entity.EquipmentSlot.VALUES.stream().filter((enumitemslot) -> net.minecraft.world.entity.LivingEntity.canGlideUsing(player.getItemBySlot(enumitemslot), enumitemslot)).toList();
@@ -14033,7 +14075,6 @@ index 18d63d2da49451a2d5e1da7bf0c00e05e2f192bc..1f081e098ce3bec61b7f374e9b737838
+ }
+ }
+ // Purpur end - Implement elytra settings
-+
if (event.shouldConsume() && !player.hasInfiniteMaterials()) {
itemInHand.shrink(1); // Moved up from below
} else {
@@ -14086,10 +14127,10 @@ index 3bf3d4030c4da65fa386a8b8083d259a6046d15e..77a8d5d334cd93d23149afa8e58f4114
consumer.accept(context);
if (player != null) {
diff --git a/net/minecraft/world/item/ItemStack.java b/net/minecraft/world/item/ItemStack.java
-index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e166fb362d 100644
+index 3acc2ae8533f19a6f9b2b6a1d96271f1047384a4..793c0a380b84d246db748be7e8807f1c0fa92d65 100644
--- a/net/minecraft/world/item/ItemStack.java
+++ b/net/minecraft/world/item/ItemStack.java
-@@ -458,6 +458,7 @@ public final class ItemStack implements DataComponentHolder {
+@@ -450,6 +450,7 @@ public final class ItemStack implements DataComponentHolder {
// revert back all captured blocks
for (org.bukkit.block.BlockState blockstate : blocks) {
((org.bukkit.craftbukkit.block.CraftBlockState) blockstate).revertPlace();
@@ -14097,7 +14138,7 @@ index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e1
}
SignItem.openSign = null; // SPIGOT-6758 - Reset on early return
-@@ -481,6 +482,7 @@ public final class ItemStack implements DataComponentHolder {
+@@ -473,6 +474,7 @@ public final class ItemStack implements DataComponentHolder {
if (!(block.getBlock() instanceof net.minecraft.world.level.block.BaseEntityBlock)) { // Containers get placed automatically
block.onPlace(serverLevel, newPos, oldBlock, true, context);
}
@@ -14105,7 +14146,7 @@ index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e1
serverLevel.notifyAndUpdatePhysics(newPos, null, oldBlock, block, serverLevel.getBlockState(newPos), updateFlags, net.minecraft.world.level.block.Block.UPDATE_LIMIT); // send null chunk as chunk.k() returns false by this point
}
-@@ -617,6 +619,26 @@ public final class ItemStack implements DataComponentHolder {
+@@ -593,6 +595,26 @@ public final class ItemStack implements DataComponentHolder {
return this.isDamageableItem() && this.getDamageValue() > 0;
}
@@ -14132,7 +14173,7 @@ index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e1
public int getDamageValue() {
return Mth.clamp(this.getOrDefault(DataComponents.DAMAGE, 0), 0, this.getMaxDamage());
}
-@@ -702,6 +724,14 @@ public final class ItemStack implements DataComponentHolder {
+@@ -678,6 +700,14 @@ public final class ItemStack implements DataComponentHolder {
org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerItemBreakEvent(serverPlayer, this); // Paper - Add EntityDamageItemEvent
}
// CraftBukkit end
@@ -14147,7 +14188,7 @@ index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e1
this.shrink(1);
onBreak.accept(item);
}
-@@ -1280,6 +1310,12 @@ public final class ItemStack implements DataComponentHolder {
+@@ -1210,6 +1240,12 @@ public final class ItemStack implements DataComponentHolder {
return !this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY).isEmpty();
}
@@ -14161,10 +14202,10 @@ index 3ec4e0aa0777009b4ee75f6ae94732bd7e125619..07f1b27116baf2a06e6cd4eeaa8639e1
return this.getOrDefault(DataComponents.ENCHANTMENTS, ItemEnchantments.EMPTY);
}
diff --git a/net/minecraft/world/item/Items.java b/net/minecraft/world/item/Items.java
-index ae228cd15342ac159dd61bf4d09c2d80b7f44fee..4afa2d9f5825ccc70492b9c3d82ac5616d6f7faa 100644
+index cb27584b484c5103feb85e139a3dbf95a23a1236..b309312491bf822582d8cc182d609f7b74399ae8 100644
--- a/net/minecraft/world/item/Items.java
+++ b/net/minecraft/world/item/Items.java
-@@ -382,7 +382,7 @@ public class Items {
+@@ -383,7 +383,7 @@ public class Items {
public static final Item PURPUR_BLOCK = registerBlock(Blocks.PURPUR_BLOCK);
public static final Item PURPUR_PILLAR = registerBlock(Blocks.PURPUR_PILLAR);
public static final Item PURPUR_STAIRS = registerBlock(Blocks.PURPUR_STAIRS);
@@ -14173,7 +14214,7 @@ index ae228cd15342ac159dd61bf4d09c2d80b7f44fee..4afa2d9f5825ccc70492b9c3d82ac561
public static final Item CREAKING_HEART = registerBlock(Blocks.CREAKING_HEART);
public static final Item CHEST = registerBlock(Blocks.CHEST, properties -> properties.component(DataComponents.CONTAINER, ItemContainerContents.EMPTY));
public static final Item CRAFTING_TABLE = registerBlock(Blocks.CRAFTING_TABLE);
-@@ -2034,7 +2034,7 @@ public class Items {
+@@ -2089,7 +2089,7 @@ public class Items {
"sweet_berries", createBlockItemWithCustomItemName(Blocks.SWEET_BERRY_BUSH), new Item.Properties().food(Foods.SWEET_BERRIES)
);
public static final Item GLOW_BERRIES = registerItem(
@@ -14398,10 +14439,10 @@ index 879c8fe1f20decc793cfa39e686b61d521bd76ba..9c383a1028988cdd3de8b29ba72a4d7b
}
diff --git a/net/minecraft/world/item/enchantment/EnchantmentHelper.java b/net/minecraft/world/item/enchantment/EnchantmentHelper.java
-index b86bc2e0aca5a7ef5b01be6a21c3a8bcd1ebcca0..7afb0ee8f92f4241ce3ebcd8e5fd9f50033e3a42 100644
+index 66234431b265e0596275ca468cd40f8da98c22e2..e0cc0b49ea47bb38f7f4fe5ef3c793b0009d03c9 100644
--- a/net/minecraft/world/item/enchantment/EnchantmentHelper.java
+++ b/net/minecraft/world/item/enchantment/EnchantmentHelper.java
-@@ -608,4 +608,58 @@ public class EnchantmentHelper {
+@@ -606,4 +606,58 @@ public class EnchantmentHelper {
interface EnchantmentVisitor {
void accept(Holder enchantment, int level);
}
@@ -14517,10 +14558,10 @@ index 9333c63f217e1207eced37c5be150e192f2fcc3e..156cee58134ada34d249aab948c02ada
public ItemStack assemble() {
diff --git a/net/minecraft/world/level/BaseSpawner.java b/net/minecraft/world/level/BaseSpawner.java
-index 650ebce14d618076cec2066d134d2ae51a87076a..0babc951d9fed6d32d3dba549cc5ced4dc6b0588 100644
+index 42f44222a8dd61f70d4583b0ca82a16400baaa5a..41ba9f234e840fadee3c8a52ba9655b97a8b7381 100644
--- a/net/minecraft/world/level/BaseSpawner.java
+++ b/net/minecraft/world/level/BaseSpawner.java
-@@ -54,6 +54,7 @@ public abstract class BaseSpawner {
+@@ -61,6 +61,7 @@ public abstract class BaseSpawner {
}
public boolean isNearPlayer(Level level, BlockPos pos) {
@@ -14529,7 +14570,7 @@ index 650ebce14d618076cec2066d134d2ae51a87076a..0babc951d9fed6d32d3dba549cc5ced4
}
diff --git a/net/minecraft/world/level/EntityGetter.java b/net/minecraft/world/level/EntityGetter.java
-index 892a7c1eb1b321ca6d5ca709142e7feae1220815..7719bc8ff1fbbc67cdf15e1fec28dc9233cea207 100644
+index 9175a7e4e6076626cb46144c5858c2f2474f1858..452b6df03152dbd2311774bf4872983d3df92665 100644
--- a/net/minecraft/world/level/EntityGetter.java
+++ b/net/minecraft/world/level/EntityGetter.java
@@ -185,7 +185,7 @@ public interface EntityGetter extends ca.spottedleaf.moonrise.patches.chunk_syst
@@ -14542,10 +14583,10 @@ index 892a7c1eb1b321ca6d5ca709142e7feae1220815..7719bc8ff1fbbc67cdf15e1fec28dc92
if (distance < 0.0 || d < distance * distance) {
return true;
diff --git a/net/minecraft/world/level/GameRules.java b/net/minecraft/world/level/GameRules.java
-index a3a2d51cf53ce4dba8caaaf73967ae714ed16a36..e0bc8e8d0a3414af452d6a889f37a828128c8d59 100644
+index 966ca1e0e828e4176e12cbcf8c4a6b16489708de..e4ac7ee4e39b609aa70d6d4b766962a4c942911e 100644
--- a/net/minecraft/world/level/GameRules.java
+++ b/net/minecraft/world/level/GameRules.java
-@@ -343,6 +343,13 @@ public class GameRules {
+@@ -354,6 +354,13 @@ public class GameRules {
this.getRule(key).setFrom(rule, level); // CraftBukkit - per-world
}
@@ -14560,18 +14601,17 @@ index a3a2d51cf53ce4dba8caaaf73967ae714ed16a36..e0bc8e8d0a3414af452d6a889f37a828
return this.getRule(key).get();
}
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index 439b8619e9f0ed3dc1974ba2ee6214b63447ea96..a94f6eb93a4271d8b50cbb55dce04affd1ac4a13 100644
+index 97d227249405c8648b8b5e9bcca5a3f202f7b903..dd8c7afecd62edc2ab3933034bf469aea729be53 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
-@@ -163,6 +163,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
- return this.galeConfig;
+@@ -164,12 +164,56 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
}
// Gale end - Gale configuration
-+ public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
++ public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
public static @Nullable BlockPos lastPhysicsProblem; // Spigot
private int tileTickPosition;
-@@ -170,6 +171,48 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+ public final Map explosionDensityCache = new java.util.HashMap<>(); // Paper - Optimize explosions
public java.util.ArrayDeque redstoneUpdateInfos; // Paper - Faster redstone torch rapid clock removal; Move from Map in BlockRedstoneTorch to here
public final ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom simpleRandom = new ca.spottedleaf.moonrise.common.util.SimpleThreadUnsafeRandom(net.minecraft.world.level.levelgen.RandomSupport.generateUniqueSeed()); // Gale - Pufferfish - move random tick random
@@ -14616,11 +14656,12 @@ index 439b8619e9f0ed3dc1974ba2ee6214b63447ea96..a94f6eb93a4271d8b50cbb55dce04aff
+ return java.util.Objects.hash(playerUUID, animalType);
+ }
+ }
++ // Purpur end - Add adjustable breeding cooldown to config
+
public CraftWorld getWorld() {
return this.world;
}
-@@ -846,6 +889,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -846,6 +890,8 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) levelData).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
this.galeConfig = galeWorldConfigCreator.apply(this.spigotConfig); // Gale - Gale configuration
@@ -14629,7 +14670,7 @@ index 439b8619e9f0ed3dc1974ba2ee6214b63447ea96..a94f6eb93a4271d8b50cbb55dce04aff
this.generator = generator;
this.world = new CraftWorld((ServerLevel) this, generator, biomeProvider, environment);
-@@ -2127,4 +2172,14 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -2124,4 +2170,14 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
return this.id;
}
}
@@ -14658,27 +14699,13 @@ index ec32d77447dd250857a2af1d8cc3e6e233aa3e6e..345d4b80bd4383e0fb66d744d87bc8ef
double d2 = nearestPlayer.distanceToSqr(d, y, d1);
if (level.isLoadedAndInBounds(mutableBlockPos) && isRightDistanceToPlayerAndSpawnPoint(level, chunk, mutableBlockPos, d2)) { // Paper - don't load chunks for mob spawn
diff --git a/net/minecraft/world/level/ServerExplosion.java b/net/minecraft/world/level/ServerExplosion.java
-index 63d0b83d648ab1a6e7c84a49f7e2e825076904ad..619d00f79276665777f3a58dec7a5f353bd7d660 100644
+index fa4695b7ee56724b4d47ce4da0a5aeb8b5467db4..1669c21534a453c9cf16b992df7a6bf276dea887 100644
--- a/net/minecraft/world/level/ServerExplosion.java
+++ b/net/minecraft/world/level/ServerExplosion.java
-@@ -314,7 +314,7 @@ public class ServerExplosion implements Explosion {
- ) {
- this.level = level;
- this.source = source;
-- this.radius = (float) Math.max(radius, 0.0); // CraftBukkit - clamp bad values
-+ this.radius = (float) (level == null || level.purpurConfig.explosionClampRadius ? Math.max(radius, 0.0) : radius); // CraftBukkit - clamp bad values // Purpur - Config to remove explosion radius clamp
- this.center = center;
- this.fire = fire;
- this.blockInteraction = blockInteraction;
-@@ -636,10 +636,27 @@ public class ServerExplosion implements Explosion {
-
- public void explode() {
- // CraftBukkit start
-- if (this.radius < 0.1F) {
-+ if ((this.level == null || this.level.purpurConfig.explosionClampRadius) && this.radius < 0.1F) { // Purpur - Config to remove explosion radius clamp
- return;
- }
- // CraftBukkit end
+@@ -646,6 +646,23 @@ public class ServerExplosion implements Explosion {
+ this.directMappedBlockCache = new ca.spottedleaf.moonrise.patches.collisions.ExplosionBlockCache[BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH * BLOCK_EXPLOSION_CACHE_WIDTH];
+ this.mutablePos = new BlockPos.MutableBlockPos();
+ // Paper end - collision optimisations
+ // Purpur start - add PreExplodeEvents
+ if (this.source != null) {
+ Location location = new Location(this.level.getWorld(), this.center.x, this.center.y, this.center.z);
@@ -14696,9 +14723,9 @@ index 63d0b83d648ab1a6e7c84a49f7e2e825076904ad..619d00f79276665777f3a58dec7a5f35
+ }
+ }
+ // Purpur end - Add PreExplodeEvents
- // Paper start - collision optimisations
- this.blockCache = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>();
- this.chunkPosCache = new long[CHUNK_CACHE_WIDTH * CHUNK_CACHE_WIDTH];
+ this.level.gameEvent(this.source, GameEvent.EXPLODE, this.center);
+ List list = this.calculateExplodedPositions();
+ this.hurtEntities();
diff --git a/net/minecraft/world/level/block/AnvilBlock.java b/net/minecraft/world/level/block/AnvilBlock.java
index e8bac6deb63e0f94fb5f8b38602b2e3333e5fa8d..b14736c25cfdd94c6e3f159e53865150b06edef6 100644
--- a/net/minecraft/world/level/block/AnvilBlock.java
@@ -14839,7 +14866,7 @@ index e1193bcb666b7d38c511df7c1ebddb5897cefa8f..29248afa290b3143375f0538b4dfc80a
level.scheduleTick(pos, this, _int);
}
diff --git a/net/minecraft/world/level/block/Block.java b/net/minecraft/world/level/block/Block.java
-index 064e08e28acf7497e950d4e7f6ad7bddd92418b4..a425131042b46843c1f41ee0e9454866f193c5d3 100644
+index cc5e4e82c2339d17edf76b9212774c9dfd8e514d..4a92d21c2b1a9473d001534cb88cdc37108dd716 100644
--- a/net/minecraft/world/level/block/Block.java
+++ b/net/minecraft/world/level/block/Block.java
@@ -99,6 +99,10 @@ public class Block extends BlockBehaviour implements ItemLike {
@@ -14929,10 +14956,10 @@ index 064e08e28acf7497e950d4e7f6ad7bddd92418b4..a425131042b46843c1f41ee0e9454866
public void updateEntityMovementAfterFallOn(BlockGetter level, Entity entity) {
diff --git a/net/minecraft/world/level/block/Blocks.java b/net/minecraft/world/level/block/Blocks.java
-index cea1e405c940cd51cf830f28bfc6ce72c0c36a12..4941bf9df0c8ed6316572920323f7c5f6791b002 100644
+index ff2743d808f3c309bf098b98a6fcba7d019f54c1..941c57083803d69503e83c3ccbbb2759ba3db605 100644
--- a/net/minecraft/world/level/block/Blocks.java
+++ b/net/minecraft/world/level/block/Blocks.java
-@@ -6583,6 +6583,7 @@ public class Blocks {
+@@ -6571,6 +6571,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
@@ -14940,7 +14967,7 @@ index cea1e405c940cd51cf830f28bfc6ce72c0c36a12..4941bf9df0c8ed6316572920323f7c5f
.instabreak()
.sound(SoundType.AZALEA)
.noOcclusion()
-@@ -6594,6 +6595,7 @@ public class Blocks {
+@@ -6582,6 +6583,7 @@ public class Blocks {
BlockBehaviour.Properties.of()
.mapColor(MapColor.PLANT)
.forceSolidOff()
@@ -14965,7 +14992,7 @@ index ab93da06d9e9858668aa796db497f282afa7020a..23a9c30baf8d33855703d45c2739fd50
}
diff --git a/net/minecraft/world/level/block/CactusBlock.java b/net/minecraft/world/level/block/CactusBlock.java
-index 8f6878cc8e72513446895bfc79886075bfcd5565..0f8cfa5423cd1813c655237aa544dad2dc56ba4d 100644
+index d4fbf130e23a959be8268085067b3bea1541be9a..2e79ce7e02aaa4abcef1507bba71e0305b6c696f 100644
--- a/net/minecraft/world/level/block/CactusBlock.java
+++ b/net/minecraft/world/level/block/CactusBlock.java
@@ -22,7 +22,7 @@ import net.minecraft.world.level.pathfinder.PathComputationType;
@@ -15332,10 +15359,10 @@ index 68914268ca9350a6c1d794e011e1f9a8aecd609c..8e53b45dbf740de6c6fe499ef424d11b
TheEndGatewayBlockEntity.triggerCooldown(level, pos, state, theEndGatewayBlockEntity);
}
diff --git a/net/minecraft/world/level/block/EndPortalBlock.java b/net/minecraft/world/level/block/EndPortalBlock.java
-index cf2b105c98a3b22b9bea59cbafcd598657dc92b5..65d3477ed32c3f0db58aab6ab87d8f1721cbe876 100644
+index f6c64277c3d6e16250e2bf963b6427404e27aa9b..997831c2b916899da8518c1415233812e6ec16b8 100644
--- a/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/net/minecraft/world/level/block/EndPortalBlock.java
-@@ -59,6 +59,13 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
+@@ -60,6 +60,13 @@ public class EndPortalBlock extends BaseEntityBlock implements Portal {
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (entity.canUsePortal(false)) {
@@ -15614,10 +15641,10 @@ index db83c3630064a6875b477021a1f78bdf59c4ddc3..bbf8447cf986015f8a2e55f39d7b4f0d
}
diff --git a/net/minecraft/world/level/block/NetherPortalBlock.java b/net/minecraft/world/level/block/NetherPortalBlock.java
-index 2f08780430fc643991ffb4aeba1f1ae8e78944d2..1c58af94050b75cd8f405a201448c822792e594a 100644
+index 6c5629a6f5f91496a55eb0bf281ceae1567915b1..44707c0bf2c11f7bf7e30f747357ca2a1c6057d6 100644
--- a/net/minecraft/world/level/block/NetherPortalBlock.java
+++ b/net/minecraft/world/level/block/NetherPortalBlock.java
-@@ -72,7 +72,7 @@ public class NetherPortalBlock extends Block implements Portal {
+@@ -67,7 +67,7 @@ public class NetherPortalBlock extends Block implements Portal {
protected void randomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random) {
if (level.spigotConfig.enableZombiePigmenPortalSpawns && level.dimensionType().natural() // Spigot
&& level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING)
@@ -15626,7 +15653,7 @@ index 2f08780430fc643991ffb4aeba1f1ae8e78944d2..1c58af94050b75cd8f405a201448c822
&& level.anyPlayerCloseEnoughForSpawning(pos)) {
while (level.getBlockState(pos).is(this)) {
pos = pos.below();
-@@ -118,6 +118,13 @@ public class NetherPortalBlock extends Block implements Portal {
+@@ -113,6 +113,13 @@ public class NetherPortalBlock extends Block implements Portal {
protected void entityInside(BlockState state, Level level, BlockPos pos, Entity entity, InsideBlockEffectApplier effectApplier) {
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(level, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
if (entity.canUsePortal(false)) {
@@ -15640,7 +15667,7 @@ index 2f08780430fc643991ffb4aeba1f1ae8e78944d2..1c58af94050b75cd8f405a201448c822
// CraftBukkit start - Entity in portal
org.bukkit.event.entity.EntityPortalEnterEvent event = new org.bukkit.event.entity.EntityPortalEnterEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, level), org.bukkit.PortalType.NETHER); // Paper - add portal type
level.getCraftServer().getPluginManager().callEvent(event);
-@@ -130,7 +137,7 @@ public class NetherPortalBlock extends Block implements Portal {
+@@ -125,7 +132,7 @@ public class NetherPortalBlock extends Block implements Portal {
@Override
public int getPortalTransitionTime(ServerLevel level, Entity entity) {
return entity instanceof Player player
@@ -15764,7 +15791,7 @@ index 248ac9bc820a96fc7653471308b18834fc735a77..ef70ba88e492904c426c7d35df442fa6
}
// CraftBukkit end
diff --git a/net/minecraft/world/level/block/PoweredRailBlock.java b/net/minecraft/world/level/block/PoweredRailBlock.java
-index 6c64fc260669266869f7495ff07e1270dcb4ac75..a2202d2b4352be07b2445064339c61ba6a2521c7 100644
+index 61acb6ec728d46bf2b0b08439ab418f355f50c79..ebc0df13fc204472742a611b25f1ffd34478b042 100644
--- a/net/minecraft/world/level/block/PoweredRailBlock.java
+++ b/net/minecraft/world/level/block/PoweredRailBlock.java
@@ -28,7 +28,7 @@ public class PoweredRailBlock extends BaseRailBlock {
@@ -15845,10 +15872,18 @@ index 9131098e3ae4e6ffdf1491eb62537e385f75b6b2..ddedc08a96e500a390421d39be36590f
&& (
blockState.is(BlockTags.SNOW_LAYER_CAN_SURVIVE_ON)
diff --git a/net/minecraft/world/level/block/SpawnerBlock.java b/net/minecraft/world/level/block/SpawnerBlock.java
-index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2076474168410f376beebc072af4959e5d08c101 100644
+index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..dc2846e26e778b2885fd9c558081c7677d48169a 100644
--- a/net/minecraft/world/level/block/SpawnerBlock.java
+++ b/net/minecraft/world/level/block/SpawnerBlock.java
-@@ -38,6 +38,59 @@ public class SpawnerBlock extends BaseEntityBlock {
+@@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour;
+ import net.minecraft.world.level.block.state.BlockState;
+
+ public class SpawnerBlock extends BaseEntityBlock {
++ private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger();
+ public static final MapCodec CODEC = simpleCodec(SpawnerBlock::new);
+
+ @Override
+@@ -38,6 +39,62 @@ public class SpawnerBlock extends BaseEntityBlock {
);
}
@@ -15861,7 +15896,10 @@ index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2076474168410f376beebc072af4959e
+ net.minecraft.world.level.SpawnData nextSpawnData = blockEntity instanceof SpawnerBlockEntity spawnerBlock ? spawnerBlock.getSpawner().nextSpawnData : null;
+ java.util.Optional> type = java.util.Optional.empty();
+ if (nextSpawnData != null) {
-+ type = net.minecraft.world.entity.EntityType.by(nextSpawnData.getEntityToSpawn());
++ try (net.minecraft.util.ProblemReporter.ScopedCollector scopedCollector = new net.minecraft.util.ProblemReporter.ScopedCollector(blockEntity.problemPath(), LOGGER)) {
++ net.minecraft.world.level.storage.ValueInput valueInput = net.minecraft.world.level.storage.TagValueInput.create(scopedCollector, player.level().registryAccess(), nextSpawnData.entityToSpawn());
++ type = net.minecraft.world.entity.EntityType.by(valueInput);
++ }
+ net.minecraft.nbt.CompoundTag spawnDataTag = new net.minecraft.nbt.CompoundTag();
+ spawnDataTag.storeNullable("SpawnData", net.minecraft.world.level.SpawnData.CODEC, nextSpawnData);
+ item.set(net.minecraft.core.component.DataComponents.CUSTOM_DATA, net.minecraft.world.item.component.CustomData.EMPTY.update(compoundTag -> compoundTag.put("Purpur.SpawnData", spawnDataTag)));
@@ -15908,7 +15946,7 @@ index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2076474168410f376beebc072af4959e
@Override
protected void spawnAfterBreak(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) {
super.spawnAfterBreak(state, level, pos, stack, dropExperience);
-@@ -46,6 +99,7 @@ public class SpawnerBlock extends BaseEntityBlock {
+@@ -46,6 +103,7 @@ public class SpawnerBlock extends BaseEntityBlock {
@Override
public int getExpDrop(BlockState state, ServerLevel level, BlockPos pos, ItemStack stack, boolean dropExperience) {
@@ -15917,7 +15955,7 @@ index e8d7b6adbcb84e8d89067b54318e0feb3c3276a6..2076474168410f376beebc072af4959e
int i = 15 + level.random.nextInt(15) + level.random.nextInt(15);
// this.popExperience(level, pos, i);
diff --git a/net/minecraft/world/level/block/SpongeBlock.java b/net/minecraft/world/level/block/SpongeBlock.java
-index ad5daac30b85fead93637c83fb9d96e02c6df216..8661443ed346cfb193138b5f37c3dd931a6d6644 100644
+index 6764a77998e23de08eaf3a82a0cc0006868e1c3e..f7b6c0029e8d35ebf0fad380b8bc3b1530e2f8f1 100644
--- a/net/minecraft/world/level/block/SpongeBlock.java
+++ b/net/minecraft/world/level/block/SpongeBlock.java
@@ -53,8 +53,8 @@ public class SpongeBlock extends Block {
@@ -15939,7 +15977,7 @@ index ad5daac30b85fead93637c83fb9d96e02c6df216..8661443ed346cfb193138b5f37c3dd93
+ if (!fluidState.is(FluidTags.WATER) && (!level.purpurConfig.spongeAbsorbsLava || !fluidState.is(FluidTags.LAVA)) && (!level.purpurConfig.spongeAbsorbsWaterFromMud || !blockState.is(Blocks.MUD))) { // Purpur - Option for sponges to work on lava and mud
return BlockPos.TraversalNodeStatus.SKIP;
} else if (blockState.getBlock() instanceof BucketPickup bucketPickup
- && !bucketPickup.pickupBlock(null, level, blockPos, blockState).isEmpty()) {
+ && !bucketPickup.pickupBlock(null, blockList, blockPos, blockState).isEmpty()) { // CraftBukkit
@@ -76,6 +76,10 @@ public class SpongeBlock extends Block {
} else {
if (blockState.getBlock() instanceof LiquidBlock) {
@@ -16142,7 +16180,7 @@ index 0b6debe0e55e404e6f34b3bc437fe7c7a30cec7c..a70f552fddc58efdce770c36abb548ef
if (!level.addFreshEntity(witherBoss, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BUILD_WITHER)) {
return;
diff --git a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
-index f6c3dac2a2a17760ab7015fe75c5a4dd04c11319..7185a084720a8b2d521227bb0e9bbf9758dec628 100644
+index ca2cab797fc16f0961ce994fcb45029589b3c370..beda1b89b8083c63b9e177495ef063a7e5574627 100644
--- a/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java
@@ -186,6 +186,21 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit
@@ -16177,7 +16215,7 @@ index f6c3dac2a2a17760ab7015fe75c5a4dd04c11319..7185a084720a8b2d521227bb0e9bbf97
private static boolean canBurn(
diff --git a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
-index 027502d0af5512c31878978c4d05c52fa3029cca..f5216355ef13593bc7333d50a003012e25b3d7ea 100644
+index d679ab599dfd0bdbdc3ab5530d7fcd1c38baf7fa..0e4f6455ec48c5a7fcd4613c1c5b79d599e4960a 100644
--- a/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BarrelBlockEntity.java
@@ -56,7 +56,17 @@ public class BarrelBlockEntity extends RandomizableContainerBlockEntity {
@@ -16236,10 +16274,10 @@ index 027502d0af5512c31878978c4d05c52fa3029cca..f5216355ef13593bc7333d50a003012e
@Override
diff --git a/net/minecraft/world/level/block/entity/BeaconBlockEntity.java b/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
-index b77cdbf3e8cf0e9d66c9e5288ebae38c79dae1fe..bc7b9d6faded66e95c38cfc5571b09c05af30deb 100644
+index 503c8625cd77a564e55fc1427137d43a5cc12d9e..c2e15c6e1c6bfc5a9d89afc9b8aa9551bad2cc8f 100644
--- a/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BeaconBlockEntity.java
-@@ -142,6 +142,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
+@@ -143,6 +143,16 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
public double getEffectRange() {
if (this.effectRange < 0) {
@@ -16256,7 +16294,7 @@ index b77cdbf3e8cf0e9d66c9e5288ebae38c79dae1fe..bc7b9d6faded66e95c38cfc5571b09c0
return this.levels * 10 + 10;
} else {
return effectRange;
-@@ -171,6 +181,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
+@@ -172,6 +182,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
int y = pos.getY();
int z = pos.getZ();
BlockPos blockPos;
@@ -16264,7 +16302,7 @@ index b77cdbf3e8cf0e9d66c9e5288ebae38c79dae1fe..bc7b9d6faded66e95c38cfc5571b09c0
if (blockEntity.lastCheckY < y) {
blockPos = pos;
blockEntity.checkingBeamSections = Lists.newArrayList();
-@@ -200,6 +211,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
+@@ -201,6 +212,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
}
}
} else {
@@ -16272,7 +16310,7 @@ index b77cdbf3e8cf0e9d66c9e5288ebae38c79dae1fe..bc7b9d6faded66e95c38cfc5571b09c0
if (section == null || blockState.getLightBlock() >= 15 && !blockState.is(Blocks.BEDROCK)) {
blockEntity.checkingBeamSections.clear();
blockEntity.lastCheckY = height;
-@@ -219,7 +231,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
+@@ -220,7 +232,7 @@ public class BeaconBlockEntity extends BlockEntity implements MenuProvider, Name
blockEntity.levels = updateBase(level, x, y, z);
}
@@ -16282,10 +16320,10 @@ index b77cdbf3e8cf0e9d66c9e5288ebae38c79dae1fe..bc7b9d6faded66e95c38cfc5571b09c0
playSound(level, pos, SoundEvents.BEACON_AMBIENT);
}
diff --git a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-index 331eb5416307378162e39e20192ba06a047b70ea..129e63c18e8c641ad2413111632c8a54b1385d1d 100644
+index 91f7ee163107d846e7f6a5783be6eff96e783886..b1b49fa83794f4237994e9b985816ddf6d20b7e9 100644
--- a/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BeehiveBlockEntity.java
-@@ -72,7 +72,7 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -75,7 +75,7 @@ public class BeehiveBlockEntity extends BlockEntity {
"leash",
"UUID"
);
@@ -16294,7 +16332,7 @@ index 331eb5416307378162e39e20192ba06a047b70ea..129e63c18e8c641ad2413111632c8a54
private static final int MIN_TICKS_BEFORE_REENTERING_HIVE = 400;
private static final int MIN_OCCUPATION_TICKS_NECTAR = 2400;
public static final int MIN_OCCUPATION_TICKS_NECTARLESS = 600;
-@@ -147,11 +147,33 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -150,11 +150,33 @@ public class BeehiveBlockEntity extends BlockEntity {
return list;
}
@@ -16328,7 +16366,7 @@ index 331eb5416307378162e39e20192ba06a047b70ea..129e63c18e8c641ad2413111632c8a54
// Paper start - Add EntityBlockStorage clearEntities
public void clearBees() {
this.stored.clear();
-@@ -389,8 +411,8 @@ public class BeehiveBlockEntity extends BlockEntity {
+@@ -392,8 +414,8 @@ public class BeehiveBlockEntity extends BlockEntity {
return this.stored.stream().map(BeehiveBlockEntity.BeeData::toOccupant).toList();
}
@@ -16340,35 +16378,34 @@ index 331eb5416307378162e39e20192ba06a047b70ea..129e63c18e8c641ad2413111632c8a54
private int ticksInHive;
diff --git a/net/minecraft/world/level/block/entity/BlockEntity.java b/net/minecraft/world/level/block/entity/BlockEntity.java
-index a1075c26d55cc01219acd94d0138f81aa9d34c48..d7a08a4ecac2bb4f5626fb53e27f8d50b6936f1c 100644
+index 5986825d6a381eeb445dd424dd127864aa703163..a5ade8268a74738170caf519e7e45e13862bc39d 100644
--- a/net/minecraft/world/level/block/entity/BlockEntity.java
+++ b/net/minecraft/world/level/block/entity/BlockEntity.java
@@ -105,6 +105,10 @@ public abstract class BlockEntity {
- this.persistentDataContainer.putAll((CompoundTag) persistentDataTag);
- }
+ input.read("PublicBukkitValues", CompoundTag.CODEC)
+ .ifPresent(this.persistentDataContainer::putAll);
// Paper end - read persistent data container
+
+
-+ this.persistentLore = tag.read("Purpur.persistentLore", net.minecraft.world.item.component.ItemLore.CODEC).orElse(null); // Purpur - Persistent BlockEntity Lore and DisplayName
++ this.persistentLore = input.read("Purpur.persistentLore", net.minecraft.world.item.component.ItemLore.CODEC).orElse(null); // Purpur - Persistent BlockEntity Lore and DisplayName
+
}
- public final void loadWithComponents(CompoundTag tag, HolderLookup.Provider registries) {
-@@ -118,6 +122,12 @@ public abstract class BlockEntity {
+ public final void loadWithComponents(ValueInput input) {
+@@ -117,6 +121,11 @@ public abstract class BlockEntity {
}
- protected void saveAdditional(CompoundTag tag, HolderLookup.Provider registries) {
+ protected void saveAdditional(ValueOutput output) {
+ // Purpur start - Persistent BlockEntity Lore and DisplayName
+ if (this.persistentLore != null) {
-+ net.minecraft.resources.RegistryOps registryOps = registries.createSerializationContext(NbtOps.INSTANCE);
-+ tag.store("Purpur.persistentLore", net.minecraft.world.item.component.ItemLore.CODEC, registryOps, this.persistentLore);
++ output.store("Purpur.persistentLore", net.minecraft.world.item.component.ItemLore.CODEC, this.persistentLore);
+ }
+ // Purpur end - Persistent BlockEntity Lore and DisplayName
}
public final CompoundTag saveWithFullMetadata(HolderLookup.Provider registries) {
-@@ -379,4 +389,17 @@ public abstract class BlockEntity {
- private ComponentHelper() {
+@@ -402,4 +411,17 @@ public abstract class BlockEntity {
+ return this.blockEntity.getNameForReporting() + "@" + this.blockEntity.getBlockPos();
}
}
+
@@ -16386,7 +16423,7 @@ index a1075c26d55cc01219acd94d0138f81aa9d34c48..d7a08a4ecac2bb4f5626fb53e27f8d50
+ // Purpur end - Persistent BlockEntity Lore and DisplayName
}
diff --git a/net/minecraft/world/level/block/entity/ConduitBlockEntity.java b/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
-index 2f07a23a6151a4dfb28ddc0ab38ec2abefcdd27c..aeb10f21cd9dab3b134d1d8478083453dc37e3f2 100644
+index 0e87d20639c382be2221d73c7498480d21ebeafb..3ea9fe4c936f024c15a6bba6e7c5d960a3def1f9 100644
--- a/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/ConduitBlockEntity.java
@@ -151,7 +151,7 @@ public class ConduitBlockEntity extends BlockEntity {
@@ -16415,57 +16452,50 @@ index 2f07a23a6151a4dfb28ddc0ab38ec2abefcdd27c..aeb10f21cd9dab3b134d1d8478083453
// CraftBukkit start
return i;
}
-@@ -209,17 +209,17 @@ public class ConduitBlockEntity extends BlockEntity {
- blockEntity.destroyTargetUUID = null;
- } else if (blockEntity.destroyTarget == null) {
- List entitiesOfClass = level.getEntitiesOfClass(
-- LivingEntity.class, getDestroyRangeAABB(pos), collidedEntity -> collidedEntity instanceof Enemy && collidedEntity.isInWaterOrRain()
-+ LivingEntity.class, getDestroyRangeAABB(pos, level), collidedEntity -> collidedEntity instanceof Enemy && collidedEntity.isInWaterOrRain() // Purpur - Conduit behavior configuration
- );
- if (!entitiesOfClass.isEmpty()) {
- blockEntity.destroyTarget = entitiesOfClass.get(level.random.nextInt(entitiesOfClass.size()));
- }
-- } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), 8.0)) {
-+ } else if (!blockEntity.destroyTarget.isAlive() || !pos.closerThan(blockEntity.destroyTarget.blockPosition(), level.purpurConfig.conduitDamageDistance)) { // Purpur - Conduit behavior configuration
- blockEntity.destroyTarget = null;
- }
-
- if (damageTarget && blockEntity.destroyTarget != null) { // CraftBukkit
-- if (blockEntity.destroyTarget.hurtServer((net.minecraft.server.level.ServerLevel) level, level.damageSources().magic().eventBlockDamager(level, pos), 4.0F)) // CraftBukkit
-+ if (blockEntity.destroyTarget.hurtServer((net.minecraft.server.level.ServerLevel) level, level.damageSources().magic().eventBlockDamager(level, pos), level.purpurConfig.conduitDamageAmount)) // CraftBukkit // Purpur - Conduit behavior configuration
+@@ -202,7 +202,7 @@ public class ConduitBlockEntity extends BlockEntity {
+ EntityReference entityReference = updateDestroyTarget(blockEntity.destroyTarget, level, pos, canDestroy);
+ LivingEntity livingEntity = EntityReference.get(entityReference, level, LivingEntity.class);
+ if (damageTarget && livingEntity != null) { // CraftBukkit
+- if (livingEntity.hurtServer(level, level.damageSources().magic().eventBlockDamager(level, pos), 4.0F)) // CraftBukkit - move up
++ if (livingEntity.hurtServer(level, level.damageSources().magic().eventBlockDamager(level, pos), level.purpurConfig.conduitDamageAmount)) // CraftBukkit - move up // Purpur - Conduit behavior configuration
level.playSound(
- null,
- blockEntity.destroyTarget.getX(),
-@@ -249,16 +249,22 @@ public class ConduitBlockEntity extends BlockEntity {
+ null, livingEntity.getX(), livingEntity.getY(), livingEntity.getZ(), SoundEvents.CONDUIT_ATTACK_TARGET, SoundSource.BLOCKS, 1.0F, 1.0F
+ );
+@@ -224,20 +224,26 @@ public class ConduitBlockEntity extends BlockEntity {
+ return selectNewTarget(level, pos);
+ } else {
+ LivingEntity livingEntity = EntityReference.get(destroyTarget, level, LivingEntity.class);
+- return livingEntity != null && livingEntity.isAlive() && pos.closerThan(livingEntity.blockPosition(), 8.0) ? destroyTarget : null;
++ return livingEntity != null && livingEntity.isAlive() && pos.closerThan(livingEntity.blockPosition(), level.purpurConfig.conduitDamageDistance) ? destroyTarget : null; // Purpur - Conduit behavior configuration
+ }
+ }
+
+ @Nullable
+ private static EntityReference selectNewTarget(ServerLevel level, BlockPos pos) {
+ List entitiesOfClass = level.getEntitiesOfClass(
+- LivingEntity.class, getDestroyRangeAABB(pos), livingEntity -> livingEntity instanceof Enemy && livingEntity.isInWaterOrRain()
++ LivingEntity.class, getDestroyRangeAABB(pos, level), livingEntity -> livingEntity instanceof Enemy && livingEntity.isInWaterOrRain() // Purpur - Conduit behavior configuration
+ );
+ return entitiesOfClass.isEmpty() ? null : new EntityReference<>(Util.getRandom(entitiesOfClass, level.random));
}
public static AABB getDestroyRangeAABB(BlockPos pos) {
+- return new AABB(pos).inflate(8.0);
+ // Purpur start - Conduit behavior configuration
+ return getDestroyRangeAABB(pos, null);
+ }
+
+ private static AABB getDestroyRangeAABB(BlockPos pos, Level level) {
+ // Purpur end - Conduit behavior configuration
- int x = pos.getX();
- int y = pos.getY();
- int z = pos.getZ();
-- return new AABB(x, y, z, x + 1, y + 1, z + 1).inflate(8.0);
-+ return new AABB(x, y, z, x + 1, y + 1, z + 1).inflate(level == null ? 8.0 : level.purpurConfig.conduitDamageDistance); // Purpur - Conduit behavior configuration
++ return new AABB(pos).inflate(level == null ? 8.0 : level.purpurConfig.conduitDamageDistance); // Purpur - Conduit behavior configuration
}
- @Nullable
- private static LivingEntity findDestroyTarget(Level level, BlockPos pos, UUID targetId) {
- List entitiesOfClass = level.getEntitiesOfClass(
-- LivingEntity.class, getDestroyRangeAABB(pos), collidedEntity -> collidedEntity.getUUID().equals(targetId)
-+ LivingEntity.class, getDestroyRangeAABB(pos, level), collidedEntity -> collidedEntity.getUUID().equals(targetId) // Purpur - Conduit behavior configuration
- );
- return entitiesOfClass.size() == 1 ? entitiesOfClass.get(0) : null;
- }
+ private static void animationTick(Level level, BlockPos pos, List positions, @Nullable Entity entity, int tickCount) {
diff --git a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
-index 4b2462ece4eb5abb76ea9259b3e6a77f8a8e4e07..d35d04823e5d0de4487310caadd013f7dab1f419 100644
+index 5dd044c13e09423af43330df565bfe6ce88a883c..93f34bbfae6f8f02ff4ea92d6745cd1d288c8dbd 100644
--- a/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/EnchantingTableBlockEntity.java
-@@ -31,6 +31,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
+@@ -30,6 +30,7 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
private static final RandomSource RANDOM = RandomSource.create();
@Nullable
private Component name;
@@ -16473,24 +16503,24 @@ index 4b2462ece4eb5abb76ea9259b3e6a77f8a8e4e07..d35d04823e5d0de4487310caadd013f7
public EnchantingTableBlockEntity(BlockPos pos, BlockState state) {
super(BlockEntityType.ENCHANTING_TABLE, pos, state);
-@@ -42,12 +43,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
- if (this.hasCustomName()) {
- tag.store("CustomName", ComponentSerialization.CODEC, registries.createSerializationContext(NbtOps.INSTANCE), this.name);
- }
-+ tag.putInt("Purpur.Lapis", this.lapis); // Purpur - Enchantment Table Persists Lapis
+@@ -39,12 +40,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
+ protected void saveAdditional(ValueOutput output) {
+ super.saveAdditional(output);
+ output.storeNullable("CustomName", ComponentSerialization.CODEC, this.name);
++ output.putInt("Purpur.Lapis", this.lapis); // Purpur - Enchantment Table Persists Lapis
}
@Override
- protected void loadAdditional(CompoundTag tag, HolderLookup.Provider registries) {
- super.loadAdditional(tag, registries);
- this.name = parseCustomNameSafe(tag.get("CustomName"), registries);
-+ this.lapis = tag.getIntOr("Purpur.Lapis", 0); // Purpur - Enchantment Table Persists Lapis
+ protected void loadAdditional(ValueInput input) {
+ super.loadAdditional(input);
+ this.name = parseCustomNameSafe(input, "CustomName");
++ this.lapis = input.getIntOr("Purpur.Lapis", 0); // Purpur - Enchantment Table Persists Lapis
}
public static void bookAnimationTick(Level level, BlockPos pos, BlockState state, EnchantingTableBlockEntity enchantingTable) {
-@@ -139,4 +142,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
- public void removeComponentsFromTag(CompoundTag tag) {
- tag.remove("CustomName");
+@@ -136,4 +139,14 @@ public class EnchantingTableBlockEntity extends BlockEntity implements Nameable
+ public void removeComponentsFromTag(ValueOutput output) {
+ output.discard("CustomName");
}
+
+ // Purpur start - Enchantment Table Persists Lapis
@@ -16504,10 +16534,10 @@ index 4b2462ece4eb5abb76ea9259b3e6a77f8a8e4e07..d35d04823e5d0de4487310caadd013f7
+ // Purpur end - Enchantment Table Persists Lapis
}
diff --git a/net/minecraft/world/level/block/entity/SignBlockEntity.java b/net/minecraft/world/level/block/entity/SignBlockEntity.java
-index 8f87248a77c2083541105cfd1da1bc87bd122ba4..4c5de8783b2fc87a442e194e0069ce9cd5b5fd6c 100644
+index be1b138a78d8cb87956d531a801d85e677ca6f4a..2e0b2b55031343e32b4972c0f0017e950d56652d 100644
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
-@@ -151,16 +151,32 @@ public class SignBlockEntity extends BlockEntity {
+@@ -148,16 +148,32 @@ public class SignBlockEntity extends BlockEntity {
return this.setText(updater.apply(text), isFrontText);
}
@@ -16542,25 +16572,28 @@ index 8f87248a77c2083541105cfd1da1bc87bd122ba4..4c5de8783b2fc87a442e194e0069ce9c
);
}
}
-@@ -298,6 +314,24 @@ public class SignBlockEntity extends BlockEntity {
- return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, (ServerLevel)level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
+@@ -307,6 +323,27 @@ public class SignBlockEntity extends BlockEntity {
+ return new CommandSourceStack(commandSource, Vec3.atCenterOf(pos), Vec2.ZERO, level, 2, string, component, level.getServer(), player); // Paper - Fix commands from signs not firing command events
}
+ // Purpur start - Signs allow color codes
+ public ClientboundBlockEntityDataPacket getTranslatedUpdatePacket(boolean filtered, boolean front) {
-+ final CompoundTag nbt = new CompoundTag();
-+ this.saveAdditional(nbt, this.getLevel().registryAccess());
-+ final Component[] lines = front ? frontText.getMessages(filtered) : backText.getMessages(filtered);
-+ final String side = front ? "front_text" : "back_text";
-+ for (int i = 0; i < 4; i++) {
-+ final var component = io.papermc.paper.adventure.PaperAdventure.asAdventure(lines[i]);
-+ final String line = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(component);
-+ final CompoundTag sideNbt = nbt.getCompoundOrEmpty(side);
-+ final net.minecraft.nbt.ListTag messagesNbt = sideNbt.getListOrEmpty("messages");
-+ messagesNbt.set(i, net.minecraft.nbt.StringTag.valueOf(line));
++ try (net.minecraft.util.ProblemReporter.ScopedCollector scopedCollector = new net.minecraft.util.ProblemReporter.ScopedCollector(this.problemPath(), LOGGER)) {
++ net.minecraft.world.level.storage.TagValueOutput tagValueOutput = net.minecraft.world.level.storage.TagValueOutput.createWithContext(scopedCollector, this.getLevel().registryAccess());
++ this.saveAdditional(tagValueOutput);
++
++ final Component[] lines = front ? frontText.getMessages(filtered) : backText.getMessages(filtered);
++ final String side = front ? "front_text" : "back_text";
++ net.minecraft.world.level.storage.ValueOutput sideNbt = tagValueOutput.child(side);
++ net.minecraft.world.level.storage.ValueOutput.TypedOutputList messagesNbt = sideNbt.list("messages", com.mojang.serialization.Codec.STRING);
++ for (int i = 0; i < 4; i++) {
++ final net.kyori.adventure.text.Component component = io.papermc.paper.adventure.PaperAdventure.asAdventure(lines[i]);
++ final String line = net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer.legacyAmpersand().serialize(component);
++ messagesNbt.add(line);
++ }
++ tagValueOutput.putString("PurpurEditor", "true");
++ return ClientboundBlockEntityDataPacket.create(this, (blockEntity, registryAccess) -> tagValueOutput.buildResult());
+ }
-+ nbt.putString("PurpurEditor", "true");
-+ return ClientboundBlockEntityDataPacket.create(this, (blockEntity, registryAccess) -> nbt);
+ }
+ // Purpur end - Signs allow color codes
+
@@ -16599,17 +16632,17 @@ index ad143a92569f5b420ccaa2089758b2fb3b4ab7c5..5a3660e02bc805e9a35a81b8a61f07b3
}
diff --git a/net/minecraft/world/level/chunk/storage/EntityStorage.java b/net/minecraft/world/level/chunk/storage/EntityStorage.java
-index f9fb1380be9cbe960127c208c65c19f770e50b6d..17315201b8d3546058e2440b8fb8a5bb465f1259 100644
+index f1f8575a4b37114ced3cdb1d2ea33a36a2db44fd..2afe96a69c09decbe972332d2d38f67427d880d8 100644
--- a/net/minecraft/world/level/chunk/storage/EntityStorage.java
+++ b/net/minecraft/world/level/chunk/storage/EntityStorage.java
-@@ -100,6 +100,7 @@ public class EntityStorage implements EntityPersistentStorage {
- }
- // Paper end - Entity load/save limit per chunk
- CompoundTag compoundTag1 = new CompoundTag();
-+ if (!entity.canSaveToDisk()) return; // Purpur - Add canSaveToDisk to Entity
- if (entity.save(compoundTag1)) {
- listTag.add(compoundTag1);
- }
+@@ -108,6 +108,7 @@ public class EntityStorage implements EntityPersistentStorage {
+ }
+ // Paper end - Entity load/save limit per chunk
+ TagValueOutput tagValueOutput = TagValueOutput.createWithContext(scopedCollector.forChild(entity.problemPath()), entity.registryAccess());
++ if (!entity.canSaveToDisk()) return; // Purpur - Add canSaveToDisk to Entity
+ if (entity.save(tagValueOutput)) {
+ CompoundTag compoundTag1 = tagValueOutput.buildResult();
+ listTag.add(compoundTag1);
diff --git a/net/minecraft/world/level/levelgen/DensityFunctions.java b/net/minecraft/world/level/levelgen/DensityFunctions.java
index 04527a5c65ad630f794fed9071d485aedd02257a..77731406cb3dc417aa2fe1cb4352f3d2d7d498aa 100644
--- a/net/minecraft/world/level/levelgen/DensityFunctions.java
@@ -16747,7 +16780,7 @@ index 9e6b2bbc1f83d32d0332f036be4f1a0e18b826bf..db6baaa698fe93aba3fbd595158b568b
} else if (blockState.is(Blocks.HONEY_BLOCK)) {
return PathType.STICKY_HONEY;
diff --git a/net/minecraft/world/level/portal/PortalShape.java b/net/minecraft/world/level/portal/PortalShape.java
-index 21e3d5702fae0b1d94739744228c4cab608adb6b..07140dddebca268c25a243f6c6e082c3adf919e2 100644
+index b19260f442fe272efed8e61d1316bf0d6ff38023..0ecc5a49de322d531c33042858f8420d370f3805 100644
--- a/net/minecraft/world/level/portal/PortalShape.java
+++ b/net/minecraft/world/level/portal/PortalShape.java
@@ -28,7 +28,7 @@ public class PortalShape {
@@ -16760,7 +16793,7 @@ index 21e3d5702fae0b1d94739744228c4cab608adb6b..07140dddebca268c25a243f6c6e082c3
private static final double SAFE_TRAVEL_MAX_VERTICAL_DELTA = 1.0;
private final Direction.Axis axis;
diff --git a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
-index c8f23011a8942a5be970c606f67142cbd202b97e..7bbeed6c998c91e68376d3f17a510d68e3cd0b27 100644
+index 98971a07757d29d6926a0aa05f229b8020af42b6..bf01c9d54248ceb8f97cf1e1c0e4234a338cb8ce 100644
--- a/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -81,6 +81,7 @@ public class MapItemSavedData extends SavedData {
@@ -16788,10 +16821,10 @@ index c4f29da30d63deb3f9eabafcf62a946ff148b6b7..f3083702286dfb7932f08e0b811eded7
return stack;
}
diff --git a/net/minecraft/world/phys/AABB.java b/net/minecraft/world/phys/AABB.java
-index c22acc8889fbb3c9ee698624189c195ee4b5eefb..5767fbfd7f33c5276fb4335ce473b2e1baca411c 100644
+index 84f3073444ae9e11e5d11224d6af6474ced925e2..e53398996bbb278c6e06024d8ca945b364a44c10 100644
--- a/net/minecraft/world/phys/AABB.java
+++ b/net/minecraft/world/phys/AABB.java
-@@ -465,4 +465,10 @@ public class AABB {
+@@ -476,4 +476,10 @@ public class AABB {
return new AABB(this.minX, this.minY, this.minZ, this.maxX, this.maxY, this.maxZ);
}
}
@@ -16804,10 +16837,10 @@ index c22acc8889fbb3c9ee698624189c195ee4b5eefb..5767fbfd7f33c5276fb4335ce473b2e1
}
diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java
new file mode 100644
-index 0000000000000000000000000000000000000000..234f123959830cc2adb78b9dc8752906140e5b11
+index 0000000000000000000000000000000000000000..ed777b003140486fd5d8d1db7af770301e30bec9
--- /dev/null
+++ b/org/purpurmc/purpur/PurpurConfig.java
-@@ -0,0 +1,597 @@
+@@ -0,0 +1,592 @@
+package org.purpurmc.purpur;
+
+import com.google.common.base.Throwables;
@@ -17040,11 +17073,6 @@ index 0000000000000000000000000000000000000000..234f123959830cc2adb78b9dc8752906
+ deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
+ }
+
-+ public static String serverModName = io.papermc.paper.ServerBuildInfo.buildInfo().brandName();
-+ private static void serverModName() {
-+ serverModName = getString("settings.server-mod-name", serverModName);
-+ }
-+
+ public static double laggingThreshold = 19.0D;
+ private static void tickLoopSettings() {
+ laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
@@ -17399,7 +17427,7 @@ index 0000000000000000000000000000000000000000..234f123959830cc2adb78b9dc8752906
+ startupCommands.add(command);
+ });
+ }
-+
++
+ public static boolean generateEndVoidRings = false;
+ private static void generateEndVoidRings() {
+ generateEndVoidRings = getBoolean("settings.generate-end-void-rings", generateEndVoidRings);
@@ -17407,10 +17435,10 @@ index 0000000000000000000000000000000000000000..234f123959830cc2adb78b9dc8752906
+}
diff --git a/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java
new file mode 100644
-index 0000000000000000000000000000000000000000..31cc4e6e68a9743aaaeb296cb31e64526d3f1f73
+index 0000000000000000000000000000000000000000..a03e166b490952534e8050654c1afa975795f731
--- /dev/null
+++ b/org/purpurmc/purpur/PurpurWorldConfig.java
-@@ -0,0 +1,3596 @@
+@@ -0,0 +1,3614 @@
+package org.purpurmc.purpur;
+
+import java.util.ArrayList;
@@ -17670,11 +17698,6 @@ index 0000000000000000000000000000000000000000..31cc4e6e68a9743aaaeb296cb31e6452
+ infinityWorksWithoutArrows = getBoolean("gameplay-mechanics.infinity-bow.works-without-arrows", infinityWorksWithoutArrows);
+ }
+
-+ public boolean explosionClampRadius = true;
-+ private void explosionSettings() {
-+ explosionClampRadius = getBoolean("gameplay-mechanics.clamp-explosion-radius", explosionClampRadius);
-+ }
-+
+ public List- itemImmuneToCactus = new ArrayList<>();
+ public List
- itemImmuneToExplosion = new ArrayList<>();
+ public List
- itemImmuneToFire = new ArrayList<>();
@@ -19385,6 +19408,29 @@ index 0000000000000000000000000000000000000000..31cc4e6e68a9743aaaeb296cb31e6452
+ chanceHeadHalloweenOnEntity = (float) getDouble("gameplay-mechanics.halloween.head-chance", chanceHeadHalloweenOnEntity);
+ }
+
++ public boolean happyGhastRidableInWater = false;
++ public double happyGhastMaxHealth = 20.0D;
++ public double happyGhastTemptRange = 16.0D;
++ public double happyGhastFlyingSpeed = 0.05D;
++ public double happyGhastMovementSpeed = 0.05D;
++ public double happyGhastFollowRange = 16.0D;
++ public double happyGhastCameraDistance = 8.0D;
++ public double happyGhastScale = 1.0D;
++ public boolean happyGhastTakeDamageFromWater = false;
++ public boolean happyGhastAlwaysDropExp = false;
++ private void happyGhastSettings() {
++ happyGhastRidableInWater = getBoolean("mobs.happy_ghast.ridable-in-water", happyGhastRidableInWater);
++ happyGhastMaxHealth = getDouble("mobs.happy_ghast.attributes.max_health", happyGhastMaxHealth);
++ happyGhastTemptRange = getDouble("mobs.happy_ghast.attributes.tempt_range", happyGhastTemptRange);
++ happyGhastFlyingSpeed = getDouble("mobs.happy_ghast.attributes.flying_speed", happyGhastFlyingSpeed);
++ happyGhastMovementSpeed = getDouble("mobs.happy_ghast.attributes.movement_speed", happyGhastMovementSpeed);
++ happyGhastFollowRange = getDouble("mobs.happy_ghast.attributes.follow_range", happyGhastFollowRange);
++ happyGhastCameraDistance = getDouble("mobs.happy_ghast.attributes.camera_distance", happyGhastCameraDistance);
++ happyGhastScale = Mth.clamp(getDouble("mobs.happy_ghast.attributes.scale", happyGhastScale), 0.0625D, 1.0D);
++ happyGhastTakeDamageFromWater = getBoolean("mobs.happy_ghast.takes-damage-from-water", happyGhastTakeDamageFromWater);
++ happyGhastAlwaysDropExp = getBoolean("mobs.happy_ghast.always-drop-exp", happyGhastAlwaysDropExp);
++ }
++
+ public boolean hoglinRidable = false;
+ public boolean hoglinRidableInWater = true;
+ public boolean hoglinControllable = true;
@@ -21825,31 +21871,37 @@ index 0000000000000000000000000000000000000000..922e48799c43ca322a8f550c98a26e1e
+}
diff --git a/org/purpurmc/purpur/entity/PurpurStoredBee.java b/org/purpurmc/purpur/entity/PurpurStoredBee.java
new file mode 100644
-index 0000000000000000000000000000000000000000..800cc8b2204c0ef885ff65005f6850749aaf445b
+index 0000000000000000000000000000000000000000..683a98b424f170b4f819422550f3f7865abd39cf
--- /dev/null
+++ b/org/purpurmc/purpur/entity/PurpurStoredBee.java
-@@ -0,0 +1,105 @@
+@@ -0,0 +1,116 @@
+package org.purpurmc.purpur.entity;
+
++import com.mojang.logging.LogUtils;
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.text.Component;
+import net.minecraft.core.RegistryAccess;
+import net.minecraft.nbt.CompoundTag;
++import net.minecraft.util.ProblemReporter;
+import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
+import net.minecraft.world.level.block.entity.BlockEntity;
++import net.minecraft.world.level.storage.TagValueInput;
++import net.minecraft.world.level.storage.ValueInput;
+import org.bukkit.block.EntityBlockStorage;
-+import org.bukkit.craftbukkit.CraftWorld;
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer;
+import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry;
++import org.bukkit.craftbukkit.util.CraftChatMessage;
+import org.bukkit.entity.Bee;
+import org.bukkit.entity.EntityType;
+import org.bukkit.persistence.PersistentDataContainer;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
-+
++import org.slf4j.Logger;
+import java.util.Locale;
+
+public class PurpurStoredBee implements StoredEntity
{
++ static final Logger LOGGER = LogUtils.getLogger();
++
+ private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry();
+
+ private final EntityBlockStorage blockStorage;
@@ -21858,16 +21910,21 @@ index 0000000000000000000000000000000000000000..800cc8b2204c0ef885ff65005f685074
+
+ private Component customName;
+
-+ public PurpurStoredBee(BeehiveBlockEntity.BeeData data, EntityBlockStorage blockStorage) {
++ public PurpurStoredBee(BeehiveBlockEntity.BeeData data, EntityBlockStorage blockStorage, final BeehiveBlockEntity blockEntity) {
+ this.handle = data;
+ this.blockStorage = blockStorage;
+
+ CompoundTag customData = handle.occupant.entityData().copyTag();
-+ net.minecraft.network.chat.Component customNameMinecraft = BlockEntity.parseCustomNameSafe(customData.get("CustomName"), RegistryAccess.EMPTY);
-+ this.customName = customNameMinecraft == null ? null : PaperAdventure.asAdventure(customNameMinecraft);
+
-+ if (customData.get("BukkitValues") instanceof CompoundTag compoundTag) {
-+ this.persistentDataContainer.putAll(compoundTag);
++ try (ProblemReporter.ScopedCollector scopedCollector = new ProblemReporter.ScopedCollector(blockEntity.problemPath(), LOGGER)) {
++ ValueInput valueInput = TagValueInput.create(scopedCollector, RegistryAccess.EMPTY, customData);
++
++ net.minecraft.network.chat.Component customNameMinecraft = BlockEntity.parseCustomNameSafe(valueInput, "CustomName");
++ this.customName = customNameMinecraft == null ? null : PaperAdventure.asAdventure(customNameMinecraft);
++
++ if (customData.get("BukkitValues") instanceof CompoundTag compoundTag) {
++ this.persistentDataContainer.putAll(compoundTag);
++ }
+ }
+ }
+
@@ -21930,7 +21987,7 @@ index 0000000000000000000000000000000000000000..800cc8b2204c0ef885ff65005f685074
+ if(customName == null) {
+ handle.occupant.entityData().copyTag().remove("CustomName");
+ } else {
-+ handle.occupant.entityData().copyTag().putString("CustomName", net.minecraft.network.chat.Component.Serializer.toJson(PaperAdventure.asVanilla(customName), RegistryAccess.EMPTY));
++ handle.occupant.entityData().copyTag().putString("CustomName", CraftChatMessage.toJSON(PaperAdventure.asVanilla(customName)));
+ }
+ }
+}
diff --git a/leaf-server/minecraft-patches/features/0099-Fix-Pufferfish-and-Purpur-patches.patch b/leaf-server/minecraft-patches/features/0099-Fix-Pufferfish-and-Purpur-patches.patch
index 2d2474e1..7d30f106 100644
--- a/leaf-server/minecraft-patches/features/0099-Fix-Pufferfish-and-Purpur-patches.patch
+++ b/leaf-server/minecraft-patches/features/0099-Fix-Pufferfish-and-Purpur-patches.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix Pufferfish and Purpur patches
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 271233087ad8a0ef8e90e1d518907e166f8235a2..ecf1e794c78962440da02aadfbe78d9782df2cf0 100644
+index db1f0031a6ae6ba1b9ea265043b87817e2c746f8..1aab4d41054f8e780e6c0ccdb96affee19068311 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -276,7 +276,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public static final long SERVER_INIT = System.nanoTime(); // Paper - Lag compensation
@@ -26,7 +26,7 @@ index 271233087ad8a0ef8e90e1d518907e166f8235a2..ecf1e794c78962440da02aadfbe78d97
public boolean lagging = false; // Purpur - Lagging threshold
protected boolean upnp = false; // Purpur - UPnP Port Forwarding
-@@ -1239,9 +1239,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop byteAllowed) {
@@ -78,10 +78,10 @@ index 35ca166964e8436154891708f69ac010491b64aa..586c00610fdba178f27391820d623c3a
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index d8c83a449a1f33031aa671f3bbe366a504172a1e..d4a7cabf25b3ba2b085c68a3a7ed73a072c5e7fa 100644
+index d8209037e988bc7a68f634a6650930bd1082c4d1..a2a4ad515a4ef0fa24948d0f47c5bd78ec7e6555 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -526,23 +526,36 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -543,23 +543,36 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// Purpur end - Add canSaveToDisk to Entity
@@ -128,10 +128,10 @@ index d8c83a449a1f33031aa671f3bbe366a504172a1e..d4a7cabf25b3ba2b085c68a3a7ed73a0
public Entity(EntityType> entityType, Level level) {
this.type = entityType;
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index cd8c764f9aa2321c6e157abe958d89868a9f7bd1..ed15b5f29658d799a36dcbd196a8fcb107be4bda 100644
+index d7d6e0543dc26694891e4a9049b8162caadbf5e6..d59caf13e9066f2171c360e07a26122a540380a0 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -1024,13 +1024,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1049,13 +1049,13 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
// Gale start - Petal - reduce skull ItemStack lookups for reduced visibility
EntityType> type = lookingEntity.getType();
// Purpur start - Mob head visibility percent
@@ -150,10 +150,10 @@ index cd8c764f9aa2321c6e157abe958d89868a9f7bd1..ed15b5f29658d799a36dcbd196a8fcb1
}
// Purpur end - Mob head visibility percent
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index 6a94f42c8e048985b94db64fa0405e12824a8a0f..fbcf26c0bfb9f496c99bd5a2ba988be06162cd52 100644
+index 6d8e7d23640707ba0d771174f65e58df75243f77..c5f4b878aa5d736d987982c94fbf557c0f267bbf 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -1505,10 +1505,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -1531,10 +1531,6 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
protected void playAttackSound() {
}
@@ -195,10 +195,10 @@ index 60ec389615cfcad388ed37b8d3ee04e87db36755..34fe1d3bd6603225f84ab18794bbb118
BlockPos blockPos = entity.blockPosition();
List list = Lists.newArrayList();
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index 441287e74243a413c97a98b7898bab7833ac6458..18107d9be4d9ba816852ee4595a5349867834bef 100644
+index 7127d8e5fff81be017f0aa04606cb8404ad7b2fd..a25976d6f0dec86b88017cd5f86f3b51c8d7444b 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -283,8 +283,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -268,8 +268,7 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -209,10 +209,10 @@ index 441287e74243a413c97a98b7898bab7833ac6458..18107d9be4d9ba816852ee4595a53498
AllayAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/axolotl/Axolotl.java b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-index de207d747026453fabe2e6e725d2aa8504fbc9a1..524a7c31708a03f7a9dae75731caa8a450a6488d 100644
+index 02db38fa315ecb9d5bdba74848012710106b662e..2cdf2fb60d4d3642f0870944be9bd5abafa9e817 100644
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
-@@ -372,8 +372,7 @@ public class Axolotl extends Animal implements Bucketable {
+@@ -374,8 +374,7 @@ public class Axolotl extends Animal implements Bucketable {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -223,10 +223,10 @@ index de207d747026453fabe2e6e725d2aa8504fbc9a1..524a7c31708a03f7a9dae75731caa8a4
AxolotlAi.updateActivity(this);
if (!this.isNoAi()) {
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 89fa6a785ff73b30effd58dde4fbcbf99fdad168..71bae5f5ed284fed30262872771f85de97383d6d 100644
+index c4db078db0b7bb2bd8f6757a8bd13d60a7a4fa14..a7e9179c287671a689cb5ce668b5a33896da87a4 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -259,8 +259,7 @@ public class Frog extends Animal {
+@@ -260,8 +260,7 @@ public class Frog extends Animal {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -237,10 +237,10 @@ index 89fa6a785ff73b30effd58dde4fbcbf99fdad168..71bae5f5ed284fed30262872771f85de
FrogAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index a445bbe84d919ffadd8f3f0006b12140cd8060fd..7a3bfa91ffc5c7c6b04eef7b1b1d3c04c5a6d856 100644
+index a3858465569c40fcfc7c8c4c4735335ac83cb078..5abdf4253f1d0a6f35d8e05f7a0a2b4100083f76 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
-@@ -134,8 +134,7 @@ public class Tadpole extends AbstractFish {
+@@ -136,8 +136,7 @@ public class Tadpole extends AbstractFish {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -251,10 +251,10 @@ index a445bbe84d919ffadd8f3f0006b12140cd8060fd..7a3bfa91ffc5c7c6b04eef7b1b1d3c04
TadpoleAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/goat/Goat.java b/net/minecraft/world/entity/animal/goat/Goat.java
-index 40ba2e6dc6b1efbd17dba582561c133f6b41df25..39d4da47dcd7bbb33ad907b428dc0f65eaa23a82 100644
+index 11b020704a673c69bd2d4ab6313ea32e8e97cc23..c608c71eb601c169f543823c5c342b8928b9cf50 100644
--- a/net/minecraft/world/entity/animal/goat/Goat.java
+++ b/net/minecraft/world/entity/animal/goat/Goat.java
-@@ -226,8 +226,7 @@ public class Goat extends Animal {
+@@ -227,8 +227,7 @@ public class Goat extends Animal {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -265,10 +265,10 @@ index 40ba2e6dc6b1efbd17dba582561c133f6b41df25..39d4da47dcd7bbb33ad907b428dc0f65
GoatAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/hoglin/Hoglin.java b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-index 584955d151e95727406bc68d6a6f15a33c0f920c..865a83fc73d79893e9bdedad37a6e3986d15fc2b 100644
+index 3c126b1610718a407c16775a935b295ecbaab533..8c9f240badf5a678ee4e1815e010a204f8704f4e 100644
--- a/net/minecraft/world/entity/monster/hoglin/Hoglin.java
+++ b/net/minecraft/world/entity/monster/hoglin/Hoglin.java
-@@ -206,8 +206,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
+@@ -207,8 +207,7 @@ public class Hoglin extends Animal implements Enemy, HoglinBase {
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -279,10 +279,10 @@ index 584955d151e95727406bc68d6a6f15a33c0f920c..865a83fc73d79893e9bdedad37a6e398
HoglinAi.updateActivity(this);
if (this.isConverting()) {
diff --git a/net/minecraft/world/entity/monster/piglin/Piglin.java b/net/minecraft/world/entity/monster/piglin/Piglin.java
-index 0afdfdc07764a26316c171c2a6722caf786875f2..732d44372cf226ca9d008ebc26d1838237ec96d6 100644
+index fb58af763cf75c80703360a5c668168775b1458c..e442784741f1d0b4892284b6811343f954b50182 100644
--- a/net/minecraft/world/entity/monster/piglin/Piglin.java
+++ b/net/minecraft/world/entity/monster/piglin/Piglin.java
-@@ -357,8 +357,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
+@@ -358,8 +358,7 @@ public class Piglin extends AbstractPiglin implements CrossbowAttackMob, Invento
private int behaviorTick; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -293,10 +293,10 @@ index 0afdfdc07764a26316c171c2a6722caf786875f2..732d44372cf226ca9d008ebc26d18382
PiglinAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/projectile/Projectile.java b/net/minecraft/world/entity/projectile/Projectile.java
-index 9f1c07be83999b7bafdee9238e8bad8c646d42f1..554e679a756dc1bf529053594231a958717f3573 100644
+index ef960ee83adbb5e3ebfa44cd2457b23718045f61..e53c18efb573dea39a3d45f3cdb827d73b901ab6 100644
--- a/net/minecraft/world/entity/projectile/Projectile.java
+++ b/net/minecraft/world/entity/projectile/Projectile.java
-@@ -85,7 +85,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
+@@ -82,7 +82,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
if (maxChunkLoadsPerProjectile >= 0 && this.chunksLoadedByProjectile >= maxChunkLoadsPerProjectile) {
if (maxProjectileChunkLoadsConfig.perProjectile.removeFromWorldAfterReachLimit) {
@@ -306,10 +306,10 @@ index 9f1c07be83999b7bafdee9238e8bad8c646d42f1..554e679a756dc1bf529053594231a958
this.setDeltaMovement(0, this.getDeltaMovement().y, 0);
}
diff --git a/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java
-index 31cc4e6e68a9743aaaeb296cb31e64526d3f1f73..cadfbb7310fce33eda24d69c39fda5689c7fb882 100644
+index a03e166b490952534e8050654c1afa975795f731..88a2ad8e3b30cb9f447eb4001d33c7799339b6a0 100644
--- a/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/org/purpurmc/purpur/PurpurWorldConfig.java
-@@ -2435,6 +2435,13 @@ public class PurpurWorldConfig {
+@@ -2453,6 +2453,13 @@ public class PurpurWorldConfig {
piglinMobGriefingOverride = getBooleanOrDefault("mobs.piglin.mob-griefing-override", piglinMobGriefingOverride);
piglinTakeDamageFromWater = getBoolean("mobs.piglin.takes-damage-from-water", piglinTakeDamageFromWater);
piglinPortalSpawnModifier = getInt("mobs.piglin.portal-spawn-modifier", piglinPortalSpawnModifier);
diff --git a/leaf-server/minecraft-patches/features/0100-Purpur-Configurable-server-mod-name.patch b/leaf-server/minecraft-patches/features/0100-Purpur-Configurable-server-mod-name.patch
index dafe82e0..c2f22db5 100644
--- a/leaf-server/minecraft-patches/features/0100-Purpur-Configurable-server-mod-name.patch
+++ b/leaf-server/minecraft-patches/features/0100-Purpur-Configurable-server-mod-name.patch
@@ -7,10 +7,10 @@ Original license: MIT
Original project: https://github.com/PurpurMC/Purpur
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index ecf1e794c78962440da02aadfbe78d9782df2cf0..cf958bb871137dc88a8c36be867f2192acba2687 100644
+index b567eed9e07e281c56ff707ad938661f37f4ee3f..54bb75a2a128e7747ab01cb0d40c81fb4340ffd1 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1838,7 +1838,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 1.18.x that updated by Mojang.
By removing this check, it gives ability for hackers to use some modules of hack clients.
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 586c00610fdba178f27391820d623c3a5254529f..44e96e867d8a4403a7c88f772d2aa60cbe9f516b 100644
+index 1aaa94a2800687faa4d86698a4e1ad72bdaf15f3..d1245f54d55e4a3c406feef3cc2d5e25bb6346ce 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2075,8 +2075,13 @@ public class ServerGamePacketListenerImpl
+@@ -2108,8 +2108,13 @@ public class ServerGamePacketListenerImpl
BlockPos blockPos = hitResult.getBlockPos();
if (this.player.canInteractWithBlock(blockPos, 1.0)) {
Vec3 vec3 = location.subtract(Vec3.atCenterOf(blockPos));
diff --git a/leaf-server/minecraft-patches/features/0105-Remove-change-non-editable-sign-warning.patch b/leaf-server/minecraft-patches/features/0105-Remove-change-non-editable-sign-warning.patch
index 4fbcb65f..c8c31ce3 100644
--- a/leaf-server/minecraft-patches/features/0105-Remove-change-non-editable-sign-warning.patch
+++ b/leaf-server/minecraft-patches/features/0105-Remove-change-non-editable-sign-warning.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove change non-editable sign warning
diff --git a/net/minecraft/world/level/block/entity/SignBlockEntity.java b/net/minecraft/world/level/block/entity/SignBlockEntity.java
-index 4c5de8783b2fc87a442e194e0069ce9cd5b5fd6c..f150c1e963dc5e7d968e1656f6f1884fe4762202 100644
+index 2e0b2b55031343e32b4972c0f0017e950d56652d..3b73a8af99e398642e9603593369420c4ca8eb77 100644
--- a/net/minecraft/world/level/block/entity/SignBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SignBlockEntity.java
-@@ -140,7 +140,7 @@ public class SignBlockEntity extends BlockEntity {
+@@ -137,7 +137,7 @@ public class SignBlockEntity extends BlockEntity {
this.setAllowedPlayerEditor(null);
this.level.sendBlockUpdated(this.getBlockPos(), this.getBlockState(), this.getBlockState(), 3);
} else {
diff --git a/leaf-server/minecraft-patches/features/0106-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch b/leaf-server/minecraft-patches/features/0106-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch
index b066fd11..6be9edf2 100644
--- a/leaf-server/minecraft-patches/features/0106-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch
+++ b/leaf-server/minecraft-patches/features/0106-KeYi-Add-an-option-for-spigot-item-merging-mechanism.patch
@@ -7,10 +7,10 @@ Original license: MIT
Original project: https://github.com/KeYiMC/KeYi
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
-index 883a053d025e74f73556a0affa2340e42365df59..8aab412c8e70b6f9d8e05a26cefac330dd7a2ea1 100644
+index 7dc97fccfd329253e0f6532d1cc2c06264674e15..605de72224f6baa112dbfd2c83fd7a1ceba6a540 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
-@@ -322,7 +322,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -320,7 +320,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
ItemStack item = this.getItem();
ItemStack item1 = itemEntity.getItem();
if (Objects.equals(this.target, itemEntity.target) && areMergable(item, item1)) {
diff --git a/leaf-server/minecraft-patches/features/0110-Slice-Smooth-Teleports.patch b/leaf-server/minecraft-patches/features/0110-Slice-Smooth-Teleports.patch
index 47b881eb..e9a42a6f 100644
--- a/leaf-server/minecraft-patches/features/0110-Slice-Smooth-Teleports.patch
+++ b/leaf-server/minecraft-patches/features/0110-Slice-Smooth-Teleports.patch
@@ -9,10 +9,10 @@ Original project: https://github.com/Cryptite/Slice
Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index 834829427f3388c6cd94b5ceadc18b234c579f26..5775a39220bb5f48e2ce01c51402ac8b194a8d9d 100644
+index 6d453bdf4f265c23e7e349d07d766553ef0a4fad..737cba1729e980f58afa5e5aa83908c64c3a1a45 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -423,6 +423,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -434,6 +434,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
private boolean tpsBar = false; // Purpur - Implement TPSBar
private boolean compassBar = false; // Purpur - Add compass command
private boolean ramBar = false; // Purpur - Implement rambar commands
@@ -21,12 +21,12 @@ index 834829427f3388c6cd94b5ceadc18b234c579f26..5775a39220bb5f48e2ce01c51402ac8b
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index bfcc40c09f80b5405cc414969693c195769bcb98..d7d68dbdd39ff6e61531d2edeafdd923f0573c89 100644
+index 7fdcdc311e5a3236df0c7d479d0e206e2fa15dd0..2f00e7899c36a2a34f810fc6083846eb3883131f 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -798,11 +798,11 @@ public abstract class PlayerList {
+@@ -794,11 +794,11 @@ public abstract class PlayerList {
byte b = (byte)(keepInventory ? 1 : 0);
- ServerLevel serverLevel = serverPlayer.serverLevel();
+ ServerLevel serverLevel = serverPlayer.level();
LevelData levelData = serverLevel.getLevelData();
- serverPlayer.connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(serverLevel), b));
+ if (!serverPlayer.smoothWorldTeleport || !isSameLogicalHeight((ServerLevel) fromWorld, level)) serverPlayer.connection.send(new ClientboundRespawnPacket(serverPlayer.createCommonSpawnInfo(serverLevel), b)); // Leaf - Slice
@@ -38,7 +38,7 @@ index bfcc40c09f80b5405cc414969693c195769bcb98..d7d68dbdd39ff6e61531d2edeafdd923
serverPlayer.connection.send(new ClientboundSetDefaultSpawnPositionPacket(level.getSharedSpawnPos(), level.getSharedSpawnAngle()));
serverPlayer.connection.send(new ClientboundChangeDifficultyPacket(levelData.getDifficulty(), levelData.isDifficultyLocked()));
serverPlayer.connection
-@@ -890,6 +890,8 @@ public abstract class PlayerList {
+@@ -886,6 +886,8 @@ public abstract class PlayerList {
return serverPlayer;
}
diff --git a/leaf-server/minecraft-patches/features/0112-Leaves-Protocol-Core.patch b/leaf-server/minecraft-patches/features/0112-Leaves-Protocol-Core.patch
index b31796ca..63fd221a 100644
--- a/leaf-server/minecraft-patches/features/0112-Leaves-Protocol-Core.patch
+++ b/leaf-server/minecraft-patches/features/0112-Leaves-Protocol-Core.patch
@@ -56,10 +56,10 @@ index 62b9d9486c15a1ec6527f786df4e9fc483390bcb..5384bbc6bb3dbe5481f9d8cb10282551
int i = buffer.readableBytes();
if (i >= 0 && i <= maxSize) {
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index cf958bb871137dc88a8c36be867f2192acba2687..2c50bde56da7174dcea828feedecb92c98347a45 100644
+index 54bb75a2a128e7747ab01cb0d40c81fb4340ffd1..0fed0f181c4d1f31d01bdaa5dc9417ccd68b3f03 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1736,6 +1736,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop entityType, Level level) {
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index 7a3bfa91ffc5c7c6b04eef7b1b1d3c04c5a6d856..07fd03f1a8e72a5b39e5f9fd13f401dbfdb45280 100644
+index 5abdf4253f1d0a6f35d8e05f7a0a2b4100083f76..5d3479a55a10444e3ad3d9ec16160f9d520a1dc6 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
-@@ -284,7 +284,7 @@ public class Tadpole extends AbstractFish {
+@@ -286,7 +286,7 @@ public class Tadpole extends AbstractFish {
}
}
@@ -35,10 +35,10 @@ index 7a3bfa91ffc5c7c6b04eef7b1b1d3c04c5a6d856..07fd03f1a8e72a5b39e5f9fd13f401db
}
diff --git a/net/minecraft/world/level/storage/loot/LootPool.java b/net/minecraft/world/level/storage/loot/LootPool.java
-index 29ad43245a310756c4227acd7532e905f7f8b8ee..ad422817593449b8e914628b51d760e732e2d50c 100644
+index 6901e629d941e22e64d83eed4e8cfee3165a96a1..fdc26c8d8c82c20534c57af2a0281b99998cc9f6 100644
--- a/net/minecraft/world/level/storage/loot/LootPool.java
+++ b/net/minecraft/world/level/storage/loot/LootPool.java
-@@ -36,7 +36,7 @@ public class LootPool {
+@@ -37,7 +37,7 @@ public class LootPool {
)
.apply(instance, LootPool::new)
);
@@ -48,10 +48,10 @@ index 29ad43245a310756c4227acd7532e905f7f8b8ee..ad422817593449b8e914628b51d760e7
private final Predicate compositeCondition;
private final List functions;
diff --git a/net/minecraft/world/level/storage/loot/LootTable.java b/net/minecraft/world/level/storage/loot/LootTable.java
-index 7a8eb1e8b07647e1124594f78652d34731e4fda6..6cfe7ef8c81f506bce9c971b597cc4e902bcabbe 100644
+index 8612cdf7161f8ddff60a6478cc901318b8f958ba..07a962d647baa99b0e1bf3898a07cc914e91397e 100644
--- a/net/minecraft/world/level/storage/loot/LootTable.java
+++ b/net/minecraft/world/level/storage/loot/LootTable.java
-@@ -49,7 +49,7 @@ public class LootTable {
+@@ -50,7 +50,7 @@ public class LootTable {
public static final LootTable EMPTY = new LootTable(LootContextParamSets.EMPTY, Optional.empty(), List.of(), List.of());
private final ContextKeySet paramSet;
private final Optional randomSequence;
@@ -61,23 +61,23 @@ index 7a8eb1e8b07647e1124594f78652d34731e4fda6..6cfe7ef8c81f506bce9c971b597cc4e9
private final BiFunction compositeFunction;
public org.bukkit.craftbukkit.CraftLootTable craftLootTable; // CraftBukkit
diff --git a/net/minecraft/world/level/storage/loot/entries/CompositeEntryBase.java b/net/minecraft/world/level/storage/loot/entries/CompositeEntryBase.java
-index 8e91ddc6c0e492d165ad8322b4a3d5c3bad5409c..6e420bfb3c223b094157bdfec7dad20d8eab4968 100644
+index eeaa49e9f70a18b5d39493aeff73f31b05ac2faa..8cd0403d7873c4c37caef75935b06b056c3d951d 100644
--- a/net/minecraft/world/level/storage/loot/entries/CompositeEntryBase.java
+++ b/net/minecraft/world/level/storage/loot/entries/CompositeEntryBase.java
-@@ -9,7 +9,7 @@ import net.minecraft.world.level.storage.loot.ValidationContext;
- import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
-
- public abstract class CompositeEntryBase extends LootPoolEntryContainer {
+@@ -16,7 +16,7 @@ public abstract class CompositeEntryBase extends LootPoolEntryContainer {
+ return "Empty children list";
+ }
+ };
- protected final List children;
+ public final List children; // Leaves - private -> public
private final ComposableEntryContainer composedChildren;
protected CompositeEntryBase(List children, List conditions) {
diff --git a/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java b/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java
-index e0e933245e038b7229eeddbda272b081161ab603..c5e3834fa970ac909cefea43420378394153d781 100644
+index 65e27bce9e59ef97bc8b914d646fba924d0f0877..a49bdcdf37b351436e0ba6d7865f10827c4e6ab4 100644
--- a/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java
+++ b/net/minecraft/world/level/storage/loot/entries/LootPoolEntryContainer.java
-@@ -13,7 +13,7 @@ import net.minecraft.world.level.storage.loot.predicates.ConditionUserBuilder;
+@@ -14,7 +14,7 @@ import net.minecraft.world.level.storage.loot.predicates.ConditionUserBuilder;
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition;
public abstract class LootPoolEntryContainer implements ComposableEntryContainer {
@@ -87,23 +87,23 @@ index e0e933245e038b7229eeddbda272b081161ab603..c5e3834fa970ac909cefea4342037839
protected LootPoolEntryContainer(List conditions) {
diff --git a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
-index f7b647e81ca99040bae8161a2bc0dcacf5bd537f..069df530b1db72bd4a2b1b80b2570dca545dfd20 100644
+index 141026601cd9a4561426b85fd1f8e7dc0544fbd7..a5d7ebb93c147bf0f806ac3c9b2dc4b878573944 100644
--- a/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
+++ b/net/minecraft/world/level/storage/loot/entries/NestedLootTable.java
-@@ -22,7 +22,7 @@ public class NestedLootTable extends LootPoolSingletonContainer {
- .and(singletonFields(instance))
- .apply(instance, NestedLootTable::new)
- );
+@@ -29,7 +29,7 @@ public class NestedLootTable extends LootPoolSingletonContainer {
+ return "->{inline}";
+ }
+ };
- private final Either, LootTable> contents;
+ public final Either, LootTable> contents; // Leaves - private -> public
private NestedLootTable(
Either, LootTable> contents, int weight, int quality, List conditions, List functions
diff --git a/net/minecraft/world/level/storage/loot/predicates/CompositeLootItemCondition.java b/net/minecraft/world/level/storage/loot/predicates/CompositeLootItemCondition.java
-index 7134c54984a12949cd6a2e8dc35c2e1c0431e524..52f36fbb9bfcad81004e531efab85e9b87d3284d 100644
+index bae72197acc929c7ed3e964f156115d728eb2176..8f3094f42f3366a1313d70c0b27fbe5632b2082a 100644
--- a/net/minecraft/world/level/storage/loot/predicates/CompositeLootItemCondition.java
+++ b/net/minecraft/world/level/storage/loot/predicates/CompositeLootItemCondition.java
-@@ -11,7 +11,7 @@ import net.minecraft.world.level.storage.loot.LootContext;
+@@ -12,7 +12,7 @@ import net.minecraft.world.level.storage.loot.LootContext;
import net.minecraft.world.level.storage.loot.ValidationContext;
public abstract class CompositeLootItemCondition implements LootItemCondition {
diff --git a/leaf-server/minecraft-patches/features/0114-Leaves-Xaero-Map-Protocol.patch b/leaf-server/minecraft-patches/features/0114-Leaves-Xaero-Map-Protocol.patch
index 93a6b810..9fa20f7d 100644
--- a/leaf-server/minecraft-patches/features/0114-Leaves-Xaero-Map-Protocol.patch
+++ b/leaf-server/minecraft-patches/features/0114-Leaves-Xaero-Map-Protocol.patch
@@ -9,10 +9,10 @@ Original project: https://github.com/LeavesMC/Leaves
This patch is Powered by Xaero Map
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 88ee35fffd6ae3183c23891ab22ec5c45e3c711f..5372599cf3d1310e28530945db13c0df4d4dbd15 100644
+index e547d6c9ee9ad3438cc839389db26a3417cc4ba4..4de0da41eaa71edd0ec7c6829dce424795a63dd8 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -1239,6 +1239,7 @@ public abstract class PlayerList {
+@@ -1235,6 +1235,7 @@ public abstract class PlayerList {
player.connection.send(new ClientboundInitializeBorderPacket(worldBorder));
player.connection.send(new ClientboundSetTimePacket(level.getGameTime(), level.getDayTime(), level.getGameRules().getBoolean(GameRules.RULE_DAYLIGHT)));
player.connection.send(new ClientboundSetDefaultSpawnPositionPacket(level.getSharedSpawnPos(), level.getSharedSpawnAngle()));
diff --git a/leaf-server/minecraft-patches/features/0115-Leaves-Syncmatica-Protocol.patch b/leaf-server/minecraft-patches/features/0115-Leaves-Syncmatica-Protocol.patch
index 168bfebb..111a1626 100644
--- a/leaf-server/minecraft-patches/features/0115-Leaves-Syncmatica-Protocol.patch
+++ b/leaf-server/minecraft-patches/features/0115-Leaves-Syncmatica-Protocol.patch
@@ -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/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 44e96e867d8a4403a7c88f772d2aa60cbe9f516b..0bf9ead58e256dccd3c1e89bd08ebae9d630b49e 100644
+index d1245f54d55e4a3c406feef3cc2d5e25bb6346ce..8e0e119b41ca1e49d7e3f7874c5fb3c2b434e737 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -319,8 +319,11 @@ public class ServerGamePacketListenerImpl
+@@ -322,8 +322,11 @@ public class ServerGamePacketListenerImpl
this.signedMessageDecoder = SignedMessageChain.Decoder.unsigned(player.getUUID(), server::enforceSecureProfile);
this.chatMessageChain = new FutureChain(server.chatExecutor); // CraftBukkit - async chat
this.tickEndEvent = new io.papermc.paper.event.packet.ClientTickEndEvent(player.getBukkitEntity()); // Paper - add client tick end event
diff --git a/leaf-server/minecraft-patches/features/0116-Leaves-Replay-Mod-API.patch b/leaf-server/minecraft-patches/features/0116-Leaves-Replay-Mod-API.patch
index d84ccea7..d3a6da08 100644
--- a/leaf-server/minecraft-patches/features/0116-Leaves-Replay-Mod-API.patch
+++ b/leaf-server/minecraft-patches/features/0116-Leaves-Replay-Mod-API.patch
@@ -11,10 +11,10 @@ Original project: https://github.com/LeavesMC/Leaves
This patch is Powered by ReplayMod(https://github.com/ReplayMod)
diff --git a/net/minecraft/commands/CommandSourceStack.java b/net/minecraft/commands/CommandSourceStack.java
-index 4d06587cd55af988eecdda5186577ab72ca3d533..6d1096d6cdf0ae23ab4cacabe4dbe531fea455a7 100644
+index 51caf352e77df49fc04bf84f1fab29b6f4f4fc14..3fb3afb4171e6ff57c73cd228c2b41b2cb543ea5 100644
--- a/net/minecraft/commands/CommandSourceStack.java
+++ b/net/minecraft/commands/CommandSourceStack.java
-@@ -625,7 +625,7 @@ public class CommandSourceStack implements ExecutionCommandSource getOnlinePlayerNames() {
@@ -92,10 +92,10 @@ index b305ba9bab617bf4e52d0e6ddf160bacc5751a94..bbaf1a29f86a9bfc13795249d545b6f7
if (players.size() >= resultLimit) {
return players;
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 2c50bde56da7174dcea828feedecb92c98347a45..ee07832a92b3f73bd85d13388276cf224743c0ed 100644
+index 3a1822e0f37c86dfad56ae06c14fffb960ff99ec..32c934a489df7a06892265c6d762e88c3716a5c6 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -1639,7 +1639,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop {
- PlayerList playerList = context.getSource().getServer().getPlayerList();
+ (commandContext, suggestionsBuilder) -> {
+ PlayerList playerList = commandContext.getSource().getServer().getPlayerList();
return SharedSuggestionProvider.suggest(
- playerList.getPlayers()
+ playerList.realPlayers // Leaves - only real player
.stream()
- .filter(player -> !playerList.isOp(player.getGameProfile()))
- .map(player -> player.getGameProfile().getName()),
+ .filter(serverPlayer -> !playerList.isOp(serverPlayer.getGameProfile()))
+ .map(serverPlayer -> serverPlayer.getGameProfile().getName()),
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index e6730996dfd4c2422b6c13f10309fc58af4ac595..9b193bf81cf7f9f45dfa207a826043e083c2f8ba 100644
+index 95c128f028c3cce7d0b37821a6e75208323fb4e9..2cf0fa70ae3d7675cac3cf7a0002097b4e773fe1 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -212,6 +212,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -215,6 +215,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
public boolean hasEntityMoveEvent; // Paper - Add EntityMoveEvent
private final alternate.current.wire.WireHandler wireHandler = new alternate.current.wire.WireHandler(this); // Paper - optimize redstone (Alternate Current)
public boolean hasRidableMoveEvent = false; // Purpur - Ridables
@@ -145,7 +145,7 @@ index e6730996dfd4c2422b6c13f10309fc58af4ac595..9b193bf81cf7f9f45dfa207a826043e0
@Override
public @Nullable LevelChunk getChunkIfLoaded(int x, int z) {
-@@ -690,6 +691,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -694,6 +695,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// Paper end - rewrite chunk system
this.getCraftServer().addWorld(this.getWorld()); // CraftBukkit
this.preciseTime = this.serverLevelData.getDayTime(); // Purpur - Configurable daylight cycle
@@ -153,7 +153,7 @@ index e6730996dfd4c2422b6c13f10309fc58af4ac595..9b193bf81cf7f9f45dfa207a826043e0
}
// Paper start
-@@ -2690,6 +2692,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -2735,6 +2737,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// ServerLevel.this.getChunkSource().addEntity(entity); // Paper - ignore and warn about illegal addEntity calls instead of crashing server; moved down below valid=true
if (entity instanceof ServerPlayer serverPlayer) {
ServerLevel.this.players.add(serverPlayer);
@@ -162,10 +162,10 @@ index e6730996dfd4c2422b6c13f10309fc58af4ac595..9b193bf81cf7f9f45dfa207a826043e0
+ ServerLevel.this.realPlayers.add(serverPlayer);
+ }
+ // Leaves end - skip
- ServerLevel.this.updateSleepingPlayerList();
- }
-
-@@ -2760,6 +2767,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+ if (serverPlayer.isReceivingWaypoints()) {
+ ServerLevel.this.getWaypointManager().addPlayer(serverPlayer);
+ }
+@@ -2813,6 +2820,11 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
ServerLevel.this.getChunkSource().removeEntity(entity);
if (entity instanceof ServerPlayer serverPlayer) {
ServerLevel.this.players.remove(serverPlayer);
@@ -174,14 +174,27 @@ index e6730996dfd4c2422b6c13f10309fc58af4ac595..9b193bf81cf7f9f45dfa207a826043e0
+ ServerLevel.this.realPlayers.remove(serverPlayer);
+ }
+ // Leaves end - skip
+ ServerLevel.this.getWaypointManager().removePlayer(serverPlayer);
ServerLevel.this.updateSleepingPlayerList();
}
-
+diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
+index 4210089d6ba271ef9d68e18699b1122f07e1946a..8d1571f3db4e7f6c4309b8a46ed0359ecdee85a5 100644
+--- a/net/minecraft/server/level/ServerPlayer.java
++++ b/net/minecraft/server/level/ServerPlayer.java
+@@ -216,7 +216,7 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+ private static final boolean DEFAULT_SEEN_CREDITS = false;
+ private static final boolean DEFAULT_SPAWN_EXTRA_PARTICLES_ON_FALL = false;
+ public ServerGamePacketListenerImpl connection;
+- private final MinecraftServer server;
++ public final MinecraftServer server; // Leaves - private -> public
+ public ServerPlayerGameMode gameMode;
+ private final PlayerAdvancements advancements;
+ private final ServerStatsCounter stats;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd4ad5df72 100644
+index 418d6970d46b3b592c17f7721ca3ecfd1edce8ad..70d394d8a257390af20bdea5895f7d8a74b16dec 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -132,6 +132,7 @@ public abstract class PlayerList {
+@@ -131,6 +131,7 @@ public abstract class PlayerList {
private boolean allowCommandsForAllPlayers;
private static final boolean ALLOW_LOGOUTIVATOR = false;
private int sendAllPlayerInfoIn;
@@ -189,7 +202,7 @@ index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd
// CraftBukkit start
private org.bukkit.craftbukkit.CraftServer cserver;
-@@ -150,6 +151,106 @@ public abstract class PlayerList {
+@@ -149,6 +150,106 @@ public abstract class PlayerList {
abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
@@ -275,7 +288,7 @@ index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd
+ this.server.getCustomBossEvents().onPlayerConnect(player);
+ }
+
-+ worldserver1 = player.serverLevel();
++ worldserver1 = player.level();
+ java.util.Iterator iterator = player.getActiveEffects().iterator();
+ while (iterator.hasNext()) {
+ MobEffectInstance mobeffect = iterator.next();
@@ -296,34 +309,34 @@ index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie) {
player.isRealPlayer = true; // Paper
player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed
-@@ -317,6 +418,7 @@ public abstract class PlayerList {
+@@ -318,6 +419,7 @@ public abstract class PlayerList {
- // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below
- this.players.add(player);
-+ this.realPlayers.add(player); // Leaves - replay api
- this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
- this.playersByUUID.put(player.getUUID(), player);
- this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
-@@ -379,6 +481,12 @@ public abstract class PlayerList {
- continue;
- }
+ // player.connection.send(ClientboundPlayerInfoUpdatePacket.createPlayerInitializing(this.players)); // CraftBukkit - replaced with loop below
+ this.players.add(player);
++ this.realPlayers.add(player); // Leaves - replay api
+ this.playersByName.put(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT), player); // Spigot
+ this.playersByUUID.put(player.getUUID(), player);
+ this.addToSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
+@@ -380,6 +482,12 @@ public abstract class PlayerList {
+ continue;
+ }
-+ // Leaves start - skip photographer
-+ if (entityplayer1 instanceof org.leavesmc.leaves.replay.ServerPhotographer) {
-+ continue;
-+ }
-+ // Leaves end - skip photographer
++ // Leaves start - skip photographer
++ if (entityplayer1 instanceof org.leavesmc.leaves.replay.ServerPhotographer) {
++ continue;
++ }
++ // Leaves end - skip photographer
+
- onlinePlayers.add(entityplayer1); // Paper - Use single player info update packet on join
- }
- // Paper start - Use single player info update packet on join
-@@ -520,6 +628,43 @@ public abstract class PlayerList {
+ onlinePlayers.add(entityplayer1); // Paper - Use single player info update packet on join
+ }
+ // Paper start - Use single player info update packet on join
+@@ -523,6 +631,43 @@ public abstract class PlayerList {
}
}
+ // Leaves start - replay mod api
+ public void removePhotographer(org.leavesmc.leaves.replay.ServerPhotographer entityplayer) {
-+ ServerLevel worldserver = entityplayer.serverLevel();
++ ServerLevel worldserver = entityplayer.level();
+
+ entityplayer.awardStat(Stats.LEAVE_GAME);
+
@@ -361,7 +374,7 @@ index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd
public @Nullable net.kyori.adventure.text.Component remove(ServerPlayer player) { // CraftBukkit - return string // Paper - return Component
// Paper start - Fix kick event leave message not being sent
return this.remove(player, net.kyori.adventure.text.Component.translatable("multiplayer.player.left", net.kyori.adventure.text.format.NamedTextColor.YELLOW, io.papermc.paper.configuration.GlobalConfiguration.get().messages.useDisplayNameInQuitMessage ? player.getBukkitEntity().displayName() : io.papermc.paper.adventure.PaperAdventure.asAdventure(player.getDisplayName())));
-@@ -596,6 +741,7 @@ public abstract class PlayerList {
+@@ -599,6 +744,7 @@ public abstract class PlayerList {
player.retireScheduler(); // Paper - Folia schedulers
player.getAdvancements().stopListening();
this.players.remove(player);
@@ -369,7 +382,7 @@ index 5372599cf3d1310e28530945db13c0df4d4dbd15..4f8d925425bef31ed70501826ddb9ddd
this.playersByName.remove(player.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot
this.removeFromSendAllPlayerInfoBuckets(player); // Gale - Purpur - spread out sending all player info
this.server.getCustomBossEvents().onPlayerDisconnect(player);
-@@ -688,7 +834,7 @@ public abstract class PlayerList {
+@@ -691,7 +837,7 @@ public abstract class PlayerList {
// return this.players.size() >= this.maxPlayers && !this.canBypassPlayerLimit(gameProfile)
// ? Component.translatable("multiplayer.disconnect.server_full")
// : null;
diff --git a/leaf-server/minecraft-patches/features/0117-Petal-Async-Pathfinding.patch b/leaf-server/minecraft-patches/features/0117-Petal-Async-Pathfinding.patch
index ccd7d83c..b496be3d 100644
--- a/leaf-server/minecraft-patches/features/0117-Petal-Async-Pathfinding.patch
+++ b/leaf-server/minecraft-patches/features/0117-Petal-Async-Pathfinding.patch
@@ -19,10 +19,10 @@ This patch was ported downstream from the Petal fork.
Makes most pathfinding-related work happen asynchronously
diff --git a/net/minecraft/world/entity/Mob.java b/net/minecraft/world/entity/Mob.java
-index fbcf26c0bfb9f496c99bd5a2ba988be06162cd52..cf136bc3d0d285ebde23c6e31c002933564fdcb2 100644
+index c5f4b878aa5d736d987982c94fbf557c0f267bbf..a6be753d1284167e090c40e6dcfbaa56b4e3d774 100644
--- a/net/minecraft/world/entity/Mob.java
+++ b/net/minecraft/world/entity/Mob.java
-@@ -243,6 +243,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
+@@ -246,6 +246,7 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
@Nullable
@Override
public LivingEntity getTarget() {
@@ -290,20 +290,20 @@ index 4f9f3367b1ca3903df03a80fa2b01a3d24e6e77d..51413df5cd61b3ff59c6c6c3ec69d673
+ // Leaf end - Kaiiju - petal - Async path processing
}
diff --git a/net/minecraft/world/entity/ai/goal/DoorInteractGoal.java b/net/minecraft/world/entity/ai/goal/DoorInteractGoal.java
-index d8f532c5e68ff4dff933556c4f981e9474c044e6..95733482a647935e1e7f81fa71a0e99ea52e9a9b 100644
+index 73bba480f3f017a8aed14562bd82ba33db04391c..ed73a102d1ca58d0c2d4ea6d715511284fa90896 100644
--- a/net/minecraft/world/entity/ai/goal/DoorInteractGoal.java
+++ b/net/minecraft/world/entity/ai/goal/DoorInteractGoal.java
-@@ -56,7 +56,7 @@ public abstract class DoorInteractGoal extends Goal {
+@@ -54,7 +54,7 @@ public abstract class DoorInteractGoal extends Goal {
+ return false;
} else {
- GroundPathNavigation groundPathNavigation = (GroundPathNavigation)this.mob.getNavigation();
- Path path = groundPathNavigation.getPath();
+ Path path = this.mob.getNavigation().getPath();
- if (path != null && !path.isDone()) {
+ if (path != null && path.isProcessed() && !path.isDone()) { // Kaiiju - async pathfinding - ensure path is processed
for (int i = 0; i < Math.min(path.getNextNodeIndex() + 2, path.getNodeCount()); i++) {
Node node = path.getNode(i);
this.doorPos = new BlockPos(node.x, node.y + 1, node.z);
diff --git a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
-index 66a02fe7594522ef391d67e09856bf3f70fe597d..55e4e6542ac05d89b8d062c546de85b29fb0099f 100644
+index 458ceec68ca138b0aa9b70d6c934473c01d468f4..dc42e63d1c166aed02081e687ada76a0e74da7a7 100644
--- a/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation.java
@@ -12,9 +12,25 @@ public class AmphibiousPathNavigation extends PathNavigation {
@@ -333,7 +333,7 @@ index 66a02fe7594522ef391d67e09856bf3f70fe597d..55e4e6542ac05d89b8d062c546de85b2
}
diff --git a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
-index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..5de4c1138c7092ff8240fcb30cd64ff1f4d12088 100644
+index 077863b758fbc3e51f25bcf842d00a2cc07c6a2f..29490cf3cb3c42dbc1dff683d8942a40e2df71b6 100644
--- a/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/FlyingPathNavigation.java
@@ -16,9 +16,25 @@ public class FlyingPathNavigation extends PathNavigation {
@@ -371,7 +371,7 @@ index 71ea68b56b3069bdf8e47931156b6ef49ea8ce5d..5de4c1138c7092ff8240fcb30cd64ff1
if (!this.isDone()) {
if (this.canUpdatePath()) {
diff --git a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
-index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..3f55b00e2f8924a8450df8a3f9812a4ae2983df3 100644
+index 86fccf3617a32f3791b03d8067e2eaf6b8d8bebb..9cef6797e6d8eb43a51a1b94fea3947dd3d534da 100644
--- a/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/GroundPathNavigation.java
@@ -24,9 +24,25 @@ public class GroundPathNavigation extends PathNavigation {
@@ -401,7 +401,7 @@ index 045cfafb3afe8271d60852ae3c7cdcb039b44d4f..3f55b00e2f8924a8450df8a3f9812a4a
}
diff --git a/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
-index 6bbdfc748f1ce66689c63424fadcf261b1e967b3..84e855a4a9890a4772aee2383797cbc3d9b46dc3 100644
+index c8e4ccb96a0f162c780066cf4f61b970b49b7703..83cbb78fece9ddabcbbf3fc7a7dac06f5c02ab7c 100644
--- a/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -167,6 +167,10 @@ public abstract class PathNavigation {
@@ -482,7 +482,7 @@ index 6bbdfc748f1ce66689c63424fadcf261b1e967b3..84e855a4a9890a4772aee2383797cbc3
Vec3 vec3 = new Vec3((endNode.x + this.mob.getX()) / 2.0, (endNode.y + this.mob.getY()) / 2.0, (endNode.z + this.mob.getZ()) / 2.0);
return pos.closerToCenterThan(vec3, this.path.getNodeCount() - this.path.getNextNodeIndex());
diff --git a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
-index 2979846853898d78a2df19df2287da16dbe4ae71..1289a6e85f3fdb9187323343b6c20e17b6a7e296 100644
+index ea0f6a19e4a79538e68917ba86cbc98be4dbca8d..e2ed5b1d9eca79dc5a63d70d718fdf8298969e97 100644
--- a/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
+++ b/net/minecraft/world/entity/ai/navigation/WaterBoundPathNavigation.java
@@ -15,11 +15,27 @@ public class WaterBoundPathNavigation extends PathNavigation {
@@ -560,10 +560,10 @@ index 1f96fd5085bacb4c584576c7cb9f51e7898e9b03..03b6c8c8dcd42e864751e68be9d35d20
+ // Leaf end - Kaiiju - await on async path processing
}
diff --git a/net/minecraft/world/entity/animal/Bee.java b/net/minecraft/world/entity/animal/Bee.java
-index e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d..04c0dad21c4cdd464a8ebe830bcdd217bb4156ec 100644
+index ca5651f15552f91fba650747d28a75c00fa11442..119e2b6b198fd4b2aaef7a9a5f46568bd52bd071 100644
--- a/net/minecraft/world/entity/animal/Bee.java
+++ b/net/minecraft/world/entity/animal/Bee.java
-@@ -936,7 +936,8 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -937,7 +937,8 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
} else {
Bee.this.pathfindRandomlyTowards(Bee.this.hivePos);
}
@@ -573,7 +573,7 @@ index e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d..04c0dad21c4cdd464a8ebe830bcdd217
boolean flag = this.pathfindDirectlyTowards(Bee.this.hivePos);
if (!flag) {
this.dropAndBlacklistHive();
-@@ -990,7 +991,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
+@@ -991,7 +992,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
return true;
} else {
Path path = Bee.this.navigation.getPath();
@@ -583,10 +583,10 @@ index e9dfff7e3726cd2229f89bb39fa1ca4815d99a6d..04c0dad21c4cdd464a8ebe830bcdd217
}
}
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 71bae5f5ed284fed30262872771f85de97383d6d..50f9a11f8cb53fd1fa34017598ff3fe828b3ca25 100644
+index a7e9179c287671a689cb5ce668b5a33896da87a4..7d450b6ccde99657a7fac354ae386a80f9f7e879 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -488,9 +488,25 @@ public class Frog extends Animal {
+@@ -489,9 +489,25 @@ public class Frog extends Animal {
return pathType != PathType.WATER_BORDER && super.canCutCorner(pathType);
}
@@ -613,10 +613,10 @@ index 71bae5f5ed284fed30262872771f85de97383d6d..50f9a11f8cb53fd1fa34017598ff3fe8
}
}
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
-index b85d1e196d2bf61ac4896205afb08eba89c4397e..c22f7054e0f78dcce3e3f9765e2ee9b63ca195ff 100644
+index 2e6d0f035a01277aa28bbe912d5df8dc4cf04547..f4428016e4fabc99dc79ecc39b7f6e0617e4dc7a 100644
--- a/net/minecraft/world/entity/monster/Drowned.java
+++ b/net/minecraft/world/entity/monster/Drowned.java
-@@ -313,7 +313,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -308,7 +308,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
protected boolean closeToNextPos() {
Path path = this.getNavigation().getPath();
@@ -656,10 +656,10 @@ index fe31c4a45afd61be8b74efe9d0858ccd0aced075..e1717b5c854aa81fdd7b7e715d7c3498
}
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index 497ea5d5aad1641d5876f23f05db82ab649c0785..e5193d7320ea17e86b776c705ec45010019493d6 100644
+index 147fb3eecf651dcee63d63255542ef2680140f66..a6109ac9d7f8a9aa4074b3e9504244b1d565a2d4 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -580,6 +580,16 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -576,6 +576,16 @@ public class Warden extends Monster implements VibrationSystem {
@Override
protected PathFinder createPathFinder(int maxVisitedNodes) {
this.nodeEvaluator = new WalkNodeEvaluator();
diff --git a/leaf-server/minecraft-patches/features/0118-Petal-reduce-work-done-by-game-event-system.patch b/leaf-server/minecraft-patches/features/0118-Petal-reduce-work-done-by-game-event-system.patch
index 5c809db3..d76de9de 100644
--- a/leaf-server/minecraft-patches/features/0118-Petal-reduce-work-done-by-game-event-system.patch
+++ b/leaf-server/minecraft-patches/features/0118-Petal-reduce-work-done-by-game-event-system.patch
@@ -11,7 +11,7 @@ Original project: https://github.com/Bloom-host/Petal
2. EuclideanGameEventListenerRegistry is not used concurrently so we ban that usage for improved performance with allays
diff --git a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
-index 2627583ab12d886b1fba0b1d1e599f942926b499..440d70811d96f97d3463c6aff131cbc5bd588254 100644
+index 0a94670dc20bb9c521b0395633eb100393895f6a..83c811eb5e493fa6630f16c206787f227fde089b 100644
--- a/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/SculkCatalystBlockEntity.java
@@ -65,7 +65,7 @@ public class SculkCatalystBlockEntity extends BlockEntity implements GameEventLi
@@ -38,10 +38,10 @@ index 2627583ab12d886b1fba0b1d1e599f942926b499..440d70811d96f97d3463c6aff131cbc5
if (entity.getLastHurtByMob() instanceof ServerPlayer serverPlayer) {
DamageSource damageSource = entity.getLastDamageSource() == null
diff --git a/net/minecraft/world/level/chunk/LevelChunk.java b/net/minecraft/world/level/chunk/LevelChunk.java
-index a8db2a822deb07ddc707cf73fdc5c269d9842c06..800fc055024c176d1830e1d2686f5d96131c8712 100644
+index 9e2debee38bc4b25281c8a8c6e7082cca1f7b569..27aa58ab47e7a7b0edddd1c483dc9165696ebf11 100644
--- a/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/net/minecraft/world/level/chunk/LevelChunk.java
-@@ -80,7 +80,19 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -82,7 +82,19 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
private Supplier fullStatus;
@Nullable
private LevelChunk.PostLoadProcessor postLoad;
@@ -62,7 +62,7 @@ index a8db2a822deb07ddc707cf73fdc5c269d9842c06..800fc055024c176d1830e1d2686f5d96
private final LevelChunkTicks blockTicks;
private final LevelChunkTicks fluidTicks;
private LevelChunk.UnsavedListener unsavedListener = chunkPos -> {};
-@@ -155,7 +167,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -157,7 +169,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
) {
super(pos, data, level, net.minecraft.server.MinecraftServer.getServer().registryAccess().lookupOrThrow(Registries.BIOME), inhabitedTime, sections, blendingData); // Paper - Anti-Xray - The world isn't ready yet, use server singleton for registry
this.level = (ServerLevel) level; // CraftBukkit - type
@@ -71,7 +71,7 @@ index a8db2a822deb07ddc707cf73fdc5c269d9842c06..800fc055024c176d1830e1d2686f5d96
for (Heightmap.Types types : Heightmap.Types.values()) {
if (ChunkStatus.FULL.heightmapsAfter().contains(types)) {
-@@ -267,10 +279,27 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -269,10 +281,27 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
@Override
public GameEventListenerRegistry getListenerRegistry(int sectionY) {
@@ -103,7 +103,7 @@ index a8db2a822deb07ddc707cf73fdc5c269d9842c06..800fc055024c176d1830e1d2686f5d96
}
// Paper start - Perf: Reduce instructions and provide final method
-@@ -617,7 +646,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
+@@ -620,7 +649,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
}
private void removeGameEventListenerRegistry(int sectionY) {
diff --git a/leaf-server/minecraft-patches/features/0119-Reduce-canSee-work.patch b/leaf-server/minecraft-patches/features/0119-Reduce-canSee-work.patch
index 14e93be2..d81408ef 100644
--- a/leaf-server/minecraft-patches/features/0119-Reduce-canSee-work.patch
+++ b/leaf-server/minecraft-patches/features/0119-Reduce-canSee-work.patch
@@ -7,10 +7,10 @@ Co-authored by: Martijn Muijsers
Co-authored by: MachineBreaker
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index a94f6eb93a4271d8b50cbb55dce04affd1ac4a13..9ac2ecb78f6214616376b0e3badef21dc3f72114 100644
+index dd8c7afecd62edc2ab3933034bf469aea729be53..3bd42eb81eae3af9323021a5dc6edaa06dfcaead 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
-@@ -987,17 +987,19 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
+@@ -988,17 +988,19 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
for (int i = 0, len = entities.size(); i < len; ++i) {
Entity entity = entities.get(i);
diff --git a/leaf-server/minecraft-patches/features/0120-Fix-sprint-glitch.patch b/leaf-server/minecraft-patches/features/0120-Fix-sprint-glitch.patch
index aa11a26c..7efd239d 100644
--- a/leaf-server/minecraft-patches/features/0120-Fix-sprint-glitch.patch
+++ b/leaf-server/minecraft-patches/features/0120-Fix-sprint-glitch.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Fix sprint glitch
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index ed15b5f29658d799a36dcbd196a8fcb107be4bda..09aa0b344aff0c48eec9a296d47c0704bd0fdc5c 100644
+index d59caf13e9066f2171c360e07a26122a540380a0..97098f05dda8a46716162dd0330ca60d30814999 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -1387,7 +1387,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1419,7 +1419,8 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
player.setRealHealth(health);
}
diff --git a/leaf-server/minecraft-patches/features/0121-Configurable-movement-speed-of-more-entities.patch b/leaf-server/minecraft-patches/features/0121-Configurable-movement-speed-of-more-entities.patch
index 4b0b4c32..32a33da7 100644
--- a/leaf-server/minecraft-patches/features/0121-Configurable-movement-speed-of-more-entities.patch
+++ b/leaf-server/minecraft-patches/features/0121-Configurable-movement-speed-of-more-entities.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Configurable movement speed of more entities
diff --git a/net/minecraft/world/entity/monster/Drowned.java b/net/minecraft/world/entity/monster/Drowned.java
-index c22f7054e0f78dcce3e3f9765e2ee9b63ca195ff..2e04078664cd723e3e0c80565e4b6e6416b13901 100644
+index f4428016e4fabc99dc79ecc39b7f6e0617e4dc7a..7ff380212ce5e56e0e58e5f52f8c75bda5061ef0 100644
--- a/net/minecraft/world/entity/monster/Drowned.java
+++ b/net/minecraft/world/entity/monster/Drowned.java
-@@ -97,6 +97,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
+@@ -98,6 +98,7 @@ public class Drowned extends Zombie implements RangedAttackMob {
public void initAttributes() {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.drownedMaxHealth);
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.drownedScale);
@@ -29,10 +29,10 @@ index a4ce65911a5d778f60bcedb3acd9fe59a5094c96..f4200bdf2002c13259821b2781137089
@Override
diff --git a/net/minecraft/world/entity/monster/Zombie.java b/net/minecraft/world/entity/monster/Zombie.java
-index 783f8b9a05939b9f42fc77065f6347e3c6ddf8f5..447adc3dcfd31a6fb9e673555e9793a82f9e02d4 100644
+index ab4dc7b3a7593d255dbd7d1df667fce3504af3ed..185d138f65e884eb9b3fdd753bc4e2a14a25c4b1 100644
--- a/net/minecraft/world/entity/monster/Zombie.java
+++ b/net/minecraft/world/entity/monster/Zombie.java
-@@ -127,6 +127,7 @@ public class Zombie extends Monster {
+@@ -126,6 +126,7 @@ public class Zombie extends Monster {
public void initAttributes() {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombieMaxHealth);
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombieScale);
@@ -40,7 +40,7 @@ index 783f8b9a05939b9f42fc77065f6347e3c6ddf8f5..447adc3dcfd31a6fb9e673555e9793a8
}
// Purpur end - Configurable entity base attributes
-@@ -194,7 +195,7 @@ public class Zombie extends Monster {
+@@ -193,7 +194,7 @@ public class Zombie extends Monster {
public static AttributeSupplier.Builder createAttributes() {
return Monster.createMonsterAttributes()
.add(Attributes.FOLLOW_RANGE, 35.0)
@@ -50,10 +50,10 @@ index 783f8b9a05939b9f42fc77065f6347e3c6ddf8f5..447adc3dcfd31a6fb9e673555e9793a8
.add(Attributes.ARMOR, 2.0)
.add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
diff --git a/net/minecraft/world/entity/monster/ZombieVillager.java b/net/minecraft/world/entity/monster/ZombieVillager.java
-index ae5939c940bdd93977fa882360fc31e46479554f..ba480249c1e8813931a668a37977347a73f3a3f5 100644
+index e218e5d5f146ec996a6f5ce7e76b1d6506ac1cb9..18966860f550ad1f35ec6a03a0b78af73628b964 100644
--- a/net/minecraft/world/entity/monster/ZombieVillager.java
+++ b/net/minecraft/world/entity/monster/ZombieVillager.java
-@@ -98,6 +98,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
+@@ -97,6 +97,7 @@ public class ZombieVillager extends Zombie implements VillagerDataHolder {
@Override
public void initAttributes() {
this.getAttribute(net.minecraft.world.entity.ai.attributes.Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombieVillagerMaxHealth);
@@ -62,10 +62,10 @@ index ae5939c940bdd93977fa882360fc31e46479554f..ba480249c1e8813931a668a37977347a
@Override
diff --git a/net/minecraft/world/entity/monster/ZombifiedPiglin.java b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
-index 39489c8a347031fb4f73faca46039786e35762ac..4de1d0966157b20526386becee10b9be45f7a9ba 100644
+index f58c48d9de85fda3d13079f3e56b31af75b3c725..cc349403ceb9b094362e706f4e5b200a51071380 100644
--- a/net/minecraft/world/entity/monster/ZombifiedPiglin.java
+++ b/net/minecraft/world/entity/monster/ZombifiedPiglin.java
-@@ -85,6 +85,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -86,6 +86,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
public void initAttributes() {
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.zombifiedPiglinMaxHealth);
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.zombifiedPiglinScale);
@@ -73,7 +73,7 @@ index 39489c8a347031fb4f73faca46039786e35762ac..4de1d0966157b20526386becee10b9be
}
// Purpur end - Configurable entity base attributes
-@@ -136,7 +137,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
+@@ -137,7 +138,7 @@ public class ZombifiedPiglin extends Zombie implements NeutralMob {
public static AttributeSupplier.Builder createAttributes() {
return Zombie.createAttributes()
.add(Attributes.SPAWN_REINFORCEMENTS_CHANCE, 0.0)
@@ -83,10 +83,10 @@ index 39489c8a347031fb4f73faca46039786e35762ac..4de1d0966157b20526386becee10b9be
}
diff --git a/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java
-index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d5e5cccb6 100644
+index 88a2ad8e3b30cb9f447eb4001d33c7799339b6a0..b3dd4862b9fa220f4aeabc3598169852f8b12482 100644
--- a/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/org/purpurmc/purpur/PurpurWorldConfig.java
-@@ -1625,6 +1625,7 @@ public class PurpurWorldConfig {
+@@ -1620,6 +1620,7 @@ public class PurpurWorldConfig {
public boolean drownedTakeDamageFromWater = false;
public boolean drownedBreakDoors = false;
public boolean drownedAlwaysDropExp = false;
@@ -94,7 +94,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
private void drownedSettings() {
drownedRidable = getBoolean("mobs.drowned.ridable", drownedRidable);
drownedRidableInWater = getBoolean("mobs.drowned.ridable-in-water", drownedRidableInWater);
-@@ -1643,6 +1644,7 @@ public class PurpurWorldConfig {
+@@ -1638,6 +1639,7 @@ public class PurpurWorldConfig {
drownedTakeDamageFromWater = getBoolean("mobs.drowned.takes-damage-from-water", drownedTakeDamageFromWater);
drownedBreakDoors = getBoolean("mobs.drowned.can-break-doors", drownedBreakDoors);
drownedAlwaysDropExp = getBoolean("mobs.drowned.always-drop-exp", drownedAlwaysDropExp);
@@ -102,7 +102,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
}
public boolean elderGuardianRidable = false;
-@@ -2037,6 +2039,7 @@ public class PurpurWorldConfig {
+@@ -2055,6 +2057,7 @@ public class PurpurWorldConfig {
public boolean huskJockeyTryExistingChickens = true;
public boolean huskTakeDamageFromWater = false;
public boolean huskAlwaysDropExp = false;
@@ -110,7 +110,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
private void huskSettings() {
huskRidable = getBoolean("mobs.husk.ridable", huskRidable);
huskRidableInWater = getBoolean("mobs.husk.ridable-in-water", huskRidableInWater);
-@@ -2054,6 +2057,7 @@ public class PurpurWorldConfig {
+@@ -2072,6 +2075,7 @@ public class PurpurWorldConfig {
huskJockeyTryExistingChickens = getBoolean("mobs.husk.jockey.try-existing-chickens", huskJockeyTryExistingChickens);
huskTakeDamageFromWater = getBoolean("mobs.husk.takes-damage-from-water", huskTakeDamageFromWater);
huskAlwaysDropExp = getBoolean("mobs.husk.always-drop-exp", huskAlwaysDropExp);
@@ -118,7 +118,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
}
public boolean illusionerRidable = false;
-@@ -3424,6 +3428,7 @@ public class PurpurWorldConfig {
+@@ -3442,6 +3446,7 @@ public class PurpurWorldConfig {
public boolean zombieTakeDamageFromWater = false;
public boolean zombieAlwaysDropExp = false;
public double zombieHeadVisibilityPercent = 0.5D;
@@ -126,7 +126,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
private void zombieSettings() {
zombieRidable = getBoolean("mobs.zombie.ridable", zombieRidable);
zombieRidableInWater = getBoolean("mobs.zombie.ridable-in-water", zombieRidableInWater);
-@@ -3449,6 +3454,7 @@ public class PurpurWorldConfig {
+@@ -3467,6 +3472,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);
@@ -134,7 +134,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
}
public boolean zombieHorseRidable = false;
-@@ -3498,6 +3504,7 @@ public class PurpurWorldConfig {
+@@ -3516,6 +3522,7 @@ public class PurpurWorldConfig {
public int zombieVillagerCuringTimeMax = 6000;
public boolean zombieVillagerCureEnabled = true;
public boolean zombieVillagerAlwaysDropExp = false;
@@ -142,7 +142,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
private void zombieVillagerSettings() {
zombieVillagerRidable = getBoolean("mobs.zombie_villager.ridable", zombieVillagerRidable);
zombieVillagerRidableInWater = getBoolean("mobs.zombie_villager.ridable-in-water", zombieVillagerRidableInWater);
-@@ -3518,6 +3525,7 @@ public class PurpurWorldConfig {
+@@ -3536,6 +3543,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);
@@ -150,7 +150,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
}
public boolean zombifiedPiglinRidable = false;
-@@ -3532,6 +3540,7 @@ public class PurpurWorldConfig {
+@@ -3550,6 +3558,7 @@ public class PurpurWorldConfig {
public boolean zombifiedPiglinCountAsPlayerKillWhenAngry = false;
public boolean zombifiedPiglinTakeDamageFromWater = false;
public boolean zombifiedPiglinAlwaysDropExp = false;
@@ -158,7 +158,7 @@ index cadfbb7310fce33eda24d69c39fda5689c7fb882..21765347d7a81f4111f23685f699286d
private void zombifiedPiglinSettings() {
zombifiedPiglinRidable = getBoolean("mobs.zombified_piglin.ridable", zombifiedPiglinRidable);
zombifiedPiglinRidableInWater = getBoolean("mobs.zombified_piglin.ridable-in-water", zombifiedPiglinRidableInWater);
-@@ -3553,6 +3562,7 @@ public class PurpurWorldConfig {
+@@ -3571,6 +3580,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);
diff --git a/leaf-server/minecraft-patches/features/0122-Faster-sequencing-of-futures-for-chunk-structure-gen.patch b/leaf-server/minecraft-patches/features/0122-Faster-sequencing-of-futures-for-chunk-structure-gen.patch
index 07560db6..9fe50807 100644
--- a/leaf-server/minecraft-patches/features/0122-Faster-sequencing-of-futures-for-chunk-structure-gen.patch
+++ b/leaf-server/minecraft-patches/features/0122-Faster-sequencing-of-futures-for-chunk-structure-gen.patch
@@ -7,7 +7,7 @@ Replace `thenApply` with `thenCompose`. Once one task is completed then the next
to prevent blocking threads while waiting to complete all tasks. But may cause the sequence of future compose disorder.
diff --git a/net/minecraft/Util.java b/net/minecraft/Util.java
-index d1fcc73f579d1c4ac79213ad039c8d803ff51b1a..9918572306e983281d05c6d28c8a5d843348ad2d 100644
+index 0a69469c79aaa2466cda04f6acefed18e421d555..82ee6c27ebc2718ad88b640775d949ec6d7cfed2 100644
--- a/net/minecraft/Util.java
+++ b/net/minecraft/Util.java
@@ -620,17 +620,39 @@ public class Util {
@@ -51,10 +51,10 @@ index d1fcc73f579d1c4ac79213ad039c8d803ff51b1a..9918572306e983281d05c6d28c8a5d84
CompletableFuture> completableFuture = new CompletableFuture<>();
return fallibleSequence(completableFutures, completableFuture::completeExceptionally).applyToEither(completableFuture, Function.identity());
diff --git a/net/minecraft/server/ReloadableServerRegistries.java b/net/minecraft/server/ReloadableServerRegistries.java
-index d8c472b8c6aadcaadef14abd8ab43f466e94417e..bc079b6c3d751f2a63d089bf209cf7d8e0da76e8 100644
+index 512d59188ff43e34463e2845aa8a174792c407a7..ca84304526050176ca7406f7a13c144798a0ed74 100644
--- a/net/minecraft/server/ReloadableServerRegistries.java
+++ b/net/minecraft/server/ReloadableServerRegistries.java
-@@ -52,7 +52,7 @@ public class ReloadableServerRegistries {
+@@ -50,7 +50,7 @@ public class ReloadableServerRegistries {
List>> list1 = LootDataType.values()
.map(lootDataType -> scheduleRegistryLoad((LootDataType>)lootDataType, registryOps, resourceManager, backgroundExecutor, conversions)) // Paper
.toList();
diff --git a/leaf-server/minecraft-patches/features/0123-Reduce-active-items-finding-hopper-nearby-check.patch b/leaf-server/minecraft-patches/features/0123-Reduce-active-items-finding-hopper-nearby-check.patch
index 6adee127..617f42dc 100644
--- a/leaf-server/minecraft-patches/features/0123-Reduce-active-items-finding-hopper-nearby-check.patch
+++ b/leaf-server/minecraft-patches/features/0123-Reduce-active-items-finding-hopper-nearby-check.patch
@@ -9,10 +9,10 @@ But still recommend to turn-off `checkForMinecartNearItemWhileActive`
Since `Reduce-hopper-item-checks.patch` will cause lag under massive dropped items
diff --git a/net/minecraft/world/entity/item/ItemEntity.java b/net/minecraft/world/entity/item/ItemEntity.java
-index 8aab412c8e70b6f9d8e05a26cefac330dd7a2ea1..ecec91d28d1b71d549f48185af5f1ef3286768be 100644
+index 605de72224f6baa112dbfd2c83fd7a1ceba6a540..52314a8fe4188689431f9a1261226859b967f5f1 100644
--- a/net/minecraft/world/entity/item/ItemEntity.java
+++ b/net/minecraft/world/entity/item/ItemEntity.java
-@@ -248,7 +248,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
+@@ -246,7 +246,11 @@ public class ItemEntity extends Entity implements TraceableEntity {
this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
return; // Gale - EMC - reduce hopper item checks
}
diff --git a/leaf-server/minecraft-patches/features/0124-Plazma-Add-some-missing-Pufferfish-configurations.patch b/leaf-server/minecraft-patches/features/0124-Plazma-Add-some-missing-Pufferfish-configurations.patch
index 6b9c1f90..0792ac16 100644
--- a/leaf-server/minecraft-patches/features/0124-Plazma-Add-some-missing-Pufferfish-configurations.patch
+++ b/leaf-server/minecraft-patches/features/0124-Plazma-Add-some-missing-Pufferfish-configurations.patch
@@ -9,11 +9,27 @@ Original project: https://github.com/PlazmaMC/PlazmaBukkit
Add Pufferfish DAB support for Camel, Sniffer
https://github.com/pufferfish-gg/Pufferfish/issues/83
+diff --git a/net/minecraft/world/entity/animal/HappyGhast.java b/net/minecraft/world/entity/animal/HappyGhast.java
+index e04da94daced96a7eb9fdb01c551bea667b72d76..e53773e086a589ee5fd83fde0bee1881ff43e926 100644
+--- a/net/minecraft/world/entity/animal/HappyGhast.java
++++ b/net/minecraft/world/entity/animal/HappyGhast.java
+@@ -415,9 +415,11 @@ public class HappyGhast extends Animal {
+ return HappyGhastAi.makeBrain(this.brainProvider().makeBrain(dynamic));
+ }
+
++ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
+ @Override
+ protected void customServerAiStep(ServerLevel level) {
+ if (this.isBaby()) {
++ if (this.behaviorTick++ % this.activatedPriority == 0) // Leaf - Plazma - Add missing Pufferfish configurations
+ ((Brain)this.brain).tick(level, this);
+ HappyGhastAi.updateActivity(this);
+ }
diff --git a/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-index fb8a56d0ee80b0d397f2acd3af1f52fc26676b62..5d93eb5e56e45d485c0718db9e3d8754e97b691c 100644
+index b0ce3ab6939cb9e37171bb64e8c5308deb03195e..c520c4e478e3191cea7c2345a2e4c42b67c0762a 100644
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
-@@ -162,8 +162,10 @@ public class Armadillo extends Animal {
+@@ -163,8 +163,10 @@ public class Armadillo extends Animal {
return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic));
}
@@ -25,10 +41,10 @@ index fb8a56d0ee80b0d397f2acd3af1f52fc26676b62..5d93eb5e56e45d485c0718db9e3d8754
ArmadilloAi.updateActivity(this);
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
-index 101931ff4474ab4445be3fa1a241a731ad3ac1da..8d2dc9b94a13c386b7e54788a9ec6baf15c09a13 100644
+index 949b6c563658e6e46ac5842d6f088ecae6d4cd0c..c2107133d3def5ef5de7837499d33b5dbf5c20b6 100644
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
-@@ -167,9 +167,11 @@ public class Camel extends AbstractHorse {
+@@ -169,9 +169,11 @@ public class Camel extends AbstractHorse {
return pose == Pose.SITTING ? SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
}
@@ -41,10 +57,10 @@ index 101931ff4474ab4445be3fa1a241a731ad3ac1da..8d2dc9b94a13c386b7e54788a9ec6baf
CamelAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-index 0565b37dd5320b49efb11cf28f064d6a970048aa..598216a2794d2c7b325a9e479dfb553427fa0bc7 100644
+index a762fc8a4616c4e48e11accdca2129fd47f300e6..08bc21733c08b9df28803b36d3fb17aa3cc29345 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-@@ -482,8 +482,10 @@ public class Sniffer extends Animal {
+@@ -493,8 +493,10 @@ public class Sniffer extends Animal {
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
}
@@ -55,6 +71,22 @@ index 0565b37dd5320b49efb11cf28f064d6a970048aa..598216a2794d2c7b325a9e479dfb5534
this.getBrain().tick(level, this);
SnifferAi.updateActivity(this);
super.customServerAiStep(level);
+diff --git a/net/minecraft/world/entity/monster/Zoglin.java b/net/minecraft/world/entity/monster/Zoglin.java
+index 2a905e8cdf22f9d7f38cc41c1474e80f704d0cb1..385e6d997ea511dd44a7319879baff14addee8bd 100644
+--- a/net/minecraft/world/entity/monster/Zoglin.java
++++ b/net/minecraft/world/entity/monster/Zoglin.java
+@@ -285,9 +285,10 @@ public class Zoglin extends Monster implements HoglinBase {
+ this.setAggressive(this.brain.hasMemoryValue(MemoryModuleType.ATTACK_TARGET));
+ }
+
++ private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
+ @Override
+ protected void customServerAiStep(ServerLevel level) {
+- if (getRider() == null || !this.isControllable()) // Purpur - only use brain if no rider
++ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Purpur - only use brain if no rider // Leaf - Plazma - Add missing Pufferfish configurations
+ this.getBrain().tick(level, this);
+ this.updateActivity();
+ }
diff --git a/net/minecraft/world/entity/monster/breeze/Breeze.java b/net/minecraft/world/entity/monster/breeze/Breeze.java
index d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5..52558a99c915da3c46e5f63bd8014cfcdb38505f 100644
--- a/net/minecraft/world/entity/monster/breeze/Breeze.java
@@ -71,10 +103,10 @@ index d91ce14cc39b1b6ccd558f53ed605d4c6a5acae5..52558a99c915da3c46e5f63bd8014cfc
BreezeAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
-index c9404d72de59e18dc809b8dec107f1f23d50f441..91c6956311da3694cb3cda2f7a86c7e110c0d212 100644
+index 775c11f658b81379784f7e5bdfdc8105b3410480..49f962bbbce22dd26555ee2092ceff96e82aa6b2 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
-@@ -231,8 +231,10 @@ public class Creaking extends Monster {
+@@ -232,8 +232,10 @@ public class Creaking extends Monster {
return (Brain)super.getBrain();
}
diff --git a/leaf-server/minecraft-patches/features/0125-Plazma-Add-missing-purpur-configuration-options.patch b/leaf-server/minecraft-patches/features/0125-Plazma-Add-missing-purpur-configuration-options.patch
index f52a2a4c..be049c54 100644
--- a/leaf-server/minecraft-patches/features/0125-Plazma-Add-missing-purpur-configuration-options.patch
+++ b/leaf-server/minecraft-patches/features/0125-Plazma-Add-missing-purpur-configuration-options.patch
@@ -9,10 +9,10 @@ Original project: https://github.com/PlazmaMC/PlazmaBukkit
Add more Purpur configurable options for entities
diff --git a/net/minecraft/world/entity/animal/allay/Allay.java b/net/minecraft/world/entity/animal/allay/Allay.java
-index 18107d9be4d9ba816852ee4595a5349867834bef..ffa224d6cff03ad903ed38636eb3857f5919912f 100644
+index a25976d6f0dec86b88017cd5f86f3b51c8d7444b..cb88b1afe261f95998a19fcb555f91143834ba3a 100644
--- a/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/net/minecraft/world/entity/animal/allay/Allay.java
-@@ -177,6 +177,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
+@@ -174,6 +174,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
}
// Purpur end - Configurable entity base attributes
@@ -32,10 +32,10 @@ index 18107d9be4d9ba816852ee4595a5349867834bef..ffa224d6cff03ad903ed38636eb3857f
protected Brain.Provider brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
diff --git a/net/minecraft/world/entity/animal/camel/Camel.java b/net/minecraft/world/entity/animal/camel/Camel.java
-index 8d2dc9b94a13c386b7e54788a9ec6baf15c09a13..29c264b70eb5ce15e8c24d444d3fd50c5cab6a1c 100644
+index c2107133d3def5ef5de7837499d33b5dbf5c20b6..04c3fb56a4014025b6a9c01e97f0ffbd678b414a 100644
--- a/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/net/minecraft/world/entity/animal/camel/Camel.java
-@@ -101,6 +101,18 @@ public class Camel extends AbstractHorse {
+@@ -103,6 +103,18 @@ public class Camel extends AbstractHorse {
}
// Purpur end - Make entity breeding times configurable
@@ -52,9 +52,9 @@ index 8d2dc9b94a13c386b7e54788a9ec6baf15c09a13..29c264b70eb5ce15e8c24d444d3fd50c
+ // Leaf start - Plazma - Add missing purpur configuration options
+
@Override
- public void addAdditionalSaveData(CompoundTag compound) {
- super.addAdditionalSaveData(compound);
-@@ -171,7 +183,7 @@ public class Camel extends AbstractHorse {
+ protected void addAdditionalSaveData(ValueOutput output) {
+ super.addAdditionalSaveData(output);
+@@ -173,7 +185,7 @@ public class Camel extends AbstractHorse {
@Override
protected void customServerAiStep(ServerLevel level) {
Brain> brain = this.getBrain();
@@ -64,10 +64,10 @@ index 8d2dc9b94a13c386b7e54788a9ec6baf15c09a13..29c264b70eb5ce15e8c24d444d3fd50c
CamelAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/animal/frog/Frog.java b/net/minecraft/world/entity/animal/frog/Frog.java
-index 50f9a11f8cb53fd1fa34017598ff3fe828b3ca25..9f9abbd3272cba17f79dc4da6cf2cd4d3ab2cc8b 100644
+index 7d450b6ccde99657a7fac354ae386a80f9f7e879..7143a7b8aae713fd7f2f167a949f98b964e72c78 100644
--- a/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/net/minecraft/world/entity/animal/frog/Frog.java
-@@ -169,6 +169,23 @@ public class Frog extends Animal {
+@@ -170,6 +170,23 @@ public class Frog extends Animal {
}
// Purpur end - Make entity breeding times configurable
@@ -92,10 +92,10 @@ index 50f9a11f8cb53fd1fa34017598ff3fe828b3ca25..9f9abbd3272cba17f79dc4da6cf2cd4d
protected Brain.Provider brainProvider() {
return Brain.provider(MEMORY_TYPES, SENSOR_TYPES);
diff --git a/net/minecraft/world/entity/animal/frog/Tadpole.java b/net/minecraft/world/entity/animal/frog/Tadpole.java
-index 07fd03f1a8e72a5b39e5f9fd13f401dbfdb45280..daa315bfbedb0ec21a684d9141fb41ad40ce45b1 100644
+index 5d3479a55a10444e3ad3d9ec16160f9d520a1dc6..0e322f480e0a6302124847e26c4bed06678e78e4 100644
--- a/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/net/minecraft/world/entity/animal/frog/Tadpole.java
-@@ -106,6 +106,23 @@ public class Tadpole extends AbstractFish {
+@@ -108,6 +108,23 @@ public class Tadpole extends AbstractFish {
}
// Purpur end - Ridables
@@ -120,10 +120,10 @@ index 07fd03f1a8e72a5b39e5f9fd13f401dbfdb45280..daa315bfbedb0ec21a684d9141fb41ad
protected PathNavigation createNavigation(Level level) {
return new WaterBoundPathNavigation(this, level);
diff --git a/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-index 598216a2794d2c7b325a9e479dfb553427fa0bc7..fca5464de3fe07c74e26c9c608efaa3c150c11a1 100644
+index 08bc21733c08b9df28803b36d3fb17aa3cc29345..1f545d4c9a3de0d6630a92481920ed6c3553ce97 100644
--- a/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/net/minecraft/world/entity/animal/sniffer/Sniffer.java
-@@ -118,6 +118,18 @@ public class Sniffer extends Animal {
+@@ -119,6 +119,18 @@ public class Sniffer extends Animal {
}
// Purpur end - Make entity breeding times configurable
@@ -142,7 +142,7 @@ index 598216a2794d2c7b325a9e479dfb553427fa0bc7..fca5464de3fe07c74e26c9c608efaa3c
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
super.defineSynchedData(builder);
-@@ -485,7 +497,7 @@ public class Sniffer extends Animal {
+@@ -496,7 +508,7 @@ public class Sniffer extends Animal {
private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -152,10 +152,10 @@ index 598216a2794d2c7b325a9e479dfb553427fa0bc7..fca5464de3fe07c74e26c9c608efaa3c
SnifferAi.updateActivity(this);
super.customServerAiStep(level);
diff --git a/net/minecraft/world/entity/monster/creaking/Creaking.java b/net/minecraft/world/entity/monster/creaking/Creaking.java
-index 91c6956311da3694cb3cda2f7a86c7e110c0d212..d4adacff205f6c6d94f2c7376485ac259aa94d61 100644
+index 49f962bbbce22dd26555ee2092ceff96e82aa6b2..ef0522feaa1cc9704f778309c1e6cf1d68379376 100644
--- a/net/minecraft/world/entity/monster/creaking/Creaking.java
+++ b/net/minecraft/world/entity/monster/creaking/Creaking.java
-@@ -131,6 +131,18 @@ public class Creaking extends Monster {
+@@ -132,6 +132,18 @@ public class Creaking extends Monster {
}
// Purpur end - Configurable entity base attributes
@@ -174,7 +174,7 @@ index 91c6956311da3694cb3cda2f7a86c7e110c0d212..d4adacff205f6c6d94f2c7376485ac25
@Override
protected BodyRotationControl createBodyControl() {
return new Creaking.CreakingBodyRotationControl(this);
-@@ -234,7 +246,7 @@ public class Creaking extends Monster {
+@@ -235,7 +247,7 @@ public class Creaking extends Monster {
private int behaviorTick; // Leaf - Plazma - Add missing Pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -184,10 +184,10 @@ index 91c6956311da3694cb3cda2f7a86c7e110c0d212..d4adacff205f6c6d94f2c7376485ac25
CreakingAi.updateActivity(this);
}
diff --git a/net/minecraft/world/entity/monster/warden/Warden.java b/net/minecraft/world/entity/monster/warden/Warden.java
-index e5193d7320ea17e86b776c705ec45010019493d6..ed221514a407f1c07986d138a17c588a523d76b8 100644
+index a6109ac9d7f8a9aa4074b3e9504244b1d565a2d4..e0bd1268f77b7234331c9fea0b11b5b04a66a4ad 100644
--- a/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/net/minecraft/world/entity/monster/warden/Warden.java
-@@ -150,6 +150,23 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -148,6 +148,23 @@ public class Warden extends Monster implements VibrationSystem {
}
// Purpur end - Ridables
@@ -211,7 +211,7 @@ index e5193d7320ea17e86b776c705ec45010019493d6..ed221514a407f1c07986d138a17c588a
@Override
public Packet getAddEntityPacket(ServerEntity entity) {
return new ClientboundAddEntityPacket(this, entity, this.hasPose(Pose.EMERGING) ? 1 : 0);
-@@ -304,7 +321,7 @@ public class Warden extends Monster implements VibrationSystem {
+@@ -302,7 +319,7 @@ public class Warden extends Monster implements VibrationSystem {
private int behaviorTick = 0; // Pufferfish
@Override
protected void customServerAiStep(ServerLevel level) {
@@ -221,10 +221,10 @@ index e5193d7320ea17e86b776c705ec45010019493d6..ed221514a407f1c07986d138a17c588a
super.customServerAiStep(level);
if ((this.tickCount + this.getId()) % 120 == 0) {
diff --git a/net/minecraft/world/entity/vehicle/AbstractChestBoat.java b/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
-index 900c2fdd58da1ba6441f74175b6967b608248315..bf7f1338584d67ed93bd73f5de83a9811d08558f 100644
+index 04b8d4be8d7b36585041b5ff69251d4150e54cae..c73840d0a08366b2d2ee3286589ab4e4e03d122d 100644
--- a/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
+++ b/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
-@@ -27,7 +27,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
+@@ -28,7 +28,7 @@ import net.minecraft.world.level.storage.loot.LootTable;
public abstract class AbstractChestBoat extends AbstractBoat implements HasCustomInventoryScreen, ContainerEntity {
private static final int CONTAINER_SIZE = 27;
@@ -233,7 +233,7 @@ index 900c2fdd58da1ba6441f74175b6967b608248315..bf7f1338584d67ed93bd73f5de83a981
@Nullable
private ResourceKey lootTable;
private long lootTableSeed;
-@@ -111,7 +111,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
+@@ -108,7 +108,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
@Override
public int getContainerSize() {
@@ -243,10 +243,10 @@ index 900c2fdd58da1ba6441f74175b6967b608248315..bf7f1338584d67ed93bd73f5de83a981
@Override
diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java
-index 234f123959830cc2adb78b9dc8752906140e5b11..e0dceff32b47b334ddcb76271e3cf3ea0d27e5f1 100644
+index ed777b003140486fd5d8d1db7af770301e30bec9..31450de492fbfdd83608ae668072bebd525db566 100644
--- a/org/purpurmc/purpur/PurpurConfig.java
+++ b/org/purpurmc/purpur/PurpurConfig.java
-@@ -322,6 +322,7 @@ public class PurpurConfig {
+@@ -317,6 +317,7 @@ public class PurpurConfig {
}
public static int barrelRows = 3;
@@ -254,7 +254,7 @@ index 234f123959830cc2adb78b9dc8752906140e5b11..e0dceff32b47b334ddcb76271e3cf3ea
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;
public static boolean cryingObsidianValidForPortalFrame = false;
-@@ -365,6 +366,7 @@ public class PurpurConfig {
+@@ -360,6 +361,7 @@ public class PurpurConfig {
case 1 -> 9;
default -> 27;
});
@@ -263,10 +263,10 @@ index 234f123959830cc2adb78b9dc8752906140e5b11..e0dceff32b47b334ddcb76271e3cf3ea
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/org/purpurmc/purpur/PurpurWorldConfig.java b/org/purpurmc/purpur/PurpurWorldConfig.java
-index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86baa2b5df 100644
+index b3dd4862b9fa220f4aeabc3598169852f8b12482..a6370d8b7bb6e07c7e41beb78b1778351b41cde1 100644
--- a/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/org/purpurmc/purpur/PurpurWorldConfig.java
-@@ -1189,12 +1189,20 @@ public class PurpurWorldConfig {
+@@ -1184,12 +1184,20 @@ public class PurpurWorldConfig {
public boolean allayControllable = true;
public double allayMaxHealth = 20.0D;
public double allayScale = 1.0D;
@@ -287,7 +287,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean armadilloRidable = false;
-@@ -1349,6 +1357,10 @@ public class PurpurWorldConfig {
+@@ -1344,6 +1352,10 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
@@ -298,7 +298,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
private void camelSettings() {
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
-@@ -1358,6 +1370,10 @@ public class PurpurWorldConfig {
+@@ -1353,6 +1365,10 @@ public class PurpurWorldConfig {
camelMovementSpeedMin = getDouble("mobs.camel.attributes.movement_speed.min", camelMovementSpeedMin);
camelMovementSpeedMax = getDouble("mobs.camel.attributes.movement_speed.max", camelMovementSpeedMax);
camelBreedingTicks = getInt("mobs.camel.breeding-delay-ticks", camelBreedingTicks);
@@ -309,7 +309,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean catRidable = false;
-@@ -1504,12 +1520,20 @@ public class PurpurWorldConfig {
+@@ -1499,12 +1515,20 @@ public class PurpurWorldConfig {
public boolean creakingControllable = true;
public double creakingMaxHealth = 1.0D;
public double creakingScale = 1.0D;
@@ -330,7 +330,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean creeperRidable = false;
-@@ -1841,12 +1865,22 @@ public class PurpurWorldConfig {
+@@ -1836,12 +1860,22 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
@@ -353,7 +353,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean ghastRidable = false;
-@@ -2918,6 +2952,10 @@ public class PurpurWorldConfig {
+@@ -2936,6 +2970,10 @@ public class PurpurWorldConfig {
public double snifferMaxHealth = 14.0D;
public double snifferScale = 1.0D;
public int snifferBreedingTicks = 6000;
@@ -364,7 +364,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
private void snifferSettings() {
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
-@@ -2925,6 +2963,10 @@ public class PurpurWorldConfig {
+@@ -2943,6 +2981,10 @@ public class PurpurWorldConfig {
snifferMaxHealth = getDouble("mobs.sniffer.attributes.max_health", snifferMaxHealth);
snifferScale = Mth.clamp(getDouble("mobs.sniffer.attributes.scale", snifferScale), 0.0625D, 16.0D);
snifferBreedingTicks = getInt("mobs.sniffer.breeding-delay-ticks", snifferBreedingTicks);
@@ -375,7 +375,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean squidRidable = false;
-@@ -3026,10 +3068,20 @@ public class PurpurWorldConfig {
+@@ -3044,10 +3086,20 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
@@ -396,7 +396,7 @@ index 21765347d7a81f4111f23685f699286d5e5cccb6..8459f5b9bf548e51b85e753a4e65dd86
}
public boolean traderLlamaRidable = false;
-@@ -3263,10 +3315,20 @@ public class PurpurWorldConfig {
+@@ -3281,10 +3333,20 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;
diff --git a/leaf-server/minecraft-patches/features/0126-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch b/leaf-server/minecraft-patches/features/0126-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch
index 31cdb852..db472574 100644
--- a/leaf-server/minecraft-patches/features/0126-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch
+++ b/leaf-server/minecraft-patches/features/0126-SparklyPaper-Skip-distanceToSqr-call-in-ServerEntity.patch
@@ -11,10 +11,10 @@ The "distanceToSqr" call is a bit expensive, so avoiding it is pretty nice, arou
We could also check if the x,y,z coordinates are equal, but for now, let's just keep the identity check, which also helps us since Minecraft's code does reuse the original delta movement Vec3 object
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
-index 7fe21b10eefce56dde19baebf9cb6d2d0a8d73ec..b3fe9ea70148cdbefbdb617abaf81fe48ee26685 100644
+index b7581796dda77bca66c03e421f2a83a920f44ef1..4859433b0a4160e7ee0af4c2e750956f6ca07649 100644
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
-@@ -211,6 +211,7 @@ public class ServerEntity {
+@@ -215,6 +215,7 @@ public class ServerEntity {
if (this.entity.hasImpulse || this.trackDelta || this.entity instanceof LivingEntity && ((LivingEntity)this.entity).isFallFlying()) {
Vec3 deltaMovement = this.entity.getDeltaMovement();
@@ -22,7 +22,7 @@ index 7fe21b10eefce56dde19baebf9cb6d2d0a8d73ec..b3fe9ea70148cdbefbdb617abaf81fe4
double d = deltaMovement.distanceToSqr(this.lastSentMovement);
if (d > 1.0E-7 || d > 0.0 && deltaMovement.lengthSqr() == 0.0) {
this.lastSentMovement = deltaMovement;
-@@ -228,6 +229,7 @@ public class ServerEntity {
+@@ -232,6 +233,7 @@ public class ServerEntity {
this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.lastSentMovement));
}
}
diff --git a/leaf-server/minecraft-patches/features/0129-SparklyPaper-Optimize-canSee-checks.patch b/leaf-server/minecraft-patches/features/0128-SparklyPaper-Optimize-canSee-checks.patch
similarity index 95%
rename from leaf-server/minecraft-patches/features/0129-SparklyPaper-Optimize-canSee-checks.patch
rename to leaf-server/minecraft-patches/features/0128-SparklyPaper-Optimize-canSee-checks.patch
index 3103d67b..9d18069c 100644
--- a/leaf-server/minecraft-patches/features/0129-SparklyPaper-Optimize-canSee-checks.patch
+++ b/leaf-server/minecraft-patches/features/0128-SparklyPaper-Optimize-canSee-checks.patch
@@ -16,7 +16,7 @@ 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/net/minecraft/server/level/ChunkMap.java b/net/minecraft/server/level/ChunkMap.java
-index a95feb65b392a971ac570dd3fd771b6ff89a2684..c60b9e4076450de2157c1a3cf4f98cc2c19e4e6a 100644
+index 78040fb6b6fd168e62494d3953006bfb38c2909f..74d11e8983f12f6f33fe2eb3016730507e1031d4 100644
--- a/net/minecraft/server/level/ChunkMap.java
+++ b/net/minecraft/server/level/ChunkMap.java
@@ -1295,7 +1295,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
diff --git a/leaf-server/minecraft-patches/features/0130-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch b/leaf-server/minecraft-patches/features/0129-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
similarity index 93%
rename from leaf-server/minecraft-patches/features/0130-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
rename to leaf-server/minecraft-patches/features/0129-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
index 45316079..61118149 100644
--- a/leaf-server/minecraft-patches/features/0130-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
+++ b/leaf-server/minecraft-patches/features/0129-SparklyPaper-Allow-throttling-hopper-checks-if-the-t.patch
@@ -7,7 +7,7 @@ Subject: [PATCH] SparklyPaper: Allow throttling hopper checks if the target
Original project: https://github.com/SparklyPower/SparklyPaper
diff --git a/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
-index c2c7832fbb207ecfd23c7a086ef72db9648f48f9..0ea3fef7cccbbeac608e87313e809fbc045a1bdf 100644
+index 2a49f65a2ea13414099b636f463239ced4fbb5f6..9705149eee437ebca99687c47b294659b67375fe 100644
--- a/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -423,6 +423,11 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
diff --git a/leaf-server/minecraft-patches/features/0131-Polpot-Make-egg-and-snowball-can-knockback-player.patch b/leaf-server/minecraft-patches/features/0130-Polpot-Make-egg-and-snowball-can-knockback-player.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0131-Polpot-Make-egg-and-snowball-can-knockback-player.patch
rename to leaf-server/minecraft-patches/features/0130-Polpot-Make-egg-and-snowball-can-knockback-player.patch
diff --git a/leaf-server/minecraft-patches/features/0132-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch b/leaf-server/minecraft-patches/features/0131-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0132-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch
rename to leaf-server/minecraft-patches/features/0131-Redirect-vanilla-getProfiler-to-inactive-in-PathNavi.patch
diff --git a/leaf-server/minecraft-patches/features/0133-Remove-useless-creating-stats-json-bases-on-player-n.patch b/leaf-server/minecraft-patches/features/0132-Remove-useless-creating-stats-json-bases-on-player-n.patch
similarity index 85%
rename from leaf-server/minecraft-patches/features/0133-Remove-useless-creating-stats-json-bases-on-player-n.patch
rename to leaf-server/minecraft-patches/features/0132-Remove-useless-creating-stats-json-bases-on-player-n.patch
index 3128e960..43e479e1 100644
--- a/leaf-server/minecraft-patches/features/0133-Remove-useless-creating-stats-json-bases-on-player-n.patch
+++ b/leaf-server/minecraft-patches/features/0132-Remove-useless-creating-stats-json-bases-on-player-n.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove useless creating stats json bases on player name logic
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 4f8d925425bef31ed70501826ddb9ddd4ad5df72..33962beef40e9dcaf09d096735c7966b146665ab 100644
+index 70d394d8a257390af20bdea5895f7d8a74b16dec..f0c66fce913af9433d53572a3dd3fc31d512346b 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -1578,6 +1578,8 @@ public abstract class PlayerList {
+@@ -1574,6 +1574,8 @@ public abstract class PlayerList {
if (serverStatsCounter == null) {
File file = this.server.getWorldPath(LevelResource.PLAYER_STATS_DIR).toFile();
File file1 = new File(file, uuid + ".json");
@@ -17,7 +17,7 @@ index 4f8d925425bef31ed70501826ddb9ddd4ad5df72..33962beef40e9dcaf09d096735c7966b
if (!file1.exists()) {
File file2 = new File(file, displayName + ".json"); // CraftBukkit
Path path = file2.toPath();
-@@ -1585,6 +1587,8 @@ public abstract class PlayerList {
+@@ -1581,6 +1583,8 @@ public abstract class PlayerList {
file2.renameTo(file1);
}
}
diff --git a/leaf-server/minecraft-patches/features/0134-Improve-Purpur-AFK-system.patch b/leaf-server/minecraft-patches/features/0133-Improve-Purpur-AFK-system.patch
similarity index 91%
rename from leaf-server/minecraft-patches/features/0134-Improve-Purpur-AFK-system.patch
rename to leaf-server/minecraft-patches/features/0133-Improve-Purpur-AFK-system.patch
index c2d02781..8d495cb6 100644
--- a/leaf-server/minecraft-patches/features/0134-Improve-Purpur-AFK-system.patch
+++ b/leaf-server/minecraft-patches/features/0133-Improve-Purpur-AFK-system.patch
@@ -7,10 +7,10 @@ AFK command & command cooldown
AFK title message
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
-index eb600398e4802bb47231bbc0c55fb24ce24a6efb..54cc28bb1693be2077cb30d1dc85f9ae24a6c954 100644
+index 1dc009e85403fe0b6a68daefecfe5cb25ad263cd..de450f9ef03944b101b483126af6a778ae8a4d1d 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
-@@ -247,6 +247,7 @@ public class Commands {
+@@ -277,6 +277,7 @@ public class Commands {
StopCommand.register(this.dispatcher);
TransferCommand.register(this.dispatcher);
WhitelistCommand.register(this.dispatcher);
@@ -19,10 +19,10 @@ index eb600398e4802bb47231bbc0c55fb24ce24a6efb..54cc28bb1693be2077cb30d1dc85f9ae
org.purpurmc.purpur.command.DemoCommand.register(this.dispatcher); // Purpur - Add demo command
org.purpurmc.purpur.command.PingCommand.register(this.dispatcher); // Purpur - Add ping command
diff --git a/net/minecraft/server/level/ServerPlayer.java b/net/minecraft/server/level/ServerPlayer.java
-index f3fb661e2cbf8119264d113a06bcb7bb5150be91..034a946cd545d775188a4375a87c90d253ebdb08 100644
+index 8dabe3ca6f5c5b0cd5f5a3801e1cbd853520738e..b71b4db16ac8b42c0061f15db05d4315dd7fecb4 100644
--- a/net/minecraft/server/level/ServerPlayer.java
+++ b/net/minecraft/server/level/ServerPlayer.java
-@@ -2387,6 +2387,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2490,6 +2490,10 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
// Purpur start - AFK API
private boolean isAfk = false;
@@ -33,7 +33,7 @@ index f3fb661e2cbf8119264d113a06bcb7bb5150be91..034a946cd545d775188a4375a87c90d2
@Override
public void setAfk(boolean afk) {
-@@ -2424,6 +2428,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
+@@ -2527,6 +2531,18 @@ public class ServerPlayer extends Player implements ca.spottedleaf.moonrise.patc
String prefix = (split.length > 0 ? split[0] : "").replace(org.purpurmc.purpur.PurpurConfig.afkTabListPrefix, "");
String suffix = (split.length > 1 ? split[1] : "").replace(org.purpurmc.purpur.PurpurConfig.afkTabListSuffix, "");
if (afk) {
@@ -53,10 +53,10 @@ index f3fb661e2cbf8119264d113a06bcb7bb5150be91..034a946cd545d775188a4375a87c90d2
} else {
getBukkitEntity().setPlayerListName(prefix + scoreboardName + suffix, true);
diff --git a/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca053de70958 100644
+index 2eecf924618192e1b8cf3971ac6cc3c95ec7f235..1306f920b5908731d04004e1b180c3ac4ad0745d 100644
--- a/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -2327,6 +2327,7 @@ public class ServerGamePacketListenerImpl
+@@ -2361,6 +2361,7 @@ public class ServerGamePacketListenerImpl
@Override
public void handleChatCommand(ServerboundChatCommandPacket packet) {
@@ -64,7 +64,7 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
this.tryHandleChat(packet.command(), () -> {
// CraftBukkit start - SPIGOT-7346: Prevent disconnected players from executing commands
if (this.player.hasDisconnected()) {
-@@ -2335,7 +2336,7 @@ public class ServerGamePacketListenerImpl
+@@ -2369,7 +2370,7 @@ public class ServerGamePacketListenerImpl
// CraftBukkit end
this.performUnsignedChatCommand(packet.command());
this.detectRateSpam("/" + packet.command()); // Spigot
@@ -73,7 +73,7 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
}
private void performUnsignedChatCommand(String command) {
-@@ -2368,6 +2369,7 @@ public class ServerGamePacketListenerImpl
+@@ -2402,6 +2403,7 @@ public class ServerGamePacketListenerImpl
public void handleSignedChatCommand(ServerboundChatCommandSignedPacket packet) {
Optional optional = this.unpackAndApplyLastSeen(packet.lastSeenMessages());
if (!optional.isEmpty()) {
@@ -81,7 +81,7 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
this.tryHandleChat(packet.command(), () -> {
// CraftBukkit start - SPIGOT-7346: Prevent disconnected players from executing commands
if (this.player.hasDisconnected()) {
-@@ -2376,7 +2378,7 @@ public class ServerGamePacketListenerImpl
+@@ -2410,7 +2412,7 @@ public class ServerGamePacketListenerImpl
// CraftBukkit end
this.performSignedChatCommand(packet, optional.get());
this.detectRateSpam("/" + packet.command()); // Spigot
@@ -90,7 +90,7 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
}
}
-@@ -2483,12 +2485,17 @@ public class ServerGamePacketListenerImpl
+@@ -2517,12 +2519,17 @@ public class ServerGamePacketListenerImpl
return dispatcher.parse(command, this.player.createCommandSourceStack());
}
@@ -110,7 +110,7 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
this.player.resetLastActionTime();
// CraftBukkit start
if (sync) {
-@@ -2500,6 +2507,40 @@ public class ServerGamePacketListenerImpl
+@@ -2534,6 +2541,40 @@ public class ServerGamePacketListenerImpl
}
}
@@ -152,19 +152,19 @@ index 0bf9ead58e256dccd3c1e89bd08ebae9d630b49e..3c14d32ec9caf3dba9d99afe86a3ca05
synchronized (this.lastSeenMessages) {
Optional var10000;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 33962beef40e9dcaf09d096735c7966b146665ab..5d8b445d5b2762b2266c3e12b3423b9c2044ac7d 100644
+index f0c66fce913af9433d53572a3dd3fc31d512346b..84914c3245de053ba07b105e44f9d838fa3efc4c 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -673,6 +673,7 @@ public abstract class PlayerList {
+@@ -676,6 +676,7 @@ public abstract class PlayerList {
org.leavesmc.leaves.protocol.core.LeavesProtocolManager.handlePlayerLeave(player); // Leaves - protocol
// Paper end - Fix kick event leave message not being sent
org.purpurmc.purpur.task.BossBarTask.removeFromAll(player.getBukkitEntity()); // Purpur - Implement TPSBar
+ net.minecraft.server.network.ServerGamePacketListenerImpl.afkCooldown.remove(player.getBukkitEntity().getUniqueId()); // Leaf - Improve Purpur AFK system
- ServerLevel serverLevel = player.serverLevel();
+ ServerLevel serverLevel = player.level();
player.awardStat(Stats.LEAVE_GAME);
// CraftBukkit start - Quitting must be before we do final save of data, in case plugins need to modify it
diff --git a/org/purpurmc/purpur/PurpurConfig.java b/org/purpurmc/purpur/PurpurConfig.java
-index e0dceff32b47b334ddcb76271e3cf3ea0d27e5f1..ba206b753afe26a5b4c6a2fd1fc438d9a581c3dc 100644
+index 31450de492fbfdd83608ae668072bebd525db566..b83b4536ac756b797f6f2d14886372f01e91145c 100644
--- a/org/purpurmc/purpur/PurpurConfig.java
+++ b/org/purpurmc/purpur/PurpurConfig.java
@@ -175,6 +175,11 @@ public class PurpurConfig {
diff --git a/leaf-server/minecraft-patches/features/0135-Virtual-thread-for-chat-executor.patch b/leaf-server/minecraft-patches/features/0134-Virtual-thread-for-chat-executor.patch
similarity index 90%
rename from leaf-server/minecraft-patches/features/0135-Virtual-thread-for-chat-executor.patch
rename to leaf-server/minecraft-patches/features/0134-Virtual-thread-for-chat-executor.patch
index 00607b62..a1c6431b 100644
--- a/leaf-server/minecraft-patches/features/0135-Virtual-thread-for-chat-executor.patch
+++ b/leaf-server/minecraft-patches/features/0134-Virtual-thread-for-chat-executor.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Virtual thread for chat executor
diff --git a/net/minecraft/server/MinecraftServer.java b/net/minecraft/server/MinecraftServer.java
-index 2ecda6d2af7721113384c11d4a96a3b3cb082232..7f6dac89c98132645799b7976b972bf43f475fe8 100644
+index 534082a0441dcde9115652cb67dbc8310529ecee..5251e0b274ab5c182f89e52013a542c2b8f30304 100644
--- a/net/minecraft/server/MinecraftServer.java
+++ b/net/minecraft/server/MinecraftServer.java
-@@ -2663,7 +2663,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop void writeJsonWithCodec(Codec codec, T value, int maxLength) {
// Paper end - Adventure; add max length parameter
DataResult dataResult = codec.encodeStart(JsonOps.INSTANCE, value);
@@ -59,7 +59,7 @@ index b5afc05924ae899e020c303c8b86398e1d4ab8a0..73c2ed488c34cddbafdcbb6f2636264e
}
diff --git a/net/minecraft/network/protocol/status/ServerStatus.java b/net/minecraft/network/protocol/status/ServerStatus.java
-index 094d1821d298fc228270b2d6cf0445949434f3e2..21334ae4764740e5cf1382726d5f5231fa220d5d 100644
+index a491be4250de3199c3e1aa9e5482b568692bd2f5..5db038df25a1b5bf2f7395464250dc0bbf8d8241 100644
--- a/net/minecraft/network/protocol/status/ServerStatus.java
+++ b/net/minecraft/network/protocol/status/ServerStatus.java
@@ -23,7 +23,10 @@ public record ServerStatus(
@@ -91,10 +91,10 @@ index 094d1821d298fc228270b2d6cf0445949434f3e2..21334ae4764740e5cf1382726d5f5231
public record Favicon(byte[] iconBytes) {
diff --git a/net/minecraft/server/dedicated/DedicatedServer.java b/net/minecraft/server/dedicated/DedicatedServer.java
-index cdfb9004dd4f4ea1bbb77895b7fc020d628c485d..54910c2e1d6e6bb556e536fda060bd09402e04e8 100644
+index 87fc8861948b50361ec04c5a23406d3abdec6eac..77f11179836636424927843f5f10c3fd23d2b2d4 100644
--- a/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/net/minecraft/server/dedicated/DedicatedServer.java
-@@ -616,6 +616,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
+@@ -614,6 +614,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override
public boolean enforceSecureProfile() {
@@ -103,10 +103,10 @@ index cdfb9004dd4f4ea1bbb77895b7fc020d628c485d..54910c2e1d6e6bb556e536fda060bd09
// Paper start - Add setting for proxy online mode status
return properties.enforceSecureProfile
diff --git a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-index 4d48ffeecba7fc4b53dad5f0a4d9c1bb8eac50c1..18f0d486c478087f404d8bb6cd840079e2c8d239 100644
+index 169d039a00339fc8eeb697ba03808f321ed4ad4c..23fefdc7122ff8e195c27651dc3a83000f62a95e 100644
--- a/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
-@@ -328,10 +328,30 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
+@@ -371,10 +371,30 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
public void send(Packet> packet) {
@@ -125,10 +125,10 @@ index 4d48ffeecba7fc4b53dad5f0a4d9c1bb8eac50c1..18f0d486c478087f404d8bb6cd840079
this.send(packet, null);
}
- public void send(Packet> packet, @Nullable PacketSendListener listener) {
+ public void send(Packet> packet, @Nullable ChannelFutureListener channelFutureListener) {
+ // Leaf start - Mirai - Configurable chat message signatures
+ if (!org.dreeam.leaf.config.modules.network.ChatMessageSignature.enabled) {
-+ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && listener != null) {
++ if (packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket chat && channelFutureListener != null) {
+ this.send(chat);
+ return;
+ }
@@ -138,10 +138,10 @@ index 4d48ffeecba7fc4b53dad5f0a4d9c1bb8eac50c1..18f0d486c478087f404d8bb6cd840079
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index 5d8b445d5b2762b2266c3e12b3423b9c2044ac7d..a829c7b293be5ddc5165a86df1251b10fd6f8650 100644
+index 84914c3245de053ba07b105e44f9d838fa3efc4c..e4543611016a648314459144e43565300153f0fe 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -1538,7 +1538,7 @@ public abstract class PlayerList {
+@@ -1534,7 +1534,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate shouldFilterMessageTo, @Nullable ServerPlayer sender, ChatType.Bound boundChatType, @Nullable Function unsignedFunction) {
// Paper end
boolean flag = this.verifyChatTrusted(message);
@@ -150,7 +150,7 @@ index 5d8b445d5b2762b2266c3e12b3423b9c2044ac7d..a829c7b293be5ddc5165a86df1251b10
OutgoingChatMessage outgoingChatMessage = OutgoingChatMessage.create(message);
boolean flag1 = false;
-@@ -1563,6 +1563,7 @@ public abstract class PlayerList {
+@@ -1559,6 +1559,7 @@ public abstract class PlayerList {
}
public boolean verifyChatTrusted(PlayerChatMessage message) {
diff --git a/leaf-server/minecraft-patches/features/0138-Cache-player-profileResult.patch b/leaf-server/minecraft-patches/features/0137-Cache-player-profileResult.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0138-Cache-player-profileResult.patch
rename to leaf-server/minecraft-patches/features/0137-Cache-player-profileResult.patch
diff --git a/leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed.patch b/leaf-server/minecraft-patches/features/0138-Matter-Secure-Seed.patch
similarity index 96%
rename from leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed.patch
rename to leaf-server/minecraft-patches/features/0138-Matter-Secure-Seed.patch
index 2452640d..760f4b9a 100644
--- a/leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed.patch
+++ b/leaf-server/minecraft-patches/features/0138-Matter-Secure-Seed.patch
@@ -13,10 +13,10 @@ Co-authored-by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
Co-authored-by: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
diff --git a/net/minecraft/server/dedicated/DedicatedServerProperties.java b/net/minecraft/server/dedicated/DedicatedServerProperties.java
-index 5748658abf0b90812005ae9d426df92daf5532f0..4a0eed7d7645ed539857592d233214e9a74499f1 100644
+index b286dc17cda16fca3af9374d2a4a8bd137c24450..72028edf5bbe8094779139c4a52da2a95fef10e8 100644
--- a/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/net/minecraft/server/dedicated/DedicatedServerProperties.java
-@@ -114,7 +114,17 @@ public class DedicatedServerProperties extends Settings GsonHelper.parse(!property.isEmpty() ? property : "{}"), new JsonObject()),
this.get("level-type", property -> property.toLowerCase(Locale.ROOT), WorldPresets.NORMAL.location().toString())
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
-index e67196b815dad6baa823822285cff83848e549ce..ac7b4625ed9ec94ca438b6fedcd3e6bb6414b157 100644
+index 4979171c8da6f366aab636fb3058ca457fe75061..91574985958950dffe0f393d7dfac4818af3b151 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
-@@ -674,6 +674,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
+@@ -675,6 +675,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
}
public ChunkGenerator getGenerator() {
@@ -48,10 +48,10 @@ index e67196b815dad6baa823822285cff83848e549ce..ac7b4625ed9ec94ca438b6fedcd3e6bb
}
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 9b193bf81cf7f9f45dfa207a826043e083c2f8ba..11e8738b7cf388e0742bfe5e6136365f6ac066f9 100644
+index 2cf0fa70ae3d7675cac3cf7a0002097b4e773fe1..d57a3a9b8ebd2f5d381336a0b5e81d71e2de6530 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -625,6 +625,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -628,6 +628,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
chunkGenerator = new org.bukkit.craftbukkit.generator.CustomChunkGenerator(this, chunkGenerator, gen);
}
// CraftBukkit end
@@ -60,10 +60,10 @@ index 9b193bf81cf7f9f45dfa207a826043e083c2f8ba..11e8738b7cf388e0742bfe5e6136365f
DataFixer fixerUpper = server.getFixerUpper();
// Paper - rewrite chunk system
diff --git a/net/minecraft/world/entity/monster/Slime.java b/net/minecraft/world/entity/monster/Slime.java
-index 9a157a2bdbbeab89dbfcd23be8bdc62c8de4548c..c257a19ff6b15ee6a83e9c946e2b20309ada9b51 100644
+index b299fc08fe900b4d48ce3e6986bcea000253053e..2885d4271405409ad2a681ea13aadf383a3520ca 100644
--- a/net/minecraft/world/entity/monster/Slime.java
+++ b/net/minecraft/world/entity/monster/Slime.java
-@@ -412,7 +412,11 @@ public class Slime extends Mob implements Enemy {
+@@ -413,7 +413,11 @@ public class Slime extends Mob implements Enemy {
}
ChunkPos chunkPos = new ChunkPos(pos);
@@ -77,10 +77,10 @@ index 9a157a2bdbbeab89dbfcd23be8bdc62c8de4548c..c257a19ff6b15ee6a83e9c946e2b2030
final double maxHeightSlimeChunk = level.getMinecraftWorld().paperConfig().entities.spawning.slimeSpawnHeight.slimeChunk.maximum;
if (random.nextInt(10) == 0 && flag && pos.getY() < maxHeightSlimeChunk) {
diff --git a/net/minecraft/world/level/chunk/ChunkAccess.java b/net/minecraft/world/level/chunk/ChunkAccess.java
-index 3b7f0d5fe40bdda65ab859a0c22bf0d369dc0f01..6683df8d0f5a61ab094393f761a3d3a22d6e0455 100644
+index 182c14b660f8860bed627eed4e01fd4002153e9a..686c031ec73acc80683aaa39a78fe9221f0215a6 100644
--- a/net/minecraft/world/level/chunk/ChunkAccess.java
+++ b/net/minecraft/world/level/chunk/ChunkAccess.java
-@@ -87,6 +87,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
+@@ -88,6 +88,10 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
public org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.DirtyCraftPersistentDataContainer(ChunkAccess.DATA_TYPE_REGISTRY);
// CraftBukkit end
public final Registry biomeRegistry; // CraftBukkit
@@ -91,7 +91,7 @@ index 3b7f0d5fe40bdda65ab859a0c22bf0d369dc0f01..6683df8d0f5a61ab094393f761a3d3a2
// Paper start - rewrite chunk system
private volatile ca.spottedleaf.moonrise.patches.starlight.light.SWMRNibbleArray[] blockNibbles;
-@@ -191,6 +195,17 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
+@@ -192,6 +196,17 @@ public abstract class ChunkAccess implements BiomeManager.NoiseBiomeSource, Ligh
return GameEventListenerRegistry.NOOP;
}
diff --git a/leaf-server/minecraft-patches/features/0140-Matter-Secure-Seed-command.patch b/leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed-command.patch
similarity index 64%
rename from leaf-server/minecraft-patches/features/0140-Matter-Secure-Seed-command.patch
rename to leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed-command.patch
index e612d244..25980dd3 100644
--- a/leaf-server/minecraft-patches/features/0140-Matter-Secure-Seed-command.patch
+++ b/leaf-server/minecraft-patches/features/0139-Matter-Secure-Seed-command.patch
@@ -7,24 +7,22 @@ Original license: GPLv3
Original project: https://github.com/plasmoapp/matter
diff --git a/net/minecraft/server/commands/SeedCommand.java b/net/minecraft/server/commands/SeedCommand.java
-index a65affc41a4fc299bc2281f0f53f2e075633899d..18dd6fa908104ea9fbb32faaca0725d4d6849b09 100644
+index 7c1e18d8362be5ae885c32b05e98b9ef45942d93..e54ed64059956555767c0c01057a8319e671b1d2 100644
--- a/net/minecraft/server/commands/SeedCommand.java
+++ b/net/minecraft/server/commands/SeedCommand.java
-@@ -12,6 +12,17 @@ public class SeedCommand {
- long seed = context.getSource().getLevel().getSeed();
+@@ -12,6 +12,15 @@ public class SeedCommand {
+ long seed = commandContext.getSource().getLevel().getSeed();
Component component = ComponentUtils.copyOnClickText(String.valueOf(seed));
- context.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
-+
+ commandContext.getSource().sendSuccess(() -> Component.translatable("commands.seed.success", component), false);
+ // Leaf start - Matter - Secure Seed command
+ if (org.dreeam.leaf.config.modules.misc.SecureSeed.enabled) {
-+ su.plo.matter.Globals.setupGlobals(context.getSource().getLevel());
++ su.plo.matter.Globals.setupGlobals(commandContext.getSource().getLevel());
+ String seedStr = su.plo.matter.Globals.seedToString(su.plo.matter.Globals.worldSeed);
+ Component featureSeedComponent = ComponentUtils.copyOnClickText(seedStr);
+
-+ context.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
++ commandContext.getSource().sendSuccess(() -> Component.translatable(("Feature seed: %s"), featureSeedComponent), false);
+ }
+ // Leaf end - Matter - Secure Seed command
-+
return (int)seed;
}));
}
diff --git a/leaf-server/minecraft-patches/features/0141-Faster-random-generator.patch b/leaf-server/minecraft-patches/features/0140-Faster-random-generator.patch
similarity index 98%
rename from leaf-server/minecraft-patches/features/0141-Faster-random-generator.patch
rename to leaf-server/minecraft-patches/features/0140-Faster-random-generator.patch
index 5a3bac6e..4818423e 100644
--- a/leaf-server/minecraft-patches/features/0141-Faster-random-generator.patch
+++ b/leaf-server/minecraft-patches/features/0140-Faster-random-generator.patch
@@ -14,7 +14,7 @@ ThreadUnsafeRandom (Moonrise): 102,265,100 ns
SimpleThreadUnsafeRandom (Moonrise): 97,054,600 ns
diff --git a/net/minecraft/server/level/ServerChunkCache.java b/net/minecraft/server/level/ServerChunkCache.java
-index ac7b4625ed9ec94ca438b6fedcd3e6bb6414b157..6d5a15122079f2d1568ceb7086db21ad454f58e6 100644
+index 91574985958950dffe0f393d7dfac4818af3b151..eaaa66c4d86d4ebda0acf8f1dbe8ecb55aa28285 100644
--- a/net/minecraft/server/level/ServerChunkCache.java
+++ b/net/minecraft/server/level/ServerChunkCache.java
@@ -154,7 +154,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
@@ -27,10 +27,10 @@ index ac7b4625ed9ec94ca438b6fedcd3e6bb6414b157..6d5a15122079f2d1568ceb7086db21ad
final ServerLevel world = this.level;
final int randomTickSpeed = world.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
diff --git a/net/minecraft/server/level/ServerLevel.java b/net/minecraft/server/level/ServerLevel.java
-index 11e8738b7cf388e0742bfe5e6136365f6ac066f9..16cafa0acb7b2972ce08ab56921e73eb44eff6fa 100644
+index d57a3a9b8ebd2f5d381336a0b5e81d71e2de6530..08d12a1acc3a672a77daa15f82392cd603c30283 100644
--- a/net/minecraft/server/level/ServerLevel.java
+++ b/net/minecraft/server/level/ServerLevel.java
-@@ -891,7 +891,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -895,7 +895,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
private void optimiseRandomTick(final LevelChunk chunk, final int tickSpeed) {
final LevelChunkSection[] sections = chunk.getSections();
final int minSection = ca.spottedleaf.moonrise.common.util.WorldUtil.getMinSection((ServerLevel)(Object)this);
@@ -39,7 +39,7 @@ index 11e8738b7cf388e0742bfe5e6136365f6ac066f9..16cafa0acb7b2972ce08ab56921e73eb
final boolean doubleTickFluids = !ca.spottedleaf.moonrise.common.PlatformHooks.get().configFixMC224294();
final ChunkPos cpos = chunk.getPos();
-@@ -940,7 +940,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
+@@ -944,7 +944,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
private int currentIceAndSnowTick = 0; protected void resetIceAndSnowTick() { this.currentIceAndSnowTick = this.simpleRandom.nextInt(16); } // Gale - Airplane - optimize random calls in chunk ticking
public void tickChunk(LevelChunk chunk, int randomTickSpeed) {
@@ -97,10 +97,10 @@ index 8516d47b0ba79d91638837199e7ae0fb6cb44a79..4f4b55dd099dd2c2fea118b18b535881
RandomSource fork();
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
-index d4a7cabf25b3ba2b085c68a3a7ed73a072c5e7fa..ddaaf29305a9cdb6dcccd38d4ec37fac6f0a1a51 100644
+index 0cdd3eb97e74aa3955f014a1f8f6a7d1580d323f..574be7359a2ad62c95a42c46c7a0f3c7a42eb44e 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
-@@ -149,7 +149,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
+@@ -155,7 +155,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
}
// Paper start - Share random for entities to make them more random
@@ -110,7 +110,7 @@ index d4a7cabf25b3ba2b085c68a3a7ed73a072c5e7fa..ddaaf29305a9cdb6dcccd38d4ec37fac
private static final class RandomRandomSource extends ca.spottedleaf.moonrise.common.util.ThreadUnsafeRandom {
public RandomRandomSource() {
diff --git a/net/minecraft/world/level/Level.java b/net/minecraft/world/level/Level.java
-index 9ac2ecb78f6214616376b0e3badef21dc3f72114..f145453f70a219c1be33b241309ae2ab22a8004b 100644
+index 3bd42eb81eae3af9323021a5dc6edaa06dfcaead..8ebfb2f5cf439190ea9bd4ad81d737fbcd4514c2 100644
--- a/net/minecraft/world/level/Level.java
+++ b/net/minecraft/world/level/Level.java
@@ -117,7 +117,7 @@ public abstract class Level implements LevelAccessor, UUIDLookup, AutoCl
diff --git a/leaf-server/minecraft-patches/features/0142-Don-t-save-primed-tnt-entity.patch b/leaf-server/minecraft-patches/features/0141-Don-t-save-primed-tnt-entity.patch
similarity index 83%
rename from leaf-server/minecraft-patches/features/0142-Don-t-save-primed-tnt-entity.patch
rename to leaf-server/minecraft-patches/features/0141-Don-t-save-primed-tnt-entity.patch
index 8060b7c7..a5c28e0d 100644
--- a/leaf-server/minecraft-patches/features/0142-Don-t-save-primed-tnt-entity.patch
+++ b/leaf-server/minecraft-patches/features/0141-Don-t-save-primed-tnt-entity.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't save primed tnt entity
diff --git a/net/minecraft/world/entity/item/PrimedTnt.java b/net/minecraft/world/entity/item/PrimedTnt.java
-index 9a00aead39e194de076ee651d2f75b29673cad1e..36e3937c9e09852937c94c268c877a15337835c5 100644
+index ef070f8a9ab3a4676e2141f7c0bc20a000d0cc3a..1acfc005260628cc70ebf063acc92fb2904d7794 100644
--- a/net/minecraft/world/entity/item/PrimedTnt.java
+++ b/net/minecraft/world/entity/item/PrimedTnt.java
-@@ -281,4 +281,11 @@ public class PrimedTnt extends Entity implements TraceableEntity {
+@@ -266,4 +266,11 @@ public class PrimedTnt extends Entity implements TraceableEntity {
return super.interact(player, hand);
}
// Purpur end - Shears can defuse TNT
diff --git a/leaf-server/minecraft-patches/features/0143-Don-t-save-falling-block-entity.patch b/leaf-server/minecraft-patches/features/0142-Don-t-save-falling-block-entity.patch
similarity index 85%
rename from leaf-server/minecraft-patches/features/0143-Don-t-save-falling-block-entity.patch
rename to leaf-server/minecraft-patches/features/0142-Don-t-save-falling-block-entity.patch
index b8c6533c..9a5c8158 100644
--- a/leaf-server/minecraft-patches/features/0143-Don-t-save-falling-block-entity.patch
+++ b/leaf-server/minecraft-patches/features/0142-Don-t-save-falling-block-entity.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Don't save falling block entity
diff --git a/net/minecraft/world/entity/item/FallingBlockEntity.java b/net/minecraft/world/entity/item/FallingBlockEntity.java
-index 31edd0d45ac6c38887e4cebffe5a7cf377b47466..149d5845480c03fe4e29b09cac7fcd1bec147507 100644
+index 595dee03e3a7d98d703e48fb53d82d7f392a2b3d..c99ddedaf25a009f0d19f97d01e7545b0c59aee2 100644
--- a/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/net/minecraft/world/entity/item/FallingBlockEntity.java
-@@ -385,4 +385,11 @@ public class FallingBlockEntity extends Entity {
+@@ -390,4 +390,11 @@ public class FallingBlockEntity extends Entity {
this.forceTickAfterTeleportToDuplicate = entity != null && flag && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.allowUnsafeEndPortalTeleportation; // Paper
return entity;
}
diff --git a/leaf-server/minecraft-patches/features/0144-Configurable-connection-message.patch b/leaf-server/minecraft-patches/features/0143-Configurable-connection-message.patch
similarity index 68%
rename from leaf-server/minecraft-patches/features/0144-Configurable-connection-message.patch
rename to leaf-server/minecraft-patches/features/0143-Configurable-connection-message.patch
index d978ce03..4fd491fe 100644
--- a/leaf-server/minecraft-patches/features/0144-Configurable-connection-message.patch
+++ b/leaf-server/minecraft-patches/features/0143-Configurable-connection-message.patch
@@ -5,28 +5,28 @@ Subject: [PATCH] Configurable connection message
diff --git a/net/minecraft/server/players/PlayerList.java b/net/minecraft/server/players/PlayerList.java
-index a829c7b293be5ddc5165a86df1251b10fd6f8650..8b7b60e2f143dcbb44f3084c3c4d2306b9708f0d 100644
+index e4543611016a648314459144e43565300153f0fe..70bec2fc50c1e6a928e450e617e76dd4434172f9 100644
--- a/net/minecraft/server/players/PlayerList.java
+++ b/net/minecraft/server/players/PlayerList.java
-@@ -438,7 +438,7 @@ public abstract class PlayerList {
- // Ensure that player inventory is populated with its viewer
- player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
+@@ -439,7 +439,7 @@ public abstract class PlayerList {
+ // Ensure that player inventory is populated with its viewer
+ player.containerMenu.transferTo(player.containerMenu, bukkitPlayer);
-- org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, io.papermc.paper.adventure.PaperAdventure.asAdventure(mutableComponent)); // Paper - Adventure
-+ org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, getJoinMsg(mutableComponent, bukkitPlayer)); // Paper - Adventure // Leaf - Configurable connection message - join message
- this.cserver.getPluginManager().callEvent(playerJoinEvent);
+- org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, io.papermc.paper.adventure.PaperAdventure.asAdventure(mutableComponent)); // Paper - Adventure
++ org.bukkit.event.player.PlayerJoinEvent playerJoinEvent = new org.bukkit.event.player.PlayerJoinEvent(bukkitPlayer, getJoinMsg(mutableComponent, bukkitPlayer)); // Paper - Adventure // Leaf - Configurable connection message - join message
+ this.cserver.getPluginManager().callEvent(playerJoinEvent);
- if (!player.connection.isAcceptingMessages()) {
-@@ -452,7 +452,7 @@ public abstract class PlayerList {
+ if (!player.connection.isAcceptingMessages()) {
+@@ -453,7 +453,7 @@ public abstract class PlayerList {
- final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
+ final net.kyori.adventure.text.Component jm = playerJoinEvent.joinMessage();
-- if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
-+ if (org.dreeam.leaf.config.modules.misc.ConnectionMessage.joinEnabled && jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure // Leaf - Configurable connection message - join message
- joinMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(jm); // Paper - Adventure
- this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure
- }
-@@ -682,7 +682,7 @@ public abstract class PlayerList {
+- if (jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure
++ if (org.dreeam.leaf.config.modules.misc.ConnectionMessage.joinEnabled && jm != null && !jm.equals(net.kyori.adventure.text.Component.empty())) { // Paper - Adventure // Leaf - Configurable connection message - join message
+ joinMessage = io.papermc.paper.adventure.PaperAdventure.asVanilla(jm); // Paper - Adventure
+ this.server.getPlayerList().broadcastSystemMessage(joinMessage, false); // Paper - Adventure
+ }
+@@ -685,7 +685,7 @@ public abstract class PlayerList {
player.closeContainer(org.bukkit.event.inventory.InventoryCloseEvent.Reason.DISCONNECT); // Paper - Inventory close reason
}
@@ -35,7 +35,7 @@ index a829c7b293be5ddc5165a86df1251b10fd6f8650..8b7b60e2f143dcbb44f3084c3c4d2306
this.cserver.getPluginManager().callEvent(playerQuitEvent);
player.getBukkitEntity().disconnect(playerQuitEvent.getQuitMessage());
-@@ -1691,4 +1691,40 @@ public abstract class PlayerList {
+@@ -1687,4 +1687,40 @@ public abstract class PlayerList {
public boolean isAllowCommandsForAllPlayers() {
return this.allowCommandsForAllPlayers;
}
diff --git a/leaf-server/minecraft-patches/features/0145-Configurable-unknown-command-message.patch b/leaf-server/minecraft-patches/features/0144-Configurable-unknown-command-message.patch
similarity index 93%
rename from leaf-server/minecraft-patches/features/0145-Configurable-unknown-command-message.patch
rename to leaf-server/minecraft-patches/features/0144-Configurable-unknown-command-message.patch
index 6385c426..26912e28 100644
--- a/leaf-server/minecraft-patches/features/0145-Configurable-unknown-command-message.patch
+++ b/leaf-server/minecraft-patches/features/0144-Configurable-unknown-command-message.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Configurable unknown command message
diff --git a/net/minecraft/commands/Commands.java b/net/minecraft/commands/Commands.java
-index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b11aa95552 100644
+index de450f9ef03944b101b483126af6a778ae8a4d1d..d201c3965d5a55de740175c140bc7ee411f1be78 100644
--- a/net/minecraft/commands/Commands.java
+++ b/net/minecraft/commands/Commands.java
-@@ -403,31 +403,8 @@ public class Commands {
+@@ -405,31 +405,8 @@ public class Commands {
// Paper start - Add UnknownCommandEvent
final net.kyori.adventure.text.TextComponent.Builder builder = net.kyori.adventure.text.Component.text();
// source.sendFailure(ComponentUtils.fromMessage(var7.getRawMessage()));
@@ -18,7 +18,7 @@ index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b1
- int min = Math.min(var7.getInput().length(), var7.getCursor());
- MutableComponent mutableComponent = Component.empty()
- .withStyle(ChatFormatting.GRAY)
-- .withStyle(style -> style.withClickEvent(new ClickEvent.SuggestCommand("/" + label))); // CraftBukkit // Paper
+- .withStyle(style -> style.withClickEvent(new ClickEvent.SuggestCommand("/" + command)));
- if (min > 10) {
- mutableComponent.append(CommonComponents.ELLIPSIS);
- }
@@ -37,22 +37,22 @@ index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b1
- .append(io.papermc.paper.adventure.PaperAdventure.asAdventure(mutableComponent));
- }
- org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(source.getBukkitSender(), command, org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty() ? null : builder.build());
-+ org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(source.getBukkitSender(), command, getUnknownCommandMessage(builder, var7, label)); // Leaf - Configurable unknown command message
++ org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(source.getBukkitSender(), command, getUnknownCommandMessage(builder, var7, command)); // Leaf - Configurable unknown command message
org.bukkit.Bukkit.getServer().getPluginManager().callEvent(event);
if (event.message() != null) {
source.sendFailure(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.message()), false);
-@@ -678,6 +655,92 @@ public class Commands {
+@@ -663,6 +640,92 @@ public class Commands {
};
}
+ // Leaf start - Configurable unknown command message
+ private static net.kyori.adventure.text.Component getUnknownCommandMessage(
-+ net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException commandSyntaxException, String label
++ net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException commandSyntaxException, String command
+ ) {
+ String rawMessage = org.dreeam.leaf.config.modules.misc.UnknownCommandMessage.unknownCommandMessage;
+
+ if ("default".equals(rawMessage)) {
-+ return getVanillaUnknownCommandMessage(builder, commandSyntaxException, label);
++ return getVanillaUnknownCommandMessage(builder, commandSyntaxException, command);
+ }
+
+ net.kyori.adventure.text.Component messageComponent = null;
@@ -71,7 +71,7 @@ index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b1
+ final net.kyori.adventure.text.Component context = net.kyori.adventure.text.Component.translatable("command.context.here")
+ .color(net.kyori.adventure.text.format.NamedTextColor.RED)
+ .decorate(net.kyori.adventure.text.format.TextDecoration.ITALIC);
-+ final net.kyori.adventure.text.event.ClickEvent event = net.kyori.adventure.text.event.ClickEvent.suggestCommand("/" + label);
++ final net.kyori.adventure.text.event.ClickEvent event = net.kyori.adventure.text.event.ClickEvent.suggestCommand("/" + command);
+
+ detail.color(net.kyori.adventure.text.format.NamedTextColor.GRAY);
+
@@ -100,7 +100,7 @@ index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b1
+ }
+
+ private static net.kyori.adventure.text.Component getVanillaUnknownCommandMessage(
-+ net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException var7, String label
++ net.kyori.adventure.text.TextComponent.Builder builder, CommandSyntaxException var7, String command
+ ) {
+ builder.color(net.kyori.adventure.text.format.NamedTextColor.RED).append(io.papermc.paper.command.brigadier.MessageComponentSerializer.message().deserialize(var7.getRawMessage()));
+
@@ -108,7 +108,7 @@ index 54cc28bb1693be2077cb30d1dc85f9ae24a6c954..1e84f726f23877ed4be1aa901d7df0b1
+ int min = Math.min(var7.getInput().length(), var7.getCursor());
+ MutableComponent mutableComponent = Component.empty()
+ .withStyle(ChatFormatting.GRAY)
-+ .withStyle(style -> style.withClickEvent(new ClickEvent.SuggestCommand("/" + label))); // CraftBukkit // Paper
++ .withStyle(style -> style.withClickEvent(new ClickEvent.SuggestCommand("/" + command)));
+ if (min > 10) {
+ mutableComponent.append(CommonComponents.ELLIPSIS);
+ }
diff --git a/leaf-server/minecraft-patches/features/0146-Remove-stream-in-BlockBehaviour-cache-blockstate.patch b/leaf-server/minecraft-patches/features/0145-Remove-stream-in-BlockBehaviour-cache-blockstate.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0146-Remove-stream-in-BlockBehaviour-cache-blockstate.patch
rename to leaf-server/minecraft-patches/features/0145-Remove-stream-in-BlockBehaviour-cache-blockstate.patch
diff --git a/leaf-server/minecraft-patches/features/0147-Remove-stream-in-entity-visible-effects-filter.patch b/leaf-server/minecraft-patches/features/0146-Remove-stream-in-entity-visible-effects-filter.patch
similarity index 86%
rename from leaf-server/minecraft-patches/features/0147-Remove-stream-in-entity-visible-effects-filter.patch
rename to leaf-server/minecraft-patches/features/0146-Remove-stream-in-entity-visible-effects-filter.patch
index eb2dd953..274d4b32 100644
--- a/leaf-server/minecraft-patches/features/0147-Remove-stream-in-entity-visible-effects-filter.patch
+++ b/leaf-server/minecraft-patches/features/0146-Remove-stream-in-entity-visible-effects-filter.patch
@@ -5,10 +5,10 @@ Subject: [PATCH] Remove stream in entity visible effects filter
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index 09aa0b344aff0c48eec9a296d47c0704bd0fdc5c..fdbe3d4d71ba30c8330760555e97ff436643a7a9 100644
+index 97098f05dda8a46716162dd0330ca60d30814999..1d60ff59942680e9993d875505db0dfb8d7a5f96 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -988,12 +988,15 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1013,12 +1013,15 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
}
private void updateSynchronizedMobEffectParticles() {
diff --git a/leaf-server/minecraft-patches/features/0148-Remove-stream-and-double-iteration-in-enough-deep-sl.patch b/leaf-server/minecraft-patches/features/0147-Remove-stream-and-double-iteration-in-enough-deep-sl.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0148-Remove-stream-and-double-iteration-in-enough-deep-sl.patch
rename to leaf-server/minecraft-patches/features/0147-Remove-stream-and-double-iteration-in-enough-deep-sl.patch
diff --git a/leaf-server/minecraft-patches/features/0149-Remove-stream-in-trial-spawner-ticking.patch b/leaf-server/minecraft-patches/features/0148-Remove-stream-in-trial-spawner-ticking.patch
similarity index 93%
rename from leaf-server/minecraft-patches/features/0149-Remove-stream-in-trial-spawner-ticking.patch
rename to leaf-server/minecraft-patches/features/0148-Remove-stream-in-trial-spawner-ticking.patch
index c469f856..3a0d3410 100644
--- a/leaf-server/minecraft-patches/features/0149-Remove-stream-in-trial-spawner-ticking.patch
+++ b/leaf-server/minecraft-patches/features/0148-Remove-stream-in-trial-spawner-ticking.patch
@@ -5,14 +5,14 @@ Subject: [PATCH] Remove stream in trial spawner ticking
diff --git a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
-index 6b3d92e76a16358c89ee07e1970c764ba4a8e2dc..5edc7278387c3fc61909582ebf34e905abc68fc4 100644
+index 3e3380dfe8fde979f0d843813583d6f07efb96c4..f4b092e3c81f692aa4632e116960e71eb084bdc8 100644
--- a/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
+++ b/net/minecraft/world/level/block/entity/trialspawner/TrialSpawnerState.java
@@ -173,17 +173,21 @@ public enum TrialSpawnerState implements StringRepresentable {
}
- private static Optional calculatePositionToSpawnSpawner(ServerLevel level, BlockPos pos, TrialSpawner spawner, TrialSpawnerData spawnerData) {
-- List list = spawnerData.detectedPlayers
+ private static Optional calculatePositionToSpawnSpawner(ServerLevel level, BlockPos pos, TrialSpawner spawner, TrialSpawnerStateData data) {
+- List list = data.detectedPlayers
- .stream()
- .map(level::getPlayerByUUID)
- .filter(Objects::nonNull)
@@ -26,7 +26,7 @@ index 6b3d92e76a16358c89ee07e1970c764ba4a8e2dc..5edc7278387c3fc61909582ebf34e905
+ // Leaf start - Remove stream in trial spawner ticking
+ List list = new java.util.ArrayList<>();
+
-+ for (UUID uuid : spawnerData.detectedPlayers) {
++ for (UUID uuid : data.detectedPlayers) {
+ Player player = level.getPlayerByUUID(uuid);
+
+ if (player != null
@@ -78,4 +78,4 @@ index 6b3d92e76a16358c89ee07e1970c764ba4a8e2dc..5edc7278387c3fc61909582ebf34e905
+ // Leaf end - Remove stream in trial spawner ticking
}
- private boolean timeToSpawnItemSpawner(ServerLevel level, TrialSpawnerData spawnerData) {
+ private boolean timeToSpawnItemSpawner(ServerLevel level, TrialSpawnerStateData data) {
diff --git a/leaf-server/minecraft-patches/features/0150-Remove-stream-in-Brain.patch b/leaf-server/minecraft-patches/features/0149-Remove-stream-in-Brain.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0150-Remove-stream-in-Brain.patch
rename to leaf-server/minecraft-patches/features/0149-Remove-stream-in-Brain.patch
diff --git a/leaf-server/minecraft-patches/features/0151-Remove-stream-in-BehaviorUtils.patch b/leaf-server/minecraft-patches/features/0150-Remove-stream-in-BehaviorUtils.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0151-Remove-stream-in-BehaviorUtils.patch
rename to leaf-server/minecraft-patches/features/0150-Remove-stream-in-BehaviorUtils.patch
diff --git a/leaf-server/minecraft-patches/features/0152-Remove-stream-in-YieldJobSite.patch b/leaf-server/minecraft-patches/features/0151-Remove-stream-in-YieldJobSite.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0152-Remove-stream-in-YieldJobSite.patch
rename to leaf-server/minecraft-patches/features/0151-Remove-stream-in-YieldJobSite.patch
diff --git a/leaf-server/minecraft-patches/features/0153-Remove-stream-in-PlayerSensor.patch b/leaf-server/minecraft-patches/features/0152-Remove-stream-in-PlayerSensor.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0153-Remove-stream-in-PlayerSensor.patch
rename to leaf-server/minecraft-patches/features/0152-Remove-stream-in-PlayerSensor.patch
diff --git a/leaf-server/minecraft-patches/features/0154-Remove-stream-in-GolemSensor.patch b/leaf-server/minecraft-patches/features/0153-Remove-stream-in-GolemSensor.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0154-Remove-stream-in-GolemSensor.patch
rename to leaf-server/minecraft-patches/features/0153-Remove-stream-in-GolemSensor.patch
diff --git a/leaf-server/minecraft-patches/features/0155-Remove-stream-in-GateBehavior.patch b/leaf-server/minecraft-patches/features/0154-Remove-stream-in-GateBehavior.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0155-Remove-stream-in-GateBehavior.patch
rename to leaf-server/minecraft-patches/features/0154-Remove-stream-in-GateBehavior.patch
diff --git a/leaf-server/minecraft-patches/features/0156-Remove-stream-in-matchingSlot.patch b/leaf-server/minecraft-patches/features/0155-Remove-stream-in-matchingSlot.patch
similarity index 100%
rename from leaf-server/minecraft-patches/features/0156-Remove-stream-in-matchingSlot.patch
rename to leaf-server/minecraft-patches/features/0155-Remove-stream-in-matchingSlot.patch
diff --git a/leaf-server/minecraft-patches/features/0157-Remove-stream-in-entity-mountedOrDismounted-changes-.patch b/leaf-server/minecraft-patches/features/0156-Remove-stream-in-entity-mountedOrDismounted-changes-.patch
similarity index 94%
rename from leaf-server/minecraft-patches/features/0157-Remove-stream-in-entity-mountedOrDismounted-changes-.patch
rename to leaf-server/minecraft-patches/features/0156-Remove-stream-in-entity-mountedOrDismounted-changes-.patch
index 4a7ad3f7..6bb0594b 100644
--- a/leaf-server/minecraft-patches/features/0157-Remove-stream-in-entity-mountedOrDismounted-changes-.patch
+++ b/leaf-server/minecraft-patches/features/0156-Remove-stream-in-entity-mountedOrDismounted-changes-.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Remove stream in entity mountedOrDismounted changes update
diff --git a/net/minecraft/server/level/ServerEntity.java b/net/minecraft/server/level/ServerEntity.java
-index b3fe9ea70148cdbefbdb617abaf81fe48ee26685..d6b261f8d3fbeee771208528b3e0bd5fcd94878b 100644
+index 4859433b0a4160e7ee0af4c2e750956f6ca07649..d605c4da4475fdc47a6d0c90fbca2713fc9d8fef 100644
--- a/net/minecraft/server/level/ServerEntity.java
+++ b/net/minecraft/server/level/ServerEntity.java
@@ -118,7 +118,19 @@ public class ServerEntity {
diff --git a/leaf-server/minecraft-patches/features/0158-Replace-Entity-active-effects-map-with-optimized-col.patch b/leaf-server/minecraft-patches/features/0157-Replace-Entity-active-effects-map-with-optimized-col.patch
similarity index 85%
rename from leaf-server/minecraft-patches/features/0158-Replace-Entity-active-effects-map-with-optimized-col.patch
rename to leaf-server/minecraft-patches/features/0157-Replace-Entity-active-effects-map-with-optimized-col.patch
index 76b8291e..c39d1693 100644
--- a/leaf-server/minecraft-patches/features/0158-Replace-Entity-active-effects-map-with-optimized-col.patch
+++ b/leaf-server/minecraft-patches/features/0157-Replace-Entity-active-effects-map-with-optimized-col.patch
@@ -6,11 +6,11 @@ Subject: [PATCH] Replace Entity active effects map with optimized collection
Dreeam TODO: check this
diff --git a/net/minecraft/world/entity/LivingEntity.java b/net/minecraft/world/entity/LivingEntity.java
-index fdbe3d4d71ba30c8330760555e97ff436643a7a9..ba6d9a5df71e9aae9defedf5bbe12f49599123cb 100644
+index 1d60ff59942680e9993d875505db0dfb8d7a5f96..6f5b160cae3a0f95f15a38d65a9f0515c00f87ba 100644
--- a/net/minecraft/world/entity/LivingEntity.java
+++ b/net/minecraft/world/entity/LivingEntity.java
-@@ -196,6 +196,10 @@ public abstract class LivingEntity extends Entity implements Attackable {
- };
+@@ -208,6 +208,10 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
+ private static final Dynamic> EMPTY_BRAIN = new Dynamic<>(JavaOps.INSTANCE, Map.of("memories", Map.of()));
private final AttributeMap attributes;
public CombatTracker combatTracker = new CombatTracker(this);
+ // Need to figure out the difference of mem access pattern between hash map and obj2obj hash map (separate chaining vs open addressing)
@@ -20,7 +20,7 @@ index fdbe3d4d71ba30c8330760555e97ff436643a7a9..ba6d9a5df71e9aae9defedf5bbe12f49
public final Map, MobEffectInstance> activeEffects = Maps.newHashMap();
private final Map lastEquipmentItems = Util.makeEnumMap(EquipmentSlot.class, slot -> ItemStack.EMPTY);
public boolean swinging;
-@@ -990,15 +994,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -1015,15 +1019,16 @@ public abstract class LivingEntity extends Entity implements Attackable, Waypoin
private void updateSynchronizedMobEffectParticles() {
// Leaf start - Remove stream in entity visible effects filter
List list = new java.util.ArrayList<>();
diff --git a/leaf-server/minecraft-patches/features/0159-Replace-criterion-map-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0158-Replace-criterion-map-with-optimized-collection.patch
similarity index 93%
rename from leaf-server/minecraft-patches/features/0159-Replace-criterion-map-with-optimized-collection.patch
rename to leaf-server/minecraft-patches/features/0158-Replace-criterion-map-with-optimized-collection.patch
index d04c8e32..9fc76dac 100644
--- a/leaf-server/minecraft-patches/features/0159-Replace-criterion-map-with-optimized-collection.patch
+++ b/leaf-server/minecraft-patches/features/0158-Replace-criterion-map-with-optimized-collection.patch
@@ -5,7 +5,7 @@ Subject: [PATCH] Replace criterion map with optimized collection
diff --git a/net/minecraft/server/PlayerAdvancements.java b/net/minecraft/server/PlayerAdvancements.java
-index c7e92f0122823d9e1aa471c5c0e995d1e1d90184..10ac7393d20a0857be2bfdd856dda448699b3eff 100644
+index eee5aaca8219802a56b8ba08986da672c40dc8b4..4bf87ebb49880b8e09203a48fce6371398281561 100644
--- a/net/minecraft/server/PlayerAdvancements.java
+++ b/net/minecraft/server/PlayerAdvancements.java
@@ -60,7 +60,7 @@ public class PlayerAdvancements {
diff --git a/leaf-server/minecraft-patches/features/0159-Replace-brain-with-optimized-collection.patch b/leaf-server/minecraft-patches/features/0159-Replace-brain-with-optimized-collection.patch
new file mode 100644
index 00000000..62d5d611
--- /dev/null
+++ b/leaf-server/minecraft-patches/features/0159-Replace-brain-with-optimized-collection.patch
@@ -0,0 +1,246 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
+Date: Sat, 26 Oct 2024 00:06:04 +0800
+Subject: [PATCH] Replace brain with optimized collection
+
+Co-authored-by: Taiyou06
+
+diff --git a/net/minecraft/world/entity/ai/Brain.java b/net/minecraft/world/entity/ai/Brain.java
+index 29fdf94db0308031edfe7915fc587a2aa5a1a18a..1d533dc2db5df6f31f307bc94f9f8e5784b0ab23 100644
+--- a/net/minecraft/world/entity/ai/Brain.java
++++ b/net/minecraft/world/entity/ai/Brain.java
+@@ -45,14 +45,20 @@ public class Brain {
+ static final Logger LOGGER = LogUtils.getLogger();
+ private final Supplier>> codec;
+ private static final int SCHEDULE_UPDATE_DELAY = 20;
+- private final Map, Optional extends ExpirableValue>>> memories = Maps.newHashMap();
+- private final Map>, Sensor super E>> sensors = Maps.newLinkedHashMap();
+- private final Map>>> availableBehaviorsByPriority = Maps.newTreeMap();
++ // Leaf start - Replace brain maps with optimized collection
++ private final Map, Optional extends ExpirableValue>>> memories = new it.unimi.dsi.fastutil.objects.Reference2ReferenceOpenHashMap<>();
++ private final Map>, Sensor super E>> sensors = new it.unimi.dsi.fastutil.objects.Reference2ReferenceArrayMap<>();
++ private final Map>>> availableBehaviorsByPriority = new it.unimi.dsi.fastutil.objects.Object2ObjectRBTreeMap<>();
++ public static final Map[] EMPTY_ARRAY = {};
++ private Map>>[] availableBehaviorsByPriorityArray = EMPTY_ARRAY;
++ // Leaf end - Replace brain maps with optimized collection
+ private Schedule schedule = Schedule.EMPTY;
+- private final Map