diff options
author | Daniel Ennis <[email protected]> | 2020-08-24 22:22:08 -0400 |
---|---|---|
committer | Aikar <[email protected]> | 2020-08-24 22:40:19 -0400 |
commit | c97ce029e99c0bd2281b30b1c35885bc9a3c4a74 (patch) | |
tree | b06142b02170a500cd810c22d7b379f4561cd7c9 | |
parent | 627f4b8561115d40d6a39587d1ad94b0104f7e14 (diff) | |
download | Paper-c97ce029e99c0bd2281b30b1c35885bc9a3c4a74.tar.gz Paper-c97ce029e99c0bd2281b30b1c35885bc9a3c4a74.zip |
1.16.2 Release (#4123)
PaperMC believes that 1.16.2 is now ready for general release as we fixed the main issue plagueing the 1.16.x release, the MapLike data conversion issues.
Until now, it was not safe for a server to convert a world to 1.16.2 without data conversion issues around villages and potentially other things. If you did, those MapLike errors meant something went wrong.
This is now resolved.
Big thanks to all those that helped, notably @BillyGalbreath and @Proximyst who did large parts of the update process with me.
Please as always, backup your worlds and test before updating to 1.16.2!
If you update to 1.16.2, there is no going back to an older build than this.
---------------------------------
Co-authored-by: William Blake Galbreath <[email protected]>
Co-authored-by: Mariell Hoversholm <[email protected]>
Co-authored-by: krolik-exe <[email protected]>
Co-authored-by: BillyGalbreath <[email protected]>
Co-authored-by: stonar96 <[email protected]>
Co-authored-by: Shane Freeder <[email protected]>
Co-authored-by: Jason <[email protected]>
Co-authored-by: kashike <[email protected]>
Co-authored-by: Aurora <[email protected]>
Co-authored-by: KennyTV <[email protected]>
Co-authored-by: commandblockguy <[email protected]>
Co-authored-by: DigitalRegent <[email protected]>
Co-authored-by: ishland <[email protected]>
646 files changed, 4391 insertions, 4114 deletions
diff --git a/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md b/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md index 72ab6a7961..8e504d24c1 100644 --- a/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md +++ b/.github/ISSUE_TEMPLATE/behavior-bug---plugin-incompatibility.md @@ -4,6 +4,9 @@ about: Server Bug or Plugin Incompatibility --- +<!-- Before reporting an issue here, please make sure you are on the latest version of Paper. --> +<!-- Forks of Paper receive no support here. Please make sure that your issue is reproducable on Paper first. --> + ### What behaviour is expected: ___What you expected to see___ @@ -16,8 +19,8 @@ ___This may include a build schematic, a video, or detailed instructions to help ### Plugin list: ___A list of your plugins___ -### Paper build number: -___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___ +### Paper version: +___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___ ### Anything else: ___Anything else you think may help us resolve the problem___ diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 066b2d920a..4d73ef7953 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,6 +4,8 @@ about: Suggest an idea for this project --- +<!-- Before requesting a new feature, please make sure you are using the latest version and that the feature you are requesting is not already in Paper. --> + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.github/ISSUE_TEMPLATE/performance-problem.md b/.github/ISSUE_TEMPLATE/performance-problem.md index 8b50dae939..15f324b995 100644 --- a/.github/ISSUE_TEMPLATE/performance-problem.md +++ b/.github/ISSUE_TEMPLATE/performance-problem.md @@ -4,6 +4,9 @@ about: Report performance problems or areas of concern --- +<!-- Before reporting performance problems here, please make sure you are on the latest version of Paper. --> +<!-- Forks of Paper receive no support here. Please make sure that this problem also affects Paper. --> + ### Timings or Profile link: ___We ask that all timings/profiles are a link, not a screenshot. Screenshots inhibit our ability to figure out the real cause of the issue.___ @@ -20,5 +23,5 @@ ___Gist/pastebin/hastebin links___ ___The more information we receive, the quicker and more effective we can be at finding the solution to the issue.___ -### Paper build number: -___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___ +### Paper version: +___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___ diff --git a/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md b/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md index 52a2e23a5b..ce43c364a7 100644 --- a/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md +++ b/.github/ISSUE_TEMPLATE/server-crash---stacktrace.md @@ -4,6 +4,9 @@ about: Report server crashes and/or scary stacktraces --- +<!-- Before reporting a crash here, please make sure you are on the latest version of Paper. --> +<!-- Forks of Paper receive no support here. Please make sure that this crash also happens when using Paper. --> + ### Link/paste of stack trace You can also simply just use code formatting in markdown! @@ -18,5 +21,5 @@ ___A list of your plugins___ ### Actions to reproduce (if known): ___This may include a build schematic, a video, or detailed instructions to help reconstruct the issue___ -### Paper build number: -___This can be found by running `/version` on your server. `latest` is not a proper version number; we require the output of `/version` so we can properly track down the issue.___ +### Paper version: +___Paste the output of running `/version` on your server WITH the Minecraft version. `latest` is not a version; we require the output of `/version` so we can properly track down the issue.___ diff --git a/.travis.yml b/.travis.yml index d6fd711072..66e0062c66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: java -sudo: required -dist: trusty +dist: focal +os: linux jdk: - oraclejdk8 - openjdk11 diff --git a/Paper-MojangAPI/pom.xml b/Paper-MojangAPI/pom.xml index 4c7c62c787..03a17db372 100644 --- a/Paper-MojangAPI/pom.xml +++ b/Paper-MojangAPI/pom.xml @@ -10,7 +10,7 @@ <groupId>com.destroystokyo.paper</groupId> <artifactId>paper-mojangapi</artifactId> - <version>1.16.1-R0.1-SNAPSHOT</version> + <version>1.16.2-R0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>Paper-MojangAPI</name> diff --git a/SHIT_TO_CHECK.md b/SHIT_TO_CHECK.md index d6eeb9a774..4d45751d17 100644 --- a/SHIT_TO_CHECK.md +++ b/SHIT_TO_CHECK.md @@ -5,4 +5,5 @@ * Make sure the flat bedrock setting doesn't do anything stupid * Check DataBits foreach * lighting is bork (load chunk, fly away, come back, everything or parts are black) -* chunk generation seems slow with a lot of it happening
\ No newline at end of file +* chunk generation seems slow with a lot of it happening +* Fix IDE Debug JVM Flag for new versions of minecraft diff --git a/Spigot-API-Patches/0001-POM-changes.patch b/Spigot-API-Patches/0001-POM-changes.patch index 61f53a53b3..f131cbc4df 100644 --- a/Spigot-API-Patches/0001-POM-changes.patch +++ b/Spigot-API-Patches/0001-POM-changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] POM changes diff --git a/pom.xml b/pom.xml -index 10d59b211587b22f73e911fb2872df3d181a0f8a..5adaed556ff075e11ad76e70b8d7e6244e2ff405 100644 +index 96687472e8a7799d0b32032026a7fc3a08f23ecc..af19075e6768aef0dcd9f54dc41f44fdd6a0e9d2 100644 --- a/pom.xml +++ b/pom.xml @@ -2,34 +2,28 @@ @@ -22,7 +22,7 @@ index 10d59b211587b22f73e911fb2872df3d181a0f8a..5adaed556ff075e11ad76e70b8d7e624 - <artifactId>spigot-api</artifactId> + <groupId>com.destroystokyo.paper</groupId> + <artifactId>paper-api</artifactId> - <version>1.16.1-R0.1-SNAPSHOT</version> + <version>1.16.2-R0.1-SNAPSHOT</version> <packaging>jar</packaging> - <name>Spigot-API</name> diff --git a/Spigot-API-Patches/0002-Add-FastUtil-to-Bukkit.patch b/Spigot-API-Patches/0002-Add-FastUtil-to-Bukkit.patch index 5a9a4031be..5a1c25baab 100644 --- a/Spigot-API-Patches/0002-Add-FastUtil-to-Bukkit.patch +++ b/Spigot-API-Patches/0002-Add-FastUtil-to-Bukkit.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add FastUtil to Bukkit Doesn't expose to plugins, just allows Paper-API to use it for optimization diff --git a/pom.xml b/pom.xml -index 5adaed556ff075e11ad76e70b8d7e6244e2ff405..e81043213ca0b56c7306be5571f0f6e542695e95 100644 +index af19075e6768aef0dcd9f54dc41f44fdd6a0e9d2..d15efd747442f20f0f6a8c22bb3ba45abdcd399b 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,12 @@ diff --git a/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch b/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch index 24339388a9..4fdb207352 100644 --- a/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch +++ b/Spigot-API-Patches/0022-Use-ASM-for-event-executors.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use ASM for event executors. Uses method handles for private or static methods. diff --git a/pom.xml b/pom.xml -index e81043213ca0b56c7306be5571f0f6e542695e95..08a1a70e2fe582e238fc9c87af69368359646231 100644 +index d15efd747442f20f0f6a8c22bb3ba45abdcd399b..f9ca0f2386049e48759646c1a38646db85c66492 100644 --- a/pom.xml +++ b/pom.xml @@ -128,6 +128,17 @@ diff --git a/Spigot-API-Patches/0042-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-API-Patches/0042-Add-API-methods-to-control-if-armour-stands-can-move.patch index 2845effc0b..3f2a539353 100644 --- a/Spigot-API-Patches/0042-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-API-Patches/0042-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index beeba55d53c3f1b268460488d57520db73f78c48..6a854d7cf68553b30e5aceca435c0bec31eb2f7c 100644 +index e94ec567fbda93f4f5783f84b4b5136b309d0eab..fddc063798edc8084ca695578a47485204a7f3cd 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -291,4 +291,22 @@ public interface ArmorStand extends LivingEntity { - * @param marker whether this is a marker - */ - void setMarker(boolean marker); -+ +@@ -344,4 +344,21 @@ public interface ArmorStand extends LivingEntity { + */ + ADDING; + } + // Paper start + /** + * Tests if this armor stand can move. diff --git a/Spigot-API-Patches/0046-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-API-Patches/0046-Provide-E-TE-Chunk-count-stat-methods.patch index ca1b41a18b..783c556487 100644 --- a/Spigot-API-Patches/0046-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-API-Patches/0046-Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index c79e083a97b849f9cdd3f9646c4f2892976b2a55..480386b2405953c3a06958a9728b38371d75662b 100644 +index d355453d5b166e8fa0c6a8c992169b0b54e5127b..fefbe857676bdab750379a9d6c120099817a83e8 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -40,6 +40,33 @@ import org.jetbrains.annotations.Nullable; diff --git a/Spigot-API-Patches/0050-Fix-upstream-javadoc-warnings-and-errors.patch b/Spigot-API-Patches/0050-Fix-upstream-javadoc-warnings-and-errors.patch index 7988dde1b5..97ab9eac1d 100644 --- a/Spigot-API-Patches/0050-Fix-upstream-javadoc-warnings-and-errors.patch +++ b/Spigot-API-Patches/0050-Fix-upstream-javadoc-warnings-and-errors.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix upstream javadoc warnings and errors Upstream still refuses to use Java 8 with the API so they are likely unaware these are even issues. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3ffc65e6be 100644 +index fefbe857676bdab750379a9d6c120099817a83e8..833f4cb13e9d3d1d0daa1ac1202a70e2606c80b8 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2077,6 +2077,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2087,6 +2087,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -17,7 +17,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, @Nullable T data); -@@ -2093,6 +2094,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2103,6 +2104,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param count the number of particles * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -25,7 +25,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, @Nullable T data); -@@ -2143,6 +2145,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2153,6 +2155,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -33,7 +33,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -2163,6 +2166,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2173,6 +2176,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param offsetZ the maximum random offset on the Z axis * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -41,7 +41,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data); -@@ -2219,6 +2223,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2229,6 +2233,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -49,7 +49,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -@@ -2241,6 +2246,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2251,6 +2256,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * particle used (normally speed) * @param data the data to use for the particle or null, * the type of this depends on {@link Particle#getDataType()} @@ -57,7 +57,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data); -@@ -2264,6 +2270,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2274,6 +2280,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended * range and encourage their client to render it regardless of * settings @@ -65,7 +65,7 @@ index 480386b2405953c3a06958a9728b38371d75662b..55d114e3a17ea623ecc0d9fa87b14c3f */ public <T> void spawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force); -@@ -2289,6 +2296,7 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2299,6 +2306,7 @@ public interface World extends PluginMessageRecipient, Metadatable { * @param force whether to send the particle to players within an extended * range and encourage their client to render it regardless of * settings diff --git a/Spigot-API-Patches/0056-Shoulder-Entities-Release-API.patch b/Spigot-API-Patches/0056-Shoulder-Entities-Release-API.patch index 84254db369..249e81f7ad 100644 --- a/Spigot-API-Patches/0056-Shoulder-Entities-Release-API.patch +++ b/Spigot-API-Patches/0056-Shoulder-Entities-Release-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index abe3d91428c4a5f7e3c6fec51faf973b76896dc3..babda8f047ab134223651ddcc8e4eb8d6682a031 100644 +index 72178c3036f567ceaf15016978a9737eb9c4afc4..d212d5123b6294f7873d72f125505a006c290b05 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -300,6 +300,26 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder diff --git a/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch b/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch index fb9449b5f1..2c2543850f 100644 --- a/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch +++ b/Spigot-API-Patches/0063-Make-plugins-list-alphabetical.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make /plugins list alphabetical diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index e8a7f435fb30da3506b2b4fa8c5675c829edc105..ba399ee5ab33b4fd8741bce53509a17b1aabc84d 100644 +index bcb576a4271b1ec7b1cfe6f83cf161b7d89ed2e5..9b2e28d04be7a89bdd0fb27d1d1f3f71846edefb 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java @@ -3,6 +3,9 @@ package org.bukkit.command.defaults; @@ -18,7 +18,7 @@ index e8a7f435fb30da3506b2b4fa8c5675c829edc105..ba399ee5ab33b4fd8741bce53509a17b import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; -@@ -49,34 +52,51 @@ public class PluginsCommand extends BukkitCommand { +@@ -34,23 +37,33 @@ public class PluginsCommand extends BukkitCommand { @NotNull private String getPluginList() { @@ -56,26 +56,5 @@ index e8a7f435fb30da3506b2b4fa8c5675c829edc105..ba399ee5ab33b4fd8741bce53509a17b + return "(" + plugins.size() + "): " + pluginList.toString(); + // Paper end } - - // Spigot start - @NotNull - private BaseComponent[] getPluginListSpigot() { -- Plugin[] plugins = Bukkit.getPluginManager().getPlugins(); -- ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.length + "): "); -+ // Paper start -+ TreeMap<String, Plugin> plugins = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); -+ for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) { -+ plugins.put(plugin.getDescription().getName(), plugin); -+ } -+ ComponentBuilder pluginList = new ComponentBuilder("Plugins (" + plugins.size() + "): "); -+ // Paper end - - int index = 0; -- for (Plugin plugin : plugins) { -+ // Paper start -+ for (Map.Entry<String, Plugin> entry : plugins.entrySet()) { -+ Plugin plugin = entry.getValue(); -+ // Paper end - if (index++ > 0) { - pluginList.append(", ", FormatRetention.NONE).color(net.md_5.bungee.api.ChatColor.WHITE); - } ++ + } diff --git a/Spigot-API-Patches/0066-Allow-plugins-to-use-SLF4J-for-logging.patch b/Spigot-API-Patches/0066-Allow-plugins-to-use-SLF4J-for-logging.patch index 701a4d2815..bd862ae33d 100644 --- a/Spigot-API-Patches/0066-Allow-plugins-to-use-SLF4J-for-logging.patch +++ b/Spigot-API-Patches/0066-Allow-plugins-to-use-SLF4J-for-logging.patch @@ -14,7 +14,7 @@ it without having to shade it in the plugin and going through several layers of logging abstraction. diff --git a/pom.xml b/pom.xml -index 08a1a70e2fe582e238fc9c87af69368359646231..cb37aea9d7f60b54b95b5cf1798d5a6c5c0e7c14 100644 +index f9ca0f2386049e48759646c1a38646db85c66492..1a34f6880b45e3c46a8e29575b549f3a601721e7 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,13 @@ diff --git a/Spigot-API-Patches/0090-Add-method-to-open-already-placed-sign.patch b/Spigot-API-Patches/0090-Add-method-to-open-already-placed-sign.patch index 0af409cf27..c75d281c23 100644 --- a/Spigot-API-Patches/0090-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-API-Patches/0090-Add-method-to-open-already-placed-sign.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index babda8f047ab134223651ddcc8e4eb8d6682a031..dd7b08f985d8ac41fdce8241a3cd2c84c1555ab3 100644 +index d212d5123b6294f7873d72f125505a006c290b05..7430bc85301d0fcb34c6035fbe08ae245c76e043 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java -@@ -461,4 +461,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder +@@ -461,6 +461,14 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder */ @Deprecated public void setShoulderEntityRight(@Nullable Entity entity); -+ + // Paper start - Add method to open already placed sign + /** + * Opens an editor window for the specified sign @@ -21,4 +20,6 @@ index babda8f047ab134223651ddcc8e4eb8d6682a031..dd7b08f985d8ac41fdce8241a3cd2c84 + */ + void openSign(@NotNull org.bukkit.block.Sign sign); + // Paper end - } + + /** + * Make the entity drop the item in their hand. diff --git a/Spigot-API-Patches/0094-Additional-world.getNearbyEntities-API-s.patch b/Spigot-API-Patches/0094-Additional-world.getNearbyEntities-API-s.patch index ef34a0f2af..8e83d78dc5 100644 --- a/Spigot-API-Patches/0094-Additional-world.getNearbyEntities-API-s.patch +++ b/Spigot-API-Patches/0094-Additional-world.getNearbyEntities-API-s.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's Provides more methods to get nearby entities, and filter by types and predicates diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 55d114e3a17ea623ecc0d9fa87b14c3ffc65e6be..c422cfa1b599bc4c158dea178e5677c4b4545d99 100644 +index 833f4cb13e9d3d1d0daa1ac1202a70e2606c80b8..f36360e9dbfa6daa3450c275764ea1e90e446da6 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -1,6 +1,9 @@ diff --git a/Spigot-API-Patches/0096-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-API-Patches/0096-Expand-World.spawnParticle-API-and-add-Builder.patch index 6083ef3906..078e71d758 100644 --- a/Spigot-API-Patches/0096-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-API-Patches/0096-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -515,10 +515,10 @@ index b32de827cf8d1780861c271b4215276fdaab7165..1020002ff7127877db2d7e096f2c5217 * Options which can be applied to redstone dust particles - a particle * color and size. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index c422cfa1b599bc4c158dea178e5677c4b4545d99..6e311dd8f1105c28be7259855e0b19ae182badfd 100644 +index f36360e9dbfa6daa3450c275764ea1e90e446da6..068eb8dbd31b3456a8ce48e045d98a4d291eba27 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2501,7 +2501,57 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2511,7 +2511,57 @@ public interface World extends PluginMessageRecipient, Metadatable { * the type of this depends on {@link Particle#getDataType()} * @param <T> Type */ diff --git a/Spigot-API-Patches/0111-Expand-Explosions-API.patch b/Spigot-API-Patches/0111-Expand-Explosions-API.patch index 6f7aadc9ed..0ac6ff50c9 100644 --- a/Spigot-API-Patches/0111-Expand-Explosions-API.patch +++ b/Spigot-API-Patches/0111-Expand-Explosions-API.patch @@ -106,10 +106,10 @@ index 4cf22afc3c1f1cc19b6e5350043431215908a612..af2ee43f2c5133668c18710f526a107d * Returns a list of entities within a bounding box centered around a Location. * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 6e311dd8f1105c28be7259855e0b19ae182badfd..4cbea0cc7b2594ebbc555edb00a86dac6d293f91 100644 +index 068eb8dbd31b3456a8ce48e045d98a4d291eba27..1f02f9a96eac55e14383a8a381be6473c014442f 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1354,6 +1354,88 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1364,6 +1364,88 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public boolean createExplosion(@NotNull Location loc, float power, boolean setFire); diff --git a/Spigot-API-Patches/0115-Add-World.getEntity-UUID-API.patch b/Spigot-API-Patches/0115-Add-World.getEntity-UUID-API.patch index 121bb131ba..8db9ac39b0 100644 --- a/Spigot-API-Patches/0115-Add-World.getEntity-UUID-API.patch +++ b/Spigot-API-Patches/0115-Add-World.getEntity-UUID-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 4cbea0cc7b2594ebbc555edb00a86dac6d293f91..2e52059cdf2431baac09db521b02fbc4c594eb60 100644 +index 1f02f9a96eac55e14383a8a381be6473c014442f..79267ebf4fd0d5ea3fc37f62bf50c4064f62fc8d 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -914,6 +914,17 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0116-InventoryCloseEvent-Reason-API.patch b/Spigot-API-Patches/0116-InventoryCloseEvent-Reason-API.patch index b11da6a932..c03581bf2f 100644 --- a/Spigot-API-Patches/0116-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-API-Patches/0116-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index dd7b08f985d8ac41fdce8241a3cd2c84c1555ab3..2668196e04a7de245c63b4b74f0d056784ef0736 100644 +index 7430bc85301d0fcb34c6035fbe08ae245c76e043..3418133d07250a7fd50caad8d97924b86fb30bad 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -153,6 +153,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder diff --git a/Spigot-API-Patches/0118-Add-an-asterisk-to-legacy-API-plugins.patch b/Spigot-API-Patches/0118-Add-an-asterisk-to-legacy-API-plugins.patch index 40cf01eecc..d9fcddb303 100644 --- a/Spigot-API-Patches/0118-Add-an-asterisk-to-legacy-API-plugins.patch +++ b/Spigot-API-Patches/0118-Add-an-asterisk-to-legacy-API-plugins.patch @@ -23,10 +23,10 @@ index 1b6d737046646c102b0d519ab3f67c3fbd503979..541e28a9bece0beb0c2cf02c39030840 // Paper end } diff --git a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -index ba399ee5ab33b4fd8741bce53509a17b1aabc84d..cbcdca042b54531fdf45e8631c4bbe8c74f68341 100644 +index 9b2e28d04be7a89bdd0fb27d1d1f3f71846edefb..fd74512a2bbbb0f198192b450e09bdbb9bac248d 100644 --- a/src/main/java/org/bukkit/command/defaults/PluginsCommand.java +++ b/src/main/java/org/bukkit/command/defaults/PluginsCommand.java -@@ -74,7 +74,13 @@ public class PluginsCommand extends BukkitCommand { +@@ -59,7 +59,13 @@ public class PluginsCommand extends BukkitCommand { pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED); diff --git a/Spigot-API-Patches/0123-Allow-disabling-armour-stand-ticking.patch b/Spigot-API-Patches/0123-Allow-disabling-armour-stand-ticking.patch index df832f339d..30f0bf5227 100644 --- a/Spigot-API-Patches/0123-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-API-Patches/0123-Allow-disabling-armour-stand-ticking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index 6a854d7cf68553b30e5aceca435c0bec31eb2f7c..c8c08f1f2cf875f3bab7548cebd3dd657a5bf3ec 100644 +index fddc063798edc8084ca695578a47485204a7f3cd..365d3a3c5fc4a47efe56225ef1eb87b5046034f4 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -308,5 +308,21 @@ public interface ArmorStand extends LivingEntity { +@@ -360,5 +360,21 @@ public interface ArmorStand extends LivingEntity { * @param move {@code true} if this armour stand can move, {@code false} otherwise */ void setCanMove(boolean move); diff --git a/Spigot-API-Patches/0126-Expand-ArmorStand-API.patch b/Spigot-API-Patches/0126-Expand-ArmorStand-API.patch index 4b00db4f51..036951f69d 100644 --- a/Spigot-API-Patches/0126-Expand-ArmorStand-API.patch +++ b/Spigot-API-Patches/0126-Expand-ArmorStand-API.patch @@ -8,18 +8,10 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/org/bukkit/entity/ArmorStand.java b/src/main/java/org/bukkit/entity/ArmorStand.java -index c8c08f1f2cf875f3bab7548cebd3dd657a5bf3ec..af70bac7921852b58629d671fe03ad0e23be9266 100644 +index 365d3a3c5fc4a47efe56225ef1eb87b5046034f4..8ca6c9eba926f436203af211c6e274a59ddb15e8 100644 --- a/src/main/java/org/bukkit/entity/ArmorStand.java +++ b/src/main/java/org/bukkit/entity/ArmorStand.java -@@ -1,6 +1,7 @@ - package org.bukkit.entity; - - import org.bukkit.inventory.EntityEquipment; -+import org.bukkit.inventory.EquipmentSlot; - import org.bukkit.inventory.ItemStack; - import org.bukkit.util.EulerAngle; - import org.jetbrains.annotations.NotNull; -@@ -12,7 +13,7 @@ public interface ArmorStand extends LivingEntity { +@@ -13,7 +13,7 @@ public interface ArmorStand extends LivingEntity { * Returns the item the armor stand is currently holding. * * @return the held item @@ -28,7 +20,7 @@ index c8c08f1f2cf875f3bab7548cebd3dd657a5bf3ec..af70bac7921852b58629d671fe03ad0e * @see #getEquipment() */ @NotNull -@@ -24,7 +25,7 @@ public interface ArmorStand extends LivingEntity { +@@ -25,7 +25,7 @@ public interface ArmorStand extends LivingEntity { * * @param item the item to hold * @deprecated prefer @@ -37,7 +29,7 @@ index c8c08f1f2cf875f3bab7548cebd3dd657a5bf3ec..af70bac7921852b58629d671fe03ad0e * @see #getEquipment() */ @Deprecated -@@ -324,5 +325,71 @@ public interface ArmorStand extends LivingEntity { +@@ -376,5 +376,71 @@ public interface ArmorStand extends LivingEntity { * @param tick {@code true} if this armour stand can tick, {@code false} otherwise */ void setCanTick(final boolean tick); diff --git a/Spigot-API-Patches/0131-Provide-Chunk-Coordinates-as-a-Long-API.patch b/Spigot-API-Patches/0131-Provide-Chunk-Coordinates-as-a-Long-API.patch index 0e7fd480ef..f715f2f134 100644 --- a/Spigot-API-Patches/0131-Provide-Chunk-Coordinates-as-a-Long-API.patch +++ b/Spigot-API-Patches/0131-Provide-Chunk-Coordinates-as-a-Long-API.patch @@ -44,7 +44,7 @@ index 95e485eea693e7648e63d198c8591d89e02e6755..0bbef14a9fc2a3ec03b4db59c8d8e1ee * Gets the world containing this chunk * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 2e52059cdf2431baac09db521b02fbc4c594eb60..fe8b255aeb46e30d0a954dcd0e3e6ac29b4fd33d 100644 +index 79267ebf4fd0d5ea3fc37f62bf50c4064f62fc8d..ff132bd7677e384debf2399ba9b1ffdb932541e9 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -207,6 +207,22 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0132-Async-Chunks-API.patch b/Spigot-API-Patches/0132-Async-Chunks-API.patch index 9e7d3074fb..cb3ec03372 100644 --- a/Spigot-API-Patches/0132-Async-Chunks-API.patch +++ b/Spigot-API-Patches/0132-Async-Chunks-API.patch @@ -8,7 +8,7 @@ Adds API's to load or generate chunks asynchronously. Also adds utility methods to Entity to teleport asynchronously. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index fe8b255aeb46e30d0a954dcd0e3e6ac29b4fd33d..eef7750fdebb4fbd156d729e4cc87f7b3d0a2ad4 100644 +index ff132bd7677e384debf2399ba9b1ffdb932541e9..a260f31d1bc00b6bd87418526170054047977da4 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -221,6 +221,467 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0136-Allow-Blocks-to-be-accessed-via-a-long-key.patch b/Spigot-API-Patches/0136-Allow-Blocks-to-be-accessed-via-a-long-key.patch index 3a2b88d082..671c65a6d3 100644 --- a/Spigot-API-Patches/0136-Allow-Blocks-to-be-accessed-via-a-long-key.patch +++ b/Spigot-API-Patches/0136-Allow-Blocks-to-be-accessed-via-a-long-key.patch @@ -48,7 +48,7 @@ index 369ce9ff6c8bb97a64a8e229115564412e6e7654..e700875beb76dadd55b585aca748338d * @return A new location where X/Y/Z are the center of the block */ diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index eef7750fdebb4fbd156d729e4cc87f7b3d0a2ad4..656615290c3378a853ea298d0a3b5f8d28c6a177 100644 +index a260f31d1bc00b6bd87418526170054047977da4..14555ceda572ba1f720fafaab12ea39df291fee6 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -90,6 +90,38 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0138-isChunkGenerated-API.patch b/Spigot-API-Patches/0138-isChunkGenerated-API.patch index e739c0e673..3eb0d8e3d5 100644 --- a/Spigot-API-Patches/0138-isChunkGenerated-API.patch +++ b/Spigot-API-Patches/0138-isChunkGenerated-API.patch @@ -34,7 +34,7 @@ index e700875beb76dadd55b585aca748338def286908..9c91c49ed7302c12fcb1d8e9bc58712e /** * Sets the position of this Location and returns itself diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 656615290c3378a853ea298d0a3b5f8d28c6a177..40dd88b538e9d9f7684f65415cf18e9b416e28de 100644 +index 14555ceda572ba1f720fafaab12ea39df291fee6..abce2ae7a861e28c5732593e163f172ebe8430ad 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -254,6 +254,17 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0142-Inventory-removeItemAnySlot.patch b/Spigot-API-Patches/0142-Inventory-removeItemAnySlot.patch index a743710250..4d6f2e9e57 100644 --- a/Spigot-API-Patches/0142-Inventory-removeItemAnySlot.patch +++ b/Spigot-API-Patches/0142-Inventory-removeItemAnySlot.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 5a38d8f13b5ee38f9d1ec01ce10b2666f5883e37..01fe217dfa93c20bdec53eb981bd6e885a9f7a25 100644 +index 5576a6a8df8c95164bf2dde45d756ce8b7ec957a..9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java @@ -125,6 +125,34 @@ public interface Inventory extends Iterable<ItemStack> { diff --git a/Spigot-API-Patches/0153-Material-API-additions.patch b/Spigot-API-Patches/0152-Material-API-additions.patch index 665fe76199..eaa11edcc9 100644 --- a/Spigot-API-Patches/0153-Material-API-additions.patch +++ b/Spigot-API-Patches/0152-Material-API-additions.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Material API additions diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java -index cedb719856573a9284443626d8823201125c895d..3a8438fb674006a5cbfd977a1cd016117691f0ee 100644 +index f66cd342c2ec3e5d4f4ae5e68dda797c793c76a7..e203c5bfc1d1bf6b500ef8a4446d3aef182b8ecb 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java -@@ -85,6 +85,7 @@ import org.jetbrains.annotations.Nullable; +@@ -86,6 +86,7 @@ import org.jetbrains.annotations.Nullable; /** * An enum of all material IDs accepted by the official server and client */ @@ -16,7 +16,7 @@ index cedb719856573a9284443626d8823201125c895d..3a8438fb674006a5cbfd977a1cd01611 public enum Material implements Keyed { //<editor-fold desc="Materials" defaultstate="collapsed"> AIR(9648, 0), -@@ -3563,6 +3564,22 @@ public enum Material implements Keyed { +@@ -3565,6 +3566,22 @@ public enum Material implements Keyed { } } diff --git a/Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch b/Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch deleted file mode 100644 index 3c3873253c..0000000000 --- a/Spigot-API-Patches/0152-Remove-Precondition-on-name-for-AttributeModifier.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Sat, 22 Sep 2018 18:41:01 -0400 -Subject: [PATCH] Remove Precondition on name for AttributeModifier - -Vanilla allows empty names - -diff --git a/src/main/java/org/bukkit/attribute/AttributeModifier.java b/src/main/java/org/bukkit/attribute/AttributeModifier.java -index a97631474545bb51dfcbc769401f4f1ffede580d..f0dff145a8c5ae729de5e5f547fff60333c6501e 100644 ---- a/src/main/java/org/bukkit/attribute/AttributeModifier.java -+++ b/src/main/java/org/bukkit/attribute/AttributeModifier.java -@@ -32,10 +32,10 @@ public class AttributeModifier implements ConfigurationSerializable { - - public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull Operation operation, @Nullable EquipmentSlot slot) { - Validate.notNull(uuid, "UUID cannot be null"); -- Validate.notEmpty(name, "Name cannot be empty"); -+ //Validate.notEmpty(name, "Name cannot be empty"); // Paper - Validate.notNull(operation, "Operation cannot be null"); - this.uuid = uuid; -- this.name = name; -+ this.name = name != null ? name : ""; // Paper - this.amount = amount; - this.operation = operation; - this.slot = slot; diff --git a/Spigot-API-Patches/0154-Add-Material-Tags.patch b/Spigot-API-Patches/0153-Add-Material-Tags.patch index ade1ae6b1a..8f9aee922c 100644 --- a/Spigot-API-Patches/0154-Add-Material-Tags.patch +++ b/Spigot-API-Patches/0153-Add-Material-Tags.patch @@ -204,7 +204,7 @@ index 0000000000000000000000000000000000000000..c91ea2a0679a7f3a5627b5a008e0b39d +} diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java new file mode 100644 -index 0000000000000000000000000000000000000000..af353bbdf8c2710d43d31237ea76eb9281aa463b +index 0000000000000000000000000000000000000000..552ba6b90b6dc1ae586af10cd8a8d4833693dea9 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java @@ -0,0 +1,511 @@ @@ -518,7 +518,7 @@ index 0000000000000000000000000000000000000000..af353bbdf8c2710d43d31237ea76eb92 + */ + public static final MaterialSetTag SPAWN_EGGS = new MaterialSetTag(keyFor("spawn_eggs")) + .endsWith("_SPAWN_EGG") -+ .ensureSize("SPAWN_EGGS", 63); ++ .ensureSize("SPAWN_EGGS", 64); + + /** + * Covers all colors of stained glass. diff --git a/Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch b/Spigot-API-Patches/0154-Allow-setting-the-vex-s-summoner.patch index 68b33503be..68b33503be 100644 --- a/Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-API-Patches/0154-Allow-setting-the-vex-s-summoner.patch diff --git a/Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch b/Spigot-API-Patches/0155-Add-LivingEntity-getTargetEntity.patch index 154fabd97c..154fabd97c 100644 --- a/Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-API-Patches/0155-Add-LivingEntity-getTargetEntity.patch diff --git a/Spigot-API-Patches/0157-Add-sun-related-API.patch b/Spigot-API-Patches/0156-Add-sun-related-API.patch index 8fda90ee4c..17f6b99f85 100644 --- a/Spigot-API-Patches/0157-Add-sun-related-API.patch +++ b/Spigot-API-Patches/0156-Add-sun-related-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 40dd88b538e9d9f7684f65415cf18e9b416e28de..8d951577c0797d299951f7fd2448121710f07e6b 100644 +index abce2ae7a861e28c5732593e163f172ebe8430ad..51b2b6d3f5de413391957a42d6a9ccb69688e0eb 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -1755,6 +1755,16 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -1765,6 +1765,16 @@ public interface World extends PluginMessageRecipient, Metadatable { */ public void setFullTime(long time); diff --git a/Spigot-API-Patches/0158-Here-s-Johnny.patch b/Spigot-API-Patches/0157-Here-s-Johnny.patch index faaadfb5db..faaadfb5db 100644 --- a/Spigot-API-Patches/0158-Here-s-Johnny.patch +++ b/Spigot-API-Patches/0157-Here-s-Johnny.patch diff --git a/Spigot-API-Patches/0159-Turtle-API.patch b/Spigot-API-Patches/0158-Turtle-API.patch index 06abb703f4..06abb703f4 100644 --- a/Spigot-API-Patches/0159-Turtle-API.patch +++ b/Spigot-API-Patches/0158-Turtle-API.patch diff --git a/Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-API-Patches/0159-Implement-getters-and-setters-for-EntityItem-owner-a.patch index 7645d0f72c..7645d0f72c 100644 --- a/Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-API-Patches/0159-Implement-getters-and-setters-for-EntityItem-owner-a.patch diff --git a/Spigot-API-Patches/0161-Add-spectator-target-events.patch b/Spigot-API-Patches/0160-Add-spectator-target-events.patch index c5d4b7c4db..c5d4b7c4db 100644 --- a/Spigot-API-Patches/0161-Add-spectator-target-events.patch +++ b/Spigot-API-Patches/0160-Add-spectator-target-events.patch diff --git a/Spigot-API-Patches/0162-Add-more-Witch-API.patch b/Spigot-API-Patches/0161-Add-more-Witch-API.patch index 10ae141b6d..10ae141b6d 100644 --- a/Spigot-API-Patches/0162-Add-more-Witch-API.patch +++ b/Spigot-API-Patches/0161-Add-more-Witch-API.patch diff --git a/Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch b/Spigot-API-Patches/0162-Make-the-default-permission-message-configurable.patch index a1377afd1a..a1377afd1a 100644 --- a/Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch +++ b/Spigot-API-Patches/0162-Make-the-default-permission-message-configurable.patch diff --git a/Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch b/Spigot-API-Patches/0163-Support-cancellation-supression-of-EntityDismount-Ve.patch index a36772974a..a36772974a 100644 --- a/Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch +++ b/Spigot-API-Patches/0163-Support-cancellation-supression-of-EntityDismount-Ve.patch diff --git a/Spigot-API-Patches/0165-Add-more-Zombie-API.patch b/Spigot-API-Patches/0164-Add-more-Zombie-API.patch index a2abe72e3e..ec2c93dc46 100644 --- a/Spigot-API-Patches/0165-Add-more-Zombie-API.patch +++ b/Spigot-API-Patches/0164-Add-more-Zombie-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/org/bukkit/entity/Zombie.java b/src/main/java/org/bukkit/entity/Zombie.java -index 6dcac979820b1460e8693b6a330876bc1ffdfffc..fa7a43c3517af455d197308d2e952ea40622349c 100644 +index a5b20b0454af5ea78e2bb7f16a56c38670c84efb..1217576e6f08abf0175ab800cfca058d5deda116 100644 --- a/src/main/java/org/bukkit/entity/Zombie.java +++ b/src/main/java/org/bukkit/entity/Zombie.java -@@ -86,4 +86,55 @@ public interface Zombie extends Monster { +@@ -90,4 +90,55 @@ public interface Zombie extends Monster, Ageable { * @param time new conversion time */ void setConversionTime(int time); diff --git a/Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch b/Spigot-API-Patches/0165-Change-the-reserved-channel-check-to-be-sensible.patch index fa3de62864..fa3de62864 100644 --- a/Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch +++ b/Spigot-API-Patches/0165-Change-the-reserved-channel-check-to-be-sensible.patch diff --git a/Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch b/Spigot-API-Patches/0166-Add-PlayerConnectionCloseEvent.patch index f1a017f4fb..f1a017f4fb 100644 --- a/Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-API-Patches/0166-Add-PlayerConnectionCloseEvent.patch diff --git a/Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-API-Patches/0167-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index ec2b79af2d..ec2b79af2d 100644 --- a/Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-API-Patches/0167-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch diff --git a/Spigot-API-Patches/0169-BlockDestroyEvent.patch b/Spigot-API-Patches/0168-BlockDestroyEvent.patch index 4ad73d8ef1..4ad73d8ef1 100644 --- a/Spigot-API-Patches/0169-BlockDestroyEvent.patch +++ b/Spigot-API-Patches/0168-BlockDestroyEvent.patch diff --git a/Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch b/Spigot-API-Patches/0169-Add-ItemStack-Recipe-API-helper-methods.patch index 45525648c7..45525648c7 100644 --- a/Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch +++ b/Spigot-API-Patches/0169-Add-ItemStack-Recipe-API-helper-methods.patch diff --git a/Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch b/Spigot-API-Patches/0170-Add-WhitelistToggleEvent.patch index 4bb54b5c92..4bb54b5c92 100644 --- a/Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch +++ b/Spigot-API-Patches/0170-Add-WhitelistToggleEvent.patch diff --git a/Spigot-API-Patches/0172-Annotation-Test-changes.patch b/Spigot-API-Patches/0171-Annotation-Test-changes.patch index 18489e6629..18489e6629 100644 --- a/Spigot-API-Patches/0172-Annotation-Test-changes.patch +++ b/Spigot-API-Patches/0171-Annotation-Test-changes.patch diff --git a/Spigot-API-Patches/0173-Entity-getEntitySpawnReason.patch b/Spigot-API-Patches/0172-Entity-getEntitySpawnReason.patch index 4a56dab290..4a56dab290 100644 --- a/Spigot-API-Patches/0173-Entity-getEntitySpawnReason.patch +++ b/Spigot-API-Patches/0172-Entity-getEntitySpawnReason.patch diff --git a/Spigot-API-Patches/0174-Add-GS4-Query-event.patch b/Spigot-API-Patches/0173-Add-GS4-Query-event.patch index ffab49a92a..ffab49a92a 100644 --- a/Spigot-API-Patches/0174-Add-GS4-Query-event.patch +++ b/Spigot-API-Patches/0173-Add-GS4-Query-event.patch diff --git a/Spigot-API-Patches/0175-Add-PlayerPostRespawnEvent.patch b/Spigot-API-Patches/0174-Add-PlayerPostRespawnEvent.patch index 2eb0647eac..2eb0647eac 100644 --- a/Spigot-API-Patches/0175-Add-PlayerPostRespawnEvent.patch +++ b/Spigot-API-Patches/0174-Add-PlayerPostRespawnEvent.patch diff --git a/Spigot-API-Patches/0176-Ignore-package-private-methods-for-nullability-annot.patch b/Spigot-API-Patches/0175-Ignore-package-private-methods-for-nullability-annot.patch index fb38d7e340..fb38d7e340 100644 --- a/Spigot-API-Patches/0176-Ignore-package-private-methods-for-nullability-annot.patch +++ b/Spigot-API-Patches/0175-Ignore-package-private-methods-for-nullability-annot.patch diff --git a/Spigot-API-Patches/0177-Flip-some-Spigot-API-null-annotations.patch b/Spigot-API-Patches/0176-Flip-some-Spigot-API-null-annotations.patch index f2306f805f..f2306f805f 100644 --- a/Spigot-API-Patches/0177-Flip-some-Spigot-API-null-annotations.patch +++ b/Spigot-API-Patches/0176-Flip-some-Spigot-API-null-annotations.patch diff --git a/Spigot-API-Patches/0178-Server-Tick-Events.patch b/Spigot-API-Patches/0177-Server-Tick-Events.patch index 9cb8b9a4c0..9cb8b9a4c0 100644 --- a/Spigot-API-Patches/0178-Server-Tick-Events.patch +++ b/Spigot-API-Patches/0177-Server-Tick-Events.patch diff --git a/Spigot-API-Patches/0179-PlayerDeathEvent-getItemsToKeep.patch b/Spigot-API-Patches/0178-PlayerDeathEvent-getItemsToKeep.patch index 625a4dd36d..625a4dd36d 100644 --- a/Spigot-API-Patches/0179-PlayerDeathEvent-getItemsToKeep.patch +++ b/Spigot-API-Patches/0178-PlayerDeathEvent-getItemsToKeep.patch diff --git a/Spigot-API-Patches/0180-Add-Heightmap-API.patch b/Spigot-API-Patches/0179-Add-Heightmap-API.patch index da24bda09e..8fee2880fb 100644 --- a/Spigot-API-Patches/0180-Add-Heightmap-API.patch +++ b/Spigot-API-Patches/0179-Add-Heightmap-API.patch @@ -89,7 +89,7 @@ index d5d67b3d84cd88ed0f858497e68535ec0162c700..ec9eb042ee8354d17f8ad4230c4acc5f * Creates explosion at this location with given power * diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 8d951577c0797d299951f7fd2448121710f07e6b..90e41bead6a51ab1f272af806c396d8411a96eb7 100644 +index 51b2b6d3f5de413391957a42d6a9ccb69688e0eb..cbd39760fd6e18a9d21794c468d874ca8a10d988 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -160,6 +160,87 @@ public interface World extends PluginMessageRecipient, Metadatable { diff --git a/Spigot-API-Patches/0181-Mob-Spawner-API-Enhancements.patch b/Spigot-API-Patches/0180-Mob-Spawner-API-Enhancements.patch index 8c9b668bf2..8c9b668bf2 100644 --- a/Spigot-API-Patches/0181-Mob-Spawner-API-Enhancements.patch +++ b/Spigot-API-Patches/0180-Mob-Spawner-API-Enhancements.patch diff --git a/Spigot-API-Patches/0182-Add-BlockSoundGroup-interface.patch b/Spigot-API-Patches/0181-Add-BlockSoundGroup-interface.patch index 99aba6f305..99aba6f305 100644 --- a/Spigot-API-Patches/0182-Add-BlockSoundGroup-interface.patch +++ b/Spigot-API-Patches/0181-Add-BlockSoundGroup-interface.patch diff --git a/Spigot-API-Patches/0183-Amend-PlayerInteractAtEntityEvent-javadoc-for-ArmorS.patch b/Spigot-API-Patches/0182-Amend-PlayerInteractAtEntityEvent-javadoc-for-ArmorS.patch index b5148c5574..b5148c5574 100644 --- a/Spigot-API-Patches/0183-Amend-PlayerInteractAtEntityEvent-javadoc-for-ArmorS.patch +++ b/Spigot-API-Patches/0182-Amend-PlayerInteractAtEntityEvent-javadoc-for-ArmorS.patch diff --git a/Spigot-API-Patches/0184-Make-PlayerEvent-public.patch b/Spigot-API-Patches/0183-Make-PlayerEvent-public.patch index ed61e9159c..ed61e9159c 100644 --- a/Spigot-API-Patches/0184-Make-PlayerEvent-public.patch +++ b/Spigot-API-Patches/0183-Make-PlayerEvent-public.patch diff --git a/Spigot-API-Patches/0185-Increase-custom-payload-channel-message-size.patch b/Spigot-API-Patches/0184-Increase-custom-payload-channel-message-size.patch index 24aacd2b29..24aacd2b29 100644 --- a/Spigot-API-Patches/0185-Increase-custom-payload-channel-message-size.patch +++ b/Spigot-API-Patches/0184-Increase-custom-payload-channel-message-size.patch diff --git a/Spigot-API-Patches/0186-Expose-the-internal-current-tick.patch b/Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch index a8a2dcc863..a8a2dcc863 100644 --- a/Spigot-API-Patches/0186-Expose-the-internal-current-tick.patch +++ b/Spigot-API-Patches/0185-Expose-the-internal-current-tick.patch diff --git a/Spigot-API-Patches/0187-PlayerDeathEvent-shouldDropExperience.patch b/Spigot-API-Patches/0186-PlayerDeathEvent-shouldDropExperience.patch index 6df0416950..6df0416950 100644 --- a/Spigot-API-Patches/0187-PlayerDeathEvent-shouldDropExperience.patch +++ b/Spigot-API-Patches/0186-PlayerDeathEvent-shouldDropExperience.patch diff --git a/Spigot-API-Patches/0188-Add-effect-to-block-break-naturally.patch b/Spigot-API-Patches/0187-Add-effect-to-block-break-naturally.patch index af59321963..af59321963 100644 --- a/Spigot-API-Patches/0188-Add-effect-to-block-break-naturally.patch +++ b/Spigot-API-Patches/0187-Add-effect-to-block-break-naturally.patch diff --git a/Spigot-API-Patches/0189-Add-ThrownEggHatchEvent.patch b/Spigot-API-Patches/0188-Add-ThrownEggHatchEvent.patch index f605a2a11b..f605a2a11b 100644 --- a/Spigot-API-Patches/0189-Add-ThrownEggHatchEvent.patch +++ b/Spigot-API-Patches/0188-Add-ThrownEggHatchEvent.patch diff --git a/Spigot-API-Patches/0190-Entity-Jump-API.patch b/Spigot-API-Patches/0189-Entity-Jump-API.patch index 32ddfae9d9..32ddfae9d9 100644 --- a/Spigot-API-Patches/0190-Entity-Jump-API.patch +++ b/Spigot-API-Patches/0189-Entity-Jump-API.patch diff --git a/Spigot-API-Patches/0191-add-hand-to-BlockMultiPlaceEvent.patch b/Spigot-API-Patches/0190-add-hand-to-BlockMultiPlaceEvent.patch index f61bddb960..f61bddb960 100644 --- a/Spigot-API-Patches/0191-add-hand-to-BlockMultiPlaceEvent.patch +++ b/Spigot-API-Patches/0190-add-hand-to-BlockMultiPlaceEvent.patch diff --git a/Spigot-API-Patches/0192-Add-tick-times-API.patch b/Spigot-API-Patches/0191-Add-tick-times-API.patch index 92fa5fb431..92fa5fb431 100644 --- a/Spigot-API-Patches/0192-Add-tick-times-API.patch +++ b/Spigot-API-Patches/0191-Add-tick-times-API.patch diff --git a/Spigot-API-Patches/0193-Expose-MinecraftServer-isRunning.patch b/Spigot-API-Patches/0192-Expose-MinecraftServer-isRunning.patch index 26bfdfc461..26bfdfc461 100644 --- a/Spigot-API-Patches/0193-Expose-MinecraftServer-isRunning.patch +++ b/Spigot-API-Patches/0192-Expose-MinecraftServer-isRunning.patch diff --git a/Spigot-API-Patches/0194-Disable-Sync-Events-firing-Async-errors-during-shutd.patch b/Spigot-API-Patches/0193-Disable-Sync-Events-firing-Async-errors-during-shutd.patch index 5ca0264ed8..5ca0264ed8 100644 --- a/Spigot-API-Patches/0194-Disable-Sync-Events-firing-Async-errors-during-shutd.patch +++ b/Spigot-API-Patches/0193-Disable-Sync-Events-firing-Async-errors-during-shutd.patch diff --git a/Spigot-API-Patches/0195-Make-JavaPluginLoader-thread-safe.patch b/Spigot-API-Patches/0194-Make-JavaPluginLoader-thread-safe.patch index 21dbe589a4..21dbe589a4 100644 --- a/Spigot-API-Patches/0195-Make-JavaPluginLoader-thread-safe.patch +++ b/Spigot-API-Patches/0194-Make-JavaPluginLoader-thread-safe.patch diff --git a/Spigot-API-Patches/0196-Add-Player-Client-Options-API.patch b/Spigot-API-Patches/0195-Add-Player-Client-Options-API.patch index a448e6fbf5..a448e6fbf5 100644 --- a/Spigot-API-Patches/0196-Add-Player-Client-Options-API.patch +++ b/Spigot-API-Patches/0195-Add-Player-Client-Options-API.patch diff --git a/Spigot-API-Patches/0197-Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-API-Patches/0196-Add-PlayerAttackEntityCooldownResetEvent.patch index 15fa2db392..15fa2db392 100644 --- a/Spigot-API-Patches/0197-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-API-Patches/0196-Add-PlayerAttackEntityCooldownResetEvent.patch diff --git a/Spigot-API-Patches/0198-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch b/Spigot-API-Patches/0197-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch index 800d5364e2..800d5364e2 100644 --- a/Spigot-API-Patches/0198-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch +++ b/Spigot-API-Patches/0197-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch diff --git a/Spigot-API-Patches/0199-Villager-Restocks-API.patch b/Spigot-API-Patches/0198-Villager-Restocks-API.patch index e2dcfc3144..e2dcfc3144 100644 --- a/Spigot-API-Patches/0199-Villager-Restocks-API.patch +++ b/Spigot-API-Patches/0198-Villager-Restocks-API.patch diff --git a/Spigot-API-Patches/0200-Expose-game-version.patch b/Spigot-API-Patches/0199-Expose-game-version.patch index 20e082dcb5..20e082dcb5 100644 --- a/Spigot-API-Patches/0200-Expose-game-version.patch +++ b/Spigot-API-Patches/0199-Expose-game-version.patch diff --git a/Spigot-API-Patches/0201-Add-item-slot-convenience-methods.patch b/Spigot-API-Patches/0200-Add-item-slot-convenience-methods.patch index b57a965aec..ee23ec1af8 100644 --- a/Spigot-API-Patches/0201-Add-item-slot-convenience-methods.patch +++ b/Spigot-API-Patches/0200-Add-item-slot-convenience-methods.patch @@ -177,6 +177,80 @@ index 4a0c43acc2714e095973eb78536041bb1a179ddc..acf2244f77133df53eb5f862c8e713c8 + } + // Paper end } +diff --git a/src/main/java/org/bukkit/inventory/SmithingInventory.java b/src/main/java/org/bukkit/inventory/SmithingInventory.java +index 616495f8517a187a1eba4d03d5a25580fd0c8715..2b8f21cfce99b6caaedb48df4aa1e989644b88ff 100644 +--- a/src/main/java/org/bukkit/inventory/SmithingInventory.java ++++ b/src/main/java/org/bukkit/inventory/SmithingInventory.java +@@ -1,6 +1,68 @@ + package org.bukkit.inventory; + ++import org.jetbrains.annotations.Nullable; // Paper ++ + /** + * Interface to the inventory of a Smithing table. + */ +-public interface SmithingInventory extends Inventory { } ++public interface SmithingInventory extends Inventory { ++ ++ // Paper start ++ /** ++ * Gets the input equipment (first slot). ++ * ++ * @return input equipment item ++ */ ++ @Nullable ++ default ItemStack getInputEquipment() { ++ return getItem(0); ++ } ++ ++ /** ++ * Sets the input equipment (first slot). ++ * ++ * @param itemStack item to set ++ */ ++ default void setInputEquipment(@Nullable ItemStack itemStack) { ++ setItem(0, itemStack); ++ } ++ ++ /** ++ * Gets the input mineral (second slot). ++ * ++ * @return input mineral item ++ */ ++ @Nullable ++ default ItemStack getInputMineral() { ++ return getItem(1); ++ } ++ ++ /** ++ * Sets the input mineral (second slot). ++ * ++ * @param itemStack item to set ++ */ ++ default void setInputMineral(@Nullable ItemStack itemStack) { ++ setItem(1, itemStack); ++ } ++ ++ /** ++ * Gets the result item. ++ * ++ * @return result ++ */ ++ @Nullable ++ default ItemStack getResult() { ++ return getItem(2); ++ } ++ ++ /** ++ * Sets the result item. ++ * ++ * @param itemStack item to set ++ */ ++ default void setResult(@Nullable ItemStack itemStack) { ++ setItem(2, itemStack); ++ } ++ // Paper end ++} diff --git a/src/main/java/org/bukkit/inventory/StonecutterInventory.java b/src/main/java/org/bukkit/inventory/StonecutterInventory.java index dbb034fae3b8bfaf40e6341460e274c21e321a3b..e7a8e7188bf8b9840de56dc80c2b79d64a9389cb 100644 --- a/src/main/java/org/bukkit/inventory/StonecutterInventory.java diff --git a/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch b/Spigot-API-Patches/0201-Add-Mob-Goal-API.patch index 23567380cc..51e88caa96 100644 --- a/Spigot-API-Patches/0202-Add-Mob-Goal-API.patch +++ b/Spigot-API-Patches/0201-Add-Mob-Goal-API.patch @@ -227,10 +227,10 @@ index 0000000000000000000000000000000000000000..e21f7574763dd4f13794f91bbef192ef +} diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java new file mode 100644 -index 0000000000000000000000000000000000000000..d7f1b2c84aebe8ed04084b9249ed08d5e52a6ecd +index 0000000000000000000000000000000000000000..b42091752981a1f309ab350e9a394092cb334824 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/VanillaGoal.java -@@ -0,0 +1,208 @@ +@@ -0,0 +1,209 @@ +package com.destroystokyo.paper.entity.ai; + +import com.destroystokyo.paper.entity.RangedEntity; @@ -356,6 +356,7 @@ index 0000000000000000000000000000000000000000..d7f1b2c84aebe8ed04084b9249ed08d5 + GoalKey<Slime> SLIME_RANDOM_JUMP = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_random_jump")); + GoalKey<Spider> SPIDER_MELEE_ATTACK = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_melee_attack")); + GoalKey<Spider> SPIDER_NEAREST_ATTACKABLE_TARGET = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_nearest_attackable_target")); ++ GoalKey<Strider> STRIDER_GO_TO_LAVA = GoalKey.of(Strider.class, NamespacedKey.minecraft("strider_go_to_lava")); + GoalKey<Squid> SQUID = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid")); + GoalKey<Squid> SQUID_FLEE = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid_flee")); + GoalKey<Turtle> TURTLE_BREED = GoalKey.of(Turtle.class, NamespacedKey.minecraft("turtle_breed")); diff --git a/Spigot-API-Patches/0203-World-view-distance-api.patch b/Spigot-API-Patches/0202-World-view-distance-api.patch index 31cfeddffb..fdf593acd6 100644 --- a/Spigot-API-Patches/0203-World-view-distance-api.patch +++ b/Spigot-API-Patches/0202-World-view-distance-api.patch @@ -5,10 +5,10 @@ Subject: [PATCH] World view distance api diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 90e41bead6a51ab1f272af806c396d8411a96eb7..71c1e93ea15f0a926a9ad822d09a076f8b800988 100644 +index cbd39760fd6e18a9d21794c468d874ca8a10d988..4511cb786a5618cc1b7ff5cbb97ef1fe8ff05e17 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -3343,6 +3343,34 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -3353,6 +3353,34 @@ public interface World extends PluginMessageRecipient, Metadatable { int getViewDistance(); // Spigot end diff --git a/Spigot-API-Patches/0204-Add-villager-reputation-API.patch b/Spigot-API-Patches/0203-Add-villager-reputation-API.patch index cef4ea6027..cef4ea6027 100644 --- a/Spigot-API-Patches/0204-Add-villager-reputation-API.patch +++ b/Spigot-API-Patches/0203-Add-villager-reputation-API.patch diff --git a/Spigot-API-Patches/0205-Spawn-Reason-API.patch b/Spigot-API-Patches/0204-Spawn-Reason-API.patch index 5be9eb6a70..8c7df5b835 100644 --- a/Spigot-API-Patches/0205-Spawn-Reason-API.patch +++ b/Spigot-API-Patches/0204-Spawn-Reason-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spawn Reason API diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 71c1e93ea15f0a926a9ad822d09a076f8b800988..75c9225bd07b4c4b6dcd702c52294a7637eb6884 100644 +index 4511cb786a5618cc1b7ff5cbb97ef1fe8ff05e17..ba5e6cca028df293a939db37ecf5857059554291 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -1,6 +1,8 @@ @@ -17,7 +17,7 @@ index 71c1e93ea15f0a926a9ad822d09a076f8b800988..75c9225bd07b4c4b6dcd702c52294a76 import org.bukkit.generator.ChunkGenerator; import java.util.ArrayList; -@@ -2146,6 +2148,12 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2156,6 +2158,12 @@ public interface World extends PluginMessageRecipient, Metadatable { @NotNull public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz) throws IllegalArgumentException; @@ -30,7 +30,7 @@ index 71c1e93ea15f0a926a9ad822d09a076f8b800988..75c9225bd07b4c4b6dcd702c52294a76 /** * Spawn an entity of a specific class at the given {@link Location}, with * the supplied function run before the entity is added to the world. -@@ -2163,7 +2171,28 @@ public interface World extends PluginMessageRecipient, Metadatable { +@@ -2173,7 +2181,28 @@ public interface World extends PluginMessageRecipient, Metadatable { * {@link Entity} requested cannot be spawned */ @NotNull diff --git a/Spigot-API-Patches/0206-Potential-bed-API.patch b/Spigot-API-Patches/0205-Potential-bed-API.patch index 021be7137f..b8b1e2519a 100644 --- a/Spigot-API-Patches/0206-Potential-bed-API.patch +++ b/Spigot-API-Patches/0205-Potential-bed-API.patch @@ -8,7 +8,7 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java -index 2668196e04a7de245c63b4b74f0d056784ef0736..d3998c61af0c5fb1189ae7829e8cdfbef0cd3f97 100644 +index 3418133d07250a7fd50caad8d97924b86fb30bad..b09d12390d5f77330ac84452e0fee63a169bd01f 100644 --- a/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java @@ -240,6 +240,19 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, InventoryHolder diff --git a/Spigot-API-Patches/0207-Prioritise-own-classes-where-possible.patch b/Spigot-API-Patches/0206-Prioritise-own-classes-where-possible.patch index fad10c31db..fad10c31db 100644 --- a/Spigot-API-Patches/0207-Prioritise-own-classes-where-possible.patch +++ b/Spigot-API-Patches/0206-Prioritise-own-classes-where-possible.patch diff --git a/Spigot-API-Patches/0208-Add-Raw-Byte-ItemStack-Serialization.patch b/Spigot-API-Patches/0207-Add-Raw-Byte-ItemStack-Serialization.patch index c4406670d6..c4406670d6 100644 --- a/Spigot-API-Patches/0208-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/Spigot-API-Patches/0207-Add-Raw-Byte-ItemStack-Serialization.patch diff --git a/Spigot-API-Patches/0209-Provide-a-useful-PluginClassLoader-toString.patch b/Spigot-API-Patches/0208-Provide-a-useful-PluginClassLoader-toString.patch index 056a908da9..056a908da9 100644 --- a/Spigot-API-Patches/0209-Provide-a-useful-PluginClassLoader-toString.patch +++ b/Spigot-API-Patches/0208-Provide-a-useful-PluginClassLoader-toString.patch diff --git a/Spigot-API-Patches/0210-Inventory-getHolder-method-without-block-snapshot.patch b/Spigot-API-Patches/0209-Inventory-getHolder-method-without-block-snapshot.patch index beffff8aef..5b633e50af 100644 --- a/Spigot-API-Patches/0210-Inventory-getHolder-method-without-block-snapshot.patch +++ b/Spigot-API-Patches/0209-Inventory-getHolder-method-without-block-snapshot.patch @@ -28,10 +28,10 @@ index 83a4642119c3f33749e04c774cf2b39839f797e2..a39d2f1acbbd84ae0e2cf29f85594e09 public Location getLocation() { return getInventory().getLocation(); diff --git a/src/main/java/org/bukkit/inventory/Inventory.java b/src/main/java/org/bukkit/inventory/Inventory.java -index 01fe217dfa93c20bdec53eb981bd6e885a9f7a25..753c052291afb0455df8298ea3a8209778ba400f 100644 +index 9c6a5bdac8c3ab682bbfae04ff24b76a62bc2883..6386206188e820206bb1a9f516b5e194fdc9d952 100644 --- a/src/main/java/org/bukkit/inventory/Inventory.java +++ b/src/main/java/org/bukkit/inventory/Inventory.java -@@ -376,6 +376,17 @@ public interface Inventory extends Iterable<ItemStack> { +@@ -384,6 +384,17 @@ public interface Inventory extends Iterable<ItemStack> { @Nullable public InventoryHolder getHolder(); diff --git a/Spigot-API-Patches/0211-Expose-Arrow-getItemStack.patch b/Spigot-API-Patches/0210-Expose-Arrow-getItemStack.patch index e718e0e598..e718e0e598 100644 --- a/Spigot-API-Patches/0211-Expose-Arrow-getItemStack.patch +++ b/Spigot-API-Patches/0210-Expose-Arrow-getItemStack.patch diff --git a/Spigot-API-Patches/0212-Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-API-Patches/0211-Add-and-implement-PlayerRecipeBookClickEvent.patch index 93bd233b85..93bd233b85 100644 --- a/Spigot-API-Patches/0212-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/Spigot-API-Patches/0211-Add-and-implement-PlayerRecipeBookClickEvent.patch diff --git a/Spigot-API-Patches/0213-Support-components-in-ItemMeta.patch b/Spigot-API-Patches/0212-Support-components-in-ItemMeta.patch index df59d38f9d..df59d38f9d 100644 --- a/Spigot-API-Patches/0213-Support-components-in-ItemMeta.patch +++ b/Spigot-API-Patches/0212-Support-components-in-ItemMeta.patch diff --git a/Spigot-API-Patches/0214-added-2-new-TargetReasons-for-1.16-mob-behavior.patch b/Spigot-API-Patches/0213-added-2-new-TargetReasons-for-1.16-mob-behavior.patch index 747470a546..747470a546 100644 --- a/Spigot-API-Patches/0214-added-2-new-TargetReasons-for-1.16-mob-behavior.patch +++ b/Spigot-API-Patches/0213-added-2-new-TargetReasons-for-1.16-mob-behavior.patch diff --git a/Spigot-API-Patches/0215-Add-entity-liquid-API.patch b/Spigot-API-Patches/0214-Add-entity-liquid-API.patch index c352c84578..c352c84578 100644 --- a/Spigot-API-Patches/0215-Add-entity-liquid-API.patch +++ b/Spigot-API-Patches/0214-Add-entity-liquid-API.patch diff --git a/Spigot-API-Patches/0216-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch b/Spigot-API-Patches/0215-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch index 5dc61d601d..5dc61d601d 100644 --- a/Spigot-API-Patches/0216-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch +++ b/Spigot-API-Patches/0215-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch diff --git a/Spigot-API-Patches/0217-Allow-delegation-to-vanilla-chunk-gen.patch b/Spigot-API-Patches/0216-Allow-delegation-to-vanilla-chunk-gen.patch index 77dc33a6a1..77dc33a6a1 100644 --- a/Spigot-API-Patches/0217-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/Spigot-API-Patches/0216-Allow-delegation-to-vanilla-chunk-gen.patch diff --git a/Spigot-API-Patches/0218-Support-hex-colors-in-getLastColors.patch b/Spigot-API-Patches/0217-Support-hex-colors-in-getLastColors.patch index a3117a4377..a3117a4377 100644 --- a/Spigot-API-Patches/0218-Support-hex-colors-in-getLastColors.patch +++ b/Spigot-API-Patches/0217-Support-hex-colors-in-getLastColors.patch diff --git a/Spigot-API-Patches/0218-Add-setMaxPlayers-API.patch b/Spigot-API-Patches/0218-Add-setMaxPlayers-API.patch new file mode 100644 index 0000000000..625a3b35af --- /dev/null +++ b/Spigot-API-Patches/0218-Add-setMaxPlayers-API.patch @@ -0,0 +1,48 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Sat, 22 Aug 2020 23:59:25 +0200 +Subject: [PATCH] Add #setMaxPlayers API + + +diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java +index 62cc1c74c11f56dcbd1e24e9c5478497742e6351..bfe842364ee0a4bf39dacdbb6972477d57a4ef8a 100644 +--- a/src/main/java/org/bukkit/Bukkit.java ++++ b/src/main/java/org/bukkit/Bukkit.java +@@ -171,6 +171,17 @@ public final class Bukkit { + return server.getMaxPlayers(); + } + ++ // Paper start ++ /** ++ * Set the maximum amount of players which can login to this server. ++ * ++ * @param maxPlayers the amount of players this server allows ++ */ ++ public static void setMaxPlayers(int maxPlayers) { ++ server.setMaxPlayers(maxPlayers); ++ } ++ // Paper end ++ + /** + * Get the game port that the server runs on. + * +diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java +index 6e01bf2d52e8bb6de7395f50c12f16c64aef72ae..7c0a788900c93c29d14d8c45ac5ae3317cf4a94e 100644 +--- a/src/main/java/org/bukkit/Server.java ++++ b/src/main/java/org/bukkit/Server.java +@@ -144,6 +144,15 @@ public interface Server extends PluginMessageRecipient { + */ + public int getMaxPlayers(); + ++ // Paper start ++ /** ++ * Set the maximum amount of players which can login to this server. ++ * ++ * @param maxPlayers the amount of players this server allows ++ */ ++ public void setMaxPlayers(int maxPlayers); ++ // Paper end ++ + /** + * Get the game port that the server runs on. + * diff --git a/Spigot-API-Patches/0219-Add-moon-phase-API.patch b/Spigot-API-Patches/0219-Add-moon-phase-API.patch new file mode 100644 index 0000000000..8083d92ef7 --- /dev/null +++ b/Spigot-API-Patches/0219-Add-moon-phase-API.patch @@ -0,0 +1,65 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath <[email protected]> +Date: Sun, 23 Aug 2020 16:32:03 +0200 +Subject: [PATCH] Add moon phase API + + +diff --git a/src/main/java/io/papermc/paper/world/MoonPhase.java b/src/main/java/io/papermc/paper/world/MoonPhase.java +new file mode 100644 +index 0000000000000000000000000000000000000000..df05153397b42930cd53d37b30824c7e5f008f7e +--- /dev/null ++++ b/src/main/java/io/papermc/paper/world/MoonPhase.java +@@ -0,0 +1,36 @@ ++package io.papermc.paper.world; ++ ++import org.jetbrains.annotations.NotNull; ++ ++import java.util.HashMap; ++import java.util.Map; ++ ++public enum MoonPhase { ++ FULL_MOON(0L), ++ WANING_GIBBOUS(1L), ++ LAST_QUARTER(2L), ++ WANING_CRESCENT(3L), ++ NEW_MOON(4L), ++ WAXING_CRESCENT(5L), ++ FIRST_QUARTER(6L), ++ WAXING_GIBBOUS(7L); ++ ++ private final long day; ++ ++ MoonPhase(long day) { ++ this.day = day; ++ } ++ ++ private static final Map<Long, MoonPhase> BY_DAY = new HashMap<>(); ++ ++ static { ++ for (MoonPhase phase : values()) { ++ BY_DAY.put(phase.day, phase); ++ } ++ } ++ ++ @NotNull ++ public static MoonPhase getPhase(long day) { ++ return BY_DAY.get(day % 8L); ++ } ++} +diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java +index ba5e6cca028df293a939db37ecf5857059554291..e827e1a6f5c0f8410ed32dda8f17aa769b469999 100644 +--- a/src/main/java/org/bukkit/World.java ++++ b/src/main/java/org/bukkit/World.java +@@ -70,6 +70,12 @@ public interface World extends PluginMessageRecipient, Metadatable { + * @return The amount of Players in this world + */ + int getPlayerCount(); ++ ++ /** ++ * @return the current moon phase at the current time in the world ++ */ ++ @NotNull ++ io.papermc.paper.world.MoonPhase getMoonPhase(); + // Paper end + + /** diff --git a/Spigot-API-Patches/0219-Brand-support.patch b/Spigot-API-Patches/0220-Brand-support.patch index bb501f24a8..bb501f24a8 100644 --- a/Spigot-API-Patches/0219-Brand-support.patch +++ b/Spigot-API-Patches/0220-Brand-support.patch diff --git a/Spigot-Server-Patches/0001-POM-Changes.patch b/Spigot-Server-Patches/0001-POM-Changes.patch index 7a883c3fc3..30ad54fed3 100644 --- a/Spigot-Server-Patches/0001-POM-Changes.patch +++ b/Spigot-Server-Patches/0001-POM-Changes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] POM Changes diff --git a/pom.xml b/pom.xml -index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef50031567c1a72dc 100644 +index 56c23681feafa2760740ad03cb7f5f274df6e20d..3dfb494e1f09da7a6ebf6c740d4e9e06eb7d4121 100644 --- a/pom.xml +++ b/pom.xml @@ -1,15 +1,14 @@ @@ -16,7 +16,7 @@ index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef5003156 - <artifactId>spigot</artifactId> + <artifactId>paper</artifactId> <packaging>jar</packaging> - <version>1.16.1-R0.1-SNAPSHOT</version> + <version>1.16.2-R0.1-SNAPSHOT</version> - <name>Spigot</name> - <url>https://www.spigotmc.org/</url> + <name>Paper</name> @@ -27,7 +27,7 @@ index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef5003156 + <!-- <skipTests>true</skipTests> Paper - This [was] not going to end well --> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <api.version>unknown</api.version> - <minecraft.version>1.16.1</minecraft.version> + <minecraft.version>1.16.2</minecraft.version> @@ -19,16 +18,22 @@ </properties> @@ -190,7 +190,7 @@ index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef5003156 <!-- we need our custom version as it fixes some bugs on case sensitive file systems --> <dependency> diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index eaec0c30f15e4ee4611ae7c9b2c146d75a1e0d51..5014cbbeef9a9980cca43680c3378b9d6cc210d3 100644 +index 93bc7535a68fbf8c2dd3b5e18cedbcbf140d60c4..113ea57fec3d71bd9842d27674eac6201d20c2d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -186,7 +186,7 @@ public class Main { @@ -201,7 +201,7 @@ index eaec0c30f15e4ee4611ae7c9b2c146d75a1e0d51..5014cbbeef9a9980cca43680c3378b9d + Date buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").parse(Main.class.getPackage().getImplementationVendor()); // Paper Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -7); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java index 93046379d0cefd5d3236fc59e698809acdc18f80..674096cab190d62622f9947853b056f57d43a2a5 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java diff --git a/Spigot-Server-Patches/0002-Paper-config-files.patch b/Spigot-Server-Patches/0002-Paper-config-files.patch index 887692ab8a..1cd2da5d2c 100644 --- a/Spigot-Server-Patches/0002-Paper-config-files.patch +++ b/Spigot-Server-Patches/0002-Paper-config-files.patch @@ -532,7 +532,7 @@ index 0000000000000000000000000000000000000000..a738657394bcccd859ef260a801736d4 + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 062a82c37723b7f032103ba2904877ae79b1ae01..5585b5646b5f3650aa3b795be06f920699a85403 100644 +index f6335ed3eba55e939aa24b1eeb83026e61d92235..94b8cda9ce78aa22c14e88f3500bb9814ff7f631 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -273,15 +273,15 @@ public class ChunkProviderServer extends IChunkProvider { @@ -556,7 +556,7 @@ index 062a82c37723b7f032103ba2904877ae79b1ae01..5585b5646b5f3650aa3b795be06f9206 } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfab071b3c4 100644 +index ca95b5aba2bdbd35ffec5327975d1b04a2b9b02a..7f3c6518cce96354cc2217e5e112ac426199ae9b 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -148,6 +148,15 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -576,7 +576,7 @@ index 27e6872c675647d7e61040b76183dac4e347a40c..aa68eb71b131c1d529ded6c651621cfa this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 62f62c2c98fbaff163d9079091e6f39db2d77fa0..484e78746aa62bb0b12968165bf8e056b27152f3 100644 +index 5cecefc7e1c3b61c47563245fb1ffed16ec0851f..9ca142e2a841e686c5647de46f0f6992a431289e 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -587,7 +587,7 @@ index 62f62c2c98fbaff163d9079091e6f39db2d77fa0..484e78746aa62bb0b12968165bf8e056 import java.util.UUID; import java.util.function.Function; import java.util.stream.Stream; -@@ -463,4 +464,10 @@ public class EntityTypes<T extends Entity> { +@@ -468,4 +469,10 @@ public class EntityTypes<T extends Entity> { return new EntityTypes<>(this.a, this.b, this.d, this.e, this.f, this.g, this.c, this.j, this.h, this.i); } } @@ -599,11 +599,11 @@ index 62f62c2c98fbaff163d9079091e6f39db2d77fa0..484e78746aa62bb0b12968165bf8e056 + // Paper end } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index d88946122e98abdefed54b29f510c7d4049fdff6..11ad9ca7d030895662903a09558fd353dcc3e49e 100644 +index 4da97dbcf95b1e782ef80956c5d128972b2c3ed5..059b9634aeffc6f710d40112f5f8d9b877f2c7a3 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -64,6 +64,12 @@ public class Main { - DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(optionset); // CraftBukkit - CLI argument support +@@ -65,6 +65,12 @@ public class Main { + DedicatedServerSettings dedicatedserversettings = new DedicatedServerSettings(iregistrycustom_dimension, optionset); // CraftBukkit - CLI argument support dedicatedserversettings.save(); + // Paper start - load config files for access below if needed @@ -633,7 +633,7 @@ index d88946122e98abdefed54b29f510c7d4049fdff6..11ad9ca7d030895662903a09558fd353 Main.LOGGER.info("Forcing world upgrade! {}", convertable_conversionsession.getLevelName()); // CraftBukkit WorldUpgrader worldupgrader = new WorldUpgrader(convertable_conversionsession, datafixer, immutableset, flag); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 5ffc84b40454e0d04e449e8b895fd5a44ebf34f6..c2403484daa7d0973b27654a9b48d0945661aa6c 100644 +index ad7acac0a980c975b9e98f17b99ad801e9176291..a5c1f82dfc80c839c38fa6139b83d3aebeae9155 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -77,6 +77,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -645,19 +645,19 @@ index 5ffc84b40454e0d04e449e8b895fd5a44ebf34f6..c2403484daa7d0973b27654a9b48d094 public final SpigotTimings.WorldTimingsHandler timings; // Spigot public static BlockPosition lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; -@@ -93,6 +95,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -97,6 +99,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { + protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 99cba42566433fdd68d432cae80d98a310c98460..23ee1e59bbc560eb2f405fccf4170dcff278be3d 100644 +index 46669f0b51bd9c2c5c2b721106b9e8e90b52b2c2..db5001cd4c601e35678181ba0ae66b3ed3cde124 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -803,6 +803,7 @@ public final class CraftServer implements Server { +@@ -802,6 +802,7 @@ public final class CraftServer implements Server { } org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot @@ -665,7 +665,7 @@ index 99cba42566433fdd68d432cae80d98a310c98460..23ee1e59bbc560eb2f405fccf4170dcf for (WorldServer world : console.getWorlds()) { world.worldDataServer.setDifficulty(config.difficulty); world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); -@@ -836,6 +837,7 @@ public final class CraftServer implements Server { +@@ -835,6 +836,7 @@ public final class CraftServer implements Server { world.ticksPerAmbientSpawns = this.getTicksPerAmbientSpawns(); } world.spigotConfig.init(); // Spigot @@ -673,7 +673,7 @@ index 99cba42566433fdd68d432cae80d98a310c98460..23ee1e59bbc560eb2f405fccf4170dcf } pluginManager.clearPlugins(); -@@ -843,6 +845,7 @@ public final class CraftServer implements Server { +@@ -842,6 +844,7 @@ public final class CraftServer implements Server { resetRecipes(); reloadData(); org.spigotmc.SpigotConfig.registerCommands(); // Spigot @@ -681,7 +681,7 @@ index 99cba42566433fdd68d432cae80d98a310c98460..23ee1e59bbc560eb2f405fccf4170dcf overrideAllCommandBlockCommands = commandsConfiguration.getStringList("command-block-overrides").contains("*"); ignoreVanillaPermissions = commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2086,4 +2089,35 @@ public final class CraftServer implements Server { +@@ -2080,4 +2083,35 @@ public final class CraftServer implements Server { { return spigot; } @@ -718,7 +718,7 @@ index 99cba42566433fdd68d432cae80d98a310c98460..23ee1e59bbc560eb2f405fccf4170dcf + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 5014cbbeef9a9980cca43680c3378b9d6cc210d3..fc76dc4585c54608531c75e48a3bacce7dc9d729 100644 +index 113ea57fec3d71bd9842d27674eac6201d20c2d5..4e5611beaa22a08573e373cc87e9a265c8bca5aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -129,6 +129,14 @@ public class Main { diff --git a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch index c79c4e28c1..4660a79203 100644 --- a/Spigot-Server-Patches/0003-MC-Dev-fixes.patch +++ b/Spigot-Server-Patches/0003-MC-Dev-fixes.patch @@ -50,180 +50,40 @@ index a3afe60b0d85cf90bf7a170dc0a0b61a796381a7..85f799a713db0c822d46b689010f9f6b System.arraycopy(this.b, 0, au, 0, this.c); if (au.length > this.c) { diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 6c2ed9c1b8567abcdb11bdc3dbaeed217a2f61e7..ae0ac8d383ca11a683465d8c83a8b8a66e567079 100644 +index 3b374fb7d55de67ef8a5fb6d6ed1081e7c644a77..260fd033c1017389a6f28447a6017b0ca15514d8 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -26,76 +26,31 @@ import org.apache.logging.log4j.Logger; - public class BiomeBase { +@@ -20,8 +20,15 @@ import org.apache.logging.log4j.Logger; + public final class BiomeBase { public static final Logger LOGGER = LogManager.getLogger(); -- public static final Codec<BiomeBase> b = RecordCodecBuilder.create((instance) -> { -- RecordCodecBuilder recordcodecbuilder = BiomeBase.Precipitation.d.fieldOf("precipitation").forGetter((biomebase) -> { -- return biomebase.o; -- }); -- RecordCodecBuilder recordcodecbuilder1 = BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> { -- return biomebase.n; -- }); -- RecordCodecBuilder recordcodecbuilder2 = Codec.FLOAT.fieldOf("depth").forGetter((biomebase) -> { -- return biomebase.h; -- }); -- RecordCodecBuilder recordcodecbuilder3 = Codec.FLOAT.fieldOf("scale").forGetter((biomebase) -> { -- return biomebase.i; -- }); -- RecordCodecBuilder recordcodecbuilder4 = Codec.FLOAT.fieldOf("temperature").forGetter((biomebase) -> { -- return biomebase.j; -- }); -- RecordCodecBuilder recordcodecbuilder5 = Codec.FLOAT.fieldOf("downfall").forGetter((biomebase) -> { -- return biomebase.k; -- }); -- RecordCodecBuilder recordcodecbuilder6 = BiomeFog.a.fieldOf("effects").forGetter((biomebase) -> { -- return biomebase.p; -- }); -- RecordCodecBuilder recordcodecbuilder7 = Codec.INT.fieldOf("sky_color").forGetter((biomebase) -> { -- return biomebase.t; -- }); -- RecordCodecBuilder recordcodecbuilder8 = WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter((biomebase) -> { -- return biomebase.m; -- }); -- Codec codec = WorldGenStage.Features.c; -- Codec codec1 = WorldGenCarverWrapper.a.listOf(); -- Logger logger = BiomeBase.LOGGER; -- -- logger.getClass(); -- RecordCodecBuilder recordcodecbuilder9 = Codec.simpleMap(codec, codec1.promotePartial(SystemUtils.a("Carver: ", logger::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter((biomebase) -> { -- return biomebase.q; -- }); -- -- codec1 = WorldGenStage.Decoration.k; -- Codec codec2 = WorldGenFeatureConfigured.b.listOf(); -- Logger logger1 = BiomeBase.LOGGER; -- -- logger1.getClass(); -- RecordCodecBuilder recordcodecbuilder10 = Codec.simpleMap(codec1, codec2.promotePartial(SystemUtils.a("Feature: ", logger1::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter((biomebase) -> { -- return biomebase.r; -- }); -- -- codec2 = StructureFeature.a.listOf(); -- logger1 = BiomeBase.LOGGER; -- logger1.getClass(); -- RecordCodecBuilder recordcodecbuilder11 = codec2.promotePartial(SystemUtils.a("Structure start: ", logger1::error)).fieldOf("starts").forGetter((biomebase) -> { -- return (List) biomebase.u.values().stream().sorted(Comparator.comparing((structurefeature) -> { -- return IRegistry.STRUCTURE_FEATURE.getKey(structurefeature.b); -- })).collect(Collectors.toList()); -- }); -- Codec codec3 = EnumCreatureType.g; -- Codec codec4 = BiomeBase.BiomeMeta.b.listOf(); -- Logger logger2 = BiomeBase.LOGGER; -- -- logger2.getClass(); -- return instance.group(recordcodecbuilder, recordcodecbuilder1, recordcodecbuilder2, recordcodecbuilder3, recordcodecbuilder4, recordcodecbuilder5, recordcodecbuilder6, recordcodecbuilder7, recordcodecbuilder8, recordcodecbuilder9, recordcodecbuilder10, recordcodecbuilder11, Codec.simpleMap(codec3, codec4.promotePartial(SystemUtils.a("Spawn data: ", logger2::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter((biomebase) -> { -- return biomebase.v; -- }), BiomeBase.d.a.listOf().fieldOf("climate_parameters").forGetter((biomebase) -> { -- return biomebase.x; -- }), Codec.STRING.optionalFieldOf("parent").forGetter((biomebase) -> { -- return Optional.ofNullable(biomebase.l); -- })).apply(instance, BiomeBase::new); -+ // Paper decompile error - Spigots stupid decompiler -+ public static final Codec<BiomeBase> b = RecordCodecBuilder.create(i -> { -+ Codec k1 = WorldGenStage.Decoration.k; // Erase type - WorldGenstage.Decoration has wrong type -+ return i.group( -+ Precipitation.d.fieldOf("precipitation").forGetter(biome -> biome.o), -+ Geography.r.fieldOf("category").forGetter(biome -> biome.n), -+ Codec.FLOAT.fieldOf("depth").forGetter(biome -> biome.h), -+ Codec.FLOAT.fieldOf("scale").forGetter(biome -> biome.i), -+ Codec.FLOAT.fieldOf("temperature").forGetter(biome -> biome.j), -+ Codec.FLOAT.fieldOf("downfall").forGetter(biome -> biome.k), -+ BiomeFog.a.fieldOf("effects").forGetter(biome -> biome.p), -+ Codec.INT.fieldOf("sky_color").forGetter(biome -> biome.t), -+ WorldGenSurfaceComposite.a.fieldOf("surface_builder").forGetter(biome -> biome.m), -+ Codec.simpleMap(WorldGenStage.Features.c, WorldGenCarverWrapper.a.listOf().promotePartial(SystemUtils.a("Carver: ", LOGGER::error)), INamable.a(WorldGenStage.Features.values())).fieldOf("carvers").forGetter(biome -> biome.q), -+ Codec.simpleMap((Codec<WorldGenStage.Decoration>) k1, WorldGenFeatureConfigured.b.listOf().promotePartial(SystemUtils.a("Feature: ", LOGGER::error)), INamable.a(WorldGenStage.Decoration.values())).fieldOf("features").forGetter(biome -> biome.r), -+ StructureFeature.a.listOf().promotePartial(SystemUtils.a("Structure start: ", LOGGER::error)).fieldOf("starts").forGetter(biome -> biome.u.values().stream().sorted(Comparator.comparing(cf -> IRegistry.STRUCTURE_FEATURE.getKey(cf.b))).collect(Collectors.toList())), -+ Codec.simpleMap(EnumCreatureType.g, BiomeMeta.b.listOf().promotePartial(SystemUtils.a("Spawn data: ", LOGGER::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter(biome -> biome.v), -+ d.a.listOf().fieldOf("climate_parameters").forGetter(biome -> biome.x), -+ Codec.STRING.optionalFieldOf("parent").forGetter(biome -> Optional.ofNullable(biome.l)) -+ ).apply(i, BiomeBase::new); -+ // Paper end ++ // Paper start ++ private static class dProxy extends BiomeBase.d { ++ private dProxy(Precipitation biomebase_precipitation, float f, TemperatureModifier biomebase_temperaturemodifier, float f1) { ++ super(biomebase_precipitation, f, biomebase_temperaturemodifier, f1); ++ } ++ }; ++ // Paper end + public static final Codec<BiomeBase> b = RecordCodecBuilder.create((instance) -> { +- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> { ++ return instance.group(dProxy.a.forGetter((biomebase) -> { // Paper + return biomebase.j; + }), BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> { + return biomebase.o; +@@ -38,7 +45,7 @@ public final class BiomeBase { + })).apply(instance, BiomeBase::new); }); - public static final Set<BiomeBase> c = Sets.newHashSet(); -- public static final RegistryBlockID<BiomeBase> d = new RegistryBlockID<>(); -- protected static final NoiseGenerator3 e = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0)); -+ public static final RegistryBlockID<BiomeBase> reg = new RegistryBlockID<>(); // Paper - decompile error - rename -+ protected static final NoiseGenerator3 NOISE_GENERATOR_3 = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0)); // Paper - decompile error - rename - public static final NoiseGenerator3 f = new NoiseGenerator3(new SeededRandom(2345L), ImmutableList.of(0)); - @Nullable - protected String g; -@@ -130,7 +85,7 @@ public class BiomeBase { - - @Nullable - public static BiomeBase a(BiomeBase biomebase) { -- return (BiomeBase) BiomeBase.d.fromId(IRegistry.BIOME.a((Object) biomebase)); -+ return (BiomeBase) BiomeBase.reg.fromId(IRegistry.BIOME.a(biomebase)); // Paper - decompile fix / rename - } - - public static <C extends WorldGenCarverConfiguration> WorldGenCarverWrapper<C> a(WorldGenCarverAbstract<C> worldgencarverabstract, C c0) { -@@ -197,7 +152,7 @@ public class BiomeBase { - }, Function.identity())); - this.v = map2; - this.x = list1; -- this.l = (String) optional.orElse((Object) null); -+ this.l = (String) optional.orElse(null); // Paper - decompile fix - Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> { - return worldgenfeatureconfigured.d == WorldGenerator.DECORATED_FLOWER; - }); -@@ -250,7 +205,7 @@ public class BiomeBase { - - protected float a(BlockPosition blockposition) { - if (blockposition.getY() > 64) { -- float f = (float) (BiomeBase.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); -+ float f = (float) (BiomeBase.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - decompile error - rename - - return this.getTemperature() - (f + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; - } else { -diff --git a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java -index 2ac69bf2ae5cbb763fc95c948725373a5c9b95b3..fdc66fc1e3440b6678a1318e9a109f2b41bc8847 100644 ---- a/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java -+++ b/src/main/java/net/minecraft/server/BiomeFrozenDeepOcean.java -@@ -58,7 +58,7 @@ public class BiomeFrozenDeepOcean extends BiomeBase { - } - - if (blockposition.getY() > 64) { -- float f1 = (float) (BiomeFrozenDeepOcean.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); -+ float f1 = (float) (BiomeFrozenDeepOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename - - return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; - } else { -diff --git a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java -index 0d0ccaec8c497c9d222c7593684ed2d913d1881e..4b18e29ccb0cb15568367abb507b844011bd7f80 100644 ---- a/src/main/java/net/minecraft/server/BiomeFrozenOcean.java -+++ b/src/main/java/net/minecraft/server/BiomeFrozenOcean.java -@@ -57,7 +57,7 @@ public final class BiomeFrozenOcean extends BiomeBase { - } - - if (blockposition.getY() > 64) { -- float f1 = (float) (BiomeFrozenOcean.e.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); -+ float f1 = (float) (BiomeFrozenOcean.NOISE_GENERATOR_3.a((double) ((float) blockposition.getX() / 8.0F), (double) ((float) blockposition.getZ() / 8.0F), false) * 4.0D); // Paper - rename - - return f - (f1 + (float) blockposition.getY() - 64.0F) * 0.05F / 30.0F; - } else { -diff --git a/src/main/java/net/minecraft/server/Biomes.java b/src/main/java/net/minecraft/server/Biomes.java -index 0aa66addb2cb472b2ab90000d3f0e0f967353e0f..eaa527f4fe289a9492b12591154a60e5aa045252 100644 ---- a/src/main/java/net/minecraft/server/Biomes.java -+++ b/src/main/java/net/minecraft/server/Biomes.java -@@ -88,7 +88,7 @@ public abstract class Biomes { - private static BiomeBase a(int i, String s, BiomeBase biomebase) { - IRegistry.a(IRegistry.BIOME, i, s, biomebase); - if (biomebase.b()) { -- BiomeBase.d.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l)))); -+ BiomeBase.reg.a(biomebase, IRegistry.BIOME.a(IRegistry.BIOME.get(new MinecraftKey(biomebase.l)))); - } - - return biomebase; + public static final Codec<BiomeBase> c = RecordCodecBuilder.create((instance) -> { +- return instance.group(BiomeBase.d.a.forGetter((biomebase) -> { ++ return instance.group(dProxy.a.forGetter((biomebase) -> { // Paper + return biomebase.j; + }), BiomeBase.Geography.r.fieldOf("category").forGetter((biomebase) -> { + return biomebase.o; diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c91d191f3 100644 +index 420863ca190f72dd8b534859f620fd0ebeb29d70..1b2f415e3ed7f6dca12d13cd098cb4ec3af54020 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -220,8 +220,8 @@ public class BlockPosition extends BaseBlockPosition { +@@ -235,8 +235,8 @@ public class BlockPosition extends BaseBlockPosition { }; } @@ -234,7 +94,7 @@ index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c int i1 = blockposition.getX(); int j1 = blockposition.getY(); int k1 = blockposition.getZ(); -@@ -249,15 +249,15 @@ public class BlockPosition extends BaseBlockPosition { +@@ -264,15 +264,15 @@ public class BlockPosition extends BaseBlockPosition { ++this.l; if (this.l > this.j) { ++this.i; @@ -253,7 +113,7 @@ index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c this.m = -this.k; } -@@ -265,7 +265,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -280,7 +280,7 @@ public class BlockPosition extends BaseBlockPosition { int i2 = this.m; int j2 = this.i - Math.abs(l1) - Math.abs(i2); @@ -262,6 +122,22 @@ index 8eb94bcb605f882c9ce096fc758df5e3ae3ab28d..886b43e2b8f21c358b4d6785c677f14c this.n = j2 != 0; blockposition_mutableblockposition = this.h.d(i1 + l1, j1 + i2, k1 + j2); } +@@ -349,13 +349,13 @@ public class BlockPosition extends BaseBlockPosition { + }; + } + +- public static Iterable<BlockPosition.MutableBlockPosition> a(BlockPosition blockposition, int i, EnumDirection enumdirection, EnumDirection enumdirection1) { ++ public static Iterable<BlockPosition.MutableBlockPosition> a(BlockPosition blockposition, int I, EnumDirection enumdirection, EnumDirection enumdirection1) { // Paper - decompile fix + Validate.validState(enumdirection.n() != enumdirection1.n(), "The two directions cannot be on the same axis", new Object[0]); + return () -> { + return new AbstractIterator<BlockPosition.MutableBlockPosition>() { + private final EnumDirection[] e = new EnumDirection[]{enumdirection, enumdirection1, enumdirection.opposite(), enumdirection1.opposite()}; + private final BlockPosition.MutableBlockPosition f = blockposition.i().c(enumdirection1); +- private final int g = 4 * i; ++ private final int g = 4 * I; + private int h = -1; + private int i; + private int j; diff --git a/src/main/java/net/minecraft/server/BlockStateEnum.java b/src/main/java/net/minecraft/server/BlockStateEnum.java index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15977047f8 100644 --- a/src/main/java/net/minecraft/server/BlockStateEnum.java @@ -280,7 +156,7 @@ index 771841e08591955e61c7bcc5b09c8457652c1b9c..8162c11d14b8e88c2b572f9ddf6b7a15 if (this.b.containsKey(s1)) { diff --git a/src/main/java/net/minecraft/server/CraftingManager.java b/src/main/java/net/minecraft/server/CraftingManager.java -index fbb708f5f7e4d2da9d96b595498da436b088a408..f27c7041cdc2f062f0abb222b02026194ab33c60 100644 +index fdb7d96cf20b37cb7bec83f5489402167bd842d5..58ecbe1e20581dc9e78cdd2f4ece29cfa014da8a 100644 --- a/src/main/java/net/minecraft/server/CraftingManager.java +++ b/src/main/java/net/minecraft/server/CraftingManager.java @@ -64,7 +64,7 @@ public class CraftingManager extends ResourceDataJson { @@ -292,8 +168,21 @@ index fbb708f5f7e4d2da9d96b595498da436b088a408..f27c7041cdc2f062f0abb222b0202619 })); CraftingManager.LOGGER.info("Loaded {} recipes", map1.size()); } +diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java +index 96d6c55c9a2fbb9f93d369eadaacf00b7e64b79e..e77634bb4d33716ed41468722187080ae7243f3d 100644 +--- a/src/main/java/net/minecraft/server/EnderDragonBattle.java ++++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java +@@ -388,7 +388,7 @@ public class EnderDragonBattle { + } + } + +- worldgenendtrophy.b((WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.k).a(this.world, this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation); ++ worldgenendtrophy.b(WorldGenFeatureConfiguration.k).a(this.world, this.world.getChunkProvider().getChunkGenerator(), new Random(), this.exitPortalLocation); // Paper - decompile fix + } + + private EntityEnderDragon o() { diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 4ab6e82a1415c40f3e2eee7414bf7de97f53b420..9c152b79164710d3d4175d0acbc9548d61390097 100644 +index ada618efe6cef7cf97959337d2cbb039c176f99c..a959006185afaa3306fdd228f52d8177b58286a7 100644 --- a/src/main/java/net/minecraft/server/EntityVindicator.java +++ b/src/main/java/net/minecraft/server/EntityVindicator.java @@ -25,7 +25,7 @@ public class EntityVindicator extends EntityIllagerAbstract { @@ -306,19 +195,20 @@ index 4ab6e82a1415c40f3e2eee7414bf7de97f53b420..9c152b79164710d3d4175d0acbc9548d this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, true)); this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); diff --git a/src/main/java/net/minecraft/server/EnumProtocol.java b/src/main/java/net/minecraft/server/EnumProtocol.java -index 728417e7c7caabe58b7edcd051f24209e5620bec..d384b1e857a5fe21a93e6fb956a2bfd777d92de3 100644 +index 1de8c7eaeb08c645058dbe1da7ca8ef91958abda..32f5470baa88c3dc80db1bb547e1c982ac90237d 100644 --- a/src/main/java/net/minecraft/server/EnumProtocol.java +++ b/src/main/java/net/minecraft/server/EnumProtocol.java -@@ -13,7 +13,7 @@ import org.apache.logging.log4j.LogManager; +@@ -13,7 +13,8 @@ import org.apache.logging.log4j.LogManager; public enum EnumProtocol { -- HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new))); -+ HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketHandshakingInListener>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketListenerPlayOut>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketListenerPlayIn>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketStatusInListener>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketStatusOutListener>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketLoginOutListener>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketLoginInListener>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new))); // Paper - fix decompile error +- HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeSettings.class, PacketPlayInRecipeSettings::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new))); ++ // Paper - fix decompile error - add generic names to < > like PacketListenerPlayOut ++ HANDSHAKING(-1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketHandshakingInListener>()).a(PacketHandshakingInSetProtocol.class, PacketHandshakingInSetProtocol::new))), PLAY(0, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketListenerPlayOut>()).a(PacketPlayOutSpawnEntity.class, PacketPlayOutSpawnEntity::new).a(PacketPlayOutSpawnEntityExperienceOrb.class, PacketPlayOutSpawnEntityExperienceOrb::new).a(PacketPlayOutSpawnEntityLiving.class, PacketPlayOutSpawnEntityLiving::new).a(PacketPlayOutSpawnEntityPainting.class, PacketPlayOutSpawnEntityPainting::new).a(PacketPlayOutNamedEntitySpawn.class, PacketPlayOutNamedEntitySpawn::new).a(PacketPlayOutAnimation.class, PacketPlayOutAnimation::new).a(PacketPlayOutStatistic.class, PacketPlayOutStatistic::new).a(PacketPlayOutBlockBreak.class, PacketPlayOutBlockBreak::new).a(PacketPlayOutBlockBreakAnimation.class, PacketPlayOutBlockBreakAnimation::new).a(PacketPlayOutTileEntityData.class, PacketPlayOutTileEntityData::new).a(PacketPlayOutBlockAction.class, PacketPlayOutBlockAction::new).a(PacketPlayOutBlockChange.class, PacketPlayOutBlockChange::new).a(PacketPlayOutBoss.class, PacketPlayOutBoss::new).a(PacketPlayOutServerDifficulty.class, PacketPlayOutServerDifficulty::new).a(PacketPlayOutChat.class, PacketPlayOutChat::new).a(PacketPlayOutTabComplete.class, PacketPlayOutTabComplete::new).a(PacketPlayOutCommands.class, PacketPlayOutCommands::new).a(PacketPlayOutTransaction.class, PacketPlayOutTransaction::new).a(PacketPlayOutCloseWindow.class, PacketPlayOutCloseWindow::new).a(PacketPlayOutWindowItems.class, PacketPlayOutWindowItems::new).a(PacketPlayOutWindowData.class, PacketPlayOutWindowData::new).a(PacketPlayOutSetSlot.class, PacketPlayOutSetSlot::new).a(PacketPlayOutSetCooldown.class, PacketPlayOutSetCooldown::new).a(PacketPlayOutCustomPayload.class, PacketPlayOutCustomPayload::new).a(PacketPlayOutCustomSoundEffect.class, PacketPlayOutCustomSoundEffect::new).a(PacketPlayOutKickDisconnect.class, PacketPlayOutKickDisconnect::new).a(PacketPlayOutEntityStatus.class, PacketPlayOutEntityStatus::new).a(PacketPlayOutExplosion.class, PacketPlayOutExplosion::new).a(PacketPlayOutUnloadChunk.class, PacketPlayOutUnloadChunk::new).a(PacketPlayOutGameStateChange.class, PacketPlayOutGameStateChange::new).a(PacketPlayOutOpenWindowHorse.class, PacketPlayOutOpenWindowHorse::new).a(PacketPlayOutKeepAlive.class, PacketPlayOutKeepAlive::new).a(PacketPlayOutMapChunk.class, PacketPlayOutMapChunk::new).a(PacketPlayOutWorldEvent.class, PacketPlayOutWorldEvent::new).a(PacketPlayOutWorldParticles.class, PacketPlayOutWorldParticles::new).a(PacketPlayOutLightUpdate.class, PacketPlayOutLightUpdate::new).a(PacketPlayOutLogin.class, PacketPlayOutLogin::new).a(PacketPlayOutMap.class, PacketPlayOutMap::new).a(PacketPlayOutOpenWindowMerchant.class, PacketPlayOutOpenWindowMerchant::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMove.class, PacketPlayOutEntity.PacketPlayOutRelEntityMove::new).a(PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook.class, PacketPlayOutEntity.PacketPlayOutRelEntityMoveLook::new).a(PacketPlayOutEntity.PacketPlayOutEntityLook.class, PacketPlayOutEntity.PacketPlayOutEntityLook::new).a(PacketPlayOutEntity.class, PacketPlayOutEntity::new).a(PacketPlayOutVehicleMove.class, PacketPlayOutVehicleMove::new).a(PacketPlayOutOpenBook.class, PacketPlayOutOpenBook::new).a(PacketPlayOutOpenWindow.class, PacketPlayOutOpenWindow::new).a(PacketPlayOutOpenSignEditor.class, PacketPlayOutOpenSignEditor::new).a(PacketPlayOutAutoRecipe.class, PacketPlayOutAutoRecipe::new).a(PacketPlayOutAbilities.class, PacketPlayOutAbilities::new).a(PacketPlayOutCombatEvent.class, PacketPlayOutCombatEvent::new).a(PacketPlayOutPlayerInfo.class, PacketPlayOutPlayerInfo::new).a(PacketPlayOutLookAt.class, PacketPlayOutLookAt::new).a(PacketPlayOutPosition.class, PacketPlayOutPosition::new).a(PacketPlayOutRecipes.class, PacketPlayOutRecipes::new).a(PacketPlayOutEntityDestroy.class, PacketPlayOutEntityDestroy::new).a(PacketPlayOutRemoveEntityEffect.class, PacketPlayOutRemoveEntityEffect::new).a(PacketPlayOutResourcePackSend.class, PacketPlayOutResourcePackSend::new).a(PacketPlayOutRespawn.class, PacketPlayOutRespawn::new).a(PacketPlayOutEntityHeadRotation.class, PacketPlayOutEntityHeadRotation::new).a(PacketPlayOutMultiBlockChange.class, PacketPlayOutMultiBlockChange::new).a(PacketPlayOutSelectAdvancementTab.class, PacketPlayOutSelectAdvancementTab::new).a(PacketPlayOutWorldBorder.class, PacketPlayOutWorldBorder::new).a(PacketPlayOutCamera.class, PacketPlayOutCamera::new).a(PacketPlayOutHeldItemSlot.class, PacketPlayOutHeldItemSlot::new).a(PacketPlayOutViewCentre.class, PacketPlayOutViewCentre::new).a(PacketPlayOutViewDistance.class, PacketPlayOutViewDistance::new).a(PacketPlayOutSpawnPosition.class, PacketPlayOutSpawnPosition::new).a(PacketPlayOutScoreboardDisplayObjective.class, PacketPlayOutScoreboardDisplayObjective::new).a(PacketPlayOutEntityMetadata.class, PacketPlayOutEntityMetadata::new).a(PacketPlayOutAttachEntity.class, PacketPlayOutAttachEntity::new).a(PacketPlayOutEntityVelocity.class, PacketPlayOutEntityVelocity::new).a(PacketPlayOutEntityEquipment.class, PacketPlayOutEntityEquipment::new).a(PacketPlayOutExperience.class, PacketPlayOutExperience::new).a(PacketPlayOutUpdateHealth.class, PacketPlayOutUpdateHealth::new).a(PacketPlayOutScoreboardObjective.class, PacketPlayOutScoreboardObjective::new).a(PacketPlayOutMount.class, PacketPlayOutMount::new).a(PacketPlayOutScoreboardTeam.class, PacketPlayOutScoreboardTeam::new).a(PacketPlayOutScoreboardScore.class, PacketPlayOutScoreboardScore::new).a(PacketPlayOutUpdateTime.class, PacketPlayOutUpdateTime::new).a(PacketPlayOutTitle.class, PacketPlayOutTitle::new).a(PacketPlayOutEntitySound.class, PacketPlayOutEntitySound::new).a(PacketPlayOutNamedSoundEffect.class, PacketPlayOutNamedSoundEffect::new).a(PacketPlayOutStopSound.class, PacketPlayOutStopSound::new).a(PacketPlayOutPlayerListHeaderFooter.class, PacketPlayOutPlayerListHeaderFooter::new).a(PacketPlayOutNBTQuery.class, PacketPlayOutNBTQuery::new).a(PacketPlayOutCollect.class, PacketPlayOutCollect::new).a(PacketPlayOutEntityTeleport.class, PacketPlayOutEntityTeleport::new).a(PacketPlayOutAdvancements.class, PacketPlayOutAdvancements::new).a(PacketPlayOutUpdateAttributes.class, PacketPlayOutUpdateAttributes::new).a(PacketPlayOutEntityEffect.class, PacketPlayOutEntityEffect::new).a(PacketPlayOutRecipeUpdate.class, PacketPlayOutRecipeUpdate::new).a(PacketPlayOutTags.class, PacketPlayOutTags::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketListenerPlayIn>()).a(PacketPlayInTeleportAccept.class, PacketPlayInTeleportAccept::new).a(PacketPlayInTileNBTQuery.class, PacketPlayInTileNBTQuery::new).a(PacketPlayInDifficultyChange.class, PacketPlayInDifficultyChange::new).a(PacketPlayInChat.class, PacketPlayInChat::new).a(PacketPlayInClientCommand.class, PacketPlayInClientCommand::new).a(PacketPlayInSettings.class, PacketPlayInSettings::new).a(PacketPlayInTabComplete.class, PacketPlayInTabComplete::new).a(PacketPlayInTransaction.class, PacketPlayInTransaction::new).a(PacketPlayInEnchantItem.class, PacketPlayInEnchantItem::new).a(PacketPlayInWindowClick.class, PacketPlayInWindowClick::new).a(PacketPlayInCloseWindow.class, PacketPlayInCloseWindow::new).a(PacketPlayInCustomPayload.class, PacketPlayInCustomPayload::new).a(PacketPlayInBEdit.class, PacketPlayInBEdit::new).a(PacketPlayInEntityNBTQuery.class, PacketPlayInEntityNBTQuery::new).a(PacketPlayInUseEntity.class, PacketPlayInUseEntity::new).a(PacketPlayInJigsawGenerate.class, PacketPlayInJigsawGenerate::new).a(PacketPlayInKeepAlive.class, PacketPlayInKeepAlive::new).a(PacketPlayInDifficultyLock.class, PacketPlayInDifficultyLock::new).a(PacketPlayInFlying.PacketPlayInPosition.class, PacketPlayInFlying.PacketPlayInPosition::new).a(PacketPlayInFlying.PacketPlayInPositionLook.class, PacketPlayInFlying.PacketPlayInPositionLook::new).a(PacketPlayInFlying.PacketPlayInLook.class, PacketPlayInFlying.PacketPlayInLook::new).a(PacketPlayInFlying.class, PacketPlayInFlying::new).a(PacketPlayInVehicleMove.class, PacketPlayInVehicleMove::new).a(PacketPlayInBoatMove.class, PacketPlayInBoatMove::new).a(PacketPlayInPickItem.class, PacketPlayInPickItem::new).a(PacketPlayInAutoRecipe.class, PacketPlayInAutoRecipe::new).a(PacketPlayInAbilities.class, PacketPlayInAbilities::new).a(PacketPlayInBlockDig.class, PacketPlayInBlockDig::new).a(PacketPlayInEntityAction.class, PacketPlayInEntityAction::new).a(PacketPlayInSteerVehicle.class, PacketPlayInSteerVehicle::new).a(PacketPlayInRecipeSettings.class, PacketPlayInRecipeSettings::new).a(PacketPlayInRecipeDisplayed.class, PacketPlayInRecipeDisplayed::new).a(PacketPlayInItemName.class, PacketPlayInItemName::new).a(PacketPlayInResourcePackStatus.class, PacketPlayInResourcePackStatus::new).a(PacketPlayInAdvancements.class, PacketPlayInAdvancements::new).a(PacketPlayInTrSel.class, PacketPlayInTrSel::new).a(PacketPlayInBeacon.class, PacketPlayInBeacon::new).a(PacketPlayInHeldItemSlot.class, PacketPlayInHeldItemSlot::new).a(PacketPlayInSetCommandBlock.class, PacketPlayInSetCommandBlock::new).a(PacketPlayInSetCommandMinecart.class, PacketPlayInSetCommandMinecart::new).a(PacketPlayInSetCreativeSlot.class, PacketPlayInSetCreativeSlot::new).a(PacketPlayInSetJigsaw.class, PacketPlayInSetJigsaw::new).a(PacketPlayInStruct.class, PacketPlayInStruct::new).a(PacketPlayInUpdateSign.class, PacketPlayInUpdateSign::new).a(PacketPlayInArmAnimation.class, PacketPlayInArmAnimation::new).a(PacketPlayInSpectate.class, PacketPlayInSpectate::new).a(PacketPlayInUseItem.class, PacketPlayInUseItem::new).a(PacketPlayInBlockPlace.class, PacketPlayInBlockPlace::new))), STATUS(1, b().a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketStatusInListener>()).a(PacketStatusInStart.class, PacketStatusInStart::new).a(PacketStatusInPing.class, PacketStatusInPing::new)).a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketStatusOutListener>()).a(PacketStatusOutServerInfo.class, PacketStatusOutServerInfo::new).a(PacketStatusOutPong.class, PacketStatusOutPong::new))), LOGIN(2, b().a(EnumProtocolDirection.CLIENTBOUND, (new EnumProtocol.a<PacketLoginOutListener>()).a(PacketLoginOutDisconnect.class, PacketLoginOutDisconnect::new).a(PacketLoginOutEncryptionBegin.class, PacketLoginOutEncryptionBegin::new).a(PacketLoginOutSuccess.class, PacketLoginOutSuccess::new).a(PacketLoginOutSetCompression.class, PacketLoginOutSetCompression::new).a(PacketLoginOutCustomPayload.class, PacketLoginOutCustomPayload::new)).a(EnumProtocolDirection.SERVERBOUND, (new EnumProtocol.a<PacketLoginInListener>()).a(PacketLoginInStart.class, PacketLoginInStart::new).a(PacketLoginInEncryptionBegin.class, PacketLoginInEncryptionBegin::new).a(PacketLoginInCustomPayload.class, PacketLoginInCustomPayload::new))); private static final EnumProtocol[] e = new EnumProtocol[4]; private static final Map<Class<? extends Packet<?>>, EnumProtocol> f = Maps.newHashMap(); -@@ -98,7 +98,7 @@ public enum EnumProtocol { +@@ -98,7 +99,7 @@ public enum EnumProtocol { private final List<Supplier<? extends Packet<T>>> b; private a() { @@ -328,7 +218,7 @@ index 728417e7c7caabe58b7edcd051f24209e5620bec..d384b1e857a5fe21a93e6fb956a2bfd7 }); this.b = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 8886cedfe8809fe4711b5f2451e3e6456d2a6513..b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba 100644 +index 447f6a55b619402447b5cf4db9b22ea8cfc7d51d..1890c760f9ffd7628d6ae3db40c36f5272379227 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -55,7 +55,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -357,6 +247,65 @@ index 8886cedfe8809fe4711b5f2451e3e6456d2a6513..b77a0f0c2ee30df44b113aa6c8d4fa92 return true; } } +diff --git a/src/main/java/net/minecraft/server/IBlockDataHolder.java b/src/main/java/net/minecraft/server/IBlockDataHolder.java +index 0aa642388b45db6fc9a1081dda519e34c23fefa1..98616f0db75d0e2b2e960dbf88289c87ba426ab6 100644 +--- a/src/main/java/net/minecraft/server/IBlockDataHolder.java ++++ b/src/main/java/net/minecraft/server/IBlockDataHolder.java +@@ -27,11 +27,11 @@ public abstract class IBlockDataHolder<O, S> { + } else { + IBlockState<?> iblockstate = (IBlockState) entry.getKey(); + +- return iblockstate.getName() + "=" + this.a(iblockstate, (Comparable) entry.getValue()); ++ return iblockstate.getName() + "=" + this.a((IBlockState) iblockstate, (Comparable) entry.getValue()); // Paper - decompile fix + } + } + +- private <T extends Comparable<T>> String a(IBlockState<T> iblockstate, Comparable<?> comparable) { ++ private <T extends Comparable<T>> String a(IBlockState<T> iblockstate, T comparable) { // Paper - decompile error + return iblockstate.a(comparable); + } + }; +@@ -47,11 +47,11 @@ public abstract class IBlockDataHolder<O, S> { + } + + public <T extends Comparable<T>> S a(IBlockState<T> iblockstate) { +- return this.set(iblockstate, (Comparable) a(iblockstate.getValues(), (Object) this.get(iblockstate))); ++ return this.set(iblockstate, a(iblockstate.getValues(), this.get(iblockstate))); // Paper - decompile error + } + + protected static <T> T a(Collection<T> collection, T t0) { +- Iterator iterator = collection.iterator(); ++ Iterator<T> iterator = collection.iterator(); // Paper + + do { + if (!iterator.hasNext()) { +@@ -93,7 +93,7 @@ public abstract class IBlockDataHolder<O, S> { + if (comparable == null) { + throw new IllegalArgumentException("Cannot get property " + iblockstate + " as it does not exist in " + this.c); + } else { +- return (Comparable) iblockstate.getType().cast(comparable); ++ return iblockstate.getType().cast(comparable); // Paper - decompile error + } + } + +@@ -109,7 +109,7 @@ public abstract class IBlockDataHolder<O, S> { + if (comparable == null) { + throw new IllegalArgumentException("Cannot set property " + iblockstate + " as it does not exist in " + this.c); + } else if (comparable == v0) { +- return this; ++ return (S) this; // Paper - decompile error + } else { + S s0 = this.e.get(iblockstate, v0); + +@@ -161,7 +161,7 @@ public abstract class IBlockDataHolder<O, S> { + return codec.dispatch("Name", (iblockdataholder) -> { + return iblockdataholder.c; + }, (object) -> { +- S s0 = (IBlockDataHolder) function.apply(object); ++ S s0 = function.apply(object); // Paper - decompile error + + return s0.getStateMap().isEmpty() ? Codec.unit(s0) : s0.d.fieldOf("Properties").codec(); + }); diff --git a/src/main/java/net/minecraft/server/IBlockState.java b/src/main/java/net/minecraft/server/IBlockState.java index 88f1f201240ef0479c4f0f93f4caca454bbe7e9e..d63a4e4916ed5f5d901be0f4dd2c13cf66239055 100644 --- a/src/main/java/net/minecraft/server/IBlockState.java @@ -379,10 +328,10 @@ index 88f1f201240ef0479c4f0f93f4caca454bbe7e9e..d63a4e4916ed5f5d901be0f4dd2c13cf this.b = s; } diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 2517b70ddeb985ae7d708c6a1708b42c6a67dd00..c469b5db81fb040fc27cd2e4f7cd61797f56a62d 100644 +index ea72fd57be88542d54a9660a3a5de57d969938f5..797249069b0b2adf91b4e69497752eed7116f02a 100644 --- a/src/main/java/net/minecraft/server/IEntityAccess.java +++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -150,22 +150,22 @@ public interface IEntityAccess { +@@ -158,22 +158,22 @@ public interface IEntityAccess { @Nullable default <T extends EntityLiving> T a(Class<? extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, @Nullable EntityLiving entityliving, double d0, double d1, double d2, AxisAlignedBB axisalignedbb) { @@ -408,8 +357,8 @@ index 2517b70ddeb985ae7d708c6a1708b42c6a67dd00..c469b5db81fb040fc27cd2e4f7cd6179 + T t1 = iterator.next(); // Paper - decompile fix if (pathfindertargetcondition.a(entityliving, t1)) { - double d4 = t1.g(d0, d1, d2); -@@ -198,10 +198,10 @@ public interface IEntityAccess { + double d4 = t1.h(d0, d1, d2); +@@ -206,10 +206,10 @@ public interface IEntityAccess { default <T extends EntityLiving> List<T> a(Class<? extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) { List<T> list = this.a(oclass, axisalignedbb, (Predicate) null); List<T> list1 = Lists.newArrayList(); @@ -469,7 +418,7 @@ index 1e1f7ec6e6e6fc698a8a5118ce21321d104dc5eb..75d9065b32731dc635d9d09c48fb9643 ++k; if (k >= l) { diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java -index 8b1f9116afd92b13426eb0e97066297705d202fb..a9dc8466278f9ec2becbcb643e6e1c973df72b82 100644 +index 144279f278b363725bd0e2f8844f13a5ea1bb39d..f8c2b957bb5b38f05251cccf5137a9c23262c3d6 100644 --- a/src/main/java/net/minecraft/server/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java @@ -167,7 +167,7 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { @@ -495,7 +444,7 @@ index 8cc8c60d3297a4ed98f3950a3971d83499ad1dfa..788078c209b8bcbd551cf0a52eb61729 jsonobject.add("conditions", jsonserializationcontext.serialize(t0.d)); } diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java -index 3aa5cc4281cdba8738890e9ffd5c7a129e60c310..32a98e758b9df48005ddc5283eacdc5123a32c39 100644 +index 90da3e630355a127451c99ad9405829116e2c8f2..37ebc9f511479778c131e02b6852b27f63e75bdd 100644 --- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java @@ -73,7 +73,7 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional @@ -536,7 +485,7 @@ index 998101592723abb26c91d1f92e98be1cf24c954d..ee9069c744df63cbb7f21dd9d28d6d55 } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index ea3685df509101f3fed8b07088baef3ffdb4b85a..5e2dff9a30615b5580710f872a92ab9f07fca6cf 100644 +index 786c845275b61e1d64db150ac0226fe5a119ad2f..b1b55d16d4e3e7952d70acfccaad0efd3a948ef3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1549,9 +1549,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -565,10 +514,10 @@ index 829a7ae0a2b77205fb8e8c5754d0d4333afa224d..8b9e47b4c7f5dc464fa617a59583df9e default String asString() { return this.toString(); diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..c9be8c7f40917056091f63d36311a10d6302acbb 100644 +index 641d4a69cb2747417d483c56d460d12d1c6165d2..f9738fb0df2704251af0a45b56e34cc005c6ec37 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -@@ -11,6 +11,7 @@ import java.io.InputStream; +@@ -14,6 +14,7 @@ import java.io.InputStream; import java.io.OutputStream; import java.util.zip.GZIPInputStream; import java.util.zip.GZIPOutputStream; @@ -576,7 +525,7 @@ index db66d4ac7dc1bede8b674cd9ad8f56dd989b6693..c9be8c7f40917056091f63d36311a10d public class NBTCompressedStreamTools { -@@ -75,7 +76,7 @@ public class NBTCompressedStreamTools { +@@ -133,7 +134,7 @@ public class NBTCompressedStreamTools { public static NBTTagCompound a(DataInput datainput, NBTReadLimiter nbtreadlimiter) throws IOException { // Spigot start @@ -621,7 +570,7 @@ index 8471920b8b92f0bbd0d3ee827e1b0a120f405f6c..e9c405fb5376c5733b9b0191cd530917 } diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..4efcb8b595750891b421e524812542f0f67e9f3f 100644 +index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..06ea0c3bfcb54a5f6a42363f633800c687b6f19d 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java @@ -27,7 +27,7 @@ public class RegistryBlockID<T> implements Registry<T> { @@ -633,11 +582,25 @@ index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..4efcb8b595750891b421e524812542f0 } this.c.set(i, t0); +@@ -41,6 +41,13 @@ public class RegistryBlockID<T> implements Registry<T> { + this.a(t0, this.a); + } + ++ // Paper start - decompile fix ++ @Override ++ public int a(T t) { ++ return getId(t); ++ } ++ // Paper end ++ + public int getId(T t0) { + Integer integer = (Integer) this.b.get(t0); + diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee2dfa25e2 100644 +index e11deed00abc10d1a9490234830803649209dfb4..5078a5ce391b445b64b2a16b123a3e3d5841619b 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java -@@ -17,9 +17,9 @@ public class RegistryID<K> implements Registry<K> { +@@ -17,11 +17,18 @@ public class RegistryID<K> implements Registry<K> { public RegistryID(int i) { i = (int) ((float) i / 0.8F); @@ -648,8 +611,17 @@ index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee + this.d = (K[]) (new Object[i]); // Paper - decompile fix } ++ // Paper start - decompile fix ++ @Override ++ public int a(K k) { ++ return getId(k); ++ } ++ // Paper end ++ public int getId(@Nullable K k0) { -@@ -59,9 +59,9 @@ public class RegistryID<K> implements Registry<K> { + return this.c(this.b(k0, this.d(k0))); + } +@@ -55,9 +62,9 @@ public class RegistryID<K> implements Registry<K> { K[] ak = this.b; int[] aint = this.c; @@ -661,11 +633,31 @@ index 2dc20b5c930c6845af41b35d69cdb03db639d63e..6cdd4d46d987132c3c241800b5d59cee this.e = 0; this.f = 0; +diff --git a/src/main/java/net/minecraft/server/ServerStatisticManager.java b/src/main/java/net/minecraft/server/ServerStatisticManager.java +index 809c0b3d10aa8fdbff8ff779ac2a9c770b218353..3c3b87e37cbf69c223da007e8b7eb646ec83691e 100644 +--- a/src/main/java/net/minecraft/server/ServerStatisticManager.java ++++ b/src/main/java/net/minecraft/server/ServerStatisticManager.java +@@ -191,7 +191,7 @@ public class ServerStatisticManager extends StatisticManager { + ObjectIterator objectiterator = this.a.object2IntEntrySet().iterator(); + + while (objectiterator.hasNext()) { +- it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Statistic<?>> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); ++ Object2IntMap.Entry<Statistic<?>> it_unimi_dsi_fastutil_objects_object2intmap_entry = (Object2IntMap.Entry) objectiterator.next(); // Paper - decompile fix + Statistic<?> statistic = (Statistic) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey(); + + ((JsonObject) map.computeIfAbsent(statistic.getWrapper(), (statisticwrapper) -> { diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index 68510457b527e61bf60bf1e7dfd664578172c00a..eefad79a01de61eff5e0bd3f709bfda030ebe20d 100644 +index e0e1a133e16b52732963df202202c50a63aa34a1..a8e3bbd18e08678e55aa88b09a9f7feb37ab4761 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -42,7 +42,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration> +@@ -38,13 +38,13 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration> + public static final StructureGenerator<WorldGenFeatureVillageConfiguration> BASTION_REMNANT = a("Bastion_Remnant", new WorldGenFeatureBastionRemnant(WorldGenFeatureVillageConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES); + public static final List<StructureGenerator<?>> t = ImmutableList.of(StructureGenerator.PILLAGER_OUTPOST, StructureGenerator.VILLAGE, StructureGenerator.NETHER_FOSSIL); + private static final MinecraftKey w = new MinecraftKey("jigsaw"); +- private static final Map<MinecraftKey, MinecraftKey> x = ImmutableMap.builder().put(new MinecraftKey("nvi"), StructureGenerator.w).put(new MinecraftKey("pcp"), StructureGenerator.w).put(new MinecraftKey("bastionremnant"), StructureGenerator.w).put(new MinecraftKey("runtime"), StructureGenerator.w).build(); ++ private static final Map<MinecraftKey, MinecraftKey> x = ImmutableMap.<MinecraftKey, MinecraftKey>builder().put(new MinecraftKey("nvi"), StructureGenerator.w).put(new MinecraftKey("pcp"), StructureGenerator.w).put(new MinecraftKey("bastionremnant"), StructureGenerator.w).put(new MinecraftKey("runtime"), StructureGenerator.w).build(); // Paper - decompile fix + private final Codec<StructureFeature<C, StructureGenerator<C>>> y; + private static <F extends StructureGenerator<?>> F a(String s, F f0, WorldGenStage.Decoration worldgenstage_decoration) { StructureGenerator.a.put(s.toLowerCase(Locale.ROOT), f0); StructureGenerator.u.put(f0, worldgenstage_decoration); @@ -675,10 +667,10 @@ index 68510457b527e61bf60bf1e7dfd664578172c00a..eefad79a01de61eff5e0bd3f709bfda0 public StructureGenerator(Codec<C> codec) { diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d1b3314a9 100644 +index 7b17c95ff7b529a62be60e9599149a7880d60ac5..5f3a960b3303c48b039630b39975d6ef549a4dbe 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -55,8 +55,8 @@ public class SystemUtils { +@@ -59,8 +59,8 @@ public class SystemUtils { return Collectors.toMap(Entry::getKey, Entry::getValue); } @@ -689,7 +681,7 @@ index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d } public static String a(String s, @Nullable MinecraftKey minecraftkey) { -@@ -224,8 +224,8 @@ public class SystemUtils { +@@ -228,8 +228,8 @@ public class SystemUtils { public static <T> T b(Iterable<T> iterable, @Nullable T t0) { Iterator<T> iterator = iterable.iterator(); @@ -700,7 +692,7 @@ index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d for (object1 = null; iterator.hasNext(); object1 = object) { object = iterator.next(); -@@ -250,7 +250,7 @@ public class SystemUtils { +@@ -254,7 +254,7 @@ public class SystemUtils { } public static <K> Strategy<K> k() { @@ -709,7 +701,7 @@ index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d } public static <V> CompletableFuture<List<V>> b(List<? extends CompletableFuture<? extends V>> list) { -@@ -261,7 +261,7 @@ public class SystemUtils { +@@ -265,7 +265,7 @@ public class SystemUtils { list.forEach((completablefuture1) -> { int i = list1.size(); @@ -719,7 +711,7 @@ index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d if (throwable != null) { completablefuture.completeExceptionally(throwable); diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java -index b64fc6e3dc8f628ead2c243baa48f2872bd8da0c..35f4d2d9591e625ab0bbeab7b606761e74965eec 100644 +index 1c9772e67f9bf5585726152d6e48d19d58f96cac..ebb9737995e0f738700d598af46a63f605f2b165 100644 --- a/src/main/java/net/minecraft/server/ThreadedMailbox.java +++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java @@ -99,7 +99,7 @@ public class ThreadedMailbox<T> implements Mailbox<T>, AutoCloseable, Runnable { @@ -745,10 +737,10 @@ index ee2059cf8ef0a0372e02b91a4bf6fa8a0ab31bca..77bb6b092a0763ff27f90f0401a8a81b } diff --git a/src/main/java/net/minecraft/server/TileEntityPiston.java b/src/main/java/net/minecraft/server/TileEntityPiston.java -index dc52856856796524e4519c34ab92e37031013759..5b941321a7fdc561e6b794a1dce5d600083c505d 100644 +index d11d94405c8a6581c632e23ae98eb23e0e43e994..8b2758377b70aaf7a9d21a28d4bbe16389f22403 100644 --- a/src/main/java/net/minecraft/server/TileEntityPiston.java +++ b/src/main/java/net/minecraft/server/TileEntityPiston.java -@@ -140,7 +140,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { +@@ -137,7 +137,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { private static void a(EnumDirection enumdirection, Entity entity, double d0, EnumDirection enumdirection1) { TileEntityPiston.h.set(enumdirection); entity.move(EnumMoveType.PISTON, new Vec3D(d0 * (double) enumdirection1.getAdjacentX(), d0 * (double) enumdirection1.getAdjacentY(), d0 * (double) enumdirection1.getAdjacentZ())); @@ -758,10 +750,10 @@ index dc52856856796524e4519c34ab92e37031013759..5b941321a7fdc561e6b794a1dce5d600 private void g(float f) { diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index bc2fab806ee1cc7628841a065436f0339f17ecce..b8c15047771bd4527b86e514a3b950b2ffc6eef0 100644 +index fffdc4392cbcbdd51c0437b0b783aab5a34183f8..d6aca683465c6898536507fab9e6888fef2e77e5 100644 --- a/src/main/java/net/minecraft/server/VillagePlace.java +++ b/src/main/java/net/minecraft/server/VillagePlace.java -@@ -170,9 +170,9 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { +@@ -180,9 +180,9 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { } private static boolean a(ChunkSection chunksection) { @@ -773,7 +765,7 @@ index bc2fab806ee1cc7628841a065436f0339f17ecce..b8c15047771bd4527b86e514a3b950b2 return chunksection.a(set::contains); } -@@ -190,7 +190,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { +@@ -200,7 +200,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { SectionPosition.b(new ChunkCoordIntPair(blockposition), Math.floorDiv(i, 16)).map((sectionposition) -> { return Pair.of(sectionposition, this.d(sectionposition.s())); }).filter((pair) -> { @@ -782,7 +774,7 @@ index bc2fab806ee1cc7628841a065436f0339f17ecce..b8c15047771bd4527b86e514a3b950b2 }).map((pair) -> { return ((SectionPosition) pair.getFirst()).r(); }).filter((chunkcoordintpair) -> { -@@ -242,7 +242,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { +@@ -252,7 +252,7 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { private final Predicate<? super VillagePlaceRecord> d; @@ -792,7 +784,7 @@ index bc2fab806ee1cc7628841a065436f0339f17ecce..b8c15047771bd4527b86e514a3b950b2 } diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java -index b0ec371c058c428a909faafe027e58e9c7f0cb38..532460e7549192dfe6170e2bf489edb46b8b5737 100644 +index a047e8f54e2e1960f4d8be8a05255c774ac2c221..4f7944d7fdaf02bae40ee71a18bd1c9bb4eb891b 100644 --- a/src/main/java/net/minecraft/server/VillagerTrades.java +++ b/src/main/java/net/minecraft/server/VillagerTrades.java @@ -14,12 +14,12 @@ import javax.annotation.Nullable; @@ -802,15 +794,15 @@ index b0ec371c058c428a909faafe027e58e9c7f0cb38..532460e7549192dfe6170e2bf489edb4 - public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> { + public static final Map<VillagerProfession, Int2ObjectMap<VillagerTrades.IMerchantRecipeOption[]>> a = SystemUtils.a(Maps.newHashMap(), (hashmap) -> { // Paper - decompile fix hashmap.put(VillagerProfession.FARMER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHEAT, 20, 16, 2), new VillagerTrades.b(Items.POTATO, 26, 16, 2), new VillagerTrades.b(Items.CARROT, 22, 16, 2), new VillagerTrades.b(Items.BEETROOT, 15, 16, 2), new VillagerTrades.h(Items.BREAD, 1, 6, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.PUMPKIN, 6, 12, 10), new VillagerTrades.h(Items.PUMPKIN_PIE, 1, 4, 5), new VillagerTrades.h(Items.APPLE, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.COOKIE, 3, 18, 10), new VillagerTrades.b(Blocks.MELON, 4, 12, 20)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Blocks.CAKE, 1, 1, 12, 15), new VillagerTrades.i(MobEffects.NIGHT_VISION, 100, 15), new VillagerTrades.i(MobEffects.JUMP, 160, 15), new VillagerTrades.i(MobEffects.WEAKNESS, 140, 15), new VillagerTrades.i(MobEffects.BLINDNESS, 120, 15), new VillagerTrades.i(MobEffects.POISON, 280, 15), new VillagerTrades.i(MobEffects.SATURATION, 7, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GOLDEN_CARROT, 3, 3, 30), new VillagerTrades.h(Items.GLISTERING_MELON_SLICE, 4, 3, 30)}))); -- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); -+ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rm, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.<VillagerType, Item>builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // <VillagerType, Item> +- hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rn, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); ++ hashmap.put(VillagerProfession.FISHERMAN, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 20, 16, 2), new VillagerTrades.b(Items.COAL, 10, 16, 2), new VillagerTrades.g(Items.COD, 6, Items.COOKED_COD, 6, 16, 1), new VillagerTrades.h(Items.COD_BUCKET, 3, 1, 16, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COD, 15, 16, 10), new VillagerTrades.g(Items.SALMON, 6, Items.COOKED_SALMON, 6, 16, 5), new VillagerTrades.h(Items.rn, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SALMON, 13, 16, 20), new VillagerTrades.e(Items.FISHING_ROD, 3, 3, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.TROPICAL_FISH, 6, 12, 30)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PUFFERFISH, 4, 12, 30), new VillagerTrades.c(1, 12, 30, ImmutableMap.<VillagerType, Item>builder().put(VillagerType.PLAINS, Items.OAK_BOAT).put(VillagerType.TAIGA, Items.SPRUCE_BOAT).put(VillagerType.SNOW, Items.SPRUCE_BOAT).put(VillagerType.DESERT, Items.JUNGLE_BOAT).put(VillagerType.JUNGLE, Items.JUNGLE_BOAT).put(VillagerType.SAVANNA, Items.ACACIA_BOAT).put(VillagerType.SWAMP, Items.DARK_OAK_BOAT).build())}))); // Paper - add <VillagerType, Item> to ImmutableMap.<VillagerType, Item>.builder() hashmap.put(VillagerProfession.SHEPHERD, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Blocks.WHITE_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BROWN_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.BLACK_WOOL, 18, 16, 2), new VillagerTrades.b(Blocks.GRAY_WOOL, 18, 16, 2), new VillagerTrades.h(Items.SHEARS, 2, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WHITE_DYE, 12, 16, 10), new VillagerTrades.b(Items.GRAY_DYE, 12, 16, 10), new VillagerTrades.b(Items.BLACK_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIGHT_BLUE_DYE, 12, 16, 10), new VillagerTrades.b(Items.LIME_DYE, 12, 16, 10), new VillagerTrades.h(Blocks.WHITE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.ORANGE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.YELLOW_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIME_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PINK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.CYAN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.PURPLE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLUE_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BROWN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.GREEN_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.RED_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.BLACK_WOOL, 1, 1, 16, 5), new VillagerTrades.h(Blocks.WHITE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.ORANGE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.MAGENTA_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.YELLOW_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIME_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PINK_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.LIGHT_GRAY_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.CYAN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.PURPLE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLUE_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BROWN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.GREEN_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.RED_CARPET, 1, 4, 16, 5), new VillagerTrades.h(Blocks.BLACK_CARPET, 1, 4, 16, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.YELLOW_DYE, 12, 16, 20), new VillagerTrades.b(Items.LIGHT_GRAY_DYE, 12, 16, 20), new VillagerTrades.b(Items.ORANGE_DYE, 12, 16, 20), new VillagerTrades.b(Items.RED_DYE, 12, 16, 20), new VillagerTrades.b(Items.PINK_DYE, 12, 16, 20), new VillagerTrades.h(Blocks.WHITE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.YELLOW_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.RED_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLACK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.BROWN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.CYAN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.GREEN_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_BLUE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIGHT_GRAY_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.LIME_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.MAGENTA_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.ORANGE_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PINK_BED, 3, 1, 12, 10), new VillagerTrades.h(Blocks.PURPLE_BED, 3, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BROWN_DYE, 12, 16, 30), new VillagerTrades.b(Items.PURPLE_DYE, 12, 16, 30), new VillagerTrades.b(Items.BLUE_DYE, 12, 16, 30), new VillagerTrades.b(Items.GREEN_DYE, 12, 16, 30), new VillagerTrades.b(Items.MAGENTA_DYE, 12, 16, 30), new VillagerTrades.b(Items.CYAN_DYE, 12, 16, 30), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 12, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 12, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.PAINTING, 2, 3, 30)}))); hashmap.put(VillagerProfession.FLETCHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STICK, 32, 16, 2), new VillagerTrades.h(Items.ARROW, 1, 16, 1), new VillagerTrades.g(Blocks.GRAVEL, 10, Items.FLINT, 10, 12, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FLINT, 26, 12, 10), new VillagerTrades.h(Items.BOW, 2, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.STRING, 14, 16, 20), new VillagerTrades.h(Items.CROSSBOW, 3, 1, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.FEATHER, 24, 16, 30), new VillagerTrades.e(Items.BOW, 2, 3, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.es, 8, 12, 30), new VillagerTrades.e(Items.CROSSBOW, 3, 3, 15), new VillagerTrades.j(Items.ARROW, 5, Items.TIPPED_ARROW, 5, 2, 12, 30)}))); -- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); -+ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.<Integer, IMerchantRecipeOption[]>builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rj, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Integer, IMerchantRecipeOption[] +- hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rk, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); ++ hashmap.put(VillagerProfession.LIBRARIAN, a(ImmutableMap.<Integer, IMerchantRecipeOption[]>builder().put(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.d(1), new VillagerTrades.h(Blocks.BOOKSHELF, 9, 1, 12, 1)}).put(2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.BOOK, 4, 12, 10), new VillagerTrades.d(5), new VillagerTrades.h(Items.rk, 1, 1, 5)}).put(3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.INK_SAC, 5, 12, 20), new VillagerTrades.d(10), new VillagerTrades.h(Items.az, 1, 4, 10)}).put(4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.WRITABLE_BOOK, 2, 12, 30), new VillagerTrades.d(15), new VillagerTrades.h(Items.CLOCK, 5, 1, 15), new VillagerTrades.h(Items.COMPASS, 4, 1, 15)}).put(5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.NAME_TAG, 20, 1, 30)}).build())); // Paper - add <Integer, IMerchantRecipeOption[]> to ImmutableMap.<Integer, IMerchantRecipeOption[]>.builder() hashmap.put(VillagerProfession.CARTOGRAPHER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.PAPER, 24, 16, 2), new VillagerTrades.h(Items.MAP, 7, 1, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.dP, 11, 16, 10), new VillagerTrades.k(13, StructureGenerator.MONUMENT, MapIcon.Type.MONUMENT, 12, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COMPASS, 1, 12, 20), new VillagerTrades.k(14, StructureGenerator.MANSION, MapIcon.Type.MANSION, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.ITEM_FRAME, 7, 1, 15), new VillagerTrades.h(Items.WHITE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_BLUE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.RED_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PINK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GREEN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIME_BANNER, 3, 1, 15), new VillagerTrades.h(Items.GRAY_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BLACK_BANNER, 3, 1, 15), new VillagerTrades.h(Items.PURPLE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.MAGENTA_BANNER, 3, 1, 15), new VillagerTrades.h(Items.CYAN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.BROWN_BANNER, 3, 1, 15), new VillagerTrades.h(Items.YELLOW_BANNER, 3, 1, 15), new VillagerTrades.h(Items.ORANGE_BANNER, 3, 1, 15), new VillagerTrades.h(Items.LIGHT_GRAY_BANNER, 3, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.h(Items.GLOBE_BANNER_PATTERN, 8, 1, 30)}))); hashmap.put(VillagerProfession.CLERIC, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.ROTTEN_FLESH, 32, 16, 2), new VillagerTrades.h(Items.REDSTONE, 1, 2, 1)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.GOLD_INGOT, 3, 12, 10), new VillagerTrades.h(Items.LAPIS_LAZULI, 1, 1, 5)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.RABBIT_FOOT, 2, 12, 20), new VillagerTrades.h(Blocks.GLOWSTONE, 4, 1, 12, 10)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.SCUTE, 4, 12, 30), new VillagerTrades.b(Items.GLASS_BOTTLE, 9, 12, 30), new VillagerTrades.h(Items.ENDER_PEARL, 5, 1, 15)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.NETHER_WART, 22, 12, 30), new VillagerTrades.h(Items.EXPERIENCE_BOTTLE, 3, 1, 30)}))); - hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.ri), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)}))); + hashmap.put(VillagerProfession.ARMORER, a(ImmutableMap.of(1, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.COAL, 15, 16, 2), new VillagerTrades.h(new ItemStack(Items.IRON_LEGGINGS), 7, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_BOOTS), 4, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_HELMET), 5, 1, 12, 1, 0.2F), new VillagerTrades.h(new ItemStack(Items.IRON_CHESTPLATE), 9, 1, 12, 1, 0.2F)}, 2, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.IRON_INGOT, 4, 12, 10), new VillagerTrades.h(new ItemStack(Items.rj), 36, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_BOOTS), 1, 1, 12, 5, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_LEGGINGS), 3, 1, 12, 5, 0.2F)}, 3, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.b(Items.LAVA_BUCKET, 1, 12, 20), new VillagerTrades.b(Items.DIAMOND, 1, 12, 20), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_HELMET), 1, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.CHAINMAIL_CHESTPLATE), 4, 1, 12, 10, 0.2F), new VillagerTrades.h(new ItemStack(Items.SHIELD), 5, 1, 12, 10, 0.2F)}, 4, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_LEGGINGS, 14, 3, 15, 0.2F), new VillagerTrades.e(Items.DIAMOND_BOOTS, 8, 3, 15, 0.2F)}, 5, new VillagerTrades.IMerchantRecipeOption[]{new VillagerTrades.e(Items.DIAMOND_HELMET, 8, 3, 30, 0.2F), new VillagerTrades.e(Items.DIAMOND_CHESTPLATE, 16, 3, 30, 0.2F)}))); diff --git a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java b/src/main/java/net/minecraft/server/VoxelShapeMergerList.java index e8daa74986f07163fd5318f431398b4f0efde6e8..71d2ae2a9c5a05351241b5a313e66ca15b0624ef 100644 --- a/src/main/java/net/minecraft/server/VoxelShapeMergerList.java @@ -825,10 +817,10 @@ index e8daa74986f07163fd5318f431398b4f0efde6e8..71d2ae2a9c5a05351241b5a313e66ca1 this.c.add(j - 1); this.a.add(d1); diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java -index 55fe7625af2207062f69188e9ab345ea68fac6ca..19e68a78310de787bca701bc2597c64e34a77d7c 100644 +index 83d799bec90693e0fbbf8a7f3bc4f569b5c0ead9..141a8e31151010e5a0bd8d4661033f109f6a2e67 100644 --- a/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java -@@ -37,7 +37,7 @@ public class WorldPersistentData { +@@ -38,7 +38,7 @@ public class WorldPersistentData { if (t0 != null) { return t0; } else { @@ -837,7 +829,7 @@ index 55fe7625af2207062f69188e9ab345ea68fac6ca..19e68a78310de787bca701bc2597c64e this.a(t1); return t1; -@@ -46,7 +46,7 @@ public class WorldPersistentData { +@@ -47,7 +47,7 @@ public class WorldPersistentData { @Nullable public <T extends PersistentBase> T b(Supplier<T> supplier, String s) { @@ -846,7 +838,7 @@ index 55fe7625af2207062f69188e9ab345ea68fac6ca..19e68a78310de787bca701bc2597c64e if (persistentbase == null && !this.data.containsKey(s)) { persistentbase = this.c(supplier, s); -@@ -62,7 +62,7 @@ public class WorldPersistentData { +@@ -63,7 +63,7 @@ public class WorldPersistentData { File file = this.a(s); if (file.exists()) { diff --git a/Spigot-Server-Patches/0004-MC-Utils.patch b/Spigot-Server-Patches/0004-MC-Utils.patch index 4423beb086..faeb6175ec 100644 --- a/Spigot-Server-Patches/0004-MC-Utils.patch +++ b/Spigot-Server-Patches/0004-MC-Utils.patch @@ -2284,7 +2284,7 @@ index 277d7a124e9a21803fe4d5a66fc0b311df2cfba7..02c09f39848399a86d46bd17569b4f01 double d0 = this.b(); double d1 = this.c(); diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index ff4b23927bb0e0ac8221d71fe2543cbee54f913a..b190cd9ef8f447e4e9ff1adb74bff6e63750caad 100644 +index 7f803529d67cdea2d809743e34d6d3d456a114d7..6b6ea0b33b10a9517b7af55fb8292fe245e3ca1e 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -16,9 +16,9 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { @@ -2300,7 +2300,7 @@ index ff4b23927bb0e0ac8221d71fe2543cbee54f913a..b190cd9ef8f447e4e9ff1adb74bff6e6 public BaseBlockPosition(int i, int j, int k) { this.a = i; -@@ -98,6 +98,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { +@@ -106,6 +106,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { return this.distanceSquared(iposition.getX(), iposition.getY(), iposition.getZ(), true) < d0 * d0; } @@ -2332,22 +2332,22 @@ index eff6ebcd30b538cbaedaa031a46a59ea956253ba..30cbfc8eac20910aa55951e3dce63862 public IBlockData getType(BlockPosition blockposition) { return Blocks.AIR.getBlockData(); diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 47324feca49786b49563d3d0e854e74ad27c190b..788dec1be6124ac26eb5709fe45c2fac3d44e7a8 100644 +index 2bc024b2e43d8fa874e0c285c322a8e117fe2dd0..e7052aba9d63a296873044623808e003b3b453b7 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java -@@ -632,6 +632,7 @@ public abstract class BlockBase { - return this.a != null ? this.a.e : Block.a(this.getCollisionShape(iblockaccess, blockposition)); +@@ -636,6 +636,7 @@ public abstract class BlockBase { + return this.a != null ? this.a.d : Block.a(this.getCollisionShape(iblockaccess, blockposition)); } + public final IBlockData getBlockData() { return p(); } // Paper - OBFHELPER protected abstract IBlockData p(); - public boolean isAlwaysDestroyable() { + public boolean isRequiresSpecialTool() { diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed39516bb2f 100644 +index 1b2f415e3ed7f6dca12d13cd098cb4ec3af54020..64e8088d394ddcda59d0209883b778ab74638c02 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -98,6 +98,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -99,6 +99,7 @@ public class BlockPosition extends BaseBlockPosition { return d0 == 0.0D && d1 == 0.0D && d2 == 0.0D ? this : new BlockPosition((double) this.getX() + d0, (double) this.getY() + d1, (double) this.getZ() + d2); } @@ -2355,7 +2355,7 @@ index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed3 public BlockPosition b(int i, int j, int k) { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } -@@ -368,6 +369,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -430,6 +431,7 @@ public class BlockPosition extends BaseBlockPosition { return super.a(enumblockrotation).immutableCopy(); } @@ -2363,7 +2363,7 @@ index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed3 public BlockPosition.MutableBlockPosition d(int i, int j, int k) { this.o(i); this.p(j); -@@ -375,6 +377,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -437,6 +439,7 @@ public class BlockPosition extends BaseBlockPosition { return this; } @@ -2371,7 +2371,7 @@ index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed3 public BlockPosition.MutableBlockPosition c(double d0, double d1, double d2) { return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } -@@ -424,6 +427,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -490,6 +493,7 @@ public class BlockPosition extends BaseBlockPosition { } } @@ -2379,7 +2379,7 @@ index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed3 @Override public void o(int i) { super.o(i); -@@ -434,10 +438,10 @@ public class BlockPosition extends BaseBlockPosition { +@@ -500,10 +504,10 @@ public class BlockPosition extends BaseBlockPosition { super.p(i); } @@ -2392,7 +2392,7 @@ index 886b43e2b8f21c358b4d6785c677f14c91d191f3..6641fd1580ffd2996ec6b74004ec3ed3 @Override public BlockPosition immutableCopy() { diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 3cdcdc60df4f28197cf19c59ea42a92ae4af3819..7c7826cf3adb19814984ab627e4c4726d8933244 100644 +index ea09e7a742f8e28dfd3db3736422326aff0912f6..3b3e94cff2c6def318864bb5b7baefcf9de2cae7 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -26,7 +26,7 @@ public class Chunk implements IChunkAccess { @@ -2687,7 +2687,7 @@ index b703382204a3ccd57e642cff18c7c28fef157cc0..8eecdcde510661ec3a13a25a04ba394f @Override public TileEntity getTileEntity(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index 2837823547bdc9655376af3af89c43d84719d513..f0e28f03074bc5e24e5fa64dca94c7573f952357 100644 +index ae61d0a7676bf06c8c9aa5c68ccb8dd4baf326b6..b12e43ed13a1a9d7d418831b8988c30a242cb5c4 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java @@ -11,27 +11,32 @@ public class ChunkCoordIntPair { @@ -2726,10 +2726,21 @@ index 2837823547bdc9655376af3af89c43d84719d513..f0e28f03074bc5e24e5fa64dca94c757 } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 5585b5646b5f3650aa3b795be06f920699a85403..359441cd993a95f933f23aebcec8180f314a5f09 100644 +index 94b8cda9ce78aa22c14e88f3500bb9814ff7f631..1ca6d656cd2c7bbf12df6368ad7d953765d03e36 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -24,7 +24,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -17,6 +17,10 @@ import java.util.function.Consumer; + import java.util.function.Function; + import java.util.function.Supplier; + import javax.annotation.Nullable; ++import com.destroystokyo.paper.exception.ServerInternalException; ++import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper ++import org.apache.logging.log4j.LogManager; ++import org.apache.logging.log4j.Logger; + + public class ChunkProviderServer extends IChunkProvider { + +@@ -24,7 +28,7 @@ public class ChunkProviderServer extends IChunkProvider { private final ChunkMapDistance chunkMapDistance; public final ChunkGenerator chunkGenerator; private final WorldServer world; @@ -2738,13 +2749,13 @@ index 5585b5646b5f3650aa3b795be06f920699a85403..359441cd993a95f933f23aebcec8180f private final LightEngineThreaded lightEngine; private final ChunkProviderServer.a serverThreadQueue; public final PlayerChunkMap playerChunkMap; -@@ -37,6 +37,167 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -37,6 +41,167 @@ public class ChunkProviderServer extends IChunkProvider { private final IChunkAccess[] cacheChunk = new IChunkAccess[4]; @Nullable private SpawnerCreature.d p; + // Paper start + final com.destroystokyo.paper.util.concurrent.WeakSeqLock loadedChunkMapSeqLock = new com.destroystokyo.paper.util.concurrent.WeakSeqLock(); -+ final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<Chunk> loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f); ++ final Long2ObjectOpenHashMap<Chunk> loadedChunkMap = new Long2ObjectOpenHashMap<>(8192, 0.5f); + + private final Chunk[] lastLoadedChunks = new Chunk[4 * 4]; + private final long[] lastLoadedChunkKeys = new long[4 * 4]; @@ -2906,7 +2917,7 @@ index 5585b5646b5f3650aa3b795be06f920699a85403..359441cd993a95f933f23aebcec8180f public ChunkProviderServer(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, ChunkGenerator chunkgenerator, int i, boolean flag, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier) { this.world = worldserver; -@@ -90,6 +251,49 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -90,6 +255,49 @@ public class ChunkProviderServer extends IChunkProvider { this.cacheChunk[0] = ichunkaccess; } @@ -2956,7 +2967,7 @@ index 5585b5646b5f3650aa3b795be06f920699a85403..359441cd993a95f933f23aebcec8180f @Nullable @Override public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) { -@@ -372,10 +576,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -372,10 +580,9 @@ public class ChunkProviderServer extends IChunkProvider { this.p = spawnercreature_d; this.world.getMethodProfiler().exit(); @@ -2983,7 +2994,7 @@ index b0f7ea97d4795655b6c30b296fd929806dac4ef1..882c2733beaff1df68b892d44fc77cac packetdataserializer.writeShort(this.nonEmptyBlockCount); this.blockIds.b(packetdataserializer); diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index cd572c76522b2ee900a03fd5cf6753f3297c1ccd..e58593e6ecc224db1b6e4bac6183d3cb032ddb4a 100644 +index c4d5ad5d3619675de55ece0583750c210e4794c4..53e7bac2f7a99238f509bb0f871ebed103fda568 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -83,6 +83,7 @@ public class DataBits { @@ -3053,32 +3064,8 @@ index 8856981da86219bdb036aa6246152f382ff8a818..32849e360a396128bd228db269ad1a8f public void b(PacketDataSerializer packetdataserializer) { this.a(); packetdataserializer.writeByte(this.i); -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 4ee11b6fbbb49b1f52fe2cf64f77c1bdd2fd3907..c6466b16926a368a4f149cedd3f2dc90ec86290d 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -983,8 +983,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { - - } - -- @Nullable -- public AxisAlignedBB ay() { -+ -+ @Nullable public final AxisAlignedBB getCollisionBox(){return ay();} //Paper - OBFHELPER -+ @Nullable public AxisAlignedBB ay() { - return null; - } - -@@ -1774,6 +1775,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { - return EnumInteractionResult.PASS; - } - -+ public final AxisAlignedBB getHardCollisionBox(Entity entity){ return j(entity);}//Paper - OBFHELPER - @Nullable - public AxisAlignedBB j(Entity entity) { - return null; diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index e83d587fd4feee1e36c18c49b98e669c09f5de20..c94197a50269622e8995685119bac984c45e6833 100644 +index 390d79187bc822187d1ba1102c418fa588e8f121..68f1a101174f4a2f7ab5556a5b733f75f3a7802f 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -6,6 +6,8 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -3091,7 +3078,7 @@ index e83d587fd4feee1e36c18c49b98e669c09f5de20..c94197a50269622e8995685119bac984 super(entitytypes, world); } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index b309d9a13b35f5c04c3a0f048e858df99d8ac617..e5455d99e3f5607a5754e5760d42853a62dddb82 100644 +index 06b2c9bdf109ab829142b8125506a3f36bc5260b..c19b17bbf1a816f65cfbfcbdf57c7cb2350cb841 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -160,6 +160,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -3103,7 +3090,7 @@ index b309d9a13b35f5c04c3a0f048e858df99d8ac617..e5455d99e3f5607a5754e5760d42853a // CraftBukkit start - fire event setGoalTarget(entityliving, EntityTargetEvent.TargetReason.UNKNOWN, true); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 7b4d71d1eb62d9368c379ccb3fb78dd930267c87..e0e918cf425c87e4f808ae1d3bd13380d37940dd 100644 +index e8f313e2b4ff4aa431243e8edb02c100390efc24..78b027465ab727b7706590d00a46e75184606432 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -137,6 +137,7 @@ public abstract class EntityLiving extends Entity { @@ -3115,7 +3102,7 @@ index 7b4d71d1eb62d9368c379ccb3fb78dd930267c87..e0e918cf425c87e4f808ae1d3bd13380 @Override public float getBukkitYaw() { diff --git a/src/main/java/net/minecraft/server/EntityMonster.java b/src/main/java/net/minecraft/server/EntityMonster.java -index fb0f281261455c9f127abd8d3b336135ad84fc27..ebdd990829edb8e423f482fa4352fe2d468efcba 100644 +index 07c48d777a71a979fb1f0063eef2e613e448d2eb..8a5d6869c269369d45cfe4e61853c44220885313 100644 --- a/src/main/java/net/minecraft/server/EntityMonster.java +++ b/src/main/java/net/minecraft/server/EntityMonster.java @@ -5,6 +5,7 @@ import java.util.function.Predicate; @@ -3127,21 +3114,21 @@ index fb0f281261455c9f127abd8d3b336135ad84fc27..ebdd990829edb8e423f482fa4352fe2d super(entitytypes, world); this.f = 5; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a904dd6b19c4d0d60d824df41069c2d6ff85a70d..34cd93a30cc447b87625c099fec32f5befae934e 100644 +index 4faf653a3a929b8043403f485d7de8eeddfac733..dd140b5e55c8ffea7e60962602435c2bd992c048 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -91,6 +91,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -93,6 +93,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public Integer clientViewDistance; // CraftBukkit end + public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper + public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { - super(worldserver, worldserver.getSpawn(), gameprofile); + super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile); this.spawnDimension = World.OVERWORLD; -@@ -102,6 +104,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -104,6 +106,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.G = 1.0F; - this.b(worldserver); + this.c(worldserver); + this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper + @@ -3149,7 +3136,7 @@ index a904dd6b19c4d0d60d824df41069c2d6ff85a70d..34cd93a30cc447b87625c099fec32f5b this.displayName = this.getName(); this.canPickUpLoot = true; diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 484e78746aa62bb0b12968165bf8e056b27152f3..9a772e40ad8f9858e6278b99d9d1ff5dc54513cb 100644 +index 9ca142e2a841e686c5647de46f0f6992a431289e..e08ccba8134846ef11928183d118a6cce53b6d89 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java @@ -3,6 +3,7 @@ package net.minecraft.server; @@ -3160,19 +3147,19 @@ index 484e78746aa62bb0b12968165bf8e056b27152f3..9a772e40ad8f9858e6278b99d9d1ff5d import java.util.UUID; import java.util.function.Function; import java.util.stream.Stream; -@@ -305,8 +306,8 @@ public class EntityTypes<T extends Entity> { - return this.bq.height; +@@ -310,8 +311,8 @@ public class EntityTypes<T extends Entity> { + return this.br.height; } - @Nullable - public T a(World world) { + public T create(World world) { return this.a(world); } // Paper - OBFHELPER + @Nullable public T a(World world) { // Paper - OBFHELPER - return this.be.create(this, world); + return this.bf.create(this, world); } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..4c65bf1f692b20d5c876a2840d5d9f76b67c6d2d 100644 +index 1890c760f9ffd7628d6ae3db40c36f5272379227..46959b58bac01b5ff7e3eb4cbac07ddf6bfc4ebc 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -68,6 +68,15 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -3192,20 +3179,15 @@ index b77a0f0c2ee30df44b113aa6c8d4fa9206d3e2ba..4c65bf1f692b20d5c876a2840d5d9f76 this.d.add(r0); LockSupport.unpark(this.getThread()); diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index 33238e2ac98e2add810ac21e40714cc2f43ac389..077fcb67f6248156aaebe7545e370ade4311b9e4 100644 +index 29cec3e7aad70c67bfefa223bad8ec607ecb2a55..a168218c6f41bb798557461a80efb785eea99b25 100644 --- a/src/main/java/net/minecraft/server/IBlockAccess.java +++ b/src/main/java/net/minecraft/server/IBlockAccess.java -@@ -10,10 +10,24 @@ public interface IBlockAccess { - @Nullable +@@ -12,6 +12,19 @@ public interface IBlockAccess { TileEntity getTileEntity(BlockPosition blockposition); -+ IBlockData getTypeIfLoaded(BlockPosition blockposition); // Paper - if loaded util IBlockData getType(BlockPosition blockposition); - -+ Fluid getFluidIfLoaded(BlockPosition blockposition); // Paper - if loaded util - Fluid getFluid(BlockPosition blockposition); - + // Paper start - if loaded util ++ IBlockData getTypeIfLoaded(BlockPosition blockposition); + default Material getMaterialIfLoaded(BlockPosition blockposition) { + IBlockData type = this.getTypeIfLoaded(blockposition); + return type == null ? null : type.getMaterial(); @@ -3215,11 +3197,11 @@ index 33238e2ac98e2add810ac21e40714cc2f43ac389..077fcb67f6248156aaebe7545e370ade + IBlockData type = this.getTypeIfLoaded(blockposition); + return type == null ? null : type.getBlock(); + } ++ Fluid getFluidIfLoaded(BlockPosition blockposition); + // Paper end -+ - default int h(BlockPosition blockposition) { - return this.getType(blockposition).f(); - } + + Fluid getFluid(BlockPosition blockposition); + diff --git a/src/main/java/net/minecraft/server/IOWorker.java b/src/main/java/net/minecraft/server/IOWorker.java index 38ccfd78639a85abcefb915c5c231be5881cebc1..8668b8f3941f37a7bc30a55c33baf74bd8ac49e3 100644 --- a/src/main/java/net/minecraft/server/IOWorker.java @@ -3234,7 +3216,7 @@ index 38ccfd78639a85abcefb915c5c231be5881cebc1..8668b8f3941f37a7bc30a55c33baf74b protected IOWorker(File file, boolean flag, String s) { diff --git a/src/main/java/net/minecraft/server/IWorldReader.java b/src/main/java/net/minecraft/server/IWorldReader.java -index 284283c5f062107df88e77edaf092cf23302a109..b6d6905260cdd32873010f24ef5a3505e66159be 100644 +index b163033a3e15a4fbfdfd8d09cae448675e61c185..eb7282c33dd4f0bb26b9ccafc42bd92e6fdb997e 100644 --- a/src/main/java/net/minecraft/server/IWorldReader.java +++ b/src/main/java/net/minecraft/server/IWorldReader.java @@ -5,6 +5,7 @@ import javax.annotation.Nullable; @@ -3246,7 +3228,7 @@ index 284283c5f062107df88e77edaf092cf23302a109..b6d6905260cdd32873010f24ef5a3505 IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag); diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 020b6e6e12d0e5840337c61e165deef942a01ed2..63842d5d1a5b8e3ec95cec13392245b43e153cf8 100644 +index 035ee010eb0183c3c13cae8d3004960486845493..10b98ba59570ae12797fa29533a6e56701849527 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -49,7 +49,7 @@ public final class ItemStack { @@ -3283,7 +3265,7 @@ index 020b6e6e12d0e5840337c61e165deef942a01ed2..63842d5d1a5b8e3ec95cec13392245b4 public void setTag(@Nullable NBTTagCompound nbttagcompound) { this.tag = nbttagcompound; if (this.getItem().usesDurability()) { -@@ -698,6 +716,7 @@ public final class ItemStack { +@@ -704,6 +722,7 @@ public final class ItemStack { return this.tag != null && this.tag.hasKeyOfType("Enchantments", 9) ? !this.tag.getList("Enchantments", 10).isEmpty() : false; } @@ -3291,7 +3273,7 @@ index 020b6e6e12d0e5840337c61e165deef942a01ed2..63842d5d1a5b8e3ec95cec13392245b4 public void a(String s, NBTBase nbtbase) { this.getOrCreateTag().set(s, nbtbase); } -@@ -783,6 +802,7 @@ public final class ItemStack { +@@ -789,6 +808,7 @@ public final class ItemStack { // CraftBukkit start @Deprecated public void setItem(Item item) { @@ -3301,14 +3283,15 @@ index 020b6e6e12d0e5840337c61e165deef942a01ed2..63842d5d1a5b8e3ec95cec13392245b4 // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java new file mode 100644 -index 0000000000000000000000000000000000000000..da7a325d070e194cd1664ed20dcb3a762c9a517a +index 0000000000000000000000000000000000000000..17d73ebbe51a83f79f338bdb1b366cecd99f880d --- /dev/null +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -0,0 +1,502 @@ +@@ -0,0 +1,503 @@ +package net.minecraft.server; + +import com.destroystokyo.paper.block.TargetBlockInfo; +import com.google.common.util.concurrent.ThreadFactoryBuilder; ++import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; +import org.apache.commons.lang.exception.ExceptionUtils; +import org.bukkit.Location; +import org.bukkit.block.BlockFace; @@ -3517,7 +3500,7 @@ index 0000000000000000000000000000000000000000..da7a325d070e194cd1664ed20dcb3a76 + + // assumes the sets have the same comparator, and if this comparator is null then assume T is Comparable + public static <T> void mergeSortedSets(final java.util.function.Consumer<T> consumer, final java.util.Comparator<? super T> comparator, final java.util.SortedSet<T>...sets) { -+ final it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<T> all = new it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<>(comparator); ++ final ObjectRBTreeSet<T> all = new ObjectRBTreeSet<>(comparator); + // note: this is done in log(n!) ~ nlogn time. It could be improved if it were to mimic what mergesort does. + for (java.util.SortedSet<T> set : sets) { + if (set != null) { @@ -3808,10 +3791,10 @@ index 0000000000000000000000000000000000000000..da7a325d070e194cd1664ed20dcb3a76 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5e2dff9a30615b5580710f872a92ab9f07fca6cf..70604fbf6bdd5166fc91d57fb4db4a8337bc4727 100644 +index b1b55d16d4e3e7952d70acfccaad0efd3a948ef3..3976bf9a94657a5842a5ced06f3d12e108667dfc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -766,6 +766,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -764,6 +764,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas MinecraftServer.LOGGER.error("Failed to unlock level {}", this.convertable.getLevelName(), ioexception1); } // Spigot start @@ -3820,7 +3803,7 @@ index 5e2dff9a30615b5580710f872a92ab9f07fca6cf..70604fbf6bdd5166fc91d57fb4db4a83 + } catch (java.lang.InterruptedException ignored) {} // Paper if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { LOGGER.info("Saving usercache.json"); - this.getUserCache().c(); + this.getUserCache().b(); diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java index ef2dee1987c45a2c43188584169dd260ee80826c..c16ff6723d3fd191b990002d40dc021d7870555d 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java @@ -3850,7 +3833,7 @@ index ef2dee1987c45a2c43188584169dd260ee80826c..c16ff6723d3fd191b990002d40dc021d return GameProfileSerializer.a(this.get(s)); } diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 69718caa347bc75ed243041797a6b53d90fc553c..c2fdccfb9192aa7ec55fd67c169cba71a695075c 100644 +index b6902ede8ca184851fdb30ff4c86549a4743bd09..5a0129d007459fbb868784f53585fd26f495358c 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -158,6 +158,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { @@ -3865,11 +3848,11 @@ index 69718caa347bc75ed243041797a6b53d90fc553c..c2fdccfb9192aa7ec55fd67c169cba71 } -+ private void sendPacketQueue() { this.o(); } // Paper - OBFHELPER - private void o() { ++ private void sendPacketQueue() { this.p(); } // Paper - OBFHELPER + private void p() { if (this.channel != null && this.channel.isOpen()) { Queue queue = this.packetQueue; -@@ -326,9 +328,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { +@@ -334,9 +336,9 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { static class QueuedPacket { @@ -3882,7 +3865,7 @@ index 69718caa347bc75ed243041797a6b53d90fc553c..c2fdccfb9192aa7ec55fd67c169cba71 public QueuedPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) { this.a = packet; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index f574a28b68cf4d3745ee5f1a3756e19dbc23ca92..6e049c2e2a142ce022b9dc278a3bb302f723e42c 100644 +index 1b9b0d98c0ad179b1351a887a90fcb1f83e8d5ea..2976e8cc2da6e54e08e50ca1f5de5669823ef3f7 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -36,6 +36,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -3906,19 +3889,19 @@ index 90223deae3376fd6828eddf3831dab96650afef2..63c4dbd327beb7b6ab42eb44650d68ac throw new SkipEncodeException(throwable); } else { diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index cb0b7e7157b629c259b0ccb946c29cbcb3c6fa98..e336437207f9d6adbab69ef2785c129ff2ec1b36 100644 +index 8bdda63a2807635e8780481244251f6e35c13627..36a7e41cc5036345929ebf4d2fa160a8c16c2c0a 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -17,7 +17,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { private NBTTagCompound d; @Nullable - private BiomeStorage e; + private int[] e; - private byte[] f; + private byte[] f; private byte[] getData() { return this.f; } // Paper - OBFHELPER private List<NBTTagCompound> g; private boolean h; - private boolean i; -@@ -133,6 +133,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { + +@@ -129,6 +129,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { return bytebuf; } @@ -3927,10 +3910,10 @@ index cb0b7e7157b629c259b0ccb946c29cbcb3c6fa98..e336437207f9d6adbab69ef2785c129f int j = 0; ChunkSection[] achunksection = chunk.getSections(); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51434733d8 100644 +index ce324c1c3ae1b7cddf962a6eb93f91000fa41d50..49686f1f39417f8c7d6e0a58fb428fa34335fb0f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -19,9 +19,9 @@ public class PlayerChunk { +@@ -21,9 +21,9 @@ public class PlayerChunk { private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.a(); private static final PlayerChunk.State[] CHUNK_STATES = PlayerChunk.State.values(); private final AtomicReferenceArray<CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> statusFutures; @@ -3943,16 +3926,16 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 private CompletableFuture<IChunkAccess> chunkSave; public int oldTicketLevel; private int ticketLevel; -@@ -37,6 +37,8 @@ public class PlayerChunk { - public final PlayerChunk.d players; +@@ -39,6 +39,8 @@ public class PlayerChunk { private boolean hasBeenLoaded; + private boolean x; + private final PlayerChunkMap chunkMap; // Paper + public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) { this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; -@@ -52,8 +54,47 @@ public class PlayerChunk { +@@ -54,8 +56,47 @@ public class PlayerChunk { this.ticketLevel = this.oldTicketLevel; this.n = this.oldTicketLevel; this.a(i); @@ -4000,7 +3983,7 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 // CraftBukkit start public Chunk getFullChunk() { if (!getChunkState(this.oldTicketLevel).isAtLeast(PlayerChunk.State.BORDER)) return null; // note: using oldTicketLevel for isLoaded checks -@@ -62,6 +103,14 @@ public class PlayerChunk { +@@ -64,6 +105,14 @@ public class PlayerChunk { return either == null ? null : (Chunk) either.left().orElse(null); } // CraftBukkit end @@ -4015,7 +3998,7 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = (CompletableFuture) this.statusFutures.get(chunkstatus.c()); -@@ -73,14 +122,17 @@ public class PlayerChunk { +@@ -75,14 +124,17 @@ public class PlayerChunk { return getChunkStatus(this.ticketLevel).b(chunkstatus) ? this.getStatusFutureUnchecked(chunkstatus) : PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE; } @@ -4033,7 +4016,7 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 public CompletableFuture<Either<Chunk, PlayerChunk.Failure>> c() { return this.fullChunkFuture; } -@@ -322,13 +374,27 @@ public class PlayerChunk { +@@ -329,13 +381,27 @@ public class PlayerChunk { this.hasBeenLoaded |= flag3; if (!flag2 && flag3) { @@ -4062,7 +4045,7 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 this.a(((CompletableFuture<Either<Chunk, PlayerChunk.Failure>>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error playerchunkmap.getClass(); return either1.ifLeft(playerchunkmap::a); -@@ -339,12 +405,24 @@ public class PlayerChunk { +@@ -346,12 +412,24 @@ public class PlayerChunk { boolean flag5 = playerchunk_state1.isAtLeast(PlayerChunk.State.TICKING); if (!flag4 && flag5) { @@ -4089,8 +4072,8 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; } -@@ -356,12 +434,24 @@ public class PlayerChunk { - throw (IllegalStateException) SystemUtils.c(new IllegalStateException()); +@@ -363,12 +441,24 @@ public class PlayerChunk { + throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException())); } - this.entityTickingFuture = playerchunkmap.b(this.location); @@ -4117,7 +4100,7 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 5f692d719fd270120207ebcf6d0a2a24e8d59f7b..3e2e355177e32856dac07dc8b98658ad1b717045 100644 +index 43168f3836eb8823f3b2046882664ba45f1be678..127c03c321e1414e0d174c8d81a7851c9da03574 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -101,6 +101,26 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -4168,7 +4151,7 @@ index 5f692d719fd270120207ebcf6d0a2a24e8d59f7b..3e2e355177e32856dac07dc8b98658ad } + this.addPlayerToDistanceMaps(entityplayer); // Paper - distance maps } else { - SectionPosition sectionposition = entityplayer.N(); + SectionPosition sectionposition = entityplayer.O(); @@ -907,6 +936,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (!flag2) { @@ -4188,7 +4171,7 @@ index 5f692d719fd270120207ebcf6d0a2a24e8d59f7b..3e2e355177e32856dac07dc8b98658ad @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 051bdbd602eb25c7d2f4a78a1a74946437d64294..d729a6a231f0b48b5b9ddabdf26febb66c0166d9 100644 +index 4791b59fc2740bdc81b62748d3edbf2b2a83e043..c7a7e2cf54b4ca7fd65fca63c0f102f479a0f3e5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -67,9 +67,9 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -4218,10 +4201,10 @@ index c027fb94881be14396cba879087861df35023500..3b65711b91c51ac7b4b5b2b0144ffd27 public final EntityHuman player; private ItemStack carried; diff --git a/src/main/java/net/minecraft/server/PotionUtil.java b/src/main/java/net/minecraft/server/PotionUtil.java -index b3824898daa80da791cdc8cfd06900e9a0b3b5b5..bf4172be525d5bdd7c152117afce8bf00106a139 100644 +index 44392c0f919a6a948ba8de0a559573727307a608..c995ce224e5236ecb33a01375824c55931faa9c0 100644 --- a/src/main/java/net/minecraft/server/PotionUtil.java +++ b/src/main/java/net/minecraft/server/PotionUtil.java -@@ -110,6 +110,7 @@ public class PotionUtil { +@@ -112,6 +112,7 @@ public class PotionUtil { return nbttagcompound == null ? Potions.EMPTY : PotionRegistry.a(nbttagcompound.getString("Potion")); } @@ -4230,7 +4213,7 @@ index b3824898daa80da791cdc8cfd06900e9a0b3b5b5..bf4172be525d5bdd7c152117afce8bf0 MinecraftKey minecraftkey = IRegistry.POTION.getKey(potionregistry); diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index f92fbf136158336b65217a504ecd422bfcc4964f..070449198273e6c42e72c891882b82361d1c8dbd 100644 +index 2335dfb90314b1b049a6cb0f8706dbbd07b4ff78..e356bd73901ac7f230492e654af579d21c8fc086 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -81,6 +81,18 @@ public class ProtoChunk implements IChunkAccess { @@ -4253,11 +4236,11 @@ index f92fbf136158336b65217a504ecd422bfcc4964f..070449198273e6c42e72c891882b8236 public IBlockData getType(BlockPosition blockposition) { int i = blockposition.getY(); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 43c5b8258d9cd15d86d4160e9c614c7ca6152962..1ce85ab949213efb9eae6daddca6ac8fb15dd472 100644 +index 49387e812a50b8cda45352cf9dd6b1692b7476c1..135f38cc5d5d2fa3866aa1063df49a96b5e72ac2 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -93,6 +93,7 @@ public class RegionFile implements AutoCloseable { - return this.d.resolve(s); +@@ -108,6 +108,7 @@ public class RegionFile implements AutoCloseable { + return this.e.resolve(s); } + @Nullable public synchronized DataInputStream getReadStream(ChunkCoordIntPair chunkCoordIntPair) throws IOException { return a(chunkCoordIntPair);} // Paper - OBFHELPER @@ -4265,10 +4248,10 @@ index 43c5b8258d9cd15d86d4160e9c614c7ca6152962..1ce85ab949213efb9eae6daddca6ac8f public synchronized DataInputStream a(ChunkCoordIntPair chunkcoordintpair) throws IOException { int i = this.getOffset(chunkcoordintpair); diff --git a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -index a2ec45a6b8bd63299508113e3522436cea2507e5..478d252953c65792df9f0068a4c1afd1985151ab 100644 +index e804c09cc89c21351c9241f426122e28e5d08452..e9fbeaf309735ea5fcb0c53b8b2485b0c5dd43be 100644 --- a/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java +++ b/src/main/java/net/minecraft/server/RegionLimitedWorldAccess.java -@@ -101,6 +101,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { +@@ -102,6 +102,26 @@ public class RegionLimitedWorldAccess implements GeneratorAccessSeed { return i >= this.n.x && i <= this.o.x && j >= this.n.z && j <= this.o.z; } @@ -4296,10 +4279,10 @@ index a2ec45a6b8bd63299508113e3522436cea2507e5..478d252953c65792df9f0068a4c1afd1 public IBlockData getType(BlockPosition blockposition) { return this.getChunkAt(blockposition.getX() >> 4, blockposition.getZ() >> 4).getType(blockposition); diff --git a/src/main/java/net/minecraft/server/RegistryBlockID.java b/src/main/java/net/minecraft/server/RegistryBlockID.java -index 4efcb8b595750891b421e524812542f0f67e9f3f..60948afa4ead71010dc27c7cef3e5acdb0ba005a 100644 +index 06ea0c3bfcb54a5f6a42363f633800c687b6f19d..f9c444c3caa1a38feafca0c59a937868b528fffe 100644 --- a/src/main/java/net/minecraft/server/RegistryBlockID.java +++ b/src/main/java/net/minecraft/server/RegistryBlockID.java -@@ -57,6 +57,7 @@ public class RegistryBlockID<T> implements Registry<T> { +@@ -64,6 +64,7 @@ public class RegistryBlockID<T> implements Registry<T> { return Iterators.filter(this.c.iterator(), Predicates.notNull()); } @@ -4308,10 +4291,10 @@ index 4efcb8b595750891b421e524812542f0f67e9f3f..60948afa4ead71010dc27c7cef3e5acd return this.b.size(); } diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 80ee8d196436e271833503a0e123401d1b3314a9..275c1d2d1eb2649de9a9b5aece6e88c21362efba 100644 +index 5f3a960b3303c48b039630b39975d6ef549a4dbe..bdfd17362518ff2398cf9e1743a7a4f0c7a0e966 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -68,7 +68,7 @@ public class SystemUtils { +@@ -72,7 +72,7 @@ public class SystemUtils { } public static long getMonotonicNanos() { @@ -4333,7 +4316,7 @@ index f82db93f88223ffddc55deec8f21efc5b774d900..75ab9f185b3231113dfa387c956a707b public static <T> TicketType<T> a(String s, Comparator<T> comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 3c08ae0cf92ab1f5395662e957ab4d9c03e13deb..86f6f082fe2991ea9065b09c9680b76ca1cf7154 100644 +index ff41038ce6d2c1a8093bce3539070fa0ccfd61c2..ed0f9c5d29c4f88b7beee4b0ecdd7a56de2d7a9e 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -21,10 +21,12 @@ public final class VoxelShapes { @@ -4350,7 +4333,7 @@ index 3c08ae0cf92ab1f5395662e957ab4d9c03e13deb..86f6f082fe2991ea9065b09c9680b76c return VoxelShapes.b; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c2403484daa7d0973b27654a9b48d0945661aa6c..fc7e29abc5a2e4fdf03f61e54c2ab716273df813 100644 +index a5c1f82dfc80c839c38fa6139b83d3aebeae9155..bf199902c599c7129e42fece0e84e9bc7277050f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -22,6 +22,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -4361,16 +4344,16 @@ index c2403484daa7d0973b27654a9b48d0945661aa6c..fc7e29abc5a2e4fdf03f61e54c2ab716 import org.bukkit.craftbukkit.block.data.CraftBlockData; import org.bukkit.event.block.BlockPhysicsEvent; // CraftBukkit end -@@ -95,7 +96,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -99,7 +100,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { + protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig(worlddata.getName(), this.spigotConfig); // Paper + this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -247,6 +248,39 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -212,6 +213,39 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return (Chunk) this.getChunkAt(i, j, ChunkStatus.FULL); } @@ -4410,7 +4393,7 @@ index c2403484daa7d0973b27654a9b48d0945661aa6c..fc7e29abc5a2e4fdf03f61e54c2ab716 @Override public IChunkAccess getChunkAt(int i, int j, ChunkStatus chunkstatus, boolean flag) { IChunkAccess ichunkaccess = this.getChunkProvider().getChunkAt(i, j, chunkstatus, flag); -@@ -405,8 +439,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -370,8 +404,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} @@ -4423,7 +4406,7 @@ index c2403484daa7d0973b27654a9b48d0945661aa6c..fc7e29abc5a2e4fdf03f61e54c2ab716 return this.setTypeAndData(blockposition, fluid.getBlockData(), 3 | (flag ? 64 : 0)); diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index ddc4570139fd9b82f4b740697e84775f5ff0a75a..d039e715624d33fc3ec9e87d5ad992415e7dc6b9 100644 +index 5719ef9714e9680596a08c42c33508c16c0e676a..bb0f30f182856d2701fde9b1a65eeb987462104a 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -37,6 +37,7 @@ public class WorldBorder { @@ -4435,10 +4418,18 @@ index ddc4570139fd9b82f4b740697e84775f5ff0a75a..d039e715624d33fc3ec9e87d5ad99241 return this.j.m(); } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f92d2e8bac5efc281988700c1a9aede36253c15b..f89611f1d8ef318a4141d62ea6a2583bd365d3f1 100644 +index c2bbcdb7a0fb2d17deb74dcbecbd8e8d99d9aaae..56ba84a0fcd3e6a6e2dbd035f466112bf17c6845 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -56,7 +56,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -11,6 +11,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectMap.Entry; + import it.unimi.dsi.fastutil.longs.LongSet; + import it.unimi.dsi.fastutil.longs.LongSets; ++import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import it.unimi.dsi.fastutil.objects.ObjectLinkedOpenHashSet; + import java.io.BufferedWriter; +@@ -56,7 +57,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap(); private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque(); private final List<EntityPlayer> players = Lists.newArrayList(); @@ -4447,6 +4438,15 @@ index f92d2e8bac5efc281988700c1a9aede36253c15b..f89611f1d8ef318a4141d62ea6a2583b boolean tickingEntities; private final MinecraftServer server; public final WorldDataServer worldDataServer; // CraftBukkit - type +@@ -1561,7 +1562,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + ObjectIterator objectiterator = spawnercreature_d.b().object2IntEntrySet().iterator(); + + while (objectiterator.hasNext()) { +- it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<EnumCreatureType> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next(); ++ Object2IntMap.Entry<EnumCreatureType> it_unimi_dsi_fastutil_objects_object2intmap_entry = (Object2IntMap.Entry) objectiterator.next(); // Paper - decompile fix + + bufferedwriter.write(String.format("spawn_count.%s: %d\n", ((EnumCreatureType) it_unimi_dsi_fastutil_objects_object2intmap_entry.getKey()).b(), it_unimi_dsi_fastutil_objects_object2intmap_entry.getIntValue())); + } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java index 62cdb32a63cdcbaee80946f73d23817bbb455488..721a1c6bd4505cb132e7004c45b795d4959389e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -4674,14 +4674,13 @@ index 0000000000000000000000000000000000000000..49dc0c441b9dd7e7745cf15ced67f383 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -index eb87f3720977e4e980d26e9cfd4fed0a808636dd..b6c39bf77e716addc9d2a1e915687bc770e937f4 100644 +index 2eeb3e23e465054f6415def6881081788239417f..0cee7f04bd27b1cb8784c23c972e31a401dbcbce 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java -@@ -187,4 +187,22 @@ public class DummyGeneratorAccess implements GeneratorAccess { - public boolean a(BlockPosition blockposition, boolean flag, Entity entity, int i) { +@@ -168,7 +168,23 @@ public class DummyGeneratorAccess implements GeneratorAccess { + public Fluid getFluid(BlockPosition blockposition) { throw new UnsupportedOperationException("Not supported yet."); } -+ + // Paper start - if loaded util + @javax.annotation.Nullable + @Override @@ -4693,13 +4692,15 @@ index eb87f3720977e4e980d26e9cfd4fed0a808636dd..b6c39bf77e716addc9d2a1e915687bc7 + public IBlockData getTypeIfLoaded(BlockPosition blockposition) { + throw new UnsupportedOperationException("Not supported yet."); + } -+ + + @Override + public Fluid getFluidIfLoaded(BlockPosition blockposition) { + throw new UnsupportedOperationException("Not supported yet."); + } + // Paper end - } + @Override + public WorldBorder getWorldBorder() { + throw new UnsupportedOperationException("Not supported yet."); diff --git a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java b/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java index 1aec70a1f1a9d8fd2cd06bde4033e19e769ab331..f72c13bedaa6fa45e26f5dcad564835bdd4af61f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/UnsafeList.java diff --git a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch index f059c86728..ccb4cc0fe8 100644 --- a/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch +++ b/Spigot-Server-Patches/0006-Add-MinecraftKey-Information-to-Objects.patch @@ -19,10 +19,10 @@ index b8868b86338ce0e89bc74eccccf714b910d7a4fe..9cb2f3b31921870ddba044840e99eb04 MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c6466b16926a368a4f149cedd3f2dc90ec86290d..2b1d674474cce96c02e5cdf71bc2c796447be59c 100644 +index e14286065d98c84d47b6596cdea5bd43f66c3603..c019a3f4febd819db32ab8917a275eec8d8493b2 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -49,7 +49,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; +@@ -51,7 +51,7 @@ import org.bukkit.event.player.PlayerTeleportEvent; import org.bukkit.plugin.PluginManager; // CraftBukkit end @@ -31,7 +31,7 @@ index c6466b16926a368a4f149cedd3f2dc90ec86290d..2b1d674474cce96c02e5cdf71bc2c796 // CraftBukkit start private static final int CURRENT_LEVEL = 2; -@@ -1670,12 +1670,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { +@@ -1664,12 +1664,31 @@ public abstract class Entity implements INamableTileEntity, ICommandListener { return true; } @@ -65,16 +65,16 @@ index c6466b16926a368a4f149cedd3f2dc90ec86290d..2b1d674474cce96c02e5cdf71bc2c796 protected abstract void loadData(NBTTagCompound nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index 9a772e40ad8f9858e6278b99d9d1ff5dc54513cb..b9fe08301409bc1f0d61a7566c26e720ff720d80 100644 +index e08ccba8134846ef11928183d118a6cce53b6d89..ffb8685e7c457483bcf4b2ed1065fec0fbaa69e2 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -248,6 +248,7 @@ public class EntityTypes<T extends Entity> { +@@ -253,6 +253,7 @@ public class EntityTypes<T extends Entity> { } } + public boolean isPersistable() { return a(); } // Paper - OBFHELPER public boolean a() { - return this.bh; + return this.bi; } diff --git a/src/main/java/net/minecraft/server/KeyedObject.java b/src/main/java/net/minecraft/server/KeyedObject.java new file mode 100644 @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..743142d0303fa25fe48a2abb07040d12 + } +} diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 6d06812f5fb6366ccd2673e9155be869b9bc0f6d..3cae7ef750371cee741c2f27799c1bb5864a278a 100644 +index 6f6f58672d882f36296bc4f65d075261fc6da912..cfbca7cfde3160e888e14c5bb3bc48267f1cb599 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -11,7 +11,7 @@ import org.bukkit.inventory.InventoryHolder; diff --git a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch index ddef59e3ee..000e8ad7ed 100644 --- a/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch +++ b/Spigot-Server-Patches/0007-Store-reference-to-current-Chunk-for-Entity-and-Bloc.patch @@ -8,7 +8,7 @@ This enables us a fast reference to the entities current chunk instead of having to look it up by hashmap lookups. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 7c7826cf3adb19814984ab627e4c4726d8933244..9cc32b879b02c8e31128e8d422221e0263126799 100644 +index 3b3e94cff2c6def318864bb5b7baefcf9de2cae7..6bd9457ad5c9fb1c0f12ff345b531be0673e866e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -56,11 +56,36 @@ public class Chunk implements IChunkAccess { @@ -80,10 +80,10 @@ index 7c7826cf3adb19814984ab627e4c4726d8933244..9cc32b879b02c8e31128e8d422221e02 } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 2b1d674474cce96c02e5cdf71bc2c796447be59c..dda4a16a6af6c39105b7dc4c2397ec5015b21ebd 100644 +index c019a3f4febd819db32ab8917a275eec8d8493b2..b16e5d7c45db92cea80913a74aee0975024220be 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -178,7 +178,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -175,7 +175,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean isChunkLoaded() { @@ -92,7 +92,7 @@ index 2b1d674474cce96c02e5cdf71bc2c796447be59c..dda4a16a6af6c39105b7dc4c2397ec50 } // CraftBukkit end -@@ -1671,6 +1671,23 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1665,6 +1665,23 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper start @@ -117,7 +117,7 @@ index 2b1d674474cce96c02e5cdf71bc2c796447be59c..dda4a16a6af6c39105b7dc4c2397ec50 private String entityKeyString; diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 3cae7ef750371cee741c2f27799c1bb5864a278a..f8d859cda8186d706304b4e182bca34573f09433 100644 +index cfbca7cfde3160e888e14c5bb3bc48267f1cb599..67fdd560f8136d83a13f75e265d5f5dd11871375 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -51,6 +51,15 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -137,10 +137,10 @@ index 3cae7ef750371cee741c2f27799c1bb5864a278a..f8d859cda8186d706304b4e182bca345 @Nullable diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 305de86630b442fe1fa27431fca1ac989d16dc61..e867168be3c17548490f30944ca56a635cc3b054 100644 +index fc23f2c4dc3ece5fd944de72b62b1a1ede3e7e45..66878c53bfb71392bf07d2c41a2edf1bc8f7af79 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -141,6 +141,7 @@ import net.minecraft.server.EntityZombieHusk; +@@ -143,6 +143,7 @@ import net.minecraft.server.EntityZombieHusk; import net.minecraft.server.EntityZombieVillager; import net.minecraft.server.IChatBaseComponent; import net.minecraft.server.NBTTagCompound; @@ -148,7 +148,7 @@ index 305de86630b442fe1fa27431fca1ac989d16dc61..e867168be3c17548490f30944ca56a63 import org.bukkit.EntityEffect; import org.bukkit.Location; import org.bukkit.Server; -@@ -182,6 +183,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -184,6 +185,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { this.entity = entity; } diff --git a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch index 57cb426087..465d0b689e 100644 --- a/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch +++ b/Spigot-Server-Patches/0008-Store-counts-for-each-Entity-Block-Entity-Type.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Store counts for each Entity/Block Entity Type Opens door for future patches to optimize performance diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index bd92ed2e6d4766f4f16ec3002c41b36b5a7e0358..eb08c7467595394fff9adf4f162aba9d71d7a7c2 100644 +index 6bd9457ad5c9fb1c0f12ff345b531be0673e866e..e6855287102be620856935df32b5df9bcf6bb88e 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -57,15 +57,19 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0009-Timings-v2.patch b/Spigot-Server-Patches/0009-Timings-v2.patch index 1f7dbfe699..f5a369d7ad 100644 --- a/Spigot-Server-Patches/0009-Timings-v2.patch +++ b/Spigot-Server-Patches/0009-Timings-v2.patch @@ -716,11 +716,11 @@ index b367bb8ea184489f433f8acc798466c38816ae62..a62f4bbb973b9cb6d1ee53f56a0897d7 + } } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index c95bbcd46978522a2dce173b4c116aa39c8f2f01..3cc572b0ce757160c7ab4733b98d8ca84f9f325a 100644 +index 871b79cb2c63525c430c257f00b2cf70157aa476..d847326b0099a0c05a085d5d62de630491c9ac56 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -24,6 +24,15 @@ public class Block extends BlockBase implements IMaterial { - private static final VoxelShape c = a(7.0D, 0.0D, 7.0D, 9.0D, 10.0D, 9.0D); +@@ -22,6 +22,15 @@ public class Block extends BlockBase implements IMaterial { + }); protected final BlockStateList<Block, IBlockData> blockStateList; private IBlockData blockData; + // Paper start @@ -736,7 +736,7 @@ index c95bbcd46978522a2dce173b4c116aa39c8f2f01..3cc572b0ce757160c7ab4733b98d8ca8 private String name; @Nullable diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 86b2e9e52d3b39f4b3cf3e93eced3d01aa84c954..87d108135d58cd75f8cba2831728cf3c33d9c337 100644 +index e6855287102be620856935df32b5df9bcf6bb88e..baa3783a0c16e9a7eaec9d38e1fe6bfed9710aa1 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -693,6 +693,7 @@ public class Chunk implements IChunkAccess { @@ -756,10 +756,10 @@ index 86b2e9e52d3b39f4b3cf3e93eced3d01aa84c954..87d108135d58cd75f8cba2831728cf3c } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadfe28ce289 100644 +index 1ca6d656cd2c7bbf12df6368ad7d953765d03e36..042031d2b7cb2f56d422145ffa7589fa46dd2e53 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -319,11 +319,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -323,11 +323,13 @@ public class ChunkProviderServer extends IChunkProvider { } gameprofilerfiller.c("getChunkCacheMiss"); @@ -775,7 +775,7 @@ index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadf ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; }, (playerchunk_failure) -> { -@@ -510,7 +512,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -514,7 +516,9 @@ public class ChunkProviderServer extends IChunkProvider { public void save(boolean flag) { this.tickDistanceManager(); @@ -785,7 +785,7 @@ index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadf } @Override -@@ -547,7 +551,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -551,7 +555,9 @@ public class ChunkProviderServer extends IChunkProvider { this.tickDistanceManager(); this.world.timings.doChunkMap.stopTiming(); // Spigot this.world.getMethodProfiler().exitEnter("chunks"); @@ -795,18 +795,18 @@ index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadf this.world.timings.doChunkUnload.startTiming(); // Spigot this.world.getMethodProfiler().exitEnter("unload"); this.playerChunkMap.unloadChunks(booleansupplier); -@@ -571,8 +577,10 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -575,8 +581,10 @@ public class ChunkProviderServer extends IChunkProvider { boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit this.world.getMethodProfiler().enter("naturalSpawnCount"); + this.world.timings.countNaturalMobs.startTiming(); // Paper - timings int l = this.chunkMapDistance.b(); - SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.z(), this::a); + SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.A(), this::a); + this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings this.p = spawnercreature_d; this.world.getMethodProfiler().exit(); -@@ -583,7 +591,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -587,7 +595,9 @@ public class ChunkProviderServer extends IChunkProvider { if (optional.isPresent()) { this.world.getMethodProfiler().enter("broadcast"); @@ -816,7 +816,7 @@ index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadf this.world.getMethodProfiler().exit(); Optional<Chunk> optional1 = ((Either) playerchunk.b().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); -@@ -597,25 +607,25 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -601,25 +611,25 @@ public class ChunkProviderServer extends IChunkProvider { SpawnerCreature.a(this.world, chunk, spawnercreature_d, this.allowAnimals, this.allowMonsters, flag2); } @@ -847,7 +847,7 @@ index 359441cd993a95f933f23aebcec8180f314a5f09..7dd9c5eec53631d25ae511b1e57bdadf private void a(long i, Consumer<Chunk> consumer) { diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 79e0e65a35945a6071cf08f688311ec4d1f71c72..28039aa8421207ce04840cc90e03d21bc8b7269f 100644 +index a9b40a74fb2080ccb9958f074d424c8b8ed97239..f30071fe5c1f33386829cc61d8c6976a39eff24f 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -1,5 +1,6 @@ @@ -911,7 +911,7 @@ index 6d628c759346701c4097f36c302d1a1ab258bf9c..67e1b153a6f2ff9547dd03fcf4abcbea return this.b; } diff --git a/src/main/java/net/minecraft/server/CustomFunctionData.java b/src/main/java/net/minecraft/server/CustomFunctionData.java -index 903cbd10fba18e61a4dc3ced71e22a665b78f177..423e4d12aba9197b936e69dfd4146ceeca3a30c4 100644 +index 11891990d90b789192d9081787c1e844646121ae..2a48d85f0490991eb323ef550cb6148d6387acaf 100644 --- a/src/main/java/net/minecraft/server/CustomFunctionData.java +++ b/src/main/java/net/minecraft/server/CustomFunctionData.java @@ -69,7 +69,7 @@ public class CustomFunctionData { @@ -924,7 +924,7 @@ index 903cbd10fba18e61a4dc3ced71e22a665b78f177..423e4d12aba9197b936e69dfd4146cee int k = 0; CustomFunction.c[] acustomfunction_c = customfunction.b(); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e00ed83c9 100644 +index 7f3c6518cce96354cc2217e5e112ac426199ae9b..4ef6913c356663b640e6ce770c123f51e6f3c057 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -28,7 +28,7 @@ import org.apache.logging.log4j.Level; @@ -936,7 +936,7 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.craftbukkit.util.Waitable; import org.bukkit.event.server.RemoteServerCommandEvent; -@@ -381,7 +381,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -379,7 +379,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } public void handleCommandQueue() { @@ -945,7 +945,7 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e while (!this.serverCommandQueue.isEmpty()) { ServerCommand servercommand = (ServerCommand) this.serverCommandQueue.remove(0); -@@ -396,7 +396,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -394,7 +394,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer // CraftBukkit end } @@ -954,7 +954,7 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e } @Override -@@ -627,6 +627,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -630,6 +630,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @Override public String executeRemoteCommand(String s) { @@ -962,7 +962,7 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e this.remoteControlCommandListener.clearMessages(); this.executeSync(() -> { // CraftBukkit start - fire RemoteServerCommandEvent -@@ -635,10 +636,39 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -638,10 +639,39 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer if (event.isCancelled()) { return; } @@ -1003,10 +1003,10 @@ index aa68eb71b131c1d529ded6c651621cfab071b3c4..9cba62efdb051c9850bbf28b0be17a7e } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index dda4a16a6af6c39105b7dc4c2397ec5015b21ebd..15b8767d330bd89c070116f1f180841d3ef9342a 100644 +index b16e5d7c45db92cea80913a74aee0975024220be..8dbf7b62d64ca7472956ad198554a98d46bac589 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -29,7 +29,8 @@ import org.bukkit.command.CommandSender; +@@ -31,7 +31,8 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; import org.bukkit.entity.Hanging; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Vehicle; @@ -1016,7 +1016,7 @@ index dda4a16a6af6c39105b7dc4c2397ec5015b21ebd..15b8767d330bd89c070116f1f180841d import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -@@ -165,7 +166,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -162,7 +163,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public boolean valid; public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 @@ -1025,7 +1025,7 @@ index dda4a16a6af6c39105b7dc4c2397ec5015b21ebd..15b8767d330bd89c070116f1f180841d // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -526,7 +527,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -531,7 +532,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public void move(EnumMoveType enummovetype, Vec3D vec3d) { @@ -1033,16 +1033,16 @@ index dda4a16a6af6c39105b7dc4c2397ec5015b21ebd..15b8767d330bd89c070116f1f180841d if (this.noclip) { this.a(this.getBoundingBox().c(vec3d)); this.recalcPosition(); -@@ -663,7 +663,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -667,7 +667,6 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.world.getMethodProfiler().exit(); } - org.bukkit.craftbukkit.SpigotTimings.entityMoveTimer.stopTiming(); // Spigot } - protected BlockPosition ak() { + protected BlockPosition ao() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b461ecaf7b1 100644 +index 78b027465ab727b7706590d00a46e75184606432..380165b54e118df19e6adefd35ad0bc039a7ac51 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -41,7 +41,7 @@ import org.bukkit.event.entity.EntityTeleportEvent; @@ -1054,15 +1054,15 @@ index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b46 public abstract class EntityLiving extends Entity { -@@ -2333,7 +2333,6 @@ public abstract class EntityLiving extends Entity { +@@ -2334,7 +2334,6 @@ public abstract class EntityLiving extends Entity { @Override public void tick() { - SpigotTimings.timerEntityBaseTick.startTiming(); // Spigot super.tick(); - this.u(); - this.x(); -@@ -2382,9 +2381,7 @@ public abstract class EntityLiving extends Entity { + this.t(); + this.v(); +@@ -2383,9 +2382,7 @@ public abstract class EntityLiving extends Entity { } } @@ -1072,7 +1072,7 @@ index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b46 double d0 = this.locX() - this.lastX; double d1 = this.locZ() - this.lastZ; float f = (float) (d0 * d0 + d1 * d1); -@@ -2464,8 +2461,6 @@ public abstract class EntityLiving extends Entity { +@@ -2465,8 +2462,6 @@ public abstract class EntityLiving extends Entity { if (this.isSleeping()) { this.pitch = 0.0F; } @@ -1080,16 +1080,16 @@ index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b46 - SpigotTimings.timerEntityTickRest.stopTiming(); // Spigot } - private void q() { -@@ -2647,7 +2642,6 @@ public abstract class EntityLiving extends Entity { + private void p() { +@@ -2648,7 +2643,6 @@ public abstract class EntityLiving extends Entity { this.setMot(d4, d5, d6); this.world.getMethodProfiler().enter("ai"); - SpigotTimings.timerEntityAI.startTiming(); // Spigot if (this.isFrozen()) { this.jumping = false; - this.aY = 0.0F; -@@ -2657,7 +2651,6 @@ public abstract class EntityLiving extends Entity { + this.aR = 0.0F; +@@ -2658,7 +2652,6 @@ public abstract class EntityLiving extends Entity { this.doTick(); this.world.getMethodProfiler().exit(); } @@ -1097,17 +1097,19 @@ index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b46 this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("jump"); -@@ -2692,9 +2685,7 @@ public abstract class EntityLiving extends Entity { - this.t(); +@@ -2693,9 +2686,9 @@ public abstract class EntityLiving extends Entity { + this.r(); AxisAlignedBB axisalignedbb = this.getBoundingBox(); - SpigotTimings.timerEntityAIMove.startTiming(); // Spigot - this.f(new Vec3D((double) this.aY, (double) this.aZ, (double) this.ba)); ++ // SpigotTimings.timerEntityAIMove.startTiming(); // Spigot // Paper + this.g(new Vec3D((double) this.aR, (double) this.aS, (double) this.aT)); - SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot ++ // SpigotTimings.timerEntityAIMove.stopTiming(); // Spigot // Paper this.world.getMethodProfiler().exit(); this.world.getMethodProfiler().enter("push"); - if (this.bm > 0) { -@@ -2702,9 +2693,7 @@ public abstract class EntityLiving extends Entity { + if (this.bf > 0) { +@@ -2703,9 +2696,7 @@ public abstract class EntityLiving extends Entity { this.a(axisalignedbb, this.getBoundingBox()); } @@ -1115,10 +1117,10 @@ index e0e918cf425c87e4f808ae1d3bd13380d37940dd..b653788984f442337b61318d73892b46 this.collideNearby(); - SpigotTimings.timerEntityAICollision.stopTiming(); // Spigot this.world.getMethodProfiler().exit(); - if (!this.world.isClientSide && this.dN() && this.aC()) { + if (!this.world.isClientSide && this.dN() && this.aF()) { this.damageEntity(DamageSource.DROWN, 1.0F); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb5353113ea039a0 100644 +index 3976bf9a94657a5842a5ced06f3d12e108667dfc..bc7f74bae272d7cef681136ebdafed3d1a3df046 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -65,7 +65,7 @@ import org.bukkit.craftbukkit.CraftServer; @@ -1136,12 +1138,12 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 private long nextTick; - private long W; - private boolean X; -+ private long W;final long getTickOversleepMaxTime() { return this.W; } // Paper - OBFHELPER ++ private long W; final long getTickOversleepMaxTime() { return this.W; } // Paper - OBFHELPER + private boolean X; final boolean hasExecutedTask() { return this.X; } // Paper - OBFHELPER - private final ResourcePackRepository<ResourcePackLoader> resourcePackRepository; + private final ResourcePackRepository resourcePackRepository; private final ScoreboardServer scoreboardServer; @Nullable -@@ -712,6 +712,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -710,6 +710,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } // CraftBukkit end MinecraftServer.LOGGER.info("Stopping server"); @@ -1149,7 +1151,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); -@@ -909,9 +910,21 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -907,9 +908,21 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas private boolean canSleepForTick() { // CraftBukkit start @@ -1171,7 +1173,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 private void executeModerately() { this.executeAll(); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); -@@ -919,9 +932,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -917,9 +930,9 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // CraftBukkit end protected void sleepForTick() { @@ -1183,7 +1185,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 }); } -@@ -1004,10 +1017,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1002,10 +1015,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas protected void exit() {} protected void a(BooleanSupplier booleansupplier) { @@ -1203,7 +1205,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 ++this.ticks; this.b(booleansupplier); if (i - this.T >= 5000000000L) { -@@ -1025,14 +1046,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1023,14 +1044,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit @@ -1218,7 +1220,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 } this.methodProfiler.enter("snooper"); -@@ -1045,6 +1064,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1043,6 +1062,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } this.methodProfiler.exit(); @@ -1232,7 +1234,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 this.methodProfiler.enter("tallying"); long l = this.h[this.ticks % 100] = SystemUtils.getMonotonicNanos() - i; -@@ -1055,30 +1081,29 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1053,30 +1079,29 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot this.slackActivityAccountant.tickEnded(l); // Spigot @@ -1271,7 +1273,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 // Send time updates to everyone, it will get the right time from the world the player is in. if (this.ticks % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -1086,7 +1111,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1084,7 +1109,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas entityplayer.playerConnection.sendPacket(new PacketPlayOutUpdateTime(entityplayer.world.getTime(), entityplayer.getPlayerTime(), entityplayer.world.getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE))); // Add support for per player time } } @@ -1280,7 +1282,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 while (iterator.hasNext()) { WorldServer worldserver = (WorldServer) iterator.next(); -@@ -1127,24 +1152,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1125,24 +1150,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } this.methodProfiler.exitEnter("connection"); @@ -1312,7 +1314,7 @@ index 70604fbf6bdd5166fc91d57fb4db4a8337bc4727..0867ad04857c652dcbcdf130bb535311 this.methodProfiler.exit(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 3e2e355177e32856dac07dc8b98658ad1b717045..7c5eaff23ef6bf3cdf2575330ea6341d6240e283 100644 +index 127c03c321e1414e0d174c8d81a7851c9da03574..d98b6ef44e1836920956754dfcb6654fec23b673 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,7 +1,9 @@ @@ -1407,7 +1409,7 @@ index 3e2e355177e32856dac07dc8b98658ad1b717045..7c5eaff23ef6bf3cdf2575330ea6341d protected void broadcast(Entity entity, Packet<?> packet) { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d729a6a231f0b48b5b9ddabdf26febb66c0166d9..0222e4d3e0555f043c7466f9daac28a24e2060e2 100644 +index c7a7e2cf54b4ca7fd65fca63c0f102f479a0f3e5..89c36a5ad2a74a2bf4c86ad108a43e97fa88e793 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -58,6 +58,7 @@ import org.bukkit.inventory.CraftingInventory; @@ -1434,7 +1436,7 @@ index d729a6a231f0b48b5b9ddabdf26febb66c0166d9..0222e4d3e0555f043c7466f9daac28a2 } -@@ -1684,7 +1683,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1678,7 +1677,7 @@ public class PlayerConnection implements PacketListenerPlayIn { // CraftBukkit end private void handleCommand(String s) { @@ -1443,7 +1445,7 @@ index d729a6a231f0b48b5b9ddabdf26febb66c0166d9..0222e4d3e0555f043c7466f9daac28a2 // CraftBukkit start - whole method if ( org.spigotmc.SpigotConfig.logCommands ) // Spigot this.LOGGER.info(this.player.getName() + " issued server command: " + s); -@@ -1695,7 +1694,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1689,7 +1688,7 @@ public class PlayerConnection implements PacketListenerPlayIn { this.server.getPluginManager().callEvent(event); if (event.isCancelled()) { @@ -1452,7 +1454,7 @@ index d729a6a231f0b48b5b9ddabdf26febb66c0166d9..0222e4d3e0555f043c7466f9daac28a2 return; } -@@ -1708,7 +1707,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1702,7 +1701,7 @@ public class PlayerConnection implements PacketListenerPlayIn { java.util.logging.Logger.getLogger(PlayerConnection.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); return; } finally { @@ -1489,7 +1491,7 @@ index 2c671629a43f42da8335e7216f9fd399bb878729..eb3269e0ea3ce33d08e9eee3bca7cf43 PlayerConnectionUtils.LOGGER.debug("Ignoring packet due to disconnection: " + packet); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f268cf1c82d66704793b817ab7cc4815b1a39e54..60a8fdbd6e458dfdc3e4449d71464bb5d5c5bd20 100644 +index 65a499b35c0e21b4b945595c07d46350724e821e..b2a89201a14e5132a0c6c69ec37c7a113202ab02 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -1,5 +1,6 @@ @@ -1499,7 +1501,7 @@ index f268cf1c82d66704793b817ab7cc4815b1a39e54..60a8fdbd6e458dfdc3e4449d71464bb5 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -941,10 +942,11 @@ public abstract class PlayerList { +@@ -953,10 +954,11 @@ public abstract class PlayerList { } public void savePlayers() { @@ -1562,7 +1564,7 @@ index e8ff43662b8397229cb19ea26342b66c88807379..3b8f56c0f0507ebdd9ac20be70688b4c this.g.clear(); this.f.clear(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index f8d859cda8186d706304b4e182bca34573f09433..057d703fe73de9bb9ca6f0e263463d32abae4c13 100644 +index 67fdd560f8136d83a13f75e265d5f5dd11871375..8f51a1e5e37566001e1d419065ce730768c1b342 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -9,11 +9,12 @@ import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; @@ -1581,7 +1583,7 @@ index f8d859cda8186d706304b4e182bca34573f09433..057d703fe73de9bb9ca6f0e263463d32 private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); public CraftPersistentDataContainer persistentDataContainer; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index fc7e29abc5a2e4fdf03f61e54c2ab716273df813..35920c82ef9b79a6d8f806b90f2f8dbd0de061c2 100644 +index bf199902c599c7129e42fece0e84e9bc7277050f..998eb1cadc40878ec6fda7963adcdf8c49154cea 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -18,7 +18,6 @@ import org.apache.logging.log4j.Logger; @@ -1601,7 +1603,7 @@ index fc7e29abc5a2e4fdf03f61e54c2ab716273df813..35920c82ef9b79a6d8f806b90f2f8dbd public static BlockPosition lastPhysicsProblem; // Spigot private org.spigotmc.TickLimiter entityLimiter; private org.spigotmc.TickLimiter tileLimiter; -@@ -159,7 +158,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -165,7 +164,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void c(WorldBorder worldborder, double d0) {} }); // CraftBukkit end @@ -1610,7 +1612,7 @@ index fc7e29abc5a2e4fdf03f61e54c2ab716273df813..35920c82ef9b79a6d8f806b90f2f8dbd this.entityLimiter = new org.spigotmc.TickLimiter(spigotConfig.entityMaxTickTime); this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } -@@ -781,15 +780,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -746,15 +745,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } timings.tileEntityPending.stopTiming(); // Spigot @@ -1628,19 +1630,19 @@ index fc7e29abc5a2e4fdf03f61e54c2ab716273df813..35920c82ef9b79a6d8f806b90f2f8dbd CrashReport crashreport = CrashReport.a(throwable, "Ticking entity"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being ticked"); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e128314436c 100644 +index 56ba84a0fcd3e6a6e2dbd035f466112bf17c6845..b281f49cd95dc9af612ee8e580f62c739920640f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -3,6 +3,8 @@ package net.minecraft.server; +@@ -2,6 +2,8 @@ package net.minecraft.server; + import com.google.common.annotations.VisibleForTesting; - import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; +import co.aikar.timings.TimingHistory; // Paper +import co.aikar.timings.Timings; // Paper import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -39,7 +41,6 @@ import org.apache.logging.log4j.Logger; +@@ -40,7 +42,6 @@ import org.apache.logging.log4j.Logger; import java.util.logging.Level; import org.bukkit.Bukkit; import org.bukkit.WeatherType; @@ -1648,7 +1650,7 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.util.WorldUUID; import org.bukkit.event.entity.CreatureSpawnEvent; -@@ -95,10 +96,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -96,10 +97,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit end this.nextTickListBlock = new TickListServer<>(this, (block) -> { return block == null || block.getBlockData().isAir(); @@ -1661,8 +1663,8 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 this.navigators = Sets.newHashSet(); this.L = new ObjectLinkedOpenHashSet(); this.Q = flag1; -@@ -326,17 +327,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { - this.N(); +@@ -327,17 +328,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { + this.P(); this.b(); gameprofilerfiller.exitEnter("chunkSource"); + this.timings.chunkProviderTick.startTiming(); // Paper - timings @@ -1684,8 +1686,8 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 + this.timings.raids.stopTiming(); // Paper - timings gameprofilerfiller.exitEnter("blockEvents"); timings.doSounds.startTiming(); // Spigot - this.ah(); -@@ -508,6 +513,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { + this.aj(); +@@ -509,6 +514,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exitEnter("tickBlocks"); @@ -1693,7 +1695,7 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 if (i > 0) { ChunkSection[] achunksection = chunk.getSections(); int l = achunksection.length; -@@ -539,7 +545,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -540,7 +546,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } } @@ -1702,7 +1704,7 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 gameprofilerfiller.exit(); } -@@ -637,6 +643,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -638,6 +644,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (!(entity instanceof EntityHuman) && !this.getChunkProvider().a(entity)) { this.chunkCheck(entity); } else { @@ -1710,17 +1712,17 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 // Spigot start if (!org.spigotmc.ActivationRange.checkIfActive(entity)) { entity.ticksLived++; -@@ -644,7 +651,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -645,7 +652,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { return; } // Spigot end + TimingHistory.activatedEntityTicks++; // Paper - timings entity.tickTimer.startTiming(); // Spigot + try { // Paper - timings - entity.f(entity.locX(), entity.locY(), entity.locZ()); + entity.g(entity.locX(), entity.locY(), entity.locZ()); entity.lastYaw = entity.yaw; entity.lastPitch = entity.pitch; -@@ -671,7 +680,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -672,7 +681,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.a(entity, entity1); } } @@ -1730,7 +1732,7 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 } } -@@ -748,6 +759,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -749,6 +760,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (!flag1) { org.bukkit.Bukkit.getPluginManager().callEvent(new org.bukkit.event.world.WorldSaveEvent(getWorld())); // CraftBukkit @@ -1738,7 +1740,7 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel")); } -@@ -757,7 +769,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -758,7 +770,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { iprogressupdate.c(new ChatMessage("menu.savingChunks")); } @@ -1750,10 +1752,10 @@ index f89611f1d8ef318a4141d62ea6a2583bd365d3f1..df63ea6680e9619e09477ed44a021e12 // CraftBukkit start - moved from MinecraftServer.saveChunks diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 23ee1e59bbc560eb2f405fccf4170dcff278be3d..89143ae11ae485d7d3d602d2f535e2fc240201f1 100644 +index db5001cd4c601e35678181ba0ae66b3ed3cde124..1727c9ab0bb9e5b18198f7089a320223f2297d88 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2059,12 +2059,31 @@ public final class CraftServer implements Server { +@@ -2053,12 +2053,31 @@ public final class CraftServer implements Server { private final Spigot spigot = new Spigot() { @@ -1955,10 +1957,10 @@ index 7f435847ac1d13756ce233e7d5ae13f9dc17c443..00000000000000000000000000000000 - } -} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 82d302832c579b4524121d21332c999a4d757de6..f8c4fb312232f1689fd19e165830e62609813213 100644 +index 1bde861afb6ff3d339bda0996e9eaa502cce5e70..495470f9c397e80b9e6e8e3c9360b0d659b916ed 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1778,6 +1778,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1774,6 +1774,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { packet.components = components; getHandle().playerConnection.sendPacket(packet); } @@ -2147,7 +2149,7 @@ index e52ef47b783785dc214746b678e7b549aea9a274..3d90b3426873a3528af14f7f1ab0adae this.value = value; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 1358c99c9f065dd19f7b71b543fc470abcad9611..e0fc695465b3dbbbc1c183cc89760a73b061eb63 100644 +index 1afaa2429995514fdaf2e2390e0545599ba4b3f4..9828935e0ab1d7bc9950f3d9225542af3d0bf5b5 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -138,6 +138,12 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch b/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch index 334c3d9cc9..0373dab6c8 100644 --- a/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch +++ b/Spigot-Server-Patches/0011-Configurable-baby-zombie-movement-speed.patch @@ -25,7 +25,7 @@ index 098bd3fba867c0e4c6c58748aa6e2e632737a948..912611cf1aeccf5a82a789aab07d7672 + } } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 4b924ce42c9440c06c8c4f04dd4262289cfee6b7..951cf5546af11434971a26dca15c20c25e6c555e 100644 +index ebf46a3c31913bf6ec2aa13b8c9bac1c590b7d84..12f954723ac2f0058081d810ce83aed99532caad 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -21,7 +21,7 @@ import org.bukkit.event.entity.EntityTransformEvent; @@ -35,9 +35,9 @@ index 4b924ce42c9440c06c8c4f04dd4262289cfee6b7..951cf5546af11434971a26dca15c20c2 - private static final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); + private final AttributeModifier c = new AttributeModifier(EntityZombie.b, "Baby speed boost", 0.5D, AttributeModifier.Operation.MULTIPLY_BASE); private final AttributeModifier babyModifier = this.c; // Paper - remove static - Make baby speed configurable private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); - private static final DataWatcherObject<Integer> bv = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); + private static final DataWatcherObject<Integer> bo = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b); public static final DataWatcherObject<Boolean> DROWN_CONVERTING = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i); -@@ -123,9 +123,9 @@ public class EntityZombie extends EntityMonster { +@@ -124,9 +124,9 @@ public class EntityZombie extends EntityMonster { if (this.world != null && !this.world.isClientSide) { AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); diff --git a/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch b/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch index 7f0cd9f31c..adadc6edda 100644 --- a/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch +++ b/Spigot-Server-Patches/0012-Configurable-fishing-time-ranges.patch @@ -22,17 +22,15 @@ index 912611cf1aeccf5a82a789aab07d76723d4357cc..7d9976ce6bf86e6fdfd0c7770104cee0 + } } diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index b0f3b30944b7741ef1d9af21e919ff2df9c510a3..ab8f67c11419cc788fc3cb814d2224e65217dd08 100644 +index b787c8a35c38aa944bcf0d849a1940bede88f86d..9928ba1d181eef8735ccd4e282719b4ca3d62bea 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -338,8 +338,9 @@ public class EntityFishingHook extends IProjectile { - this.ap = MathHelper.nextInt(this.random, 20, 80); +@@ -338,7 +338,7 @@ public class EntityFishingHook extends IProjectile { + this.ai = MathHelper.nextInt(this.random, 20, 80); } } else { -- this.ao = MathHelper.nextInt(this.random, 100, 600); -+ this.ao = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper - this.ao -= this.av * 20 * 5; -+ this.ao = Math.max(0, this.ao); // Paper - Don't allow negative values; +- this.ah = MathHelper.nextInt(this.random, 100, 600); ++ this.ah = MathHelper.nextInt(this.random, world.paperConfig.fishingMinTicks, world.paperConfig.fishingMaxTicks); // Paper + this.ah -= this.ao * 20 * 5; } } - diff --git a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch index 17c043634b..065ee4ba51 100644 --- a/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch +++ b/Spigot-Server-Patches/0013-Allow-nerfed-mobs-to-jump-and-take-water-damage.patch @@ -31,19 +31,19 @@ index 2e869004c8c6b8bfbb002fb4eda04519d50390c8..22eb89df768819f0a18f91b806b56ace this.b.setJumping(this.a); this.a = false; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 15b8767d330bd89c070116f1f180841d3ef9342a..faf51fd55870cc8fff5b92e7ba9eeb0ed039c079 100644 +index 8dbf7b62d64ca7472956ad198554a98d46bac589..32e10105fa68b6f647d6c3173ae6e6db03209b78 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1024,6 +1024,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1022,6 +1022,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.isInWater() || this.isInRain(); } -+ public final boolean isInWaterOrRainOrBubble() { return aC(); } // Paper - OBFHELPER - public boolean aC() { ++ public final boolean isInWaterOrRainOrBubble() { return aF(); } // Paper - OBFHELPER + public boolean aF() { return this.isInWater() || this.isInRain() || this.k(); } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index e5455d99e3f5607a5754e5760d42853a62dddb82..b9732287ba16d90bed33929348a223f6dbdbfb45 100644 +index c19b17bbf1a816f65cfbfcbdf57c7cb2350cb841..d09faa237905a6d4ad39ece64f6db5079be655e1 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -33,6 +33,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -53,7 +53,7 @@ index e5455d99e3f5607a5754e5760d42853a62dddb82..b9732287ba16d90bed33929348a223f6 + @Nullable public PathfinderGoalFloat goalFloat; // Paper public PathfinderGoalSelector targetSelector; private EntityLiving goalTarget; - private final EntitySenses bv; + private final EntitySenses bo; @@ -719,7 +720,17 @@ public abstract class EntityInsentient extends EntityLiving { @Override protected final void doTick() { @@ -71,10 +71,10 @@ index e5455d99e3f5607a5754e5760d42853a62dddb82..b9732287ba16d90bed33929348a223f6 + } + // Paper end this.world.getMethodProfiler().enter("sensing"); - this.bv.a(); + this.bo.a(); this.world.getMethodProfiler().exit(); diff --git a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java -index d0281a98a318376922b5bd8fcad7ba7db2012b54..e2b23978e347fe63e8bc900b72da6cbaf27bf652 100644 +index 8e41e7a159a9eabd955c5110c6c2458f5348f2f9..cb633bec6e977ba0af388d3c9b005a2dcb91bb87 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalFloat.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalFloat.java @@ -8,15 +8,18 @@ public class PathfinderGoalFloat extends PathfinderGoal { @@ -89,7 +89,7 @@ index d0281a98a318376922b5bd8fcad7ba7db2012b54..e2b23978e347fe63e8bc900b72da6cba + public final boolean validConditions() { return this.a(); } // Paper - OBFHELPER @Override public boolean a() { - return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aN(); + return this.a.isInWater() && this.a.b((Tag) TagsFluid.WATER) > this.a.cw() || this.a.aP(); } + public void update() { this.e(); } // Paper - OBFHELPER diff --git a/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch b/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch index 5ea0976113..93b17f6cc1 100644 --- a/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch +++ b/Spigot-Server-Patches/0014-Add-configurable-despawn-distances-for-living-entiti.patch @@ -30,7 +30,7 @@ index 6d6a68cb1b952da8308ac9ce5b54694bc9ba0e30..2845686411615245137cfe1a155088a8 + } } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index b9732287ba16d90bed33929348a223f6dbdbfb45..885b97f9397753e7561f113f588b4ca2d5edb0fe 100644 +index d09faa237905a6d4ad39ece64f6db5079be655e1..0f28d047453b99a6dc051196642cedc86b3d657b 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -698,14 +698,14 @@ public abstract class EntityInsentient extends EntityLiving { diff --git a/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch b/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch index 6283591552..024ddc8115 100644 --- a/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch +++ b/Spigot-Server-Patches/0015-Allow-for-toggling-of-spawn-chunks.patch @@ -20,10 +20,10 @@ index 2845686411615245137cfe1a155088a865a4d3a0..8ee2b9bb1bce698fce50ac1b3fc477fc + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 35920c82ef9b79a6d8f806b90f2f8dbd0de061c2..e5e4d25ffc8f640a183b53961ce4678e52a67a91 100644 +index 998eb1cadc40878ec6fda7963adcdf8c49154cea..1ad366de6d2857edb6d12006e8db11845cdf30d8 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -159,6 +159,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -165,6 +165,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { }); // CraftBukkit end timings = new co.aikar.timings.WorldTimingsHandler(this); // Paper - code below can generate new world and access timings diff --git a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch index ddde3606db..62fdec635a 100644 --- a/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch +++ b/Spigot-Server-Patches/0016-Drop-falling-block-and-tnt-entities-at-the-specified.patch @@ -24,10 +24,10 @@ index 8ee2b9bb1bce698fce50ac1b3fc477fcafd0542c..d59b82b7bb1f6d1b231f4e394e0a67a3 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a50b005b9f3fc58674560f42b9c4a20fd8b669fa..e85172eb69b04746eab08abf213dcd02cd4513ee 100644 +index 32e10105fa68b6f647d6c3173ae6e6db03209b78..f38931dec12c09e3822b320855f749158fd784f4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1761,6 +1761,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1755,6 +1755,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.a(itemstack, 0.0F); } @@ -36,7 +36,7 @@ index a50b005b9f3fc58674560f42b9c4a20fd8b669fa..e85172eb69b04746eab08abf213dcd02 public EntityItem a(ItemStack itemstack, float f) { if (itemstack.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index d3e25e3503670804fba67c922c63e0e7f5a9543b..8c51b3060114a24249962c2d6142166ac8600a0a 100644 +index d80245492a89180f9cc7d8bc8a8e485ffa4ba174..e7efc540a9ec67e67714c9b3cfd2c24c0842e3f5 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -85,6 +85,17 @@ public class EntityFallingBlock extends Entity { @@ -58,7 +58,7 @@ index d3e25e3503670804fba67c922c63e0e7f5a9543b..8c51b3060114a24249962c2d6142166a blockposition = this.getChunkCoordinates(); boolean flag = this.block.getBlock() instanceof BlockConcretePowder; diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 5fca541ca8af4a8ed9ec6dacb3d551048b9efbf4..b5900e1cad8137954d5fa4fde10b4afb64fb6412 100644 +index ea4ecd9833c33cf3bf0257030f63d0c1693ad9ff..71404a34d27dd7771ea1145085a6a6e4dc7589b0 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -54,6 +54,12 @@ public class EntityTNTPrimed extends Entity { diff --git a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 27a0dbaafa..617193f6aa 100644 --- a/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/Spigot-Server-Patches/0017-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -19,10 +19,10 @@ index aab33df7a36eb69300fedfce733985d6c239ca01..550232cb3819138b3bae0fa1c5142948 throwable = throwable1; throw throwable1; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0867ad04857c652dcbcdf130bb5353113ea039a0..9eacc1ba58986c21c5d8dc8d8d14c6f3b48fd171 100644 +index bc7f74bae272d7cef681136ebdafed3d1a3df046..1148a81b74cf6e9d27e32c3a61cf423786daed16 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1224,7 +1224,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1222,7 +1222,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } public String getServerModName() { @@ -32,10 +32,10 @@ index 0867ad04857c652dcbcdf130bb5353113ea039a0..9eacc1ba58986c21c5d8dc8d8d14c6f3 public CrashReport b(CrashReport crashreport) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 89143ae11ae485d7d3d602d2f535e2fc240201f1..a19e208415a5918414d61304de4bd282725bef56 100644 +index 1727c9ab0bb9e5b18198f7089a320223f2297d88..4bdb096cd74c75f02d34f9d367b1bd5c0b6500df 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -226,7 +226,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -225,7 +225,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot public final class CraftServer implements Server { @@ -45,11 +45,11 @@ index 89143ae11ae485d7d3d602d2f535e2fc240201f1..a19e208415a5918414d61304de4bd282 private final String bukkitVersion = Versioning.getBukkitVersion(); private final Logger logger = Logger.getLogger("Minecraft"); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index fc76dc4585c54608531c75e48a3bacce7dc9d729..aa5f94f85b5792c9896fcdafe77e37ec49681d58 100644 +index 4e5611beaa22a08573e373cc87e9a265c8bca5aa..6eaffb5fa1a0181936c602f0045a9a815cde15dd 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -200,12 +200,25 @@ public class Main { - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); - System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***"); diff --git a/Spigot-Server-Patches/0018-Implement-Paper-VersionChecker.patch b/Spigot-Server-Patches/0018-Implement-Paper-VersionChecker.patch index b4efa964cb..d5c4ad88a8 100644 --- a/Spigot-Server-Patches/0018-Implement-Paper-VersionChecker.patch +++ b/Spigot-Server-Patches/0018-Implement-Paper-VersionChecker.patch @@ -126,7 +126,7 @@ index 0000000000000000000000000000000000000000..5deed3e25ff41ab0a4015a5fd0c1e952 + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index e0fc695465b3dbbbc1c183cc89760a73b061eb63..8b45f510bf24bb1f9503cb4dcef0e21b3634400c 100644 +index 9828935e0ab1d7bc9950f3d9225542af3d0bf5b5..66925d9c3be206bb4fc4e88b247b099a2432b200 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -323,6 +323,11 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/Spigot-Server-Patches/0019-Add-version-history-to-version-command.patch b/Spigot-Server-Patches/0019-Add-version-history-to-version-command.patch index 887372cc14..97386ecbda 100644 --- a/Spigot-Server-Patches/0019-Add-version-history-to-version-command.patch +++ b/Spigot-Server-Patches/0019-Add-version-history-to-version-command.patch @@ -192,7 +192,7 @@ index 0000000000000000000000000000000000000000..aac3f66cb23d260729c2a48d8710a9de + } +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 9cba62efdb051c9850bbf28b0be17a7e00ed83c9..ce285b97cbdc9d74504d073fc659c295300dd720 100644 +index 4ef6913c356663b640e6ce770c123f51e6f3c057..36be0b4516702e0760ba6262a8c894fafbf276b4 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -156,6 +156,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/0020-Player-affects-spawning-API.patch b/Spigot-Server-Patches/0020-Player-affects-spawning-API.patch index b2299e257b..78e3ceb976 100644 --- a/Spigot-Server-Patches/0020-Player-affects-spawning-API.patch +++ b/Spigot-Server-Patches/0020-Player-affects-spawning-API.patch @@ -4,12 +4,24 @@ Date: Tue, 1 Mar 2016 14:47:52 -0600 Subject: [PATCH] Player affects spawning API +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index f38931dec12c09e3822b320855f749158fd784f4..6b4f38c6528a0a730f31eff3204d741e9b4a2ae2 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -1271,6 +1271,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return MathHelper.c(f * f + f1 * f1 + f2 * f2); + } + ++ public double getDistanceSquared(double x, double y, double z) { return h(x, y, z); } // Paper - OBFHELPER + public double h(double d0, double d1, double d2) { + double d3 = this.locX() - d0; + double d4 = this.locY() - d1; diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 475a3bcabcb829b04124fe2c3393ec70fe90f4b2..94eab21f0defe90e7ad169c45de1fdd002f35f7a 100644 +index e16be546b22c09e1c6ed50c453e1f2c711832a81..683d98dea1b46931478ac7b55e49bc9d92d36f77 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -70,6 +70,9 @@ public abstract class EntityHuman extends EntityLiving { - private final ItemCooldown bT; + private final ItemCooldown bM; @Nullable public EntityFishingHook hookedFish; + // Paper start @@ -19,7 +31,7 @@ index 475a3bcabcb829b04124fe2c3393ec70fe90f4b2..94eab21f0defe90e7ad169c45de1fdd0 // CraftBukkit start public boolean fauxSleeping; diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 885b97f9397753e7561f113f588b4ca2d5edb0fe..9715f10c790c0210435622ab9997ac40f98da185 100644 +index 0f28d047453b99a6dc051196642cedc86b3d657b..69acb0f17577cb46a0302f1d6bbb3a42924aeda9 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -691,7 +691,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -32,11 +44,11 @@ index 885b97f9397753e7561f113f588b4ca2d5edb0fe..9715f10c790c0210435622ab9997ac40 if (entityhuman != null) { double d0 = entityhuman.h((Entity) this); // CraftBukkit - decompile error diff --git a/src/main/java/net/minecraft/server/EntitySilverfish.java b/src/main/java/net/minecraft/server/EntitySilverfish.java -index f9ae1ffbff3a813226b2081c79abf3b92d07754d..29c0a9c36a1f6727fb9485ab41e04f7dc9db1fe5 100644 +index 17a0ebfcd7eefa63adc581479244231b20150340..35f15c8ddd7c85aeb599bc7921053abe09130e59 100644 --- a/src/main/java/net/minecraft/server/EntitySilverfish.java +++ b/src/main/java/net/minecraft/server/EntitySilverfish.java @@ -95,7 +95,7 @@ public class EntitySilverfish extends EntityMonster { - if (d(entitytypes, generatoraccess, enummobspawn, blockposition, random)) { + if (c(entitytypes, generatoraccess, enummobspawn, blockposition, random)) { EntityHuman entityhuman = generatoraccess.a((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, 5.0D, true); - return entityhuman == null; @@ -45,10 +57,10 @@ index f9ae1ffbff3a813226b2081c79abf3b92d07754d..29c0a9c36a1f6727fb9485ab41e04f7d return false; } diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index c469b5db81fb040fc27cd2e4f7cd61797f56a62d..48e8b005bd9589135eff03a110ecce8776ab208a 100644 +index 797249069b0b2adf91b4e69497752eed7116f02a..b6cf294e785b36b8bc800f26dbb8cfcb2119eae1 100644 --- a/src/main/java/net/minecraft/server/IEntityAccess.java +++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -75,8 +75,9 @@ public interface IEntityAccess { +@@ -83,8 +83,9 @@ public interface IEntityAccess { } } @@ -60,7 +72,7 @@ index c469b5db81fb040fc27cd2e4f7cd61797f56a62d..48e8b005bd9589135eff03a110ecce87 double d4 = -1.0D; EntityHuman entityhuman = null; Iterator iterator = this.getPlayers().iterator(); -@@ -109,6 +110,27 @@ public interface IEntityAccess { +@@ -117,6 +118,27 @@ public interface IEntityAccess { return this.a(d0, d1, d2, d3, predicate); } @@ -78,7 +90,7 @@ index c469b5db81fb040fc27cd2e4f7cd61797f56a62d..48e8b005bd9589135eff03a110ecce87 + entityhuman = (EntityHuman) iterator.next(); + } while (!IEntitySelector.affectsSpawning.test(entityhuman)); + -+ d4 = entityhuman.g(d0, d1, d2); ++ d4 = entityhuman.getDistanceSquared(d0, d1, d2); + } while (d3 >= 0.0D && d4 >= d3 * d3); + + return true; @@ -89,7 +101,7 @@ index c469b5db81fb040fc27cd2e4f7cd61797f56a62d..48e8b005bd9589135eff03a110ecce87 Iterator iterator = this.getPlayers().iterator(); diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 37ece74b4265a6f555d2550df7dade416bc7ef84..ed7566591bac72d17b40a940531b7feb1cb8f392 100644 +index 8061f33c01b9c2382f72d2d1d1fa2fb8a731e3c8..e8e7532493c973ce10d94a41676859674fc4e6f6 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -24,6 +24,12 @@ public final class IEntitySelector { @@ -106,7 +118,7 @@ index 37ece74b4265a6f555d2550df7dade416bc7ef84..ed7566591bac72d17b40a940531b7feb double d4 = d3 * d3; diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 4f7dc23d67e97f9a2b8983750299fc43b0ed6db9..a4a48dbee002e96a5644d9a033f9f233cc9a6b46 100644 +index 90af43930f9141b0c7f51bb3d887d7b9c4d935eb..1741ec5e241f8ae7a3c30a9021d14cb0224da840 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -49,7 +49,7 @@ public abstract class MobSpawnerAbstract { @@ -119,10 +131,10 @@ index 4f7dc23d67e97f9a2b8983750299fc43b0ed6db9..a4a48dbee002e96a5644d9a033f9f233 public void c() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f8c4fb312232f1689fd19e165830e62609813213..8d4a0513df27767053342eddda05398eae7b46be 100644 +index 495470f9c397e80b9e6e8e3c9360b0d659b916ed..11f80c6f58e611f33ad8bbd09aa8bf90c7933426 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1690,7 +1690,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1686,7 +1686,19 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { return getHandle().locale; diff --git a/Spigot-Server-Patches/0021-Remove-invalid-mob-spawner-tile-entities.patch b/Spigot-Server-Patches/0021-Remove-invalid-mob-spawner-tile-entities.patch index 92005b1f0d..f7eecaa07d 100644 --- a/Spigot-Server-Patches/0021-Remove-invalid-mob-spawner-tile-entities.patch +++ b/Spigot-Server-Patches/0021-Remove-invalid-mob-spawner-tile-entities.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Remove invalid mob spawner tile entities diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 09b4594ae6750252b4b13ed4735dad0d00e2aeec..a803d1093dfa7c7421eda913679766224fda6dcf 100644 +index baa3783a0c16e9a7eaec9d38e1fe6bfed9710aa1..dbaa56f4f8c1093935a981c14bc1cb79c991579c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -608,6 +608,10 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch index 90e6dc29e4..45a28891f3 100644 --- a/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch +++ b/Spigot-Server-Patches/0022-Optimize-TileEntity-Ticking.patch @@ -29,20 +29,34 @@ index d4ebcf8f66197299256bd6b65710a1488c90ea41..c9164dfdb27ddf3709129c8aec54903a return pair(rule, world.getWorld().getGameRuleValue(rule)); })), diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index 1441d096d44ea653539ba20ccda94eb62ffc32df..b9d0d2d42850c3a5d093429cd0d02ac47848f04b 100644 +index 1441d096d44ea653539ba20ccda94eb62ffc32df..fb7c0d45765e36181c809b250ba4eee5d21c5894 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java -@@ -11,7 +11,7 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I +@@ -10,8 +10,8 @@ import javax.annotation.Nullable; + public class BlockChest extends BlockChestAbstract<TileEntityChest> implements IBlockWaterlogged { public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING; - public static final BlockStateEnum<BlockPropertyChestType> c = BlockProperties.aF; +- public static final BlockStateEnum<BlockPropertyChestType> c = BlockProperties.aF; - public static final BlockStateBoolean d = BlockProperties.C; ++ public static final BlockStateEnum<BlockPropertyChestType> c = BlockProperties.aF; public static final BlockStateEnum<BlockPropertyChestType> CHEST_TYPE_PROPERTY = c; // Paper - OBFHELPER + public static final BlockStateBoolean d = BlockProperties.C; public static final BlockStateBoolean waterlogged() { return d; } // Paper OBFHELPER protected static final VoxelShape e = Block.a(1.0D, 0.0D, 0.0D, 15.0D, 14.0D, 15.0D); protected static final VoxelShape f = Block.a(1.0D, 0.0D, 1.0D, 15.0D, 14.0D, 16.0D); protected static final VoxelShape g = Block.a(0.0D, 0.0D, 1.0D, 15.0D, 14.0D, 15.0D); +diff --git a/src/main/java/net/minecraft/server/IBlockDataHolder.java b/src/main/java/net/minecraft/server/IBlockDataHolder.java +index 98616f0db75d0e2b2e960dbf88289c87ba426ab6..b19c694cf01bc868dd7c4ec6432b613d19f2ca40 100644 +--- a/src/main/java/net/minecraft/server/IBlockDataHolder.java ++++ b/src/main/java/net/minecraft/server/IBlockDataHolder.java +@@ -83,6 +83,7 @@ public abstract class IBlockDataHolder<O, S> { + return Collections.unmodifiableCollection(this.b.keySet()); + } + ++ public <T extends Comparable<T>> boolean contains(IBlockState<T> iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER + public <T extends Comparable<T>> boolean b(IBlockState<T> iblockstate) { + return this.b.containsKey(iblockstate); + } diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 0a22bdbac4c627502e609166590a3936f3372161..47ed08c414dca46720a3d4808ea71f999232e70c 100644 +index d4b8daf1f064bff25ef5566b0288dad0087e379e..52f64460ba1bfb298f343f71a923c8f34de9e39d 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.entity.CraftHumanEntity; @@ -79,7 +93,7 @@ index 0a22bdbac4c627502e609166590a3936f3372161..47ed08c414dca46720a3d4808ea71f99 @@ -106,8 +112,11 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { if (this.viewingCount > 0 && this.a == 0.0F) { - this.a(SoundEffects.BLOCK_CHEST_OPEN); + this.playOpenSound(SoundEffects.BLOCK_CHEST_OPEN); } + } @@ -94,11 +108,10 @@ index 0a22bdbac4c627502e609166590a3936f3372161..47ed08c414dca46720a3d4808ea71f99 float f2 = 0.5F; if (this.a < 0.5F && f1 >= 0.5F) { -- this.a(SoundEffects.BLOCK_CHEST_CLOSE); -- } -+ */ ++ */ + MCUtil.scheduleTask(10, () -> { -+ this.a(SoundEffects.BLOCK_CHEST_CLOSE); + this.playOpenSound(SoundEffects.BLOCK_CHEST_CLOSE); +- } + }, "Chest Sounds"); + //} // Paper end @@ -107,8 +120,8 @@ index 0a22bdbac4c627502e609166590a3936f3372161..47ed08c414dca46720a3d4808ea71f99 @@ -163,6 +175,7 @@ public class TileEntityChest extends TileEntityLootable implements ITickable { } - public void a(SoundEffect soundeffect) { // PAIL private -> public, rename playSound -+ if (!this.getBlock().b(BlockChest.c)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 + public void playOpenSound(SoundEffect soundeffect) { ++ if (!this.getBlock().contains(BlockChest.CHEST_TYPE_PROPERTY)) { return; } // Paper - this can be delayed, double check exists - Fixes GH-2074 BlockPropertyChestType blockpropertychesttype = (BlockPropertyChestType) this.getBlock().get(BlockChest.c); if (blockpropertychesttype != BlockPropertyChestType.LEFT) { @@ -129,7 +142,7 @@ index 0a22bdbac4c627502e609166590a3936f3372161..47ed08c414dca46720a3d4808ea71f99 int newPower = Math.max(0, Math.min(15, this.viewingCount)); diff --git a/src/main/java/net/minecraft/server/TileEntityEnderChest.java b/src/main/java/net/minecraft/server/TileEntityEnderChest.java -index b37a705e49f64b46c2256a1b6b077c67fa240b0f..9d03a9ae7fe85fdd0550f737246eef2688a51c8e 100644 +index 4ee3520882df2f6f358f3f61dc42c20129984b72..80440aa24f546dd151e89b705322d9c3e906b139 100644 --- a/src/main/java/net/minecraft/server/TileEntityEnderChest.java +++ b/src/main/java/net/minecraft/server/TileEntityEnderChest.java @@ -1,6 +1,6 @@ diff --git a/Spigot-Server-Patches/0023-Further-improve-server-tick-loop.patch b/Spigot-Server-Patches/0023-Further-improve-server-tick-loop.patch index ad1d1b406f..d343457253 100644 --- a/Spigot-Server-Patches/0023-Further-improve-server-tick-loop.patch +++ b/Spigot-Server-Patches/0023-Further-improve-server-tick-loop.patch @@ -12,7 +12,7 @@ Previous implementation did not calculate TPS correctly. Switch to a realistic rolling average and factor in std deviation as an extra reporting variable diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 9eacc1ba58986c21c5d8dc8d8d14c6f3b48fd171..7b58499c24d5a4296cc539087ca86d2ec4148b1c 100644 +index 1148a81b74cf6e9d27e32c3a61cf423786daed16..0a3eeda5d52215a222ed1919c09a38f7fd2ef8e5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -144,7 +144,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -33,7 +33,7 @@ index 9eacc1ba58986c21c5d8dc8d8d14c6f3b48fd171..7b58499c24d5a4296cc539087ca86d2e public final double[] recentTps = new double[ 3 ]; public final SlackActivityAccountant slackActivityAccountant = new SlackActivityAccountant(); // Spigot end -@@ -807,6 +807,57 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -805,6 +805,57 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas { return ( avg * exp ) + ( tps * ( 1 - exp ) ); } @@ -90,8 +90,8 @@ index 9eacc1ba58986c21c5d8dc8d8d14c6f3b48fd171..7b58499c24d5a4296cc539087ca86d2e + // Paper End // Spigot End - protected void v() { -@@ -819,30 +870,38 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas + protected void w() { +@@ -817,30 +868,38 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // Spigot start Arrays.fill( recentTps, 20 ); @@ -140,10 +140,10 @@ index 9eacc1ba58986c21c5d8dc8d8d14c6f3b48fd171..7b58499c24d5a4296cc539087ca86d2e GameProfilerTick gameprofilertick = GameProfilerTick.a("Server"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a19e208415a5918414d61304de4bd282725bef56..44a7c6377baa210862ce0ccf60ad0f16d8a839b9 100644 +index 4bdb096cd74c75f02d34f9d367b1bd5c0b6500df..3228d479918ea5b0e639521f375120c11e8efdf3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2056,6 +2056,17 @@ public final class CraftServer implements Server { +@@ -2050,6 +2050,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } diff --git a/Spigot-Server-Patches/0024-Only-refresh-abilities-if-needed.patch b/Spigot-Server-Patches/0024-Only-refresh-abilities-if-needed.patch index 0cdd1fd061..c6efe54a7e 100644 --- a/Spigot-Server-Patches/0024-Only-refresh-abilities-if-needed.patch +++ b/Spigot-Server-Patches/0024-Only-refresh-abilities-if-needed.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Only refresh abilities if needed diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 8d4a0513df27767053342eddda05398eae7b46be..cebf6f85eea3faea8fecb112234ea23b40cd4d9c 100644 +index 11f80c6f58e611f33ad8bbd09aa8bf90c7933426..b491e10b95d2235e2495e491596d23614be23d50 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1370,12 +1370,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1366,12 +1366,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void setFlying(boolean value) { diff --git a/Spigot-Server-Patches/0025-Entity-Origin-API.patch b/Spigot-Server-Patches/0025-Entity-Origin-API.patch index 1390084050..cb3e5ec871 100644 --- a/Spigot-Server-Patches/0025-Entity-Origin-API.patch +++ b/Spigot-Server-Patches/0025-Entity-Origin-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c32011b272 100644 +index 6b4f38c6528a0a730f31eff3204d741e9b4a2ae2..7cfd035d2baa4318c306cd850ea49468ac213792 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -167,6 +167,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -164,6 +164,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public org.bukkit.projectiles.ProjectileSource projectileSource; // For projectiles only public boolean forceExplosionKnockback; // SPIGOT-949 public Timing tickTimer = MinecraftTimings.getEntityTimings(this); // Paper @@ -16,7 +16,7 @@ index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c3 // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -1541,6 +1542,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1536,6 +1537,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.bukkitEntity.storeBukkitValues(nbttagcompound); } // CraftBukkit end @@ -28,7 +28,7 @@ index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c3 return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT"); -@@ -1657,6 +1663,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1652,6 +1658,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.getBukkitEntity().readBukkitValues(nbttagcompound); // CraftBukkit end @@ -42,7 +42,7 @@ index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c3 } catch (Throwable throwable) { CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT"); CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded"); -@@ -1718,6 +1731,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1713,6 +1726,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected abstract void saveData(NBTTagCompound nbttagcompound); @@ -51,7 +51,7 @@ index 20fbe45c9daa629e1c9841936a0bf1795b40f6a9..c1bb876262c17d32b1f14fd818f990c3 NBTTagList nbttaglist = new NBTTagList(); double[] adouble1 = adouble; diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 8c51b3060114a24249962c2d6142166ac8600a0a..7c308e0912fb60f8dcdfb36c8a8c8718231858bc 100644 +index e7efc540a9ec67e67714c9b3cfd2c24c0842e3f5..969b0dca4acc959330c5f10a2c970c896d23ce63 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -254,6 +254,14 @@ public class EntityFallingBlock extends Entity { @@ -70,7 +70,7 @@ index 8c51b3060114a24249962c2d6142166ac8600a0a..7c308e0912fb60f8dcdfb36c8a8c8718 public void a(boolean flag) { diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index b5900e1cad8137954d5fa4fde10b4afb64fb6412..0f4923bce392c8e46f6b256f47d23e15b08e6d62 100644 +index 71404a34d27dd7771ea1145085a6a6e4dc7589b0..623db6e3befcc7031e68c71f7eb179fce78291c4 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -104,6 +104,14 @@ public class EntityTNTPrimed extends Entity { @@ -101,10 +101,10 @@ index ad8a506bb430b26fe147a657a2f826daf9bf4d45..ad4807e0bdd6409bd798f995da8f43ce if (i >= 0 && i < this.list.size()) { NBTBase nbtbase = (NBTBase) this.list.get(i); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index df63ea6680e9619e09477ed44a021e128314436c..118f2b80193bf59139c46b811be96edda4ae0014 100644 +index b281f49cd95dc9af612ee8e580f62c739920640f..73faa25ff7642aab6eaee4af1a4f036cde3b691b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1087,6 +1087,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1126,6 +1126,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.navigators.add(((EntityInsentient) entity).getNavigation()); } entity.valid = true; // CraftBukkit @@ -117,10 +117,10 @@ index df63ea6680e9619e09477ed44a021e128314436c..118f2b80193bf59139c46b811be96edd } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index e867168be3c17548490f30944ca56a635cc3b054..19669d7354d8cfa723e614ac3b471e703ee7feee 100644 +index 66878c53bfb71392bf07d2c41a2edf1bc8f7af79..10f96056700c88cc8e83477877788e3443cecefd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1016,4 +1016,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1022,4 +1022,12 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return spigot; } // Spigot end diff --git a/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch b/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch index bd3a84d510..c9a491dd52 100644 --- a/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch +++ b/Spigot-Server-Patches/0026-Prevent-tile-entity-and-entity-crashes.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent tile entity and entity crashes diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 057d703fe73de9bb9ca6f0e263463d32abae4c13..534295965ee701611b5e12a10f14a69e8226376a 100644 +index 8f51a1e5e37566001e1d419065ce730768c1b342..950dc3de042159de9f667dcd2499f4ee16525b0b 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -194,7 +194,12 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -23,10 +23,10 @@ index 057d703fe73de9bb9ca6f0e263463d32abae4c13..534295965ee701611b5e12a10f14a69e } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e5e4d25ffc8f640a183b53961ce4678e52a67a91..8e122f3e28dd1ec2e27faa663adcbc900f0e105e 100644 +index 1ad366de6d2857edb6d12006e8db11845cdf30d8..a65a5953bcd035ba8e73c97341adff06246d2601 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -720,11 +720,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -685,11 +685,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.exit(); } catch (Throwable throwable) { @@ -45,7 +45,7 @@ index e5e4d25ffc8f640a183b53961ce4678e52a67a91..8e122f3e28dd1ec2e27faa663adcbc90 } // Spigot start finally { -@@ -790,11 +792,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -755,11 +757,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { consumer.accept(entity); } catch (Throwable throwable) { diff --git a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch b/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch index cf16b0e54f..f44b0ad80e 100644 --- a/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch +++ b/Spigot-Server-Patches/0027-Configurable-top-of-nether-void-damage.patch @@ -29,10 +29,10 @@ index d59b82b7bb1f6d1b231f4e394e0a67a3d154d7be..f7a0a33e49cadf9b2bd43f118c106937 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index bfe36be070677d215eadd3ad38f93c6bddab0b75..9e132052e1a9b997300e3f5d88473fc5f9ebdd73 100644 +index 7cfd035d2baa4318c306cd850ea49468ac213792..acb246076e5b127703c8080a8c5000c8cb05e4ec 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -420,9 +420,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -417,9 +417,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance *= 0.5F; } @@ -41,7 +41,7 @@ index bfe36be070677d215eadd3ad38f93c6bddab0b75..9e132052e1a9b997300e3f5d88473fc5 + // Extracted to own function + /* if (this.locY() < -64.0D) { - this.ai(); + this.am(); } + */ + this.performVoidDamage(); @@ -49,8 +49,8 @@ index bfe36be070677d215eadd3ad38f93c6bddab0b75..9e132052e1a9b997300e3f5d88473fc5 if (!this.world.isClientSide) { this.setFlag(0, this.fireTicks > 0); -@@ -432,6 +439,17 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.world.getMethodProfiler().exit(); +@@ -512,6 +519,16 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + this.setFireTicks(0); } + // Paper start @@ -58,28 +58,19 @@ index bfe36be070677d215eadd3ad38f93c6bddab0b75..9e132052e1a9b997300e3f5d88473fc5 + if (this.locY() < -64.0D || (this.world.getWorld().getEnvironment() == org.bukkit.World.Environment.NETHER + && world.paperConfig.doNetherTopVoidDamage() + && this.locY() >= world.paperConfig.netherVoidTopDamageHeight)) { -+ + this.doVoidDamage(); + } + } + // Paper end -+ - protected void E() { - if (this.portalCooldown > 0) { - --this.portalCooldown; -@@ -507,6 +525,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.setFireTicks(0); - } - -+ protected final void doVoidDamage() { this.ai(); } // Paper - OBFHELPER - protected void ai() { ++ protected final void doVoidDamage() { this.am(); } // Paper - OBFHELPER + protected void am() { this.die(); } diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index cb25cf3bb7be041d9b135165b6f66b5c232a2553..9124d00521463157df6348b84260f91a47e1f076 100644 +index 4a646f6609b5a85060460d7f8511b7d2d20166f4..a033000a2c85043822b7cab0dee796043ce2520f 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -@@ -285,9 +285,15 @@ public abstract class EntityMinecartAbstract extends Entity { +@@ -292,9 +292,15 @@ public abstract class EntityMinecartAbstract extends Entity { this.setDamage(this.getDamage() - 1.0F); } @@ -87,7 +78,7 @@ index cb25cf3bb7be041d9b135165b6f66b5c232a2553..9124d00521463157df6348b84260f91a + // Extracted to own function + /* if (this.locY() < -64.0D) { - this.ai(); + this.am(); } + */ + this.performVoidDamage(); diff --git a/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch b/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch index d9176841a6..99598db234 100644 --- a/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch +++ b/Spigot-Server-Patches/0028-Check-online-mode-before-converting-and-renaming-pla.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Check online mode before converting and renaming player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index 240f9331dca65990f5e724b88050342831868e72..ef9719bf20db92a7e6690bccb00cc54293d392a9 100644 +index 9190e7c6de201868b909f0724930f13f7ec82edf..9d81bb896e3688c644edf93cd9dfeadd9cdf8836 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -50,7 +50,7 @@ public class WorldNBTStorage { +@@ -48,7 +48,7 @@ public class WorldNBTStorage { File file = new File(this.playerDir, entityhuman.getUniqueIDString() + ".dat"); // Spigot Start boolean usingWrongFile = false; diff --git a/Spigot-Server-Patches/0030-Configurable-end-credits.patch b/Spigot-Server-Patches/0030-Configurable-end-credits.patch index aaae948232..2d7a462cbb 100644 --- a/Spigot-Server-Patches/0030-Configurable-end-credits.patch +++ b/Spigot-Server-Patches/0030-Configurable-end-credits.patch @@ -20,23 +20,23 @@ index f7a0a33e49cadf9b2bd43f118c106937760da762..50dec5cb5e924301842300e8fc80cb67 + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 34cd93a30cc447b87625c099fec32f5befae934e..4b932c18390e6a94f5ce0683b87d20c7e6708be7 100644 +index dd140b5e55c8ffea7e60962602435c2bd992c048..791474acb3d6219eb43255eda907738b1471158e 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -60,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - private long ch = SystemUtils.getMonotonicMillis(); +@@ -61,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private long ca = SystemUtils.getMonotonicMillis(); private Entity spectatedEntity; public boolean worldChangeInvuln; -- private boolean ck; -+ private boolean ck; private void setHasSeenCredits(boolean has) { this.ck = has; } // Paper - OBFHELPER +- private boolean cd; ++ private boolean cd; private void setHasSeenCredits(boolean has) { this.cd = has; } // Paper - OBFHELPER private final RecipeBookServer recipeBook = new RecipeBookServer(); - private Vec3D cm; - private int cn; -@@ -749,6 +749,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + private Vec3D cf; + private int cg; +@@ -766,6 +766,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + this.decouple(); this.getWorldServer().removePlayer(this); if (!this.viewingCredits) { - this.viewingCredits = true; + if (world.paperConfig.disableEndCredits) this.setHasSeenCredits(true); // Paper - Toggle to always disable end credits - this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.ck ? 0.0F : 1.0F)); - this.ck = true; - } + this.viewingCredits = true; + this.playerConnection.sendPacket(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, this.cd ? 0.0F : 1.0F)); + this.cd = true; diff --git a/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch b/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch index 99d0d82ee8..a3a8c0aae1 100644 --- a/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch +++ b/Spigot-Server-Patches/0031-Fix-lag-from-explosions-processing-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix lag from explosions processing dead entities diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 692625d9f80b6e98ba4bb6c94c71e6b59ba36d6a..bf156897acfe25c16a1b09a83a00ba3ab647a2dd 100644 +index bf910359de9365f51461ec1b80aaabdb24e26449..abc9eea66fed45db54e7b2a26ca8f7b05ca40e20 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -153,7 +153,7 @@ public class Explosion { +@@ -154,7 +154,7 @@ public class Explosion { int i1 = MathHelper.floor(this.posY + (double) f2 + 1.0D); int j1 = MathHelper.floor(this.posZ - (double) f2 - 1.0D); int k1 = MathHelper.floor(this.posZ + (double) f2 + 1.0D); @@ -18,7 +18,7 @@ index 692625d9f80b6e98ba4bb6c94c71e6b59ba36d6a..bf156897acfe25c16a1b09a83a00ba3a for (int l1 = 0; l1 < list.size(); ++l1) { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index ed7566591bac72d17b40a940531b7feb1cb8f392..d7e3580067bcbca09b66f05f02e8736863bd7ef5 100644 +index e8e7532493c973ce10d94a41676859674fc4e6f6..b88a99221933108141b558adef6aa91f0cedc136 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -14,6 +14,7 @@ public final class IEntitySelector { diff --git a/Spigot-Server-Patches/0032-Optimize-explosions.patch b/Spigot-Server-Patches/0032-Optimize-explosions.patch index f7d9c327d3..8b133a3e08 100644 --- a/Spigot-Server-Patches/0032-Optimize-explosions.patch +++ b/Spigot-Server-Patches/0032-Optimize-explosions.patch @@ -25,10 +25,10 @@ index 50dec5cb5e924301842300e8fc80cb671b6b9173..f038d3f7dc7d1034a3ee9f2384a85642 + } } diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index bf156897acfe25c16a1b09a83a00ba3ab647a2dd..842563f2030382659a62a3a63d9af9d5a58e3d85 100644 +index abc9eea66fed45db54e7b2a26ca8f7b05ca40e20..19f7312ee31baebbbccc3126b28418e7b817d247 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -172,7 +172,7 @@ public class Explosion { +@@ -173,7 +173,7 @@ public class Explosion { d8 /= d11; d9 /= d11; d10 /= d11; @@ -37,7 +37,7 @@ index bf156897acfe25c16a1b09a83a00ba3ab647a2dd..842563f2030382659a62a3a63d9af9d5 double d13 = (1.0D - d7) * d12; // CraftBukkit start -@@ -391,4 +391,84 @@ public class Explosion { +@@ -392,4 +392,84 @@ public class Explosion { private Effect() {} } @@ -123,10 +123,10 @@ index bf156897acfe25c16a1b09a83a00ba3ab647a2dd..842563f2030382659a62a3a63d9af9d5 + // Paper end } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7b58499c24d5a4296cc539087ca86d2ec4148b1c..991baec71cfeb79ee2108870645a19582f151def 100644 +index 0a3eeda5d52215a222ed1919c09a38f7fd2ef8e5..02e60ff8da52742b0fd3d81a2ef62b098708347a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1208,6 +1208,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1206,6 +1206,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.methodProfiler.exit(); this.methodProfiler.exit(); @@ -135,7 +135,7 @@ index 7b58499c24d5a4296cc539087ca86d2ec4148b1c..991baec71cfeb79ee2108870645a1958 this.methodProfiler.exitEnter("connection"); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8e122f3e28dd1ec2e27faa663adcbc900f0e105e..2f161749ff822f4d0f5aaf7e7c9fd1608360de6c 100644 +index a65a5953bcd035ba8e73c97341adff06246d2601..9ed82bcc504eef01a021038e3186cfa69832b4b9 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -84,6 +84,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch b/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch index 752882a6a3..fff74164c3 100644 --- a/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch +++ b/Spigot-Server-Patches/0033-Disable-explosion-knockback.patch @@ -19,7 +19,7 @@ index f038d3f7dc7d1034a3ee9f2384a85642f224836e..25e0717186366af580e512eedfd403b8 + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 96a95413f74592ef0a8e9367fd3ed81fc0a2c2fe..8fc632b4b0d79efaced83ea9b39b5727f6f5ebef 100644 +index 380165b54e118df19e6adefd35ad0bc039a7ac51..df5984cf80da32e5997581171d0eb2bdbbf22244 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1183,6 +1183,7 @@ public abstract class EntityLiving extends Entity { @@ -47,10 +47,10 @@ index 96a95413f74592ef0a8e9367fd3ed81fc0a2c2fe..8fc632b4b0d79efaced83ea9b39b5727 if (!this.f(damagesource)) { SoundEffect soundeffect = this.getSoundDeath(); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 842563f2030382659a62a3a63d9af9d5a58e3d85..1b738260fb06446713ceab159eb7fa3df70fb611 100644 +index 19f7312ee31baebbbccc3126b28418e7b817d247..7b6c3a667ea67b25f9f12d4049dfc51b1c9fb69d 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -188,14 +188,14 @@ public class Explosion { +@@ -189,14 +189,14 @@ public class Explosion { double d14 = d13; if (entity instanceof EntityLiving) { @@ -64,6 +64,6 @@ index 842563f2030382659a62a3a63d9af9d5a58e3d85..1b738260fb06446713ceab159eb7fa3d - if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying)) { + if (!entityhuman.isSpectator() && (!entityhuman.isCreative() || !entityhuman.abilities.isFlying) && !world.paperConfig.disableExplosionKnockback) { // Paper - Disable explosion knockback - this.m.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); + this.n.put(entityhuman, new Vec3D(d8 * d13, d9 * d13, d10 * d13)); } } diff --git a/Spigot-Server-Patches/0034-Disable-thunder.patch b/Spigot-Server-Patches/0034-Disable-thunder.patch index 16c27c9fc6..92843c3e6d 100644 --- a/Spigot-Server-Patches/0034-Disable-thunder.patch +++ b/Spigot-Server-Patches/0034-Disable-thunder.patch @@ -19,15 +19,15 @@ index 25e0717186366af580e512eedfd403b8efc64a75..41436a4ead736dc925ca77d4cabf925f + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 118f2b80193bf59139c46b811be96edda4ae0014..bfece8ac9aff33a5ec823f2ce7030c7474a1aee5 100644 +index 73faa25ff7642aab6eaee4af1a4f036cde3b691b..5e931f779fd24aecd4fbd896fd27d5fce345b602 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -470,7 +470,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -471,7 +471,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { gameprofilerfiller.enter("thunder"); BlockPosition blockposition; -- if (flag && this.T() && this.random.nextInt(100000) == 0) { -+ if (!this.paperConfig.disableThunder && flag && this.T() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder +- if (flag && this.V() && this.random.nextInt(100000) == 0) { ++ if (!this.paperConfig.disableThunder && flag && this.V() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder blockposition = this.a(this.a(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); diff --git a/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch b/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch index 430fa02a24..976130c66c 100644 --- a/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch +++ b/Spigot-Server-Patches/0035-Disable-ice-and-snow.patch @@ -19,10 +19,10 @@ index 41436a4ead736dc925ca77d4cabf925f4e492d68..f53d8b96757cbedc5fbb16195952a7da + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index bfece8ac9aff33a5ec823f2ce7030c7474a1aee5..89e960ef91f588f16ca3efde5518e731d6bc29cb 100644 +index 5e931f779fd24aecd4fbd896fd27d5fce345b602..d593899d3243d85bd1dafba4d2c603d6cfe32839 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -494,7 +494,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -495,7 +495,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exitEnter("iceandsnow"); diff --git a/Spigot-Server-Patches/0036-Configurable-mob-spawner-tick-rate.patch b/Spigot-Server-Patches/0036-Configurable-mob-spawner-tick-rate.patch index 9dbf9ea061..cae98463a1 100644 --- a/Spigot-Server-Patches/0036-Configurable-mob-spawner-tick-rate.patch +++ b/Spigot-Server-Patches/0036-Configurable-mob-spawner-tick-rate.patch @@ -19,7 +19,7 @@ index f53d8b96757cbedc5fbb16195952a7da5c07164f..428deed56dae597291670bea8c8a6a67 + } } diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index a4a48dbee002e96a5644d9a033f9f233cc9a6b46..2b7f020e00fc1ea456d0155e7e383969aee318b7 100644 +index 1741ec5e241f8ae7a3c30a9021d14cb0224da840..259713339217660e8b81a9500f57c6995ea59dde 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -24,6 +24,7 @@ public abstract class MobSpawnerAbstract { diff --git a/Spigot-Server-Patches/0037-Send-absolute-position-the-first-time-an-entity-is-s.patch b/Spigot-Server-Patches/0037-Send-absolute-position-the-first-time-an-entity-is-s.patch index 3672764a2c..ffa1a3a788 100644 --- a/Spigot-Server-Patches/0037-Send-absolute-position-the-first-time-an-entity-is-s.patch +++ b/Spigot-Server-Patches/0037-Send-absolute-position-the-first-time-an-entity-is-s.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Send absolute position the first time an entity is seen diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index bad775d9a5d761c5accff1d408366f1a9f028762..10821c2b631b4c0e91abb0b05cfc696f1fda36c0 100644 +index 65095b7d91fb4549ef67593054c54ca81b77debe..50df43653933e3bdeb3fd514a1c6c3b9ac3b15ab 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -4,6 +4,7 @@ import com.google.common.collect.Lists; @@ -77,7 +77,7 @@ index bad775d9a5d761c5accff1d408366f1a9f028762..10821c2b631b4c0e91abb0b05cfc696f this.c(); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 7c5eaff23ef6bf3cdf2575330ea6341d6240e283..31d4faebcf34e2e207806d7945e1d8c50c5097bd 100644 +index d98b6ef44e1836920956754dfcb6654fec23b673..b40f6b7d45028b5bc58a222e2d54cb8693273325 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1249,10 +1249,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { diff --git a/Spigot-Server-Patches/0038-Add-BeaconEffectEvent.patch b/Spigot-Server-Patches/0038-Add-BeaconEffectEvent.patch index 6b397633d8..f6c2284aa3 100644 --- a/Spigot-Server-Patches/0038-Add-BeaconEffectEvent.patch +++ b/Spigot-Server-Patches/0038-Add-BeaconEffectEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add BeaconEffectEvent diff --git a/src/main/java/net/minecraft/server/TileEntityBeacon.java b/src/main/java/net/minecraft/server/TileEntityBeacon.java -index b9aa63e6c38f6b023da5e9865ba1f74f931cc7af..2858ea1f3eb44ea2cc6b11454b8e94bca4ab0568 100644 +index 79774d8dabd46eb91940db934bb58f8b082ff9e2..c6b7bc3dc1445269c1562c308b386ce480d70ef3 100644 --- a/src/main/java/net/minecraft/server/TileEntityBeacon.java +++ b/src/main/java/net/minecraft/server/TileEntityBeacon.java @@ -14,6 +14,11 @@ import org.bukkit.craftbukkit.potion.CraftPotionUtil; diff --git a/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch b/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch index c5bc6146fb..cd0a6ddd78 100644 --- a/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch +++ b/Spigot-Server-Patches/0039-Configurable-container-update-tick-rate.patch @@ -19,10 +19,10 @@ index 428deed56dae597291670bea8c8a6a67ce4d940f..a4da22ea65d5fdba38f8dc331919088f + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 4b932c18390e6a94f5ce0683b87d20c7e6708be7..5dce27334541d55c7a7d494cd92370570615dc05 100644 +index 791474acb3d6219eb43255eda907738b1471158e..603d42098d9f78828e75e5411f1a97371ebaebab 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -76,6 +76,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -78,6 +78,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean e; public int ping; public boolean viewingCredits; @@ -30,7 +30,7 @@ index 4b932c18390e6a94f5ce0683b87d20c7e6708be7..5dce27334541d55c7a7d494cd9237057 // CraftBukkit start public String displayName; -@@ -395,7 +396,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -399,7 +400,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { --this.noDamageTicks; } diff --git a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch index 25cc7bacf0..a8102fcdd4 100644 --- a/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch +++ b/Spigot-Server-Patches/0041-Disable-spigot-tick-limiters.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Disable spigot tick limiters diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 2f161749ff822f4d0f5aaf7e7c9fd1608360de6c..a2574722e0893d63a4d4878febd02b0184c60ac7 100644 +index 9ed82bcc504eef01a021038e3186cfa69832b4b9..892843e23e89d6b1fefa15415692ce7b75ff952e 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -690,9 +690,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -655,9 +655,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // Spigot start // Iterator iterator = this.tileEntityListTick.iterator(); int tilesThisCycle = 0; diff --git a/Spigot-Server-Patches/0042-Add-PlayerInitialSpawnEvent.patch b/Spigot-Server-Patches/0042-Add-PlayerInitialSpawnEvent.patch index 1374f3d3a6..aebcb54f76 100644 --- a/Spigot-Server-Patches/0042-Add-PlayerInitialSpawnEvent.patch +++ b/Spigot-Server-Patches/0042-Add-PlayerInitialSpawnEvent.patch @@ -9,7 +9,7 @@ This is a duplicate API from spigot, so use our duplicate subclass and improve setPosition to use raw diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 60a8fdbd6e458dfdc3e4449d71464bb5d5c5bd20..107d18b028e042f7de505ea2a58a8dc2b9bf0fb3 100644 +index b2a89201a14e5132a0c6c69ec37c7a113202ab02..1b12577cabc52dbb870838599e1dd33ef8fa1948 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -143,7 +143,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0043-Configurable-Disabling-Cat-Chest-Detection.patch b/Spigot-Server-Patches/0043-Configurable-Disabling-Cat-Chest-Detection.patch index 4f50672d2c..20afc77c15 100644 --- a/Spigot-Server-Patches/0043-Configurable-Disabling-Cat-Chest-Detection.patch +++ b/Spigot-Server-Patches/0043-Configurable-Disabling-Cat-Chest-Detection.patch @@ -20,7 +20,7 @@ index a4da22ea65d5fdba38f8dc331919088f9ca99aed..345ac63e281bb3372b2ae879d587d658 + } } diff --git a/src/main/java/net/minecraft/server/BlockChest.java b/src/main/java/net/minecraft/server/BlockChest.java -index b9d0d2d42850c3a5d093429cd0d02ac47848f04b..44b9bfcdc7f2cbf4dc6e28c258506d9f84783b0e 100644 +index fb7c0d45765e36181c809b250ba4eee5d21c5894..12a0230448dd8d56f6dc20e23cacaf0b8a9433d1 100644 --- a/src/main/java/net/minecraft/server/BlockChest.java +++ b/src/main/java/net/minecraft/server/BlockChest.java @@ -268,6 +268,11 @@ public class BlockChest extends BlockChestAbstract<TileEntityChest> implements I diff --git a/Spigot-Server-Patches/0044-Ensure-commands-are-not-ran-async.patch b/Spigot-Server-Patches/0044-Ensure-commands-are-not-ran-async.patch index f4857c4250..7811b82ebe 100644 --- a/Spigot-Server-Patches/0044-Ensure-commands-are-not-ran-async.patch +++ b/Spigot-Server-Patches/0044-Ensure-commands-are-not-ran-async.patch @@ -14,10 +14,10 @@ big slowdown in execution but throwing an exception at same time to raise awaren that it is happening so that plugin authors can fix their code to stop executing commands async. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 88fa8d63c5bb2c76ba09db6bb002f6d6b6a42afc..8ecca907357119ed8eb67381914daba4ae6db38f 100644 +index 89c36a5ad2a74a2bf4c86ad108a43e97fa88e793..090bce8c24e08c0af6f71d64568514f2c9675aa5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1615,6 +1615,29 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1609,6 +1609,29 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (!async && s.startsWith("/")) { @@ -48,10 +48,10 @@ index 88fa8d63c5bb2c76ba09db6bb002f6d6b6a42afc..8ecca907357119ed8eb67381914daba4 } else if (this.player.getChatFlags() == EnumChatVisibility.SYSTEM) { // Do nothing, this is coming from a plugin diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 44a7c6377baa210862ce0ccf60ad0f16d8a839b9..e3e938801cd97fbae2802e8962c70e5d2e66f5f0 100644 +index 3228d479918ea5b0e639521f375120c11e8efdf3..996723e822d22a4a70054b002d7119e0a621aa33 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -754,6 +754,29 @@ public final class CraftServer implements Server { +@@ -753,6 +753,29 @@ public final class CraftServer implements Server { Validate.notNull(commandLine, "CommandLine cannot be null"); org.spigotmc.AsyncCatcher.catchOp("command dispatch"); // Spigot diff --git a/Spigot-Server-Patches/0045-All-chunks-are-slime-spawn-chunks-toggle.patch b/Spigot-Server-Patches/0045-All-chunks-are-slime-spawn-chunks-toggle.patch index e71531ace5..9af20250e0 100644 --- a/Spigot-Server-Patches/0045-All-chunks-are-slime-spawn-chunks-toggle.patch +++ b/Spigot-Server-Patches/0045-All-chunks-are-slime-spawn-chunks-toggle.patch @@ -19,7 +19,7 @@ index 345ac63e281bb3372b2ae879d587d658243581ba..62e793b71b313146b86b466421e7a5f8 + } } diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 8e958367fb0873b26cb01c5a38e24650b0527be8..9c83389c56083d9febf604bf30da47c89330902e 100644 +index dd7ceb679c1b03c419bb2a2799328aed889b1caf..cb7cf185cc93813de97fbab830856573af8b6e73 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java @@ -285,7 +285,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { diff --git a/Spigot-Server-Patches/0046-Expose-server-CommandMap.patch b/Spigot-Server-Patches/0046-Expose-server-CommandMap.patch index 3c9bd93947..04af5cb9ab 100644 --- a/Spigot-Server-Patches/0046-Expose-server-CommandMap.patch +++ b/Spigot-Server-Patches/0046-Expose-server-CommandMap.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose server CommandMap diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e3e938801cd97fbae2802e8962c70e5d2e66f5f0..dbc2fa67426794d7c023c5c984ca165d734652be 100644 +index 996723e822d22a4a70054b002d7119e0a621aa33..fd0ed7f06c338b85efc3930cfd16325331786f2c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1710,6 +1710,7 @@ public final class CraftServer implements Server { +@@ -1704,6 +1704,7 @@ public final class CraftServer implements Server { return helpMap; } diff --git a/Spigot-Server-Patches/0048-Player-Tab-List-and-Title-APIs.patch b/Spigot-Server-Patches/0048-Player-Tab-List-and-Title-APIs.patch index 6d46ff6c9c..279b010339 100644 --- a/Spigot-Server-Patches/0048-Player-Tab-List-and-Title-APIs.patch +++ b/Spigot-Server-Patches/0048-Player-Tab-List-and-Title-APIs.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Player Tab List and Title APIs diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java -index 89dae553392206abb8b3a7be6c807f97cb60ddac..fd3e6cda6a0e7154c50608ba9a4b70f3c43c8f2a 100644 +index 7441beeaa4ee83467dac4d68176132efc6247337..b8770066a86df25d6ba9ecf74d846c730d228c01 100644 --- a/src/main/java/net/minecraft/server/IChatBaseComponent.java +++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java @@ -352,6 +352,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC @@ -52,7 +52,7 @@ index 3a6e780007bc1b1fa799166daa01d3a9e15c7ab0..535056c64ef866e645b1bfbd149b50c5 if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index cebf6f85eea3faea8fecb112234ea23b40cd4d9c..f933af87971ae96f154f26be2a8c122670e3cf64 100644 +index b491e10b95d2235e2495e491596d23614be23d50..7c89694da8bb0ee10b5294d8ecf83842c9030c20 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,6 @@ diff --git a/Spigot-Server-Patches/0049-Ensure-inv-drag-is-in-bounds.patch b/Spigot-Server-Patches/0049-Ensure-inv-drag-is-in-bounds.patch index fb84ecb10a..39967f1538 100644 --- a/Spigot-Server-Patches/0049-Ensure-inv-drag-is-in-bounds.patch +++ b/Spigot-Server-Patches/0049-Ensure-inv-drag-is-in-bounds.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ensure inv drag is in bounds diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java -index d336760a8983b1c6d57be0d965debc42544cc4b0..4effcc860f9b1cf9f13f4c6ae02a6b16df459259 100644 +index 4ae2f06f527503bfdd366d8210a55ced073f0c52..1045bd6eaa977b0142b4496c3f872ffae767a0f1 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -223,7 +223,7 @@ public abstract class Container { diff --git a/Spigot-Server-Patches/0050-Change-implementation-of-tile-entity-removal-list.patch b/Spigot-Server-Patches/0050-Change-implementation-of-tile-entity-removal-list.patch index 2862e90353..edbacda114 100644 --- a/Spigot-Server-Patches/0050-Change-implementation-of-tile-entity-removal-list.patch +++ b/Spigot-Server-Patches/0050-Change-implementation-of-tile-entity-removal-list.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Change implementation of (tile)entity removal list use sets for faster removal diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a2574722e0893d63a4d4878febd02b0184c60ac7..b44240960f4416356b1e9cd1994d676c48ee71d1 100644 +index 892843e23e89d6b1fefa15415692ce7b75ff952e..8f230374f7ee6b98fbdf17e19262e3b668401716 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -37,7 +37,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch index 94cfa240ef..591dd0c87f 100644 --- a/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch +++ b/Spigot-Server-Patches/0051-Add-configurable-portal-search-radius.patch @@ -21,51 +21,41 @@ index 62e793b71b313146b86b466421e7a5f894bef9df..cd47a4ca069df26969de3051c2aac805 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9e132052e1a9b997300e3f5d88473fc5f9ebdd73..1a8fc714f6e4663fc02c1df6a67aaa37d48f743d 100644 +index acb246076e5b127703c8080a8c5000c8cb05e4ec..ca0b6424379f5470315815e6f3d9731c83125999 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2508,7 +2508,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - - blockposition = new BlockPosition(d0, this.locY(), d1); +@@ -2513,7 +2513,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + double d4 = DimensionManager.a(this.world.getDimensionManager(), worldserver.getDimensionManager()); + BlockPosition blockposition = new BlockPosition(MathHelper.a(this.locX() * d4, d0, d2), this.locY(), MathHelper.a(this.locZ() * d4, d1, d3)); // CraftBukkit start -- EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, blockposition, 128); -+ EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, blockposition, worldserver.paperConfig.portalSearchRadius); // Paper - use portal search radius +- CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, flag2 ? 16 : 128, 16); ++ CraftPortalEvent event = callPortalEvent(this, worldserver, blockposition, PlayerTeleportEvent.TeleportCause.NETHER_PORTAL, worldserver.paperConfig.portalSearchRadius, worldserver.paperConfig.portalCreateRadius); // Paper start - configurable portal radius if (event == null) { return null; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 5dce27334541d55c7a7d494cd92370570615dc05..2cdb999dd78611e6f72ef06d9128f21a251cb061 100644 +index 603d42098d9f78828e75e5411f1a97371ebaebab..339cb8c54152290b048d7d601e0ebb7ad9f4c646 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -815,7 +815,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - // CraftBukkit start - Location enter = this.getBukkitEntity().getLocation(); - Location exit = (worldserver == null) ? null : new Location(worldserver.getWorld(), d0, d1, d2, f1, f); -- PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, 128, true, resourcekey == DimensionManager.THE_END ? 0 : 16); -+ com.destroystokyo.paper.PaperWorldConfig config = worldserver != null ? worldserver.paperConfig : worldserver1.paperConfig; // Paper - portal radius -+ PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, config.portalSearchRadius, true, resourcekey == DimensionManager.THE_END ? 0 : config.portalCreateRadius); // Paper - portal radius - Bukkit.getServer().getPluginManager().callEvent(event); - if (event.isCancelled() || event.getTo() == null) { - return null; +@@ -871,7 +871,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + protected CraftPortalEvent callPortalEvent(Entity entity, WorldServer exitWorldServer, BlockPosition exitPosition, TeleportCause cause, int searchRadius, int creationRadius) { + Location enter = this.getBukkitEntity().getLocation(); + Location exit = new Location(exitWorldServer.getWorld(), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ(), yaw, pitch); +- PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, 128, true, creationRadius); ++ PlayerPortalEvent event = new PlayerPortalEvent(this.getBukkitEntity(), enter, exit, cause, searchRadius, true, creationRadius); // Paper - use searchRadius + Bukkit.getServer().getPluginManager().callEvent(event); + if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null) { + return null; diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java -index 8eacfc66dc04bba89c8e1c03746c67068e07718b..f6ec165f9c7d83698100c85b1d4bf6b4cea0f458 100644 +index dc972bf0abc87c2b2fb84d8fffc368a947b2d9a3..205f3f697e9c31674a4ac8db38467bb2e61cfe6b 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java -@@ -45,7 +45,7 @@ public class PortalTravelAgent { - @Nullable - public ShapeDetector.Shape a(BlockPosition blockposition, Vec3D vec3d, EnumDirection enumdirection, double d0, double d1, boolean flag) { // PAIL: rename to findPortal, d0 = portal offset x, d1 = portal offset z, flag = instanceof EntityHuman +@@ -14,7 +14,7 @@ public class PortalTravelAgent { + + public Optional<BlockUtil.Rectangle> findPortal(BlockPosition blockposition, boolean flag) { // CraftBukkit start -- return findPortal(blockposition, vec3d, enumdirection, d0, d1, flag, 128); -+ return findPortal(blockposition, vec3d, enumdirection, d0, d1, flag, world.paperConfig.portalSearchRadius); // Paper +- return findPortal(blockposition, flag ? 16 : 128); // Search Radius ++ return findPortal(blockposition, flag ? world.paperConfig.portalCreateRadius : world.paperConfig.portalSearchRadius); // Paper - search Radius } - @Nullable -@@ -53,7 +53,7 @@ public class PortalTravelAgent { - // CraftBukkit end - VillagePlace villageplace = this.world.x(); - -- villageplace.a(this.world, blockposition, 128); -+ villageplace.a(this.world, blockposition, searchRadius); // Paper - This impacts the # of chunks searched for entries - List<VillagePlaceRecord> list = (List) villageplace.b((villageplacetype) -> { - return villageplacetype == VillagePlaceType.v; - }, blockposition, searchRadius, VillagePlace.Occupancy.ANY).collect(Collectors.toList()); // CraftBukkit - searchRadius + public Optional<BlockUtil.Rectangle> findPortal(BlockPosition blockposition, int i) { diff --git a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch index 684421c8a0..3061ffa7cb 100644 --- a/Spigot-Server-Patches/0052-Add-velocity-warnings.patch +++ b/Spigot-Server-Patches/0052-Add-velocity-warnings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add velocity warnings diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dbc2fa67426794d7c023c5c984ca165d734652be..b2524582a59939aa0a4569bfbb03eb1cc64c3cab 100644 +index fd0ed7f06c338b85efc3930cfd16325331786f2c..50fe1d881e6b618aadb31ae4daa7891452a89863 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -262,6 +262,7 @@ public final class CraftServer implements Server { +@@ -261,6 +261,7 @@ public final class CraftServer implements Server { public boolean ignoreVanillaPermissions = false; private final List<CraftPlayer> playerView; public int reloadCount; @@ -17,10 +17,10 @@ index dbc2fa67426794d7c023c5c984ca165d734652be..b2524582a59939aa0a4569bfbb03eb1c static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 19669d7354d8cfa723e614ac3b471e703ee7feee..613081685e233074728366b9ff16642c04774c91 100644 +index 10f96056700c88cc8e83477877788e3443cecefd..e7125c8a3a4b8374e3a5ea37dc097d383ba8bdc3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -416,10 +416,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -422,10 +422,41 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public void setVelocity(Vector velocity) { Preconditions.checkArgument(velocity != null, "velocity"); velocity.checkFinite(); diff --git a/Spigot-Server-Patches/0053-Configurable-inter-world-teleportation-safety.patch b/Spigot-Server-Patches/0053-Configurable-inter-world-teleportation-safety.patch index a9d43064e9..dd0f9e8716 100644 --- a/Spigot-Server-Patches/0053-Configurable-inter-world-teleportation-safety.patch +++ b/Spigot-Server-Patches/0053-Configurable-inter-world-teleportation-safety.patch @@ -30,10 +30,10 @@ index cd47a4ca069df26969de3051c2aac80540093818..abbf59bb91021821876a8960e8f77fac + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f933af87971ae96f154f26be2a8c122670e3cf64..c90d3c8fe0965f437fe17979978f1189a27851ac 100644 +index 7c89694da8bb0ee10b5294d8ecf83842c9030c20..3698080b147301b41014ea75c677af042a38c6a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -764,7 +764,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -760,7 +760,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { if (fromWorld == toWorld) { entity.playerConnection.teleport(to); } else { diff --git a/Spigot-Server-Patches/0054-Add-exception-reporting-event.patch b/Spigot-Server-Patches/0054-Add-exception-reporting-event.patch index 67412b52c3..67218dc166 100644 --- a/Spigot-Server-Patches/0054-Add-exception-reporting-event.patch +++ b/Spigot-Server-Patches/0054-Add-exception-reporting-event.patch @@ -49,7 +49,7 @@ index 0000000000000000000000000000000000000000..f699ce18ca044f813e194ef2786b7ea8 + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a803d1093dfa7c7421eda913679766224fda6dcf..3ade9a83f750854cd5663a6a177fe27eaac73c39 100644 +index dbaa56f4f8c1093935a981c14bc1cb79c991579c..330492e918efa42717ef2208947e8be927df5398 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -1,5 +1,6 @@ @@ -79,20 +79,6 @@ index a803d1093dfa7c7421eda913679766224fda6dcf..3ade9a83f750854cd5663a6a177fe27e // CraftBukkit end } } -diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7dd9c5eec53631d25ae511b1e57bdadfe28ce289..7abd3683f9cc21b90dc74739954de2decddf6478 100644 ---- a/src/main/java/net/minecraft/server/ChunkProviderServer.java -+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -17,6 +17,9 @@ import java.util.function.Consumer; - import java.util.function.Function; - import java.util.function.Supplier; - import javax.annotation.Nullable; -+import com.destroystokyo.paper.exception.ServerInternalException; -+import org.apache.logging.log4j.LogManager; -+import org.apache.logging.log4j.Logger; - - public class ChunkProviderServer extends IChunkProvider { - diff --git a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java b/src/main/java/net/minecraft/server/NameReferencingFileConverter.java index bf0ccfb9bf20422b90ef26370d113b49be7d730b..060887d765604e4be82913607bb6266a278f5db6 100644 --- a/src/main/java/net/minecraft/server/NameReferencingFileConverter.java @@ -121,7 +107,7 @@ index bf0ccfb9bf20422b90ef26370d113b49be7d730b..060887d765604e4be82913607bb6266a } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 31d4faebcf34e2e207806d7945e1d8c50c5097bd..2b4033cb2b3d42b776afb9c219d2f64b6c6b1e79 100644 +index b40f6b7d45028b5bc58a222e2d54cb8693273325..0542dde09d288488b88e17a044cc508d5d39782f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -761,6 +761,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -133,10 +119,10 @@ index 31d4faebcf34e2e207806d7945e1d8c50c5097bd..2b4033cb2b3d42b776afb9c219d2f64b } } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 1ce85ab949213efb9eae6daddca6ac8fb15dd472..d2977022d163edc5518dd4737c30cffd3eff5954 100644 +index 135f38cc5d5d2fa3866aa1063df49a96b5e72ac2..f722b148464b7b8e515dba25aeffe8dfd3c0d6c3 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -246,6 +246,7 @@ public class RegionFile implements AutoCloseable { +@@ -261,6 +261,7 @@ public class RegionFile implements AutoCloseable { return true; } } catch (IOException ioexception) { @@ -144,7 +130,7 @@ index 1ce85ab949213efb9eae6daddca6ac8fb15dd472..d2977022d163edc5518dd4737c30cffd return false; } } -@@ -318,6 +319,7 @@ public class RegionFile implements AutoCloseable { +@@ -333,6 +334,7 @@ public class RegionFile implements AutoCloseable { filechannel.write(bytebuffer); } catch (Throwable throwable1) { throwable = throwable1; @@ -153,7 +139,7 @@ index 1ce85ab949213efb9eae6daddca6ac8fb15dd472..d2977022d163edc5518dd4737c30cffd } finally { if (filechannel != null) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index f27ffc56d548c09b7a1fced6d87623d493a21543..e08de74543535072e63ecfc9bd3ada95c9dbfeb7 100644 +index 278e7bcd4bed86c32dea7f7cce419df089dceb43..ca3dc5a113554381a2ff97cb3175eda1ec4034ae 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -14,6 +14,7 @@ import org.apache.logging.log4j.LogManager; @@ -164,7 +150,7 @@ index f27ffc56d548c09b7a1fced6d87623d493a21543..e08de74543535072e63ecfc9bd3ada95 import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; // CraftBukkit end -@@ -268,6 +269,7 @@ public final class SpawnerCreature { +@@ -267,6 +268,7 @@ public final class SpawnerCreature { } } catch (Exception exception) { SpawnerCreature.LOGGER.warn("Failed to create mob", exception); @@ -173,7 +159,7 @@ index f27ffc56d548c09b7a1fced6d87623d493a21543..e08de74543535072e63ecfc9bd3ada95 } } @@ -373,6 +375,7 @@ public final class SpawnerCreature { - entity = biomebase_biomemeta.c.a(generatoraccess.getMinecraftWorld()); + entity = biomesettingsmobs_c.c.a((World) worldaccess.getMinecraftWorld()); } catch (Exception exception) { SpawnerCreature.LOGGER.warn("Failed to create mob", exception); + ServerInternalException.reportInternalException(exception); // Paper @@ -181,7 +167,7 @@ index f27ffc56d548c09b7a1fced6d87623d493a21543..e08de74543535072e63ecfc9bd3ada95 } diff --git a/src/main/java/net/minecraft/server/VillageSiege.java b/src/main/java/net/minecraft/server/VillageSiege.java -index 045c16654e60f2312e9b6f7b0de2c9e921321201..b1081e441023f5d24091321b1267b5651adeb331 100644 +index 1844a6504acc420bdfaaf8f045c569e970d055db..d6aadbda5c5a17976659f57ee04cf9b917e09160 100644 --- a/src/main/java/net/minecraft/server/VillageSiege.java +++ b/src/main/java/net/minecraft/server/VillageSiege.java @@ -1,5 +1,7 @@ @@ -191,17 +177,17 @@ index 045c16654e60f2312e9b6f7b0de2c9e921321201..b1081e441023f5d24091321b1267b565 + import java.util.Iterator; import javax.annotation.Nullable; - -@@ -101,6 +103,7 @@ public class VillageSiege implements MobSpawner { + import org.apache.logging.log4j.LogManager; +@@ -104,6 +106,7 @@ public class VillageSiege implements MobSpawner { entityzombie.prepare(worldserver, worldserver.getDamageScaler(entityzombie.getChunkCoordinates()), EnumMobSpawn.EVENT, (GroupDataEntity) null, (NBTTagCompound) null); } catch (Exception exception) { - exception.printStackTrace(); + VillageSiege.LOGGER.warn("Failed to create zombie for village siege at {}", vec3d, exception); + ServerInternalException.reportInternalException(exception); // Paper return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b44240960f4416356b1e9cd1994d676c48ee71d1..c2f8b3eecdb9492b800086a81ef5c0c4c34ff8b7 100644 +index 8f230374f7ee6b98fbdf17e19262e3b668401716..c830fcb3b8ba836a88a81dc2ac19c997f0e438d7 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -1,5 +1,10 @@ @@ -215,7 +201,7 @@ index b44240960f4416356b1e9cd1994d676c48ee71d1..c2f8b3eecdb9492b800086a81ef5c0c4 import com.google.common.collect.Lists; import com.mojang.serialization.Codec; import java.io.IOException; -@@ -720,8 +725,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -685,8 +690,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.exit(); } catch (Throwable throwable) { // Paper start - Prevent tile entity and entity crashes @@ -228,7 +214,7 @@ index b44240960f4416356b1e9cd1994d676c48ee71d1..c2f8b3eecdb9492b800086a81ef5c0c4 tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); continue; -@@ -792,8 +800,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -757,8 +765,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { consumer.accept(entity); } catch (Throwable throwable) { // Paper start - Prevent tile entity and entity crashes @@ -241,17 +227,17 @@ index b44240960f4416356b1e9cd1994d676c48ee71d1..c2f8b3eecdb9492b800086a81ef5c0c4 return; // Paper end diff --git a/src/main/java/net/minecraft/server/WorldPersistentData.java b/src/main/java/net/minecraft/server/WorldPersistentData.java -index 19e68a78310de787bca701bc2597c64e34a77d7c..a2a25cf6a43a1f59a80c997e2980f2bb8e6b3817 100644 +index 141a8e31151010e5a0bd8d4661033f109f6a2e67..138c6d707e33cd352aa4b26dfb279c5b77448de0 100644 --- a/src/main/java/net/minecraft/server/WorldPersistentData.java +++ b/src/main/java/net/minecraft/server/WorldPersistentData.java -@@ -121,6 +121,7 @@ public class WorldPersistentData { - nbttagcompound = GameProfileSerializer.a(this.c, DataFixTypes.SAVED_DATA, nbttagcompound1, j, i); - } catch (Throwable throwable4) { - throwable = throwable4; +@@ -144,6 +144,7 @@ public class WorldPersistentData { + } + } catch (Throwable throwable6) { + throwable = throwable6; + com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(throwable); // Paper - throw throwable4; + throw throwable6; } finally { - if (pushbackinputstream != null) { + if (fileinputstream != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index ffe9cc1011226d604dc5499e7692e9a9a5132b72..343cdb06881fa8b0155b56d29c110bba489f9667 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java diff --git a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch index 3e83fd9463..d78ef3bc78 100644 --- a/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch +++ b/Spigot-Server-Patches/0056-Disable-Scoreboards-for-non-players-by-default.patch @@ -25,10 +25,10 @@ index abbf59bb91021821876a8960e8f77fac24457ec4..04430aae52205ee167662004e45c145b + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1a8fc714f6e4663fc02c1df6a67aaa37d48f743d..1903635fd3416965adbbba5af38ff29dac0c6670 100644 +index ca0b6424379f5470315815e6f3d9731c83125999..263564408d05a231e1857c23d2c15882c4364dd5 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2201,6 +2201,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2188,6 +2188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable public ScoreboardTeamBase getScoreboardTeam() { @@ -37,7 +37,7 @@ index 1a8fc714f6e4663fc02c1df6a67aaa37d48f743d..1903635fd3416965adbbba5af38ff29d } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 8fc632b4b0d79efaced83ea9b39b5727f6f5ebef..d96f6736826896d2b7f482fba0c5125edf2ce3c0 100644 +index df5984cf80da32e5997581171d0eb2bdbbf22244..ff47c899302c7cdedce2190d57745e265e1783d0 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -641,6 +641,7 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/0058-Complete-resource-pack-API.patch b/Spigot-Server-Patches/0058-Complete-resource-pack-API.patch index ce3f992206..69c32e2198 100644 --- a/Spigot-Server-Patches/0058-Complete-resource-pack-API.patch +++ b/Spigot-Server-Patches/0058-Complete-resource-pack-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Complete resource pack API diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8ecca907357119ed8eb67381914daba4ae6db38f..ffed0587323dbf522e478f43948bbb03c0af84a2 100644 +index 090bce8c24e08c0af6f71d64568514f2c9675aa5..c3f2575fb40e82ee4b70301b7655698388b6ae05 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1381,7 +1381,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1375,7 +1375,11 @@ public class PlayerConnection implements PacketListenerPlayIn { // CraftBukkit start public void a(PacketPlayInResourcePackStatus packetplayinresourcepackstatus) { PlayerConnectionUtils.ensureMainThread(packetplayinresourcepackstatus, this, this.player.getWorldServer()); @@ -22,7 +22,7 @@ index 8ecca907357119ed8eb67381914daba4ae6db38f..ffed0587323dbf522e478f43948bbb03 // CraftBukkit end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c90d3c8fe0965f437fe17979978f1189a27851ac..34a3e269c59d1797c764a2dc6c5ba9e646792084 100644 +index 3698080b147301b41014ea75c677af042a38c6a3..4140fef9aeb3a67c8a0e543c54b3df66ba50eb0b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -138,6 +138,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -36,7 +36,7 @@ index c90d3c8fe0965f437fe17979978f1189a27851ac..34a3e269c59d1797c764a2dc6c5ba9e6 public CraftPlayer(CraftServer server, EntityPlayer entity) { super(server, entity); -@@ -1794,6 +1798,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1790,6 +1794,32 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public boolean getAffectsSpawning() { return this.getHandle().affectsSpawning; } diff --git a/Spigot-Server-Patches/0059-Chunk-Save-Reattempt.patch b/Spigot-Server-Patches/0059-Chunk-Save-Reattempt.patch index 24e5c9f56e..6021773c6d 100644 --- a/Spigot-Server-Patches/0059-Chunk-Save-Reattempt.patch +++ b/Spigot-Server-Patches/0059-Chunk-Save-Reattempt.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Chunk Save Reattempt We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks. diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index d2977022d163edc5518dd4737c30cffd3eff5954..26b55108ecf4cd48762b00da625b0ce1d2f42c67 100644 +index f722b148464b7b8e515dba25aeffe8dfd3c0d6c3..be7165098fcb814d7b301a1670c33c78461d8d95 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -246,7 +246,7 @@ public class RegionFile implements AutoCloseable { +@@ -261,7 +261,7 @@ public class RegionFile implements AutoCloseable { return true; } } catch (IOException ioexception) { @@ -19,10 +19,10 @@ index d2977022d163edc5518dd4737c30cffd3eff5954..26b55108ecf4cd48762b00da625b0ce1 } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 4d1de29e7c4bea266c544917fbe807a0b19462d6..4cff831de2128cd346f1f1627f0915d534b0d3bf 100644 +index caa1eb3ea5d2e97944adc735895708a76215ee7b..26fabb4e5d3945ace851cf6e4474e91611c45b1d 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -87,6 +87,7 @@ public final class RegionFileCache implements AutoCloseable { +@@ -88,6 +88,7 @@ public final class RegionFileCache implements AutoCloseable { protected void write(ChunkCoordIntPair chunkcoordintpair, NBTTagCompound nbttagcompound) throws IOException { RegionFile regionfile = this.getFile(chunkcoordintpair, false); // CraftBukkit @@ -30,7 +30,7 @@ index 4d1de29e7c4bea266c544917fbe807a0b19462d6..4cff831de2128cd346f1f1627f0915d5 DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair); Throwable throwable = null; -@@ -110,6 +111,18 @@ public final class RegionFileCache implements AutoCloseable { +@@ -111,6 +112,18 @@ public final class RegionFileCache implements AutoCloseable { } diff --git a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch index f522c4a5d3..63043fc33b 100644 --- a/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch +++ b/Spigot-Server-Patches/0060-Default-loading-permissions.yml-before-plugins.patch @@ -30,10 +30,10 @@ index a62f4bbb973b9cb6d1ee53f56a0897d70ae176af..f207abbe757ad403a29a7a012903aaa8 + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b2524582a59939aa0a4569bfbb03eb1cc64c3cab..3c5b3ab38c22dd127caa2218e9bc62baf7cf5760 100644 +index 50fe1d881e6b618aadb31ae4daa7891452a89863..05bb668478bf3926eb0b471e6bf20edd2d4450e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -399,6 +399,7 @@ public final class CraftServer implements Server { +@@ -398,6 +398,7 @@ public final class CraftServer implements Server { if (type == PluginLoadOrder.STARTUP) { helpMap.clear(); helpMap.initializeGeneralTopics(); @@ -41,7 +41,7 @@ index b2524582a59939aa0a4569bfbb03eb1cc64c3cab..3c5b3ab38c22dd127caa2218e9bc62ba } Plugin[] plugins = pluginManager.getPlugins(); -@@ -418,7 +419,7 @@ public final class CraftServer implements Server { +@@ -417,7 +418,7 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); diff --git a/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch b/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch index fe7880ae84..288023cc36 100644 --- a/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch +++ b/Spigot-Server-Patches/0061-Allow-Reloading-of-Custom-Permissions.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Custom Permissions https://github.com/PaperMC/Paper/issues/49 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3c5b3ab38c22dd127caa2218e9bc62baf7cf5760..ed6832b13c4e59afb2e8e74f075c991f9f91de39 100644 +index 05bb668478bf3926eb0b471e6bf20edd2d4450e8..6bc21f72d185aac6f61e7ee471b84e593a9edc64 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2175,5 +2175,23 @@ public final class CraftServer implements Server { +@@ -2169,5 +2169,23 @@ public final class CraftServer implements Server { return null; } } diff --git a/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch b/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch index 335ce766d5..db9699086d 100644 --- a/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch +++ b/Spigot-Server-Patches/0062-Remove-Metadata-on-reload.patch @@ -7,10 +7,10 @@ Metadata is not meant to persist reload as things break badly with non primitive This will remove metadata on reload so it does not crash everything if a plugin uses it. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ed6832b13c4e59afb2e8e74f075c991f9f91de39..b98efc399fd6d8af53c3a2b74bbbdb97d9ea11e8 100644 +index 6bc21f72d185aac6f61e7ee471b84e593a9edc64..eb780daa0da83b66d8e89f9b132be5334707818c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -865,8 +865,18 @@ public final class CraftServer implements Server { +@@ -864,8 +864,18 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper } diff --git a/Spigot-Server-Patches/0063-Handle-Item-Meta-Inconsistencies.patch b/Spigot-Server-Patches/0063-Handle-Item-Meta-Inconsistencies.patch index 16d65651dd..4c31ff7dcb 100644 --- a/Spigot-Server-Patches/0063-Handle-Item-Meta-Inconsistencies.patch +++ b/Spigot-Server-Patches/0063-Handle-Item-Meta-Inconsistencies.patch @@ -18,7 +18,7 @@ For consistency, the old API methods now forward to use the ItemMeta API equivalents, and should deprecate the old API's. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 63842d5d1a5b8e3ec95cec13392245b43e153cf8..648ae6d9e8f3c7f4d5bbd442efda2ca7d2fc0c3b 100644 +index 10b98ba59570ae12797fa29533a6e56701849527..dce861df47403ae7f7c5f0f541f3f7abf0abe0cc 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -9,6 +9,8 @@ import com.mojang.serialization.Codec; @@ -70,7 +70,7 @@ index 63842d5d1a5b8e3ec95cec13392245b43e153cf8..648ae6d9e8f3c7f4d5bbd442efda2ca7 if (this.getItem().usesDurability()) { this.setDamage(this.getDamage()); } -@@ -710,6 +731,7 @@ public final class ItemStack { +@@ -716,6 +737,7 @@ public final class ItemStack { nbttagcompound.setString("id", String.valueOf(IRegistry.ENCHANTMENT.getKey(enchantment))); nbttagcompound.setShort("lvl", (short) ((byte) i)); nbttaglist.add(nbttagcompound); diff --git a/Spigot-Server-Patches/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch b/Spigot-Server-Patches/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch index 4af1434650..afeb550348 100644 --- a/Spigot-Server-Patches/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch +++ b/Spigot-Server-Patches/0064-Configurable-Non-Player-Arrow-Despawn-Rate.patch @@ -30,7 +30,7 @@ index 04430aae52205ee167662004e45c145b9d2e8bed..d8b9d87bca6eb95c2cea91e4d8466b97 + } } diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index b0930e054ea99f921fc71db9f9342b1a64f3df43..44e23fa452c5f39ad7ff678064f5474813f7cea8 100644 +index 17be0b56f8eeafd1f2ee01bc3b654f7f926c837c..2fb014c2a20363c94045dd834f771cfd9baf37cd 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -245,7 +245,7 @@ public abstract class EntityArrow extends IProjectile { diff --git a/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch b/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch index 7db4d5b87c..c0bc18bf81 100644 --- a/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch +++ b/Spigot-Server-Patches/0065-Add-World-Util-Methods.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add World Util Methods Methods that can be used for other patches to help improve logic. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index c2f8b3eecdb9492b800086a81ef5c0c4c34ff8b7..08d9268c6b6883757d6a6f008dda846d34d63dca 100644 +index c830fcb3b8ba836a88a81dc2ac19c997f0e438d7..1d0238566d8cef75c28389c5b7084019d25c8f72 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -285,6 +285,22 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -250,6 +250,22 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return chunk == null ? null : chunk.getFluid(blockposition); } @@ -33,7 +33,7 @@ index c2f8b3eecdb9492b800086a81ef5c0c4c34ff8b7..08d9268c6b6883757d6a6f008dda846d @Override diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index d039e715624d33fc3ec9e87d5ad992415e7dc6b9..d5c0d394feaf8bb991245dbdcc6252cf45eac13d 100644 +index bb0f30f182856d2701fde9b1a65eeb987462104a..717f495abd63218bb7ce9241e7cfeac809ef02de 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -21,6 +21,7 @@ public class WorldBorder { @@ -45,10 +45,10 @@ index d039e715624d33fc3ec9e87d5ad992415e7dc6b9..d5c0d394feaf8bb991245dbdcc6252cf return (double) (blockposition.getX() + 1) > this.e() && (double) blockposition.getX() < this.g() && (double) (blockposition.getZ() + 1) > this.f() && (double) blockposition.getZ() < this.h(); } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 89e960ef91f588f16ca3efde5518e731d6bc29cb..45921bbb8241901743b08aa94fb9700293a724c2 100644 +index d593899d3243d85bd1dafba4d2c603d6cfe32839..cbfb5538965201bcdcb96d75a9fc5be8bc1d39fd 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -83,7 +83,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -84,7 +84,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { public final Convertable.ConversionSession convertable; public final UUID uuid; diff --git a/Spigot-Server-Patches/0066-Custom-replacement-for-eaten-items.patch b/Spigot-Server-Patches/0066-Custom-replacement-for-eaten-items.patch index 113d7241af..df994d9a77 100644 --- a/Spigot-Server-Patches/0066-Custom-replacement-for-eaten-items.patch +++ b/Spigot-Server-Patches/0066-Custom-replacement-for-eaten-items.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Custom replacement for eaten items diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ac608392ec480b927ce5047cc0519ea06a68e040..9c9af548fe32ab1dd3eecdb4fe4aacf255b39e22 100644 +index ff47c899302c7cdedce2190d57745e265e1783d0..76ec25889cfc9a89a48d9319e1db9d81240306c4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3067,9 +3067,10 @@ public abstract class EntityLiving extends Entity { +@@ -3081,9 +3081,10 @@ public abstract class EntityLiving extends Entity { this.b(this.activeItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; @@ -20,18 +20,23 @@ index ac608392ec480b927ce5047cc0519ea06a68e040..9c9af548fe32ab1dd3eecdb4fe4aacf2 world.getServer().getPluginManager().callEvent(event); if (event.isCancelled()) { -@@ -3084,9 +3085,20 @@ public abstract class EntityLiving extends Entity { +@@ -3097,6 +3098,13 @@ public abstract class EntityLiving extends Entity { + } else { itemstack = this.activeItem.a(this.world, this); } - ++ + // Paper start - save the default replacement item and change it if necessary + final ItemStack defaultReplacement = itemstack; + if (event != null && event.getReplacement() != null) { + itemstack = CraftItemStack.asNMSCopy(event.getReplacement()); + } + // Paper end - this.a(this.getRaisedHand(), itemstack); // CraftBukkit end + + if (itemstack != this.activeItem) { +@@ -3104,6 +3112,11 @@ public abstract class EntityLiving extends Entity { + } + this.clearActiveItem(); + // Paper start - if the replacement is anything but the default, update the client inventory + if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) { diff --git a/Spigot-Server-Patches/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch b/Spigot-Server-Patches/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch index fc751f3ab6..397075bb9a 100644 --- a/Spigot-Server-Patches/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch +++ b/Spigot-Server-Patches/0067-handle-NaN-health-absorb-values-and-repair-bad-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] handle NaN health/absorb values and repair bad data diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9c9af548fe32ab1dd3eecdb4fe4aacf255b39e22..8cb1537114c4aa3d6835e46e9e70de2fa67fac6a 100644 +index 76ec25889cfc9a89a48d9319e1db9d81240306c4..c2d02112eff5c7dabb55e801ae9b2970af3c07ec 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -602,7 +602,13 @@ public abstract class EntityLiving extends Entity { @@ -34,7 +34,7 @@ index 9c9af548fe32ab1dd3eecdb4fe4aacf255b39e22..8cb1537114c4aa3d6835e46e9e70de2f // CraftBukkit start - Handle scaled health if (this instanceof EntityPlayer) { org.bukkit.craftbukkit.entity.CraftPlayer player = ((EntityPlayer) this).getBukkitEntity(); -@@ -2909,7 +2919,7 @@ public abstract class EntityLiving extends Entity { +@@ -2921,7 +2931,7 @@ public abstract class EntityLiving extends Entity { } public void setAbsorptionHearts(float f) { @@ -44,10 +44,10 @@ index 9c9af548fe32ab1dd3eecdb4fe4aacf255b39e22..8cb1537114c4aa3d6835e46e9e70de2f } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 34a3e269c59d1797c764a2dc6c5ba9e646792084..2e8105fe1d0f5f953ac8ba94df3e8eb66b7813d7 100644 +index 4140fef9aeb3a67c8a0e543c54b3df66ba50eb0b..90f04e16956e18f48a45d45f09d4f37eabc65478 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1611,6 +1611,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1607,6 +1607,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setRealHealth(double health) { diff --git a/Spigot-Server-Patches/0069-Use-a-Shared-Random-for-Entities.patch b/Spigot-Server-Patches/0069-Use-a-Shared-Random-for-Entities.patch index 690ca1f255..4c08daf3d1 100644 --- a/Spigot-Server-Patches/0069-Use-a-Shared-Random-for-Entities.patch +++ b/Spigot-Server-Patches/0069-Use-a-Shared-Random-for-Entities.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Use a Shared Random for Entities Reduces memory usage and provides ensures more randomness, Especially since a lot of garbage entity objects get created. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1903635fd3416965adbbba5af38ff29dac0c6670..b5625318ca6bfeeada2d3fb009b711685265ebaa 100644 +index 263564408d05a231e1857c23d2c15882c4364dd5..2a928e016b45ac8aafb97bbebebcf4c00000a9e8 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -58,6 +58,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -60,6 +60,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return tag.hasKey("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } @@ -31,10 +31,10 @@ index 1903635fd3416965adbbba5af38ff29dac0c6670..b5625318ca6bfeeada2d3fb009b71168 private CraftEntity bukkitEntity; public CraftEntity getBukkitEntity() { -@@ -192,7 +207,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -189,7 +204,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.x = Vec3D.a; - this.at = 1.0F; - this.au = 1.0F; + this.am = 1.0F; + this.an = 1.0F; - this.random = new Random(); + this.random = SHARED_RANDOM; // Paper this.fireTicks = -this.getMaxFireTicks(); diff --git a/Spigot-Server-Patches/0070-Configurable-spawn-chances-for-skeleton-horses.patch b/Spigot-Server-Patches/0070-Configurable-spawn-chances-for-skeleton-horses.patch index 78c5b58cbf..ccdbde5293 100644 --- a/Spigot-Server-Patches/0070-Configurable-spawn-chances-for-skeleton-horses.patch +++ b/Spigot-Server-Patches/0070-Configurable-spawn-chances-for-skeleton-horses.patch @@ -22,10 +22,10 @@ index d8b9d87bca6eb95c2cea91e4d8466b9792582d52..92d1dffbf436a21943b4a6aa0fabf54f + } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 45921bbb8241901743b08aa94fb9700293a724c2..746e6266ef62413ac0915818aab23d33912b4bea 100644 +index cbfb5538965201bcdcb96d75a9fc5be8bc1d39fd..27336f26eec55e7d86b12986fff9ccb5874bad97 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -474,7 +474,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -475,7 +475,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { blockposition = this.a(this.a(j, 0, k, 15)); if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); diff --git a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch index b218cac77a..d6be51e05e 100644 --- a/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch +++ b/Spigot-Server-Patches/0071-Optimize-isValidLocation-getType-and-getBlockData-fo.patch @@ -13,7 +13,7 @@ Replace all calls to the new place to the unnecessary forward. Optimize getType and getBlockData to manually inline and optimize the calls diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index b190cd9ef8f447e4e9ff1adb74bff6e63750caad..1e1f4663525db5ab80e7c645be19a6ab4f335e5b 100644 +index 6b6ea0b33b10a9517b7af55fb8292fe245e3ca1e..e126f9d1d03de085f2d09d53fe8bcc1972aedeff 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -20,6 +20,15 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { @@ -33,7 +33,7 @@ index b190cd9ef8f447e4e9ff1adb74bff6e63750caad..1e1f4663525db5ab80e7c645be19a6ab this.a = i; this.b = j; diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 421997be8a8519ed6e24eae2db5e77a4322adb2a..64a1c6f4672626818e28842bca7e8d78d013d14a 100644 +index 330492e918efa42717ef2208947e8be927df5398..8d13c2fab572428d61777699d5463f0678d9ad7c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -308,12 +308,27 @@ public class Chunk implements IChunkAccess { @@ -69,7 +69,7 @@ index 421997be8a8519ed6e24eae2db5e77a4322adb2a..64a1c6f4672626818e28842bca7e8d78 IBlockData iblockdata = null; diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java -index 82fdd3db6f698f8b77c8bbd1f17cb21980ecfeec..fd49438961451987bd102a85484be24b341d946b 100644 +index 84207e7da6df97246f756940142a2af9eb9ca815..ed22ff28ea6c0978ec0d9d1ecf7baa3f422ed677 100644 --- a/src/main/java/net/minecraft/server/ChunkEmpty.java +++ b/src/main/java/net/minecraft/server/ChunkEmpty.java @@ -7,7 +7,7 @@ import javax.annotation.Nullable; @@ -77,12 +77,12 @@ index 82fdd3db6f698f8b77c8bbd1f17cb21980ecfeec..fd49438961451987bd102a85484be24b public class ChunkEmpty extends Chunk { - private static final BiomeBase[] b = (BiomeBase[]) SystemUtils.a((Object) (new BiomeBase[BiomeStorage.a]), (abiomebase) -> { -+ private static final BiomeBase[] b = (BiomeBase[]) SystemUtils.a((new BiomeBase[BiomeStorage.a]), (abiomebase) -> { // Paper - decompile error - Arrays.fill(abiomebase, Biomes.PLAINS); ++ private static final BiomeBase[] b = SystemUtils.a((new BiomeBase[BiomeStorage.a]), (abiomebase) -> { // Paper - decompile error + Arrays.fill(abiomebase, BiomeRegistry.a); }); @@ -15,6 +15,11 @@ public class ChunkEmpty extends Chunk { - super(world, chunkcoordintpair, new BiomeStorage(ChunkEmpty.b)); + super(world, chunkcoordintpair, new BiomeStorage(world.r().b(IRegistry.ay), ChunkEmpty.b)); } + // Paper start @@ -94,7 +94,7 @@ index 82fdd3db6f698f8b77c8bbd1f17cb21980ecfeec..fd49438961451987bd102a85484be24b public IBlockData getType(BlockPosition blockposition) { return Blocks.VOID_AIR.getBlockData(); diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index 882c2733beaff1df68b892d44fc77cacf4364ff4..bd2290a4d4ec314b7afdb1f63d711f80803153cd 100644 +index 882c2733beaff1df68b892d44fc77cacf4364ff4..5c7068cd93806d67c643ed6aabdfcab8888ed94e 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -7,10 +7,10 @@ public class ChunkSection { @@ -106,7 +106,7 @@ index 882c2733beaff1df68b892d44fc77cacf4364ff4..bd2290a4d4ec314b7afdb1f63d711f80 private short tickingBlockCount; private short e; - private final DataPaletteBlock<IBlockData> blockIds; -+ final DataPaletteBlock<IBlockData> blockIds; ++ final DataPaletteBlock<IBlockData> blockIds; // Paper - package-private public ChunkSection(int i) { this(i, (short) 0, (short) 0, (short) 0); @@ -135,7 +135,7 @@ index 32849e360a396128bd228db269ad1a8f7c6583a8..eabc9d7b934f27c823e012f3f10fffc2 protected T a(int i) { diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java -index 91efe3e9d8da340b383847bc1ba29d26b7971cd2..3adb35b6abd0df9617e27e10fa3e0d365958ba42 100644 +index e0672c3c0bf30d88ea1cc609459050499a7271f3..887366f4c2ab608974113e75760b58c47f2afa00 100644 --- a/src/main/java/net/minecraft/server/IChunkAccess.java +++ b/src/main/java/net/minecraft/server/IChunkAccess.java @@ -12,6 +12,7 @@ import org.apache.logging.log4j.LogManager; @@ -147,7 +147,7 @@ index 91efe3e9d8da340b383847bc1ba29d26b7971cd2..3adb35b6abd0df9617e27e10fa3e0d36 IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 070449198273e6c42e72c891882b82361d1c8dbd..5114ce15ad1be23ca83b3a3fcaba10a34fcb1a6f 100644 +index e356bd73901ac7f230492e654af579d21c8fc086..2bcd26ccccf4503241c6b77600ed6ce1d94ccfcc 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -95,16 +95,18 @@ public class ProtoChunk implements IChunkAccess { @@ -176,7 +176,7 @@ index 070449198273e6c42e72c891882b82361d1c8dbd..5114ce15ad1be23ca83b3a3fcaba10a3 @Override public Fluid getFluid(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -index c5d7a013e65c2c81b14ceb2476c1c6dfe3239f0d..ee8df274d43be753887fb77e4203e2ee30ea02b3 100644 +index 065eeed71075bb8f4069cb172ea7fca54793ddc0..09da0cc8f02c504191dfec8be93e6cf67c6afb78 100644 --- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java +++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java @@ -26,6 +26,11 @@ public class ProtoChunkExtension extends ProtoChunk { @@ -192,24 +192,15 @@ index c5d7a013e65c2c81b14ceb2476c1c6dfe3239f0d..ee8df274d43be753887fb77e4203e2ee @Override public Fluid getFluid(BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 08d9268c6b6883757d6a6f008dda846d34d63dca..8308c1dbff44226f93715670ce03504f53f6fdb7 100644 +index 1d0238566d8cef75c28389c5b7084019d25c8f72..b5a6e6152b020201de631a924c8fd077eb1b546a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -181,7 +181,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -187,7 +187,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } public static boolean isValidLocation(BlockPosition blockposition) { -- return !isOutsideWorld(blockposition) && e(blockposition); -+ return blockposition.isValidLocation(); +- return !isOutsideWorld(blockposition) && D(blockposition); ++ return blockposition.isValidLocation(); // Paper - use better/optimized check } - public static boolean k(BlockPosition blockposition) { -@@ -197,7 +197,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - } - - public static boolean isOutsideWorld(BlockPosition blockposition) { -- return b(blockposition.getY()); -+ return blockposition.isInvalidYLocation(); - } - - public static boolean b(int i) { + public static boolean l(BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index 348a0aa17c..bf1ede7be8 100644 --- a/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/Spigot-Server-Patches/0072-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -19,7 +19,7 @@ index 47e370667926e59f036be3f2befe8820668cf892..a830305f0e334ad87e6b9ed94230ff61 } } diff --git a/src/main/java/net/minecraft/server/BlockTallPlant.java b/src/main/java/net/minecraft/server/BlockTallPlant.java -index f87fc631255aa5948459f0726b188ebbbae13c5f..446a2ffcd95fd631750b74fd31b4c41013b8a5a8 100644 +index 48eb9c8a68d45c88c7a42e8e400446a374fb4fc9..2c8d49501664862559ed8974b4821bdd36fabebf 100644 --- a/src/main/java/net/minecraft/server/BlockTallPlant.java +++ b/src/main/java/net/minecraft/server/BlockTallPlant.java @@ -67,7 +67,7 @@ public class BlockTallPlant extends BlockPlant { @@ -32,10 +32,10 @@ index f87fc631255aa5948459f0726b188ebbbae13c5f..446a2ffcd95fd631750b74fd31b4c410 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 991baec71cfeb79ee2108870645a19582f151def..a2954709415751d9688b5b3597f5b15ae5bd8ccb 100644 +index 02e60ff8da52742b0fd3d81a2ef62b098708347a..6b03ad1c75a7f62dd4fc6c5f355799ad981c40e6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1174,6 +1174,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1172,6 +1172,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas while (iterator.hasNext()) { WorldServer worldserver = (WorldServer) iterator.next(); @@ -44,10 +44,10 @@ index 991baec71cfeb79ee2108870645a19582f151def..a2954709415751d9688b5b3597f5b15a this.methodProfiler.a(() -> { return worldserver + " " + worldserver.getDimensionKey().a(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 8308c1dbff44226f93715670ce03504f53f6fdb7..b6102d501616bc536a7dc14ec2917e1461b3ea19 100644 +index b5a6e6152b020201de631a924c8fd077eb1b546a..60bf9af6fe31a730861d82989cfb551ef3d3de59 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -441,7 +441,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -406,7 +406,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit start iblockdata1.b(this, blockposition, k, j - 1); // Don't call an event for the old block to limit event spam CraftWorld world = ((WorldServer) this).getWorld(); @@ -56,7 +56,7 @@ index 8308c1dbff44226f93715670ce03504f53f6fdb7..b6102d501616bc536a7dc14ec2917e14 BlockPhysicsEvent event = new BlockPhysicsEvent(world.getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()), CraftBlockData.fromData(iblockdata)); this.getServer().getPluginManager().callEvent(event); -@@ -543,7 +543,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -508,7 +508,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { // CraftBukkit start CraftWorld world = ((WorldServer) this).getWorld(); @@ -66,10 +66,10 @@ index 8308c1dbff44226f93715670ce03504f53f6fdb7..b6102d501616bc536a7dc14ec2917e14 this.getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 746e6266ef62413ac0915818aab23d33912b4bea..4300a6720ff2083b697bdbddd1599d29a9906464 100644 +index 27336f26eec55e7d86b12986fff9ccb5874bad97..7d1cfda9ea4944ff772003b8ecbbbd7554c79da1 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -82,6 +82,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -83,6 +83,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private int tickPosition; public final Convertable.ConversionSession convertable; public final UUID uuid; diff --git a/Spigot-Server-Patches/0073-Entity-AddTo-RemoveFrom-World-Events.patch b/Spigot-Server-Patches/0073-Entity-AddTo-RemoveFrom-World-Events.patch index 6104389bc8..0ab40b2923 100644 --- a/Spigot-Server-Patches/0073-Entity-AddTo-RemoveFrom-World-Events.patch +++ b/Spigot-Server-Patches/0073-Entity-AddTo-RemoveFrom-World-Events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity AddTo/RemoveFrom World Events diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4300a6720ff2083b697bdbddd1599d29a9906464..f67a654d0a32967720a7d234f1a467387ea0dbbf 100644 +index 7d1cfda9ea4944ff772003b8ecbbbd7554c79da1..f07f70fcfe1b8531910561e92f47f47ec398f0ba 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1055,7 +1055,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1094,7 +1094,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity instanceof EntityInsentient) { this.navigators.remove(((EntityInsentient) entity).getNavigation()); } @@ -17,7 +17,7 @@ index 4300a6720ff2083b697bdbddd1599d29a9906464..f67a654d0a32967720a7d234f1a46738 entity.valid = false; // CraftBukkit } -@@ -1093,6 +1093,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1132,6 +1132,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.origin = entity.getBukkitEntity().getLocation(); } // Paper end diff --git a/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch b/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch index ee7c5ebd1c..072c434fb7 100644 --- a/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch +++ b/Spigot-Server-Patches/0074-Configurable-Chunk-Inhabited-Time.patch @@ -30,7 +30,7 @@ index 92d1dffbf436a21943b4a6aa0fabf54f064e6046..725958efab3dd05e04b7b18e16923076 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index dc65ad095f9ec281c13f04254311d9cea80f43f8..c0b5d25f63741947c0d8ee32f317eb7fd3db4b65 100644 +index 8d13c2fab572428d61777699d5463f0678d9ad7c..72f7d415907b7e8478b3ca4a0fd6c3897ce70d40 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -977,7 +977,7 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0075-EntityPathfindEvent.patch b/Spigot-Server-Patches/0075-EntityPathfindEvent.patch index 87db80a591..5cb90f5bed 100644 --- a/Spigot-Server-Patches/0075-EntityPathfindEvent.patch +++ b/Spigot-Server-Patches/0075-EntityPathfindEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityPathfindEvent Fires when an Entity decides to start moving to a location. diff --git a/src/main/java/net/minecraft/server/Navigation.java b/src/main/java/net/minecraft/server/Navigation.java -index 3303edadf722557212ab973cb4f1684a0a8ae0f2..681465d8a74831461dce4615d2d19c7ed46bc299 100644 +index 3bb8363d08a017623e55ed733b86d0899ef7391d..0ed01f40edfdbeeeea9db55fcba7501ee597c1fb 100644 --- a/src/main/java/net/minecraft/server/Navigation.java +++ b/src/main/java/net/minecraft/server/Navigation.java @@ -60,7 +60,7 @@ public class Navigation extends NavigationAbstract { @@ -19,7 +19,7 @@ index 3303edadf722557212ab973cb4f1684a0a8ae0f2..681465d8a74831461dce4615d2d19c7e private int t() { diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 6c65bab60d21b6c431855bc6516d4fd840a0efb8..0ed4b1d9c636a9051718f800ba5717e3ae46cdc9 100644 +index 5003d16ab68e6b51bff07f66b10e93ce4a5cdb2d..8c51ab85ed4ef23f049fcbfac93e39ab739194cf 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -8,7 +8,7 @@ import javax.annotation.Nullable; @@ -61,7 +61,7 @@ index 6c65bab60d21b6c431855bc6516d4fd840a0efb8..0ed4b1d9c636a9051718f800ba5717e3 return null; } else if (this.a.locY() < 0.0D) { @@ -113,6 +123,23 @@ public abstract class NavigationAbstract { - } else if (this.c != null && !this.c.b() && set.contains(this.p)) { + } else if (this.c != null && !this.c.c() && set.contains(this.p)) { return this.c; } else { + // Paper start - Pathfind event @@ -85,7 +85,7 @@ index 6c65bab60d21b6c431855bc6516d4fd840a0efb8..0ed4b1d9c636a9051718f800ba5717e3 float f = (float) this.a.b(GenericAttributes.FOLLOW_RANGE); BlockPosition blockposition = flag ? this.a.getChunkCoordinates().up() : this.a.getChunkCoordinates(); diff --git a/src/main/java/net/minecraft/server/NavigationFlying.java b/src/main/java/net/minecraft/server/NavigationFlying.java -index d9f0d446fceeba33fdf47e6ff88f888e6e17d019..0c33a0c9d59d79a39826b5ee14144604717ffebe 100644 +index feed11b62a4df63c1782e7124a3f006d7a8019a3..013bdfe5540ae594a7f9cbe3ef8dc54dfb25afd4 100644 --- a/src/main/java/net/minecraft/server/NavigationFlying.java +++ b/src/main/java/net/minecraft/server/NavigationFlying.java @@ -25,7 +25,7 @@ public class NavigationFlying extends NavigationAbstract { diff --git a/Spigot-Server-Patches/0076-Sanitise-RegionFileCache-and-make-configurable.patch b/Spigot-Server-Patches/0076-Sanitise-RegionFileCache-and-make-configurable.patch index 40b7fe7091..315550f51f 100644 --- a/Spigot-Server-Patches/0076-Sanitise-RegionFileCache-and-make-configurable.patch +++ b/Spigot-Server-Patches/0076-Sanitise-RegionFileCache-and-make-configurable.patch @@ -25,10 +25,10 @@ index f207abbe757ad403a29a7a012903aaa88d5b1685..7d726757d1083011a09c9f2ca37c33a8 + } } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 4cff831de2128cd346f1f1627f0915d534b0d3bf..0305f3c93e8485552890dd5eca8e79277e2bb886 100644 +index 26fabb4e5d3945ace851cf6e4474e91611c45b1d..6be04e230fe96c1f2345a00de4f648d9eb712a82 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -27,7 +27,7 @@ public final class RegionFileCache implements AutoCloseable { +@@ -28,7 +28,7 @@ public final class RegionFileCache implements AutoCloseable { if (regionfile != null) { return regionfile; } else { diff --git a/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch b/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch index 1a57e503cf..52506cd159 100644 --- a/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch +++ b/Spigot-Server-Patches/0077-Do-not-load-chunks-for-Pathfinding.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not load chunks for Pathfinding diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 0ed4b1d9c636a9051718f800ba5717e3ae46cdc9..9330e65cbdf2f826528e3c891197fac7860306ec 100644 +index 8c51ab85ed4ef23f049fcbfac93e39ab739194cf..35de4e5be6bc0f3660ec795e41fa71d622662987 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -27,7 +27,7 @@ public abstract class NavigationAbstract { @@ -31,10 +31,10 @@ index 8ba6dd459a863717c91dd59f3f2ee5e3a5ed8170..b31d1f73ce0f067e352868b53eab7557 public Pathfinder(PathfinderAbstract pathfinderabstract, int i) { diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java -index 7249dd2e6d66b20398103301050ac96ca0c44386..d7f0df123ba716ca8587cbfab2c8e94961164909 100644 +index 40fd404fd3d7715efb1eeee4f1715acc2368c577..a0555b132d6ddd2c6c259ae569e411606e496d1d 100644 --- a/src/main/java/net/minecraft/server/PathfinderNormal.java +++ b/src/main/java/net/minecraft/server/PathfinderNormal.java -@@ -468,7 +468,12 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -456,7 +456,12 @@ public class PathfinderNormal extends PathfinderAbstract { for (int j1 = -1; j1 <= 1; ++j1) { if (l != 0 || j1 != 0) { blockposition_mutableblockposition.d(i + l, j + i1, k + j1); @@ -48,15 +48,15 @@ index 7249dd2e6d66b20398103301050ac96ca0c44386..d7f0df123ba716ca8587cbfab2c8e949 if (iblockdata.a(Blocks.CACTUS)) { return PathType.DANGER_CACTUS; -@@ -491,6 +496,7 @@ public class PathfinderNormal extends PathfinderAbstract { - if (fluid.a((Tag) TagsFluid.LAVA)) { - return PathType.LAVA; +@@ -473,6 +478,7 @@ public class PathfinderNormal extends PathfinderAbstract { + if (iblockaccess.getFluid(blockposition_mutableblockposition).a((Tag) TagsFluid.WATER)) { + return PathType.WATER_BORDER; } + } // Paper } } } -@@ -500,7 +506,8 @@ public class PathfinderNormal extends PathfinderAbstract { +@@ -482,7 +488,8 @@ public class PathfinderNormal extends PathfinderAbstract { } protected static PathType b(IBlockAccess iblockaccess, BlockPosition blockposition) { diff --git a/Spigot-Server-Patches/0078-Add-PlayerUseUnknownEntityEvent.patch b/Spigot-Server-Patches/0078-Add-PlayerUseUnknownEntityEvent.patch index 693ddb3746..359d9b177a 100644 --- a/Spigot-Server-Patches/0078-Add-PlayerUseUnknownEntityEvent.patch +++ b/Spigot-Server-Patches/0078-Add-PlayerUseUnknownEntityEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerUseUnknownEntityEvent diff --git a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java -index 58546550cba0dc239980ef6c920bd5db55328693..51970a4f134e29f5d2bf681d83aeeda916fe9195 100644 +index 49c911e54eb3b20d820f3e1895c057eead6d312b..09c757a3bb1d9a49343cf58e18f736e1fa9e10c7 100644 --- a/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java +++ b/src/main/java/net/minecraft/server/PacketPlayInUseEntity.java @@ -5,7 +5,7 @@ import javax.annotation.Nullable; @@ -18,10 +18,10 @@ index 58546550cba0dc239980ef6c920bd5db55328693..51970a4f134e29f5d2bf681d83aeeda9 private Vec3D c; private EnumHand d; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ffed0587323dbf522e478f43948bbb03c0af84a2..e65aa13ed4d751c7eec576b75496683d8b95d06f 100644 +index c3f2575fb40e82ee4b70301b7655698388b6ae05..28febcc22bc931e4e89f274275853ceaeab9ce0a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1955,6 +1955,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1950,6 +1950,16 @@ public class PlayerConnection implements PacketListenerPlayIn { } } } diff --git a/Spigot-Server-Patches/0079-Fix-reducedDebugInfo-not-initialized-on-client.patch b/Spigot-Server-Patches/0079-Fix-reducedDebugInfo-not-initialized-on-client.patch index 032c238865..eb84c2e53c 100644 --- a/Spigot-Server-Patches/0079-Fix-reducedDebugInfo-not-initialized-on-client.patch +++ b/Spigot-Server-Patches/0079-Fix-reducedDebugInfo-not-initialized-on-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix reducedDebugInfo not initialized on client diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 107d18b028e042f7de505ea2a58a8dc2b9bf0fb3..f8224fbc4a677f9c9a5ee65d4f96f849037c0bf9 100644 +index 1b12577cabc52dbb870838599e1dd33ef8fa1948..7387d04174000974c1d6a0de33e04433a1d11e59 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -174,6 +174,7 @@ public abstract class PlayerList { @@ -15,4 +15,4 @@ index 107d18b028e042f7de505ea2a58a8dc2b9bf0fb3..f8224fbc4a677f9c9a5ee65d4f96f849 + playerconnection.sendPacket(new PacketPlayOutEntityStatus(entityplayer, (byte) (worldserver1.getGameRules().getBoolean(GameRules.REDUCED_DEBUG_INFO) ? 22 : 23))); // Paper - fix this rule not being initialized on the client this.d(entityplayer); entityplayer.getStatisticManager().c(); - entityplayer.B().a(entityplayer); + entityplayer.getRecipeBook().a(entityplayer); diff --git a/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch b/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch index 8941bb9c17..48f8acd0e9 100644 --- a/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch +++ b/Spigot-Server-Patches/0080-Configurable-Grass-Spread-Tick-Rate.patch @@ -20,7 +20,7 @@ index 725958efab3dd05e04b7b18e169230762ef800d0..fe2c8001897dc6d66ce0d24ddb1a5d3b + } } diff --git a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java -index 87f5aa46d6a3f8510f4359415f8405c56841619b..3262b43b5844c332502a3dd1358596998aba0a89 100644 +index 7268a1e8f28145c923033bfc4bcaae1fcfdb72fb..2dfc9b3769257a6dcec6ff83bcc904e62018b2dc 100644 --- a/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java +++ b/src/main/java/net/minecraft/server/BlockDirtSnowSpreadable.java @@ -31,6 +31,7 @@ public abstract class BlockDirtSnowSpreadable extends BlockDirtSnow { diff --git a/Spigot-Server-Patches/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch b/Spigot-Server-Patches/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch index e689889729..3a8cbf22d5 100644 --- a/Spigot-Server-Patches/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch +++ b/Spigot-Server-Patches/0081-Fix-Cancelling-BlockPlaceEvent-triggering-physics.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix Cancelling BlockPlaceEvent triggering physics diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index b6102d501616bc536a7dc14ec2917e1461b3ea19..3fc0fcc9e6598ec77fd562c0887335fe018b4051 100644 +index 60bf9af6fe31a730861d82989cfb551ef3d3de59..04887987f33b10a91ab0580b69ff1ad1db376593 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -501,6 +501,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -466,6 +466,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} public void applyPhysics(BlockPosition blockposition, Block block) { diff --git a/Spigot-Server-Patches/0082-Remove-Debug-checks-from-DataBits.patch b/Spigot-Server-Patches/0082-Remove-Debug-checks-from-DataBits.patch index ff31c66ed5..005e25c375 100644 --- a/Spigot-Server-Patches/0082-Remove-Debug-checks-from-DataBits.patch +++ b/Spigot-Server-Patches/0082-Remove-Debug-checks-from-DataBits.patch @@ -9,7 +9,7 @@ Before: http://i.imgur.com/nQsMzAE.png After: http://i.imgur.com/nJ46crB.png diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 2c3580c1c7bcd6afc83a45550c0f672a592e0c38..48cca2b9a1dbb071615625842123c0c47e281b29 100644 +index 53e7bac2f7a99238f509bb0f871ebed103fda568..2901700dc0ff5dce4fb6f6df9f6686c786293d28 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -53,8 +53,8 @@ public class DataBits { diff --git a/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch b/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch index 1589e6774c..63d24d26ef 100644 --- a/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch +++ b/Spigot-Server-Patches/0083-Option-to-use-vanilla-per-world-scoreboard-coloring-.patch @@ -26,10 +26,10 @@ index fe2c8001897dc6d66ce0d24ddb1a5d3b79810294..538e6751f3bda77ba32256158d2a6a25 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 530b5d4be48adae8d7d31e886b62b543de7d97ad..b6d1637607b5bd2339e2ddebaad89898ecc83c78 100644 +index 28febcc22bc931e4e89f274275853ceaeab9ce0a..6a9b673929a934e37d2abb83cc8efcb91f1fd92a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1693,7 +1693,16 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1687,7 +1687,16 @@ public class PlayerConnection implements PacketListenerPlayIn { return; } diff --git a/Spigot-Server-Patches/0084-Workaround-for-setting-passengers-on-players.patch b/Spigot-Server-Patches/0084-Workaround-for-setting-passengers-on-players.patch index d7effbc682..9e4211a791 100644 --- a/Spigot-Server-Patches/0084-Workaround-for-setting-passengers-on-players.patch +++ b/Spigot-Server-Patches/0084-Workaround-for-setting-passengers-on-players.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Workaround for setting passengers on players SPIGOT-1915 & GH-114 diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 2e8105fe1d0f5f953ac8ba94df3e8eb66b7813d7..532698f80bb2e266f27ae1d4b70c80138560b8cc 100644 +index 90f04e16956e18f48a45d45f09d4f37eabc65478..81beabd053c024b0fc4d0948b94a8ff789cb1ba6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -773,6 +773,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -769,6 +769,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return true; } diff --git a/Spigot-Server-Patches/0085-Remove-unused-World-Tile-Entity-List.patch b/Spigot-Server-Patches/0085-Remove-unused-World-Tile-Entity-List.patch index 4f4eeec44a..07b73818ab 100644 --- a/Spigot-Server-Patches/0085-Remove-unused-World-Tile-Entity-List.patch +++ b/Spigot-Server-Patches/0085-Remove-unused-World-Tile-Entity-List.patch @@ -6,19 +6,19 @@ Subject: [PATCH] Remove unused World Tile Entity List Massive hit to performance and it is completely unnecessary. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2e4fc86ef 100644 +index 04887987f33b10a91ab0580b69ff1ad1db376593..03aa2d9c2d0ef96d2a97a9aae18cc04fa04b9665 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -39,7 +39,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - public static final ResourceKey<World> THE_NETHER = ResourceKey.a(IRegistry.ae, new MinecraftKey("the_nether")); - public static final ResourceKey<World> THE_END = ResourceKey.a(IRegistry.ae, new MinecraftKey("the_end")); + public static final ResourceKey<World> THE_NETHER = ResourceKey.a(IRegistry.L, new MinecraftKey("the_nether")); + public static final ResourceKey<World> THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end")); private static final EnumDirection[] a = EnumDirection.values(); - public final List<TileEntity> tileEntityList = Lists.newArrayList(); + //public final List<TileEntity> tileEntityList = Lists.newArrayList(); // Paper - remove unused list public final List<TileEntity> tileEntityListTick = Lists.newArrayList(); protected final List<TileEntity> tileEntityListPending = Lists.newArrayList(); protected final java.util.Set<TileEntity> tileEntityListUnload = com.google.common.collect.Sets.newHashSet(); -@@ -666,9 +666,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -631,9 +631,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { }, tileentity::getPosition}); } @@ -30,7 +30,7 @@ index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2 this.tileEntityListTick.add(tileentity); } -@@ -704,7 +704,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -669,7 +669,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { this.tileEntityListTick.removeAll(this.tileEntityListUnload); @@ -39,7 +39,7 @@ index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2 this.tileEntityListUnload.clear(); } -@@ -765,7 +765,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -730,7 +730,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { tilesThisCycle--; this.tileEntityListTick.remove(tileTickPosition--); // Spigot end @@ -48,7 +48,7 @@ index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2 if (this.isLoaded(tileentity.getPosition())) { this.getChunkAtWorldCoords(tileentity.getPosition()).removeTileEntity(tileentity.getPosition()); } -@@ -795,7 +795,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -760,7 +760,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); // CraftBukkit start // From above, don't screw this up - SPIGOT-1746 @@ -57,7 +57,7 @@ index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2 this.a(tileentity1); } // CraftBukkit end -@@ -937,7 +937,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -902,7 +902,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } else { if (tileentity != null) { this.tileEntityListPending.remove(tileentity); @@ -67,10 +67,10 @@ index 3fc0fcc9e6598ec77fd562c0887335fe018b4051..e2167413702f8a7369e4719fd6bb28e2 } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f67a654d0a32967720a7d234f1a467387ea0dbbf..1525ea4666d67072f16a04647af238c82bcd3fbb 100644 +index f07f70fcfe1b8531910561e92f47f47ec398f0ba..e1484ee03f1f1c59f849f72cc563cab88acf8930 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1541,7 +1541,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1591,7 +1591,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } bufferedwriter.write(String.format("entities: %d\n", this.entitiesById.size())); @@ -79,7 +79,7 @@ index f67a654d0a32967720a7d234f1a467387ea0dbbf..1525ea4666d67072f16a04647af238c8 bufferedwriter.write(String.format("block_ticks: %d\n", this.getBlockTickList().a())); bufferedwriter.write(String.format("fluid_ticks: %d\n", this.getFluidTickList().a())); bufferedwriter.write("distance_manager: " + playerchunkmap.e().c() + "\n"); -@@ -1680,7 +1680,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1730,7 +1730,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { private void a(Writer writer) throws IOException { CSVWriter csvwriter = CSVWriter.a().a("x").a("y").a("z").a("type").a(writer); diff --git a/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch b/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch index 59355a9a2c..e70d339e91 100644 --- a/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch +++ b/Spigot-Server-Patches/0087-Configurable-Player-Collision.patch @@ -19,10 +19,10 @@ index 7d726757d1083011a09c9f2ca37c33a81360e964..3d9a98936cfe933fd71fb82f07e1ba54 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a2954709415751d9688b5b3597f5b15ae5bd8ccb..48511aac1493322803c49b36edea547810efc701 100644 +index 6b03ad1c75a7f62dd4fc6c5f355799ad981c40e6..4f072874e4687cbfbe8ccd07c3f48b6ed6ea0b5e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -435,6 +435,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -432,6 +432,20 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.server.getPluginManager().callEvent(new org.bukkit.event.world.WorldLoadEvent(worldserver.getWorld())); } @@ -57,7 +57,7 @@ index d1581c9d9838797eb425020d21bd0fba432e5652..99dc43159f240135957aee35f6129f19 packetdataserializer.a(this.c); packetdataserializer.a(this.d); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f8224fbc4a677f9c9a5ee65d4f96f849037c0bf9..12b1ef7fb02e1c4c265f24a090fea10e59a02f67 100644 +index 7387d04174000974c1d6a0de33e04433a1d11e59..10b4427d1b55da936a211475a696355d49b77c0f 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -75,6 +75,7 @@ public abstract class PlayerList { @@ -99,7 +99,7 @@ index f8224fbc4a677f9c9a5ee65d4f96f849037c0bf9..12b1ef7fb02e1c4c265f24a090fea10e this.savePlayerFile(entityplayer); if (entityplayer.isPassenger()) { Entity entity = entityplayer.getRootVehicle(); -@@ -1059,6 +1077,13 @@ public abstract class PlayerList { +@@ -1071,6 +1089,13 @@ public abstract class PlayerList { } // CraftBukkit end diff --git a/Spigot-Server-Patches/0088-Add-handshake-event-to-allow-plugins-to-handle-clien.patch b/Spigot-Server-Patches/0088-Add-handshake-event-to-allow-plugins-to-handle-clien.patch index bd37493f36..072b0d3f12 100644 --- a/Spigot-Server-Patches/0088-Add-handshake-event-to-allow-plugins-to-handle-clien.patch +++ b/Spigot-Server-Patches/0088-Add-handshake-event-to-allow-plugins-to-handle-clien.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add handshake event to allow plugins to handle client diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index ba4e3177180f79b865140f29b6cb25156f9e96b1..c0e3d18b0a528d6bca878f354bf8b4b417522c29 100644 +index a79c3a548e181970b90edba18729b564c2980c39..ad2861cde180403069c96f5fd7e4d26ee918bbea 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -14,7 +14,7 @@ public class HandshakeListener implements PacketHandshakingInListener { diff --git a/Spigot-Server-Patches/0089-Configurable-RCON-IP-address.patch b/Spigot-Server-Patches/0089-Configurable-RCON-IP-address.patch index 76224288ca..1c177d7cdd 100644 --- a/Spigot-Server-Patches/0089-Configurable-RCON-IP-address.patch +++ b/Spigot-Server-Patches/0089-Configurable-RCON-IP-address.patch @@ -6,31 +6,31 @@ Subject: [PATCH] Configurable RCON IP address For servers with multiple IP's, ability to bind to a specific interface. diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -index 9dcf91c0505c759d841791c37834360b82df8a7e..1122861a8f9c12668e7bd9d65e63fc9166a66d1a 100644 +index 834330e97326f8f739c9358234b64c685b80025c..0aa8448d25f743a0d12e4c7f7c9c04fd9d5d0088 100644 --- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -@@ -55,6 +55,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr +@@ -56,6 +56,8 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr public final PropertyManager<DedicatedServerProperties>.EditableProperty<Boolean> whiteList; public final GeneratorSettings generatorSettings; + public final String rconIp; // Paper - Add rcon ip + // CraftBukkit start - public DedicatedServerProperties(Properties properties, OptionSet optionset) { + public DedicatedServerProperties(Properties properties, IRegistryCustom iregistrycustom, OptionSet optionset) { super(properties, optionset); -@@ -105,6 +107,10 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr +@@ -106,6 +108,10 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr + }, 100); this.playerIdleTimeout = this.b("player-idle-timeout", 0); this.whiteList = this.b("white-list", false); - this.generatorSettings = GeneratorSettings.a(properties); + // Paper start - Configurable rcon ip + final String rconIp = this.getSettingIfExists("rcon.ip"); + this.rconIp = rconIp == null ? this.serverIp : rconIp; + // Paper end + this.generatorSettings = GeneratorSettings.a(iregistrycustom, properties); } - // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/PropertyManager.java b/src/main/java/net/minecraft/server/PropertyManager.java -index d7e81a6d99fcbf1d71f8c1f42b5138244000f584..729455ce53944a9afaaa3e30052ab44f2a87cad9 100644 +index 3aa05fd2b38562039960b58cab0ea40743ef06bb..2170d539a72a3e254a688e6148b282975e84e491 100644 --- a/src/main/java/net/minecraft/server/PropertyManager.java +++ b/src/main/java/net/minecraft/server/PropertyManager.java @@ -127,8 +127,8 @@ public abstract class PropertyManager<T extends PropertyManager<T>> { @@ -45,15 +45,15 @@ index d7e81a6d99fcbf1d71f8c1f42b5138244000f584..729455ce53944a9afaaa3e30052ab44f } diff --git a/src/main/java/net/minecraft/server/RemoteControlListener.java b/src/main/java/net/minecraft/server/RemoteControlListener.java -index 1afa2b58d04c6169d26336f7871489d7db34ec90..e550b8428245ef2bc0265ae6267bb7e1cabec35c 100644 +index 44afacf7ebbdf09a25189cc636e9c8149e03c9f2..8006659f167879863b5e89e527813e6f664e90d6 100644 --- a/src/main/java/net/minecraft/server/RemoteControlListener.java +++ b/src/main/java/net/minecraft/server/RemoteControlListener.java -@@ -28,7 +28,7 @@ public class RemoteControlListener extends RemoteConnectionThread { +@@ -60,7 +60,7 @@ public class RemoteControlListener extends RemoteConnectionThread { + @Nullable + public static RemoteControlListener a(IMinecraftServer iminecraftserver) { + DedicatedServerProperties dedicatedserverproperties = iminecraftserver.getDedicatedServerProperties(); +- String s = iminecraftserver.h_(); ++ String s = dedicatedserverproperties.rconIp; // Paper - Configurable rcon ip - this.e = dedicatedserverproperties.rconPort; - this.h = dedicatedserverproperties.rconPassword; -- this.f = iminecraftserver.h_(); -+ this.f = dedicatedserverproperties.rconIp; // Paper - Configurable rcon ip - if (this.f.isEmpty()) { - this.f = "0.0.0.0"; - } + if (s.isEmpty()) { + s = "0.0.0.0"; diff --git a/Spigot-Server-Patches/0090-Prevent-Fire-from-loading-chunks.patch b/Spigot-Server-Patches/0090-Prevent-Fire-from-loading-chunks.patch index f1ba6191ea..71c1c724a4 100644 --- a/Spigot-Server-Patches/0090-Prevent-Fire-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0090-Prevent-Fire-from-loading-chunks.patch @@ -7,11 +7,11 @@ This causes the nether to spam unload/reload chunks, plus overall bad behavior. diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d5ff1e60d 100644 +index 3d6aae40cab0cefbfc56389d9d2d37d2f0badd98..48b52b58ff4779fe92d17ab3b3c4cf608917a325 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java -@@ -99,7 +99,7 @@ public class BlockFire extends BlockFireAbstract { - BlockStateBoolean blockstateboolean = (BlockStateBoolean) BlockFire.p.get(enumdirection); +@@ -115,7 +115,7 @@ public class BlockFire extends BlockFireAbstract { + BlockStateBoolean blockstateboolean = (BlockStateBoolean) BlockFire.h.get(enumdirection); if (blockstateboolean != null) { - iblockdata1 = (IBlockData) iblockdata1.set(blockstateboolean, this.e(iblockaccess.getType(blockposition.shift(enumdirection)))); @@ -19,7 +19,7 @@ index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d } } -@@ -179,6 +179,7 @@ public class BlockFire extends BlockFireAbstract { +@@ -195,6 +195,7 @@ public class BlockFire extends BlockFireAbstract { } blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, l, j1, i1); @@ -27,7 +27,7 @@ index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d int l1 = this.a((IWorldReader) worldserver, (BlockPosition) blockposition_mutableblockposition); if (l1 > 0) { -@@ -224,10 +225,16 @@ public class BlockFire extends BlockFireAbstract { +@@ -240,10 +241,16 @@ public class BlockFire extends BlockFireAbstract { } private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition @@ -46,7 +46,7 @@ index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d // CraftBukkit start org.bukkit.block.Block theBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); -@@ -273,7 +280,7 @@ public class BlockFire extends BlockFireAbstract { +@@ -289,7 +296,7 @@ public class BlockFire extends BlockFireAbstract { for (int j = 0; j < i; ++j) { EnumDirection enumdirection = aenumdirection[j]; @@ -55,7 +55,7 @@ index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d return true; } } -@@ -291,7 +298,12 @@ public class BlockFire extends BlockFireAbstract { +@@ -307,7 +314,12 @@ public class BlockFire extends BlockFireAbstract { for (int k = 0; k < j; ++k) { EnumDirection enumdirection = aenumdirection[k]; @@ -69,7 +69,7 @@ index 9f139dd2dbf9706cb018ee26c1315dc29067d68e..9c3b79c1314dedae06278328b6ca722d i = Math.max(this.getFlameChance(iblockdata), i); } -@@ -302,7 +314,7 @@ public class BlockFire extends BlockFireAbstract { +@@ -318,7 +330,7 @@ public class BlockFire extends BlockFireAbstract { @Override protected boolean e(IBlockData iblockdata) { diff --git a/Spigot-Server-Patches/0091-Implement-PlayerLocaleChangeEvent.patch b/Spigot-Server-Patches/0091-Implement-PlayerLocaleChangeEvent.patch index 48dde43add..92106c3765 100644 --- a/Spigot-Server-Patches/0091-Implement-PlayerLocaleChangeEvent.patch +++ b/Spigot-Server-Patches/0091-Implement-PlayerLocaleChangeEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerLocaleChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 2cdb999dd78611e6f72ef06d9128f21a251cb061..6a3d9a06c3e099f5966fe71c5c710daadb4699bb 100644 +index 339cb8c54152290b048d7d601e0ebb7ad9f4c646..a4252ef2d5fcd66b47c87fc904f9dac5c4402724 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1567,20 +1567,28 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1539,16 +1539,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return s; } @@ -24,26 +24,15 @@ index 2cdb999dd78611e6f72ef06d9128f21a251cb061..6a3d9a06c3e099f5966fe71c5c710daa + if (this.locale == null || !this.locale.equals(packetplayinsettings.locale)) { // Paper - check for null PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), packetplayinsettings.locale); this.server.server.getPluginManager().callEvent(event); ++ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), this.locale, packetplayinsettings.locale).callEvent(); // Paper } this.locale = packetplayinsettings.locale; this.clientViewDistance = packetplayinsettings.viewDistance; - // CraftBukkit end -+ // Paper start - add PlayerLocaleChangeEvent -+ // Since the field is initialized to null, this event should always fire the first time the packet is received -+ String oldLocale = this.locale; -+ this.locale = packetplayinsettings.locale; -+ if (!this.locale.equals(oldLocale)) { -+ new com.destroystokyo.paper.event.player.PlayerLocaleChangeEvent(this.getBukkitEntity(), oldLocale, this.locale).callEvent(); -+ } -+ // Paper end - this.cf = packetplayinsettings.d(); - this.cg = packetplayinsettings.e(); - this.getDataWatcher().set(EntityPlayer.bp, (byte) packetplayinsettings.f()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 532698f80bb2e266f27ae1d4b70c80138560b8cc..9e9d054ed9d345eb7ab76ad9c3526889aeb220e3 100644 +index 81beabd053c024b0fc4d0948b94a8ff789cb1ba6..da264f118fca10bc7ff758e702c11f9d4885d2c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1797,8 +1797,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1793,8 +1793,10 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public String getLocale() { diff --git a/Spigot-Server-Patches/0092-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/0092-EntityRegainHealthEvent-isFastRegen-API.patch index e55c1e1ad4..81d9b52fd3 100644 --- a/Spigot-Server-Patches/0092-EntityRegainHealthEvent-isFastRegen-API.patch +++ b/Spigot-Server-Patches/0092-EntityRegainHealthEvent-isFastRegen-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityRegainHealthEvent isFastRegen API Don't even get me started diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 374e4a3dcb656d6a84e05bb9260d3198a4243c05..9086712e1206a980a10c7cc36d3ae3a0b8f8bc79 100644 +index c2d02112eff5c7dabb55e801ae9b2970af3c07ec..61b4e385ceae74d75db6e1f1942a133a2e843773 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1030,10 +1030,16 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch b/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch index cfafb26920..192de227ae 100644 --- a/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch +++ b/Spigot-Server-Patches/0094-remove-null-possibility-for-getServer-singleton.patch @@ -6,7 +6,7 @@ Subject: [PATCH] remove null possibility for getServer singleton to stop IDE complaining about potential NPE diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 48511aac1493322803c49b36edea547810efc701..f449a9aa819fca1fa1db72b8a76a2f2a2739ff96 100644 +index 4f072874e4687cbfbe8ccd07c3f48b6ed6ea0b5e..ad02086e71070eced13e17fbbee204020db4fed7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -70,6 +70,7 @@ import org.spigotmc.SlackActivityAccountant; // Spigot @@ -19,10 +19,10 @@ index 48511aac1493322803c49b36edea547810efc701..f449a9aa819fca1fa1db72b8a76a2f2a public static final WorldSettings c = new WorldSettings("Demo World", EnumGamemode.SURVIVAL, false, EnumDifficulty.NORMAL, false, new GameRules(), DataPackConfiguration.a); @@ -176,6 +177,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository<ResourcePackLoader> resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) { + public MinecraftServer(OptionSet options, DataPackConfiguration datapackconfiguration, Thread thread, IRegistryCustom.Dimension iregistrycustom_dimension, Convertable.ConversionSession convertable_conversionsession, SaveData savedata, ResourcePackRepository resourcepackrepository, Proxy proxy, DataFixer datafixer, DataPackResources datapackresources, MinecraftSessionService minecraftsessionservice, GameProfileRepository gameprofilerepository, UserCache usercache, WorldLoadListenerFactory worldloadlistenerfactory) { super("Server"); + SERVER = this; // Paper - better singleton - this.m = new GameProfilerSwitcher(SystemUtils.a, this::ag); + this.m = new GameProfilerSwitcher(SystemUtils.a, this::ah); this.methodProfiler = GameProfilerDisabled.a; this.serverPing = new ServerPing(); @@ -2036,7 +2038,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas diff --git a/Spigot-Server-Patches/0095-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/Spigot-Server-Patches/0095-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index 74f3c3fd2f..d716c7280f 100644 --- a/Spigot-Server-Patches/0095-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/Spigot-Server-Patches/0095-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -13,7 +13,7 @@ custom renderers are in use, defaulting to the much simpler Vanilla system. Additionally, numerous issues to player position tracking on maps has been fixed. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 94eab21f0defe90e7ad169c45de1fdd002f35f7a..d1cf7602a0c47723593be11c030d3c819426d4d4 100644 +index 683d98dea1b46931478ac7b55e49bc9d92d36f77..485b69140f72a22b3eae53be74bcad003dd92e8f 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -595,6 +595,12 @@ public abstract class EntityHuman extends EntityLiving { @@ -102,10 +102,10 @@ index e6d97e7ffae3eadac586bad078123cd4aaa69916..225353e072033d1e5aaf5604b8db255d for ( org.bukkit.map.MapCursor cursor : render.cursors) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 1525ea4666d67072f16a04647af238c82bcd3fbb..558093814d19bfc371ea03ea0233c11c04504709 100644 +index e1484ee03f1f1c59f849f72cc563cab88acf8930..c8d553007cacdeb734c88983151d433ccfe3d36b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1011,6 +1011,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1050,6 +1050,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { { if ( iter.next().trackee == entity ) { diff --git a/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch b/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch index 2291c3bd62..3492667238 100644 --- a/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/Spigot-Server-Patches/0096-LootTable-API-Replenishable-Lootables-Feature.patch @@ -518,10 +518,10 @@ index 0000000000000000000000000000000000000000..a1923aff2b5e2e867670a5a064a76791 + } +} diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index d20d8f37dd8e09afaa763312040d31adddff5838..05a297534e1986226404f5fa27d817eb0fe87fec 100644 +index 2a928e016b45ac8aafb97bbebebcf4c00000a9e8..ef96a77ed1164ce331b65e5ed8c6bbf4350f885e 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -75,6 +75,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }; // Paper end @@ -530,7 +530,7 @@ index d20d8f37dd8e09afaa763312040d31adddff5838..05a297534e1986226404f5fa27d817eb public CraftEntity getBukkitEntity() { diff --git a/src/main/java/net/minecraft/server/EntityMinecartContainer.java b/src/main/java/net/minecraft/server/EntityMinecartContainer.java -index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce62fc3ed0 100644 +index 50dab307c888cb07cf137f4dc0a38ef59d7acd57..67ff7fe6ab823e89015fb2bf17d70900597ab2fe 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartContainer.java +++ b/src/main/java/net/minecraft/server/EntityMinecartContainer.java @@ -19,6 +19,7 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp @@ -541,7 +541,7 @@ index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>(); private int maxStack = MAX_STACK; -@@ -169,12 +170,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -176,12 +177,13 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp @Override protected void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); @@ -556,7 +556,7 @@ index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce ContainerUtil.a(nbttagcompound, this.items); } -@@ -183,11 +185,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -190,11 +192,12 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp @Override protected void loadData(NBTTagCompound nbttagcompound) { super.loadData(nbttagcompound); @@ -570,7 +570,7 @@ index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce ContainerUtil.b(nbttagcompound, this.items); } -@@ -213,14 +216,15 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp +@@ -225,14 +228,15 @@ public abstract class EntityMinecartContainer extends EntityMinecartAbstract imp } public void d(@Nullable EntityHuman entityhuman) { @@ -585,11 +585,11 @@ index 9a969d71b078ec67a442cc2df387ad633e0fb0f7..510bfffcb986eed991f0b6981eeba5ce - this.lootTable = null; + //this.lootTable = null; // Paper + this.lootableData.processRefill(entityhuman); // Paper - LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.POSITION, this.getChunkCoordinates()).a(this.lootTableSeed); + LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.ORIGIN, this.getPositionVector()).a(this.lootTableSeed); if (entityhuman != null) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index 1eb43345bda9fa96d4f3383afb2fed1e998c9da6..006f8bace83ba1e540399b3f05952fa5edb0681f 100644 +index 1551136c0a50a116eef3430b0c5848ac1ed44bae..c6e6c54a3eb5d725b71f2ec2bb27dd8e2aceabde 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java @@ -8,6 +8,7 @@ public abstract class TileEntityLootable extends TileEntityContainer { @@ -641,7 +641,7 @@ index 1eb43345bda9fa96d4f3383afb2fed1e998c9da6..006f8bace83ba1e540399b3f05952fa5 - this.lootTable = null; + //this.lootTable = null; // Paper + this.lootableData.processRefill(entityhuman); // Paper - LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.POSITION, new BlockPosition(this.position)).a(this.lootTableSeed); + LootTableInfo.Builder loottableinfo_builder = (new LootTableInfo.Builder((WorldServer) this.world)).set(LootContextParameters.ORIGIN, Vec3D.a((BaseBlockPosition) this.position)).a(this.lootTableSeed); if (entityhuman != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -658,7 +658,7 @@ index da5a80267b189d75374375211a574ca5f18d96be..26cc40e57f5b73b9c32859bff37c4a3d } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java -index 941cb98cc2c736e66af61171429243c484ceffc2..31585e9bb825fbd84e30b7c026da57734a3698b3 100644 +index 89df1d7f8b1221014affec459244223491fafaa2..c0fed05d3b68258a61980bdb84fe16dd6adba4c5 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -12,8 +12,9 @@ import org.bukkit.craftbukkit.CraftWorld; diff --git a/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch b/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch index 5002a754ac..ebfddbb779 100644 --- a/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch +++ b/Spigot-Server-Patches/0099-Optimize-UserCache-Thread-Safe.patch @@ -9,82 +9,92 @@ easier to do this than replace the entire thing. Additionally, move Saving of the User cache to be done async, incase the user never changed the default setting for Spigot's save on stop only. +diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java +index 36be0b4516702e0760ba6262a8c894fafbf276b4..56a3ef812966f9dce9c53b105a56e1761cdb467b 100644 +--- a/src/main/java/net/minecraft/server/DedicatedServer.java ++++ b/src/main/java/net/minecraft/server/DedicatedServer.java +@@ -212,7 +212,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer + } + + if (this.convertNames()) { +- this.getUserCache().b(); ++ this.getUserCache().b(false); // Paper + } + + if (!NameReferencingFileConverter.e(this)) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f449a9aa819fca1fa1db72b8a76a2f2a2739ff96..793d4d928bac4febf090291eb773871b492cdc6d 100644 +index ad02086e71070eced13e17fbbee204020db4fed7..b9e757b94d7c00b8bea23102417b2afbe7eccd7a 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -788,7 +788,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -786,7 +786,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } catch (java.lang.InterruptedException ignored) {} // Paper if (org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { LOGGER.info("Saving usercache.json"); -- this.getUserCache().c(); -+ this.getUserCache().c(false); // Paper +- this.getUserCache().b(); ++ this.getUserCache().b(false); // Paper } // Spigot end diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index b211609995b95c26317995f4d776d21ab58d6c0e..4d3cbe3e517a75269d5c9cdd7f3751b81daee1c2 100644 +index ce81aaf3e6ae97ad2af2aad6b668bdd4e18abcf1..15222ed19f049b7465a43a8651584a8a4c5fd666 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -43,8 +43,8 @@ public class UserCache { - - public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); - private static boolean c; -- private final Map<String, UserCache.UserCacheEntry> d = Maps.newHashMap(); -- private final Map<UUID, UserCache.UserCacheEntry> e = Maps.newHashMap(); -+ private final Map<String, UserCache.UserCacheEntry> d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper -+ private final Map<UUID, UserCache.UserCacheEntry> e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - private final Deque<GameProfile> f = new java.util.concurrent.LinkedBlockingDeque<GameProfile>(); // CraftBukkit - private final GameProfileRepository g; - protected final Gson b; -@@ -97,7 +97,7 @@ public class UserCache { - this.a(gameprofile, (Date) null); +@@ -106,7 +106,7 @@ public class UserCache { + return UserCache.b; } -- private void a(GameProfile gameprofile, Date date) { -+ private synchronized void a(GameProfile gameprofile, Date date) { // Paper - synchronize - UUID uuid = gameprofile.getId(); - - if (date == null) { -@@ -110,8 +110,9 @@ public class UserCache { +- public void a(GameProfile gameprofile) { ++ public synchronized void a(GameProfile gameprofile) { // Paper - synchronize + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); +@@ -115,7 +115,7 @@ public class UserCache { UserCache.UserCacheEntry usercache_usercacheentry = new UserCache.UserCacheEntry(gameprofile, date); -- if (this.e.containsKey(uuid)) { -+ //if (this.e.containsKey(uuid)) { // Paper - UserCache.UserCacheEntry usercache_usercacheentry1 = (UserCache.UserCacheEntry) this.e.get(uuid); -+ if (usercache_usercacheentry1 != null) { // Paper + this.a(usercache_usercacheentry); +- if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.b(); // Spigot - skip saving if disabled ++ if( !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly ) this.b(true); // Spigot - skip saving if disabled // Paper - async + } - this.d.remove(usercache_usercacheentry1.a().getName().toLowerCase(Locale.ROOT)); - this.f.remove(gameprofile); -@@ -124,7 +125,7 @@ public class UserCache { + private long d() { +@@ -123,7 +123,7 @@ public class UserCache { } @Nullable - public GameProfile getProfile(String s) { + public synchronized GameProfile getProfile(String s) { // Paper - synchronize String s1 = s.toLowerCase(Locale.ROOT); - UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(s1); + UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.c.get(s1); + boolean flag = false; +@@ -149,7 +149,7 @@ public class UserCache { + } -@@ -209,8 +210,15 @@ public class UserCache { + if (flag && !org.spigotmc.SpigotConfig.saveUserCacheOnStopOnly) { // Spigot - skip saving if disabled +- this.b(); ++ this.b(true); // Paper + } + return gameprofile; +@@ -231,7 +231,7 @@ public class UserCache { + return arraylist; } -+ // Paper start - public void c() { -+ c(true); -+ } -+ public void c(boolean asyncSave) { -+ // Paper end - String s = this.b.toJson(this.a(org.spigotmc.SpigotConfig.userCacheCap)); -+ Runnable save = () -> { -+ - BufferedWriter bufferedwriter = null; +- public void b() { ++ public void b(boolean asyncSave) { // Paper + JsonArray jsonarray = new JsonArray(); + DateFormat dateformat = e(); + +@@ -239,6 +239,7 @@ public class UserCache { + jsonarray.add(a(usercache_usercacheentry, dateformat)); + }); + String s = this.f.toJson(jsonarray); ++ Runnable save = () -> { // Paper try { -@@ -224,6 +232,14 @@ public class UserCache { - } finally { - IOUtils.closeQuietly(bufferedwriter); + BufferedWriter bufferedwriter = Files.newWriter(this.g, StandardCharsets.UTF_8); +@@ -266,6 +267,14 @@ public class UserCache { + } catch (IOException ioexception) { + ; } + // Paper start + }; diff --git a/Spigot-Server-Patches/0100-Avoid-blocking-on-Network-Manager-creation.patch b/Spigot-Server-Patches/0100-Avoid-blocking-on-Network-Manager-creation.patch index 0ef8f2f371..2bd1cf31e9 100644 --- a/Spigot-Server-Patches/0100-Avoid-blocking-on-Network-Manager-creation.patch +++ b/Spigot-Server-Patches/0100-Avoid-blocking-on-Network-Manager-creation.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Avoid blocking on Network Manager creation Per Paper issue 294 diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 6e7c5756a2338f5e901fff0e75fa42a494a2e8ee..7abb122943b8a5ce0e888d16d1592a127bb9bb6f 100644 +index 399420916da4c924cd28c0c4a45b4eca3972acb6..8fcd8f4056620713d0c02fdd9b829053ba95e851 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -38,6 +38,15 @@ public class ServerConnection { +@@ -39,6 +39,15 @@ public class ServerConnection { public volatile boolean c; private final List<ChannelFuture> listeningChannels = Collections.synchronizedList(Lists.newArrayList()); private final List<NetworkManager> connectedChannels = Collections.synchronizedList(Lists.newArrayList()); @@ -25,16 +25,17 @@ index 6e7c5756a2338f5e901fff0e75fa42a494a2e8ee..7abb122943b8a5ce0e888d16d1592a12 public ServerConnection(MinecraftServer minecraftserver) { this.e = minecraftserver; -@@ -72,7 +81,7 @@ public class ServerConnection { - channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND)); - NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND); +@@ -74,7 +83,8 @@ public class ServerConnection { + int j = ServerConnection.this.e.k(); + Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND); -- ServerConnection.this.connectedChannels.add(networkmanager); -+ pending.add(networkmanager); // Paper - channel.pipeline().addLast("packet_handler", networkmanager); - networkmanager.setPacketListener(new HandshakeListener(ServerConnection.this.e, networkmanager)); +- ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error ++ //ServerConnection.this.connectedChannels.add((NetworkManager) object); // CraftBukkit - decompile error ++ pending.add((NetworkManager) object); // Paper + channel.pipeline().addLast("packet_handler", (ChannelHandler) object); + ((NetworkManager) object).setPacketListener(new HandshakeListener(ServerConnection.this.e, (NetworkManager) object)); } -@@ -111,6 +120,7 @@ public class ServerConnection { +@@ -113,6 +123,7 @@ public class ServerConnection { synchronized (this.connectedChannels) { // Spigot Start diff --git a/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch b/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch index e28762220f..d944286eff 100644 --- a/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch +++ b/Spigot-Server-Patches/0101-Optional-TNT-doesn-t-move-in-water.patch @@ -32,10 +32,10 @@ index 05ea87a473228f5b386258fae3943f3f4561eaa6..ac76bdd7e1d91b0d242539c4495948cd + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 562f2e3e639a07852951081ea0887a9c582be6c5..14351cc9e60a0b8d33d319da9d473e74072767d7 100644 +index ef96a77ed1164ce331b65e5ed8c6bbf4350f885e..17cc2b686e33c6de0ab9db6aa7cbc56dac6abcdf 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2652,6 +2652,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2660,6 +2660,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean bU() { @@ -48,7 +48,7 @@ index 562f2e3e639a07852951081ea0887a9c582be6c5..14351cc9e60a0b8d33d319da9d473e74 } diff --git a/src/main/java/net/minecraft/server/EntityTNTPrimed.java b/src/main/java/net/minecraft/server/EntityTNTPrimed.java -index 0f4923bce392c8e46f6b256f47d23e15b08e6d62..00b95dcb80dd2510e7448c03f38cd84a50c6526a 100644 +index 623db6e3befcc7031e68c71f7eb179fce78291c4..3e71332c47000b21ff90aec6937f90dc639a41bd 100644 --- a/src/main/java/net/minecraft/server/EntityTNTPrimed.java +++ b/src/main/java/net/minecraft/server/EntityTNTPrimed.java @@ -80,7 +80,27 @@ public class EntityTNTPrimed extends Entity { @@ -81,7 +81,7 @@ index 0f4923bce392c8e46f6b256f47d23e15b08e6d62..00b95dcb80dd2510e7448c03f38cd84a private void explode() { @@ -149,4 +169,11 @@ public class EntityTNTPrimed extends Entity { - public Packet<?> O() { + public Packet<?> P() { return new PacketPlayOutSpawnEntity(this); } + @@ -93,7 +93,7 @@ index 0f4923bce392c8e46f6b256f47d23e15b08e6d62..00b95dcb80dd2510e7448c03f38cd84a + // Paper end } diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 10821c2b631b4c0e91abb0b05cfc696f1fda36c0..b5a76f37c27cde25b2561a23c7c0fe7bdd992fee 100644 +index 50df43653933e3bdeb3fd514a1c6c3b9ac3b15ab..bbb3f88bb15c70aec7f4d223dd3c0cc986c6eb21 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -38,7 +38,7 @@ public class EntityTrackerEntry { diff --git a/Spigot-Server-Patches/0102-Faster-redstone-torch-rapid-clock-removal.patch b/Spigot-Server-Patches/0102-Faster-redstone-torch-rapid-clock-removal.patch index 095f0bfa15..9383b22480 100644 --- a/Spigot-Server-Patches/0102-Faster-redstone-torch-rapid-clock-removal.patch +++ b/Spigot-Server-Patches/0102-Faster-redstone-torch-rapid-clock-removal.patch @@ -77,7 +77,7 @@ index d88d435b7777f731bc0bb728ebe4d4cb31c6376e..a63a60348fe45f63deec6fcb27b6be09 public RedstoneUpdateInfo(BlockPosition blockposition, long i) { this.a = blockposition; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e2167413702f8a7369e4719fd6bb28e2e4fc86ef..ab64a37d26f79ed081d0c84571106a7c2f9ddfe8 100644 +index 03aa2d9c2d0ef96d2a97a9aae18cc04fa04b9665..a834930a72b5e289675c57f5d1a0594f258aa745 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -90,6 +90,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0103-Add-server-name-parameter.patch b/Spigot-Server-Patches/0103-Add-server-name-parameter.patch index faf4ee491c..915e43c775 100644 --- a/Spigot-Server-Patches/0103-Add-server-name-parameter.patch +++ b/Spigot-Server-Patches/0103-Add-server-name-parameter.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add server-name parameter diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index aa5f94f85b5792c9896fcdafe77e37ec49681d58..46ccad51bb60be735cee5f22fef234298882c6e4 100644 +index 6eaffb5fa1a0181936c602f0045a9a815cde15dd..463915ca7afa9a6f4337590e9c289fa23148aea8 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -137,6 +137,14 @@ public class Main { diff --git a/Spigot-Server-Patches/0104-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch b/Spigot-Server-Patches/0104-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch index b12ddb26a0..2a8c32c6e0 100644 --- a/Spigot-Server-Patches/0104-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch +++ b/Spigot-Server-Patches/0104-Only-send-Dragon-Wither-Death-sounds-to-same-world.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Only send Dragon/Wither Death sounds to same world Also fix view distance lookup diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index d335eb7898dc3a2b1553157d35050112f7b7a426..72a9430789301b264a36c5060ded31ccdc4a1ebf 100644 +index 61f06933ef5405a088dba4282c7857976f406efb..1627fdb2ef8551e1c63034b496a2c9bfb12d0e38 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -570,8 +570,9 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -22,7 +22,7 @@ index d335eb7898dc3a2b1553157d35050112f7b7a426..72a9430789301b264a36c5060ded31cc double deltaZ = this.locZ() - player.locZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 1d725c152a2f96dd12fc3c4e25e142129a783e1b..9331f96f68f121b41ce74904d624520291b7c72e 100644 +index 5fd3f79d825e0b583d94a93d79ca86ecb72050f2..dd4d12f4e3ab5385b85504bde962adce2981dfb5 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java @@ -208,8 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/0105-Fix-Double-World-Add-issues.patch b/Spigot-Server-Patches/0105-Fix-Double-World-Add-issues.patch index 496b8209c7..dae24db6fc 100644 --- a/Spigot-Server-Patches/0105-Fix-Double-World-Add-issues.patch +++ b/Spigot-Server-Patches/0105-Fix-Double-World-Add-issues.patch @@ -8,10 +8,10 @@ Vanilla will double add Spider Jockeys to the world, so ignore already added. Also add debug if something else tries to, and abort before world gets bad state diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 558093814d19bfc371ea03ea0233c11c04504709..75ecd9449de2681ec767cbadb3460a546f3222df 100644 +index c8d553007cacdeb734c88983151d433ccfe3d36b..81a7278915eef762e1ddb296be4a73ac6450d44e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -918,6 +918,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -919,6 +919,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot diff --git a/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch b/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch index 02c51f9ac9..599f49ceb3 100644 --- a/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch +++ b/Spigot-Server-Patches/0106-Fix-Old-Sign-Conversion.patch @@ -9,7 +9,7 @@ Subject: [PATCH] Fix Old Sign Conversion This causes Igloos and such to render broken signs. We fix this by ignoring sign conversion for Defined Structures diff --git a/src/main/java/net/minecraft/server/DefinedStructure.java b/src/main/java/net/minecraft/server/DefinedStructure.java -index 637632b1324e2cdc80cecc4a5a94dc9379312f30..05aae52e662f7effbfb358a5fa6e33c3c4d86001 100644 +index 58e9c99b44fd8e77e62c4098d9872d5378d4f5e5..8974d7944f159b9346680c639daf0f8c06767cfe 100644 --- a/src/main/java/net/minecraft/server/DefinedStructure.java +++ b/src/main/java/net/minecraft/server/DefinedStructure.java @@ -242,9 +242,11 @@ public class DefinedStructure { @@ -25,7 +25,7 @@ index 637632b1324e2cdc80cecc4a5a94dc9379312f30..05aae52e662f7effbfb358a5fa6e33c3 } diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 534295965ee701611b5e12a10f14a69e8226376a..5e5bb5aaa3d8f4e8f4b00ba8bee059ec79f82b43 100644 +index 950dc3de042159de9f667dcd2499f4ee16525b0b..6c4c804797fbbe73d179c6ed089427e64d0ebff4 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -20,6 +20,7 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -37,7 +37,7 @@ index 534295965ee701611b5e12a10f14a69e8226376a..5e5bb5aaa3d8f4e8f4b00ba8bee059ec @Nullable protected World world; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index b7b7d8966ed3390cb828cdd08e4e12d75024d784..8e77c662f7d970d8ff86f6c5b9bccc598442594d 100644 +index b7c9b356e24a8269ade76738335a63ef18890d4d..2b249e7e2018a283b80b9462fbc129420e47ec06 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -59,13 +59,14 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // diff --git a/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch b/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch index 02a31384e5..32e456dccd 100644 --- a/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch +++ b/Spigot-Server-Patches/0107-Don-t-lookup-game-profiles-that-have-no-UUID-and-no-.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Don't lookup game profiles that have no UUID and no name diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 4d3cbe3e517a75269d5c9cdd7f3751b81daee1c2..4f769211cf98c3da720a904da3dcdcd4c7611f0b 100644 +index 15222ed19f049b7465a43a8651584a8a4c5fd666..7171bdf7fb0489e9678588dfa33410984015ea3f 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -75,7 +75,7 @@ public class UserCache { - }; - +@@ -89,7 +89,7 @@ public class UserCache { gameprofilerepository.findProfilesByNames(new String[]{s}, Agent.MINECRAFT, profilelookupcallback); -- if (!d() && agameprofile[0] == null) { -+ if (!d() && agameprofile[0] == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name + GameProfile gameprofile = (GameProfile) atomicreference.get(); + +- if (!c() && gameprofile == null) { ++ if (!c() && gameprofile == null && !org.apache.commons.lang3.StringUtils.isBlank(s)) { // Paper - Don't lookup a profile with a blank name UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s)); - GameProfile gameprofile = new GameProfile(uuid, s); + gameprofile = new GameProfile(uuid, s); diff --git a/Spigot-Server-Patches/0108-Add-setting-for-proxy-online-mode-status.patch b/Spigot-Server-Patches/0108-Add-setting-for-proxy-online-mode-status.patch index bd2612e251..f850f9edaa 100644 --- a/Spigot-Server-Patches/0108-Add-setting-for-proxy-online-mode-status.patch +++ b/Spigot-Server-Patches/0108-Add-setting-for-proxy-online-mode-status.patch @@ -45,10 +45,10 @@ index 060887d765604e4be82913607bb6266a278f5db6..c5957c2d6c54b076ebe7f9a432e30551 } else { String[] astring1 = astring; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b98efc399fd6d8af53c3a2b74bbbdb97d9ea11e8..6b4886371637f0a8adee638ca07e181dd675708e 100644 +index eb780daa0da83b66d8e89f9b132be5334707818c..a215a6968ce378199e645b0786d6094ab11dd398 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1488,7 +1488,8 @@ public final class CraftServer implements Server { +@@ -1482,7 +1482,8 @@ public final class CraftServer implements Server { // Spigot Start GameProfile profile = null; // Only fetch an online UUID in online mode diff --git a/Spigot-Server-Patches/0110-Configurable-packet-in-spam-threshold.patch b/Spigot-Server-Patches/0110-Configurable-packet-in-spam-threshold.patch index 158d12e49a..a98b60384f 100644 --- a/Spigot-Server-Patches/0110-Configurable-packet-in-spam-threshold.patch +++ b/Spigot-Server-Patches/0110-Configurable-packet-in-spam-threshold.patch @@ -23,10 +23,10 @@ index 5827ef1e3eb35a11867ee4f92f301e1b0245c0fa..23c9e0f317073bb9c327ec49e0b0586d + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c865aab4f56d6b0544ef66a35ebf58e48c8afbb8..f92a994d3b0530a35195132adcf5af1ad1fcbb31 100644 +index 6a9b673929a934e37d2abb83cc8efcb91f1fd92a..146dd4dd194a79a5c99218cc776c46ed83f63dc1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1241,13 +1241,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1235,13 +1235,14 @@ public class PlayerConnection implements PacketListenerPlayIn { // Spigot start - limit place/interactions private int limitedPackets; private long lastLimitedPacket = -1; diff --git a/Spigot-Server-Patches/0111-Configurable-flying-kick-messages.patch b/Spigot-Server-Patches/0111-Configurable-flying-kick-messages.patch index 01bfd92c04..460f206ff8 100644 --- a/Spigot-Server-Patches/0111-Configurable-flying-kick-messages.patch +++ b/Spigot-Server-Patches/0111-Configurable-flying-kick-messages.patch @@ -21,7 +21,7 @@ index 23c9e0f317073bb9c327ec49e0b0586d2123e4e9..c4086de778cc2ccc958b1a94dd6e9cdb + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f92a994d3b0530a35195132adcf5af1ad1fcbb31..17edeff6cf5c3f7fee5c17028d3231f70f358537 100644 +index 146dd4dd194a79a5c99218cc776c46ed83f63dc1..f31d8d8253ddcde645b805dd809e0a0c39403c8b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -147,7 +147,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0112-Chunk-registration-fixes.patch b/Spigot-Server-Patches/0112-Chunk-registration-fixes.patch index ea30ea4cd0..48b40e0bfd 100644 --- a/Spigot-Server-Patches/0112-Chunk-registration-fixes.patch +++ b/Spigot-Server-Patches/0112-Chunk-registration-fixes.patch @@ -8,10 +8,10 @@ World checks and the Chunk Add logic are inconsistent on how Y > 256, < 0, is tr Keep them consistent diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 75ecd9449de2681ec767cbadb3460a546f3222df..1ac19271391d437160e02983fbc4d707205c8893 100644 +index 81a7278915eef762e1ddb296be4a73ac6450d44e..173388ca55bd15ba88f730ec9108f738740d64c5 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -727,7 +727,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -728,7 +728,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity.ck()) { this.getMethodProfiler().enter("chunkCheck"); int i = MathHelper.floor(entity.locX() / 16.0D); diff --git a/Spigot-Server-Patches/0114-Auto-fix-bad-Y-levels-on-player-login.patch b/Spigot-Server-Patches/0114-Auto-fix-bad-Y-levels-on-player-login.patch index c2185db0d3..fac5180ca0 100644 --- a/Spigot-Server-Patches/0114-Auto-fix-bad-Y-levels-on-player-login.patch +++ b/Spigot-Server-Patches/0114-Auto-fix-bad-Y-levels-on-player-login.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Auto fix bad Y levels on player login Bring down to a saner Y level if super high, as this can cause the server to crash diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 6a3d9a06c3e099f5966fe71c5c710daadb4699bb..1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac 100644 +index a4252ef2d5fcd66b47c87fc904f9dac5c4402724..5f8d7d71886de1e1dec23453d4e9a72000661cc5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -203,6 +203,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -205,6 +205,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public void loadData(NBTTagCompound nbttagcompound) { super.loadData(nbttagcompound); diff --git a/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch b/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch index 4fc8b4c766..b9daea3940 100644 --- a/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch +++ b/Spigot-Server-Patches/0115-Option-to-remove-corrupt-tile-entities.patch @@ -19,7 +19,7 @@ index ac76bdd7e1d91b0d242539c4495948cdfbb622e0..6cb717a63f52d757b0b323408d2fc0c3 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index c0b5d25f63741947c0d8ee32f317eb7fd3db4b65..fdc02b512f2d4bc968977564d520bc7ec7189c69 100644 +index 72f7d415907b7e8478b3ca4a0fd6c3897ce70d40..e33711fc14323777c86a485dee20ebaeb3989614 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -637,6 +637,12 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0116-Add-EntityZapEvent.patch b/Spigot-Server-Patches/0116-Add-EntityZapEvent.patch index 7011596b57..c02b25502b 100644 --- a/Spigot-Server-Patches/0116-Add-EntityZapEvent.patch +++ b/Spigot-Server-Patches/0116-Add-EntityZapEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityZapEvent diff --git a/src/main/java/net/minecraft/server/EntityPig.java b/src/main/java/net/minecraft/server/EntityPig.java -index 1d580d9cbdca9ceafccd35e20f6f075a582a0ac6..cd0a94794e8969937f7f8408e0fb46c1684abc00 100644 +index 61d9dbea6e932ecdae01458222286483a992a8e3..6848670104e12ac4529d4f210729c32675a2eac9 100644 --- a/src/main/java/net/minecraft/server/EntityPig.java +++ b/src/main/java/net/minecraft/server/EntityPig.java @@ -208,6 +208,11 @@ public class EntityPig extends EntityAnimal implements ISteerable, ISaddleable { @@ -21,12 +21,12 @@ index 1d580d9cbdca9ceafccd35e20f6f075a582a0ac6..cd0a94794e8969937f7f8408e0fb46c1 if (CraftEventFactory.callPigZapEvent(this, entitylightning, entitypigzombie).isCancelled()) { return; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index f7f76bca254dc7bc5792e449feeaa113a96c93e4..d0b04707e830fbaf3a6bfe92637e4432172fd9c7 100644 +index 0182836a801da077ca0e6fcc75e7095454fb2349..17ae6530bda22144866e94e8449220d108084fe5 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -714,6 +714,12 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -719,6 +719,12 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation EntityVillager.LOGGER.info("Villager {} was struck by lightning {}.", this, entitylightning); - EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a(this.world); + EntityWitch entitywitch = (EntityWitch) EntityTypes.WITCH.a((World) worldserver); + // Paper start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityZapEvent(this, entitylightning, entitywitch).isCancelled()) { @@ -35,13 +35,13 @@ index f7f76bca254dc7bc5792e449feeaa113a96c93e4..d0b04707e830fbaf3a6bfe92637e4432 + // Paper end + entitywitch.setPositionRotation(this.locX(), this.locY(), this.locZ(), this.yaw, this.pitch); - entitywitch.prepare(this.world, this.world.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null); + entitywitch.prepare(worldserver, worldserver.getDamageScaler(entitywitch.getChunkCoordinates()), EnumMobSpawn.CONVERSION, (GroupDataEntity) null, (NBTTagCompound) null); entitywitch.setNoAI(this.isNoAI()); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 60a7b9abf65adf8a326b17d07b5864b83137fde2..df807692aad0c61ea101e40a5468ee7f7295e32e 100644 +index 12ee73413363084e11c75c943606869e678a864a..08dd8d04a2a033c0c3f78e13dd184afaa3dc3b60 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1081,6 +1081,14 @@ public class CraftEventFactory { +@@ -1085,6 +1085,14 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0117-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch b/Spigot-Server-Patches/0117-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch index bcf6ae9288..a618e5e66f 100644 --- a/Spigot-Server-Patches/0117-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch +++ b/Spigot-Server-Patches/0117-Filter-bad-data-from-ArmorStand-and-SpawnEgg-items.patch @@ -30,7 +30,7 @@ index 6cb717a63f52d757b0b323408d2fc0c3d7db77da..e43aee3757b6765d898b50ebfff1a280 + } } diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 7c308e0912fb60f8dcdfb36c8a8c8718231858bc..40ab0a1e5b8e31f1ef3b2444366784a65f034341 100644 +index 969b0dca4acc959330c5f10a2c970c896d23ce63..6a03359a781874ed657157e3407897dde71f5b45 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -233,6 +233,13 @@ public class EntityFallingBlock extends Entity { diff --git a/Spigot-Server-Patches/0118-Cache-user-authenticator-threads.patch b/Spigot-Server-Patches/0118-Cache-user-authenticator-threads.patch index a8b6f8b6a5..e10e4844b6 100644 --- a/Spigot-Server-Patches/0118-Cache-user-authenticator-threads.patch +++ b/Spigot-Server-Patches/0118-Cache-user-authenticator-threads.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac..0d9a944d7fdf82c2b20a1238483b76fbe2b4f743 100644 +index 5f8d7d71886de1e1dec23453d4e9a72000661cc5..9e2d39cbad7e52fe2338623fbbda65b273062276 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -4,7 +4,9 @@ import com.google.common.collect.Lists; @@ -17,8 +17,8 @@ index 1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac..0d9a944d7fdf82c2b20a1238483b76fb +import java.util.Deque; // Paper import java.util.Iterator; import java.util.List; - import java.util.OptionalInt; -@@ -41,7 +43,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + import java.util.Optional; +@@ -42,7 +44,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public PlayerConnection playerConnection; public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; @@ -27,7 +27,7 @@ index 1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac..0d9a944d7fdf82c2b20a1238483b76fb private final AdvancementDataPlayer advancementDataPlayer; private final ServerStatisticManager serverStatisticManager; private float lastHealthScored = Float.MIN_VALUE; -@@ -411,13 +413,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -415,13 +417,20 @@ public class EntityPlayer extends EntityHuman implements ICrafting { while (!this.removeQueue.isEmpty()) { int i = Math.min(this.removeQueue.size(), Integer.MAX_VALUE); int[] aint = new int[i]; @@ -50,7 +50,7 @@ index 1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac..0d9a944d7fdf82c2b20a1238483b76fb this.playerConnection.sendPacket(new PacketPlayOutEntityDestroy(aint)); } -@@ -1433,7 +1442,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1406,7 +1415,14 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.lastHealthSent = -1.0F; this.lastFoodSent = -1; // this.recipeBook.a((RecipeBook) entityplayer.recipeBook); // CraftBukkit @@ -58,11 +58,11 @@ index 1e8e95c2f653fd0f3e3d62a80984dcb39e7c1dac..0d9a944d7fdf82c2b20a1238483b76fb + // Paper start - Optimize remove queue - vanilla copies player objects, but CB doesn't. This method currently only + // Applies to the same player, so we need to not duplicate our removal queue. The rest of this method does "resetting" + // type logic so it does need to be called, maybe? This is silly. -+ //this.removeQueue.addAll(entityplayer.removeQueue); ++ // this.removeQueue.addAll(entityplayer.removeQueue); + if (this.removeQueue != entityplayer.removeQueue) { + this.removeQueue.addAll(entityplayer.removeQueue); + } + // Paper end - this.ck = entityplayer.ck; - this.cp = entityplayer.cp; + this.cd = entityplayer.cd; + this.ci = entityplayer.ci; this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); diff --git a/Spigot-Server-Patches/0119-Optimise-removeQueue.patch b/Spigot-Server-Patches/0119-Optimise-removeQueue.patch index 58e4428a99..2865349a9a 100644 --- a/Spigot-Server-Patches/0119-Optimise-removeQueue.patch +++ b/Spigot-Server-Patches/0119-Optimise-removeQueue.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimise removeQueue diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 01e981209ec832b3da368091ed109f42464c1c33..7c016afc904d6d6958abf73fd0d87a25c9fa41ad 100644 +index 87afa6e458f50e8e1d9e6c5a05020876de0a0fdc..dfdc7598a47cc60d0877d2e48aea017cab92c8a2 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -96,6 +96,12 @@ public class LoginListener implements PacketLoginInListener { @@ -54,7 +54,7 @@ index 01e981209ec832b3da368091ed109f42464c1c33..7c016afc904d6d6958abf73fd0d87a25 @@ -250,10 +258,8 @@ public class LoginListener implements PacketLoginInListener { - return LoginListener.this.server.U() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; + return LoginListener.this.server.V() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; } - }; - diff --git a/Spigot-Server-Patches/0120-Allow-Reloading-of-Command-Aliases.patch b/Spigot-Server-Patches/0120-Allow-Reloading-of-Command-Aliases.patch index 0d1e7449d7..65cc804a36 100644 --- a/Spigot-Server-Patches/0120-Allow-Reloading-of-Command-Aliases.patch +++ b/Spigot-Server-Patches/0120-Allow-Reloading-of-Command-Aliases.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow Reloading of Command Aliases Reload the aliases stored in commands.yml diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 6b4886371637f0a8adee638ca07e181dd675708e..c98157c561d1c75499f0a8cb8580a04aef24f2a1 100644 +index a215a6968ce378199e645b0786d6094ab11dd398..b233e48ce7cd173bad6f596f27ed920706e2fdfb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2204,5 +2204,24 @@ public final class CraftServer implements Server { +@@ -2198,5 +2198,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/Spigot-Server-Patches/0121-Add-source-to-PlayerExpChangeEvent.patch b/Spigot-Server-Patches/0121-Add-source-to-PlayerExpChangeEvent.patch index 6e7be086c0..cd367d5b77 100644 --- a/Spigot-Server-Patches/0121-Add-source-to-PlayerExpChangeEvent.patch +++ b/Spigot-Server-Patches/0121-Add-source-to-PlayerExpChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add source to PlayerExpChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 2e25aba27993608ed7ee1cfb7ae8ee60bc74feda..c13a47382d0a7456fa5035a64f42a6ed5e9f1c8e 100644 +index 23d5b7cb1a5cbe3409a0741af08b2fac8d1a58c1..604bdc5ab98071db88ac3e93ebf11869cc60a308 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -188,7 +188,7 @@ public class EntityExperienceOrb extends Entity { @@ -18,10 +18,10 @@ index 2e25aba27993608ed7ee1cfb7ae8ee60bc74feda..c13a47382d0a7456fa5035a64f42a6ed this.die(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index df807692aad0c61ea101e40a5468ee7f7295e32e..7311a4aecd67a0b8524e2f1ab157cd2347ec0570 100644 +index 08dd8d04a2a033c0c3f78e13dd184afaa3dc3b60..a5ca8447b1e403b4ad13a03f9104388fd48d6c7e 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -120,6 +120,7 @@ import org.bukkit.entity.ThrownPotion; +@@ -123,6 +123,7 @@ import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.Vehicle; import org.bukkit.entity.Villager; import org.bukkit.entity.Villager.Profession; @@ -29,7 +29,7 @@ index df807692aad0c61ea101e40a5468ee7f7295e32e..7311a4aecd67a0b8524e2f1ab157cd23 import org.bukkit.event.Cancellable; import org.bukkit.event.Event; import org.bukkit.event.Event.Result; -@@ -1040,6 +1041,17 @@ public class CraftEventFactory { +@@ -1044,6 +1045,17 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch b/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch index e3098a696b..56a9116bce 100644 --- a/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch +++ b/Spigot-Server-Patches/0122-Don-t-let-fishinghooks-use-portals.patch @@ -4,28 +4,14 @@ Date: Fri, 16 Dec 2016 16:03:19 -0600 Subject: [PATCH] Don't let fishinghooks use portals -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 62516bd33f52c01502157def48601f129e49b618..a82cafc57b4ac27c3920e30c999c1a36478e9f7c 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -162,7 +162,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - public boolean ac; - public boolean impulse; - public int portalCooldown; -- protected boolean inPortal; -+ protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER - protected int portalTicks; - protected BlockPosition ah; - protected Vec3D ai; diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index ab8f67c11419cc788fc3cb814d2224e65217dd08..588997ffe1e1d9bbc17a2fe64063138bde1469b8 100644 +index 9928ba1d181eef8735ccd4e282719b4ca3d62bea..bb1cb3a0a82ff3ef878aa591483b30eeab6fdc61 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -191,6 +191,12 @@ public class EntityFishingHook extends IProjectile { +@@ -191,6 +191,11 @@ public class EntityFishingHook extends IProjectile { this.setMot(this.getMot().a(0.92D)); - this.ac(); -+ + this.ae(); + // Paper start - These shouldn't be going through portals + if (this.inPortal) { + this.die(); diff --git a/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch b/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch index 363bc9a05c..ff1d03884e 100644 --- a/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch +++ b/Spigot-Server-Patches/0123-Add-ProjectileCollideEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add ProjectileCollideEvent diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index 44e23fa452c5f39ad7ff678064f5474813f7cea8..c552962a9a2c8dac6794ef6698943c7d91ea45c4 100644 +index 2fb014c2a20363c94045dd834f771cfd9baf37cd..a7c475454e627e54d6771c5023144d55ad389ae3 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -160,6 +160,17 @@ public abstract class EntityArrow extends IProjectile { @@ -27,12 +27,12 @@ index 44e23fa452c5f39ad7ff678064f5474813f7cea8..c552962a9a2c8dac6794ef6698943c7d this.a((MovingObjectPosition) object); this.impulse = true; diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java -index 17ab9401dbd6c67488a79abeeed24e37c126b729..5c737d605219bcb0c509f10e62550981f7cdb03f 100644 +index d63b7b53da148ce404124115337e0dadf3357548..19aa9dab2509554417c2952eccd4ad5cb6008eda 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -57,7 +57,16 @@ public abstract class EntityFireball extends IProjectile { - MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, this::a, RayTrace.BlockCollisionOption.COLLIDER); + MovingObjectPosition movingobjectposition = ProjectileHelper.a((Entity) this, this::a); - if (movingobjectposition.getType() != MovingObjectPosition.EnumMovingObjectType.MISS) { + // Paper start - Call ProjectileCollideEvent @@ -49,7 +49,7 @@ index 17ab9401dbd6c67488a79abeeed24e37c126b729..5c737d605219bcb0c509f10e62550981 // CraftBukkit start - Fire ProjectileHitEvent diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java -index 5cc122fc0e80bd67160c8b4a7a469edfb6e24808..795685f1eed489b8323c7a8528b2bbd4737b9cb7 100644 +index 7391fd31148dbde60e34955841a296f454ac768e..53a8ea7d1eff84abe6c49464d556aa2788a6abcb 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java +++ b/src/main/java/net/minecraft/server/EntityProjectile.java @@ -41,7 +41,17 @@ public abstract class EntityProjectile extends IProjectile { @@ -69,12 +69,12 @@ index 5cc122fc0e80bd67160c8b4a7a469edfb6e24808..795685f1eed489b8323c7a8528b2bbd4 + } // Paper } - Vec3D vec3d = this.getMot(); + this.checkBlockCollisions(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 7311a4aecd67a0b8524e2f1ab157cd2347ec0570..ad3467b32a58c9268f7667c1beea7e919e63212c 100644 +index a5ca8447b1e403b4ad13a03f9104388fd48d6c7e..dc8186b38930bf32f140a2da822cf359b6004a12 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1185,6 +1185,16 @@ public class CraftEventFactory { +@@ -1189,6 +1189,16 @@ public class CraftEventFactory { return CraftItemStack.asNMSCopy(bitem); } diff --git a/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch b/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch index 39a11f46f2..0e8360a0f4 100644 --- a/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch +++ b/Spigot-Server-Patches/0124-Prevent-Pathfinding-out-of-World-Border.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent Pathfinding out of World Border This prevents Entities from trying to run outside of the World Border diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index 9330e65cbdf2f826528e3c891197fac7860306ec..b06c76a369f1dc9de8d782272c3ff0573af89361 100644 +index 35de4e5be6bc0f3660ec795e41fa71d622662987..85ffe76b80adfeaf15f057085de4b383e01b3b55 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -126,7 +126,7 @@ public abstract class NavigationAbstract { diff --git a/Spigot-Server-Patches/0125-Optimize-World.isLoaded-BlockPosition-Z.patch b/Spigot-Server-Patches/0125-Optimize-World.isLoaded-BlockPosition-Z.patch index 975991ca5a..f365a2fadd 100644 --- a/Spigot-Server-Patches/0125-Optimize-World.isLoaded-BlockPosition-Z.patch +++ b/Spigot-Server-Patches/0125-Optimize-World.isLoaded-BlockPosition-Z.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimize World.isLoaded(BlockPosition)Z Reduce method invocations for World.isLoaded(BlockPosition)Z diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ab64a37d26f79ed081d0c84571106a7c2f9ddfe8..a28071a2855c72fd125eb48d67796791a5a40fe0 100644 +index a834930a72b5e289675c57f5d1a0594f258aa745..74f92b44550ed93dcae2366bb44e6a6d210925c6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -287,6 +287,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -252,6 +252,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return chunk == null ? null : chunk.getFluid(blockposition); } diff --git a/Spigot-Server-Patches/0126-Bound-Treasure-Maps-to-World-Border.patch b/Spigot-Server-Patches/0126-Bound-Treasure-Maps-to-World-Border.patch index 230f55e10f..73568db208 100644 --- a/Spigot-Server-Patches/0126-Bound-Treasure-Maps-to-World-Border.patch +++ b/Spigot-Server-Patches/0126-Bound-Treasure-Maps-to-World-Border.patch @@ -11,10 +11,10 @@ that is outside happens to be closer, but unreachable, yet another reachable one is in border that would of been missed. diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java -index eefad79a01de61eff5e0bd3f709bfda030ebe20d..6eb81504146af614a806add6e5effe0c2b111c8a 100644 +index a8e3bbd18e08678e55aa88b09a9f7feb37ab4761..c3bd58069d8dbdf36f70f1dafd7c24000f31708b 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java -@@ -138,6 +138,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration> +@@ -142,6 +142,7 @@ public abstract class StructureGenerator<C extends WorldGenFeatureConfiguration> int i2 = l + k * k1; int j2 = i1 + k * l1; ChunkCoordIntPair chunkcoordintpair = this.a(structuresettingsfeature, j, seededrandom, i2, j2); @@ -23,7 +23,7 @@ index eefad79a01de61eff5e0bd3f709bfda030ebe20d..6eb81504146af614a806add6e5effe0c StructureStart<?> structurestart = structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), this, ichunkaccess); diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index d5c0d394feaf8bb991245dbdcc6252cf45eac13d..0ef92a320d132b443e76276b2c34a4626cf187db 100644 +index 717f495abd63218bb7ce9241e7cfeac809ef02de..adab2bd76e7e99140218ddbdb00aa9c27c0d0183 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -26,6 +26,18 @@ public class WorldBorder { diff --git a/Spigot-Server-Patches/0127-Configurable-Cartographer-Treasure-Maps.patch b/Spigot-Server-Patches/0127-Configurable-Cartographer-Treasure-Maps.patch index f55d2be9cd..057940ae2c 100644 --- a/Spigot-Server-Patches/0127-Configurable-Cartographer-Treasure-Maps.patch +++ b/Spigot-Server-Patches/0127-Configurable-Cartographer-Treasure-Maps.patch @@ -28,12 +28,12 @@ index e43aee3757b6765d898b50ebfff1a28071638558..255b4081314162cbe344b008158c6f45 + } } diff --git a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java -index 32a98e758b9df48005ddc5283eacdc5123a32c39..30f21e3ff7eed3c7291e01b94cc0f66fd48756d0 100644 +index 37ebc9f511479778c131e02b6852b27f63e75bdd..6000c7c2fc68427dea343115183b8faacc985514 100644 --- a/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java +++ b/src/main/java/net/minecraft/server/LootItemFunctionExplorationMap.java @@ -48,6 +48,15 @@ public class LootItemFunctionExplorationMap extends LootItemFunctionConditional - if (blockposition != null) { + if (vec3d != null) { WorldServer worldserver = loottableinfo.getWorld(); + // Paper start + if (!worldserver.paperConfig.enableTreasureMaps) { @@ -44,11 +44,11 @@ index 32a98e758b9df48005ddc5283eacdc5123a32c39..30f21e3ff7eed3c7291e01b94cc0f66f + return itemstack; + } + // Paper end - BlockPosition blockposition1 = worldserver.a(this.e, blockposition, this.h, this.i); + BlockPosition blockposition = worldserver.a(this.e, new BlockPosition(vec3d), this.h, this.i); - if (blockposition1 != null) { + if (blockposition != null) { diff --git a/src/main/java/net/minecraft/server/VillagerTrades.java b/src/main/java/net/minecraft/server/VillagerTrades.java -index 532460e7549192dfe6170e2bf489edb46b8b5737..d0c2ec4050458e26d1bd85cc09b1a3fdca8488c6 100644 +index 4f7944d7fdaf02bae40ee71a18bd1c9bb4eb891b..49f9ae86512ad679aaa71992de2284e024591101 100644 --- a/src/main/java/net/minecraft/server/VillagerTrades.java +++ b/src/main/java/net/minecraft/server/VillagerTrades.java @@ -91,7 +91,8 @@ public class VillagerTrades { diff --git a/Spigot-Server-Patches/0128-Optimize-ItemStack.isEmpty.patch b/Spigot-Server-Patches/0128-Optimize-ItemStack.isEmpty.patch index 7110c98c61..e3476cb3ff 100644 --- a/Spigot-Server-Patches/0128-Optimize-ItemStack.isEmpty.patch +++ b/Spigot-Server-Patches/0128-Optimize-ItemStack.isEmpty.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize ItemStack.isEmpty() Remove hashMap lookup every check, simplify code to remove ternary diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 648ae6d9e8f3c7f4d5bbd442efda2ca7d2fc0c3b..a62c2307a1d0f93c830fb3b125f03dc58757b8e6 100644 +index dce861df47403ae7f7c5f0f541f3f7abf0abe0cc..74de67380094261cb93264d760ddbbbd5cce8220 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -154,7 +154,7 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/0129-Add-API-methods-to-control-if-armour-stands-can-move.patch b/Spigot-Server-Patches/0129-Add-API-methods-to-control-if-armour-stands-can-move.patch index c05365d971..18ba2d14b7 100644 --- a/Spigot-Server-Patches/0129-Add-API-methods-to-control-if-armour-stands-can-move.patch +++ b/Spigot-Server-Patches/0129-Add-API-methods-to-control-if-armour-stands-can-move.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add API methods to control if armour stands can move diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 073c3e17eee996f2a9b620bbc13c59d6e342fd6c..3571ef9ac1299702ad274aad43070abf959bf9d9 100644 +index c2672f55f1da295c97bacc1313f84198573c0187..73e5bd74f6f9b1532d4abf8d8a0383c851daf35f 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -43,6 +43,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -45,6 +45,7 @@ public class EntityArmorStand extends EntityLiving { public Vector3f rightArmPose; public Vector3f leftLegPose; public Vector3f rightLegPose; @@ -16,9 +16,9 @@ index 073c3e17eee996f2a9b620bbc13c59d6e342fd6c..3571ef9ac1299702ad274aad43070abf public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) { super(entitytypes, world); -@@ -817,4 +818,13 @@ public class EntityArmorStand extends EntityLiving { - - return this.getEntityType().l().a(f); +@@ -821,4 +822,13 @@ public class EntityArmorStand extends EntityLiving { + private EntitySize s(boolean flag) { + return flag ? EntityArmorStand.bp : (this.isBaby() ? EntityArmorStand.bq : this.getEntityType().l()); } + + // Paper start @@ -31,14 +31,13 @@ index 073c3e17eee996f2a9b620bbc13c59d6e342fd6c..3571ef9ac1299702ad274aad43070abf + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 2b66a08aded172164079952850f43a84c3f514b2..124c3185bc5c344555f684629c8818130d80ab3d 100644 +index 253033878391f6cac97dcdbffe151ca82e830a9c..76176a3de05295a5493e0990116759505029dedc 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -211,4 +211,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { - public void setMarker(boolean marker) { - getHandle().setMarker(marker); +@@ -228,4 +228,15 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { + public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { + return (getHandle().bv & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8)) != 0; } -+ + // Paper start + @Override + public boolean canMove() { diff --git a/Spigot-Server-Patches/0130-Properly-fix-item-duplication-bug.patch b/Spigot-Server-Patches/0130-Properly-fix-item-duplication-bug.patch index 2ebb80d9e9..e2d919e4a6 100644 --- a/Spigot-Server-Patches/0130-Properly-fix-item-duplication-bug.patch +++ b/Spigot-Server-Patches/0130-Properly-fix-item-duplication-bug.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Properly fix item duplication bug Credit to prplz for figuring out the real issue diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0d9a944d7fdf82c2b20a1238483b76fbe2b4f743..b94afac539a5d7a1e6ed39ef8f130385f8ea07b6 100644 +index 9e2d39cbad7e52fe2338623fbbda65b273062276..044fecfda9dc9f7f503f39b26adab55c98b909c4 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1933,7 +1933,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1904,7 +1904,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override protected boolean isFrozen() { @@ -19,10 +19,10 @@ index 0d9a944d7fdf82c2b20a1238483b76fbe2b4f743..b94afac539a5d7a1e6ed39ef8f130385 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 17edeff6cf5c3f7fee5c17028d3231f70f358537..e04bb290a94f5cfc93b5bd2121e6b32610199237 100644 +index f31d8d8253ddcde645b805dd809e0a0c39403c8b..cadeb30ef8f31fcc0d626c2cc7f079c3e778704d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2569,7 +2569,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2564,7 +2564,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } public final boolean isDisconnected() { diff --git a/Spigot-Server-Patches/0131-String-based-Action-Bar-API.patch b/Spigot-Server-Patches/0131-String-based-Action-Bar-API.patch index 8424f5aad3..415e1fff2b 100644 --- a/Spigot-Server-Patches/0131-String-based-Action-Bar-API.patch +++ b/Spigot-Server-Patches/0131-String-based-Action-Bar-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] String based Action Bar API diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 275c1d2d1eb2649de9a9b5aece6e88c21362efba..d72ba7f76c42fd525a5b59a999a0c08e35d0ef78 100644 +index bdfd17362518ff2398cf9e1743a7a4f0c7a0e966..cc14e4b4609fa7013df666181c0e02a53970c123 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -48,7 +48,7 @@ public class SystemUtils { +@@ -52,7 +52,7 @@ public class SystemUtils { private static final ExecutorService e = a("Main"); private static final ExecutorService f = n(); public static LongSupplier a = System::nanoTime; @@ -18,7 +18,7 @@ index 275c1d2d1eb2649de9a9b5aece6e88c21362efba..d72ba7f76c42fd525a5b59a999a0c08e public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> a() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 9e9d054ed9d345eb7ab76ad9c3526889aeb220e3..b03d7747ca582c212534b061369564daa74f5022 100644 +index da264f118fca10bc7ff758e702c11f9d4885d2c2..6ca7a7a3267d3c8477c8333dea9ac2bbad230056 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -221,6 +221,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0132-Firework-API-s.patch b/Spigot-Server-Patches/0132-Firework-API-s.patch index eccccc9865..1112b30ecc 100644 --- a/Spigot-Server-Patches/0132-Firework-API-s.patch +++ b/Spigot-Server-Patches/0132-Firework-API-s.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Firework API's diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index fd34a0f2dcfe300763f31eda4d53951d66d875f7..438002cd5d6c3e56ed05e99d89a061f07ecfe73f 100644 +index b350825141e7a0d71a7362f1faf01c41d769a14f..36729e478329cdcd4af6132f3024963314bc4c61 100644 --- a/src/main/java/net/minecraft/server/EntityFireworks.java +++ b/src/main/java/net/minecraft/server/EntityFireworks.java @@ -13,7 +13,8 @@ public class EntityFireworks extends IProjectile { diff --git a/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch index 0de9818d27..b4bb2e862c 100644 --- a/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0133-PlayerTeleportEndGatewayEvent.patch @@ -6,10 +6,10 @@ Subject: [PATCH] PlayerTeleportEndGatewayEvent Allows you to access the Gateway being used in a teleport event diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 2c449a92b1e0941cf746c3c50257e5c99f542d16..4686880e1f37841ae0217654ed6aa8f813ad90a6 100644 +index eb37395d83a16b7e94d6b8978ddf305b860a5534..717c736cbc4defd24c5d08b501227bbd3e00a7e8 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -151,7 +151,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +@@ -155,7 +155,7 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick location.setPitch(player.getLocation().getPitch()); location.setYaw(player.getLocation().getYaw()); diff --git a/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch b/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch index 4299ae2280..dec6e7647b 100644 --- a/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch +++ b/Spigot-Server-Patches/0134-Provide-E-TE-Chunk-count-stat-methods.patch @@ -7,7 +7,7 @@ Provides counts without the ineffeciency of using .getEntities().size() which creates copy of the collections. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index cf8bb747cc404045cb35a3bed15884e50af7e20a..afc7263644c0bf45769dbdb6801d025c49e8d323 100644 +index e38b1a7258ea5be6baec9a9f40b70055499e9369..948639d629d0126c914b1b4d20f7dfaa6137e63e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -281,6 +281,48 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0135-Enforce-Sync-Player-Saves.patch b/Spigot-Server-Patches/0135-Enforce-Sync-Player-Saves.patch index 0e35938a56..25b6275112 100644 --- a/Spigot-Server-Patches/0135-Enforce-Sync-Player-Saves.patch +++ b/Spigot-Server-Patches/0135-Enforce-Sync-Player-Saves.patch @@ -7,10 +7,10 @@ Saving players async is extremely dangerous. This will force it to main the same way we handle async chunk loads. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 12b1ef7fb02e1c4c265f24a090fea10e59a02f67..8bc8c20f0cbf909bd11f360d14926ba29637f779 100644 +index 10b4427d1b55da936a211475a696355d49b77c0f..8c2d49215f4ac4232cf5850b67fa5cc46477a9e9 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -961,11 +961,13 @@ public abstract class PlayerList { +@@ -973,11 +973,13 @@ public abstract class PlayerList { } public void savePlayers() { diff --git a/Spigot-Server-Patches/0136-Don-t-allow-entities-to-ride-themselves-572.patch b/Spigot-Server-Patches/0136-Don-t-allow-entities-to-ride-themselves-572.patch index a03971152b..119f6c7238 100644 --- a/Spigot-Server-Patches/0136-Don-t-allow-entities-to-ride-themselves-572.patch +++ b/Spigot-Server-Patches/0136-Don-t-allow-entities-to-ride-themselves-572.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow entities to ride themselves - #572 diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 393a2d3ede8e82b33979f18e0cda796bf003f8ef..bd270ea92404c2055c09324988e1ec28109a8815 100644 +index 17cc2b686e33c6de0ab9db6aa7cbc56dac6abcdf..df77b4e6d5fb3e0ff795ae36402b4c902a613225 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1950,6 +1950,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1945,6 +1945,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } protected boolean addPassenger(Entity entity) { // CraftBukkit diff --git a/Spigot-Server-Patches/0137-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/Spigot-Server-Patches/0137-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index aed5f815b8..f37fd8b40b 100644 --- a/Spigot-Server-Patches/0137-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/Spigot-Server-Patches/0137-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -8,22 +8,22 @@ Adds lots of information about why this orb exists. Replaces isFromBottle() with logic that persists entity reloads too. diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 3cc572b0ce757160c7ab4733b98d8ca84f9f325a..247d9300a755aa22c2ca3bcef86b3b25f3ed75ee 100644 +index d847326b0099a0c05a085d5d62de630491c9ac56..b537385d12463adc82751e40b479b047b32fa5bd 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -236,13 +236,13 @@ public class Block extends BlockBase implements IMaterial { +@@ -228,13 +228,13 @@ public class Block extends BlockBase implements IMaterial { } } -- protected void dropExperience(World world, BlockPosition blockposition, int i) { -+ protected void dropExperience(World world, BlockPosition blockposition, int i, EntityPlayer player) { // Paper - if (!world.isClientSide && world.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) { +- protected void dropExperience(WorldServer worldserver, BlockPosition blockposition, int i) { ++ protected void dropExperience(WorldServer worldserver, BlockPosition blockposition, int i, EntityPlayer player) { // Paper + if (worldserver.getGameRules().getBoolean(GameRules.DO_TILE_DROPS)) { while (i > 0) { int j = EntityExperienceOrb.getOrbValue(i); i -= j; -- world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j)); -+ world.addEntity(new EntityExperienceOrb(world, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.BLOCK_BREAK, player)); // Paper +- worldserver.addEntity(new EntityExperienceOrb(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j)); ++ worldserver.addEntity(new EntityExperienceOrb(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D, j, org.bukkit.entity.ExperienceOrb.SpawnReason.BLOCK_BREAK, player)); // Paper } } @@ -41,20 +41,20 @@ index 5bdb0c3a7a04a55cd5ddff8e375497e402408811..fe9a083b724a8657cac8462b3f44d3cc world.triggerEffect(1042, blockposition, 0); diff --git a/src/main/java/net/minecraft/server/EntityAnimal.java b/src/main/java/net/minecraft/server/EntityAnimal.java -index b09d7bccf6faae08284e905a8bad0c8f75f59109..b1a41ca53462e50dc0d5cabfcd91579908c07b62 100644 +index 783cd9dbf423986d2e5cd52b05d7046e019c0b7a..2a68591c1d56f39551d0b37187b51320298787b4 100644 --- a/src/main/java/net/minecraft/server/EntityAnimal.java +++ b/src/main/java/net/minecraft/server/EntityAnimal.java @@ -237,7 +237,7 @@ public abstract class EntityAnimal extends EntityAgeable { - if (world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { + if (worldserver.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { // CraftBukkit start - use event experience if (experience > 0) { -- world.addEntity(new EntityExperienceOrb(world, this.locX(), this.locY(), this.locZ(), experience)); -+ world.addEntity(new EntityExperienceOrb(world, this.locX(), this.locY(), this.locZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper +- worldserver.addEntity(new EntityExperienceOrb(worldserver, this.locX(), this.locY(), this.locZ(), experience)); ++ worldserver.addEntity(new EntityExperienceOrb(worldserver, this.locX(), this.locY(), this.locZ(), experience, org.bukkit.entity.ExperienceOrb.SpawnReason.BREED, entityplayer, entityageable)); // Paper } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 72a9430789301b264a36c5060ded31ccdc4a1ebf..05b7cdb33b45a4f503cd7fe4130b54d59e7b6452 100644 +index 1627fdb2ef8551e1c63034b496a2c9bfb12d0e38..6ad63e5bb4b7bec976d1aef74547ff96f64204c6 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -612,7 +612,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -67,7 +67,7 @@ index 72a9430789301b264a36c5060ded31ccdc4a1ebf..05b7cdb33b45a4f503cd7fe4130b54d5 } diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index c13a47382d0a7456fa5035a64f42a6ed5e9f1c8e..d9a0cd1e90445ff7a1d9e7cef2f71e27bd3686cb 100644 +index 604bdc5ab98071db88ac3e93ebf11869cc60a308..deebd63e0297b245b82a620bc380c9f1a502027b 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -16,9 +16,59 @@ public class EntityExperienceOrb extends Entity { @@ -147,10 +147,10 @@ index c13a47382d0a7456fa5035a64f42a6ed5e9f1c8e..d9a0cd1e90445ff7a1d9e7cef2f71e27 @Override diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java -index 13b46c59b9a017bfa985ad74f80eca77608d1891..03c6a81346857392aacb22a0947bdc6391a260f2 100644 +index bb1cb3a0a82ff3ef878aa591483b30eeab6fdc61..5c2f6b0454f44c4b85cfd6d06eee584dfa0e0c6d 100644 --- a/src/main/java/net/minecraft/server/EntityFishingHook.java +++ b/src/main/java/net/minecraft/server/EntityFishingHook.java -@@ -454,7 +454,7 @@ public class EntityFishingHook extends IProjectile { +@@ -452,7 +452,7 @@ public class EntityFishingHook extends IProjectile { this.world.addEntity(entityitem); // CraftBukkit start - this.random.nextInt(6) + 1 -> playerFishEvent.getExpToDrop() if (playerFishEvent.getExpToDrop() > 0) { @@ -160,10 +160,10 @@ index 13b46c59b9a017bfa985ad74f80eca77608d1891..03c6a81346857392aacb22a0947bdc63 // CraftBukkit end if (itemstack1.getItem().a((Tag) TagsItem.FISHES)) { diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index c0c0187447976050ea57ae0c4bd62ba7f14c0f6b..95874526516291607a44ae2213d4d6d65edfe18d 100644 +index 13dad7a2db788bf900a48bab0a4ef0c4f4b5ddc3..83fa99b1cf784eb7f30b14f9f0743cbab7136563 100644 --- a/src/main/java/net/minecraft/server/EntityFox.java +++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -1234,7 +1234,7 @@ public class EntityFox extends EntityAnimal { +@@ -1236,7 +1236,7 @@ public class EntityFox extends EntityAnimal { if (this.b.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) { // CraftBukkit start - use event experience if (experience > 0) { @@ -173,10 +173,10 @@ index c0c0187447976050ea57ae0c4bd62ba7f14c0f6b..95874526516291607a44ae2213d4d6d6 // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9618074cfba21a6ced4354df56ecd035521bbe69..ed25f93bdb62104f6114e1ecc5e62d5e55bc3b05 100644 +index 61b4e385ceae74d75db6e1f1942a133a2e843773..8627486dab34f1dccdab96e42d2d429ac78b2e77 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1486,7 +1486,8 @@ public abstract class EntityLiving extends Entity { +@@ -1487,7 +1487,8 @@ public abstract class EntityLiving extends Entity { int j = EntityExperienceOrb.getOrbValue(i); i -= j; @@ -200,7 +200,7 @@ index 7a80b341ee7734cc289abdff8755834447cbef75..2d3ca8c424f2088027d51066d634c487 this.die(); diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index 13c8fab8a57eb3f90abb4bbc5a6c5b5f8bdad0d2..dd745894614982fad6277e77b98bed75fc2a2f55 100644 +index acd91ec21e2754b9969e203bd56de8a0f369c6c2..40a632434e43211710815944ad4aefa207f78780 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -499,7 +499,7 @@ public class EntityTurtle extends EntityAnimal { @@ -213,7 +213,7 @@ index 13c8fab8a57eb3f90abb4bbc5a6c5b5f8bdad0d2..dd745894614982fad6277e77b98bed75 } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index d0b04707e830fbaf3a6bfe92637e4432172fd9c7..00183a7f6e2000ce045ce50454f1296c4c93b148 100644 +index 17ae6530bda22144866e94e8449220d108084fe5..ea7fff8ff9922e038f71e887072c567cded10973 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -532,7 +532,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @@ -226,7 +226,7 @@ index d0b04707e830fbaf3a6bfe92637e4432172fd9c7..00183a7f6e2000ce045ce50454f1296c } diff --git a/src/main/java/net/minecraft/server/EntityVillagerTrader.java b/src/main/java/net/minecraft/server/EntityVillagerTrader.java -index e3a80bddc59c8f148a6a195deb3e8fa85fba4c7b..a0841cfaf950508b73b43a5fadbc1796015e5dbb 100644 +index c830b3c2145effc16314c6216be8af935416cb58..f1a509063c09e603140c74255a3fb901693d2cc5 100644 --- a/src/main/java/net/minecraft/server/EntityVillagerTrader.java +++ b/src/main/java/net/minecraft/server/EntityVillagerTrader.java @@ -144,7 +144,7 @@ public class EntityVillagerTrader extends EntityVillagerAbstract { @@ -265,7 +265,7 @@ index d2698e847cfcbc4d2f91b4f5d66b38b47f86c10e..edc4a5c34e8064d900668d132b3496e3 public SlotFurnaceResult(EntityHuman entityhuman, IInventory iinventory, int i, int j, int k) { diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index ba42ca08ca61832cb07bebcfa0b1e5422d7b30e9..623cd63711c6cb79dce7a46056e193fdb13334a5 100644 +index a3ddf7be4c7ea588098381b8f05b2bad5b388853..99b20fa5feff0f766124d4ec9474852e33e329f2 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -573,7 +573,7 @@ public abstract class TileEntityFurnace extends TileEntityContainer implements I @@ -278,10 +278,10 @@ index ba42ca08ca61832cb07bebcfa0b1e5422d7b30e9..623cd63711c6cb79dce7a46056e193fd } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index afc7263644c0bf45769dbdb6801d025c49e8d323..214e3d1a626a3a3ff523904d15aec1e351b9957b 100644 +index 948639d629d0126c914b1b4d20f7dfaa6137e63e..be55c6c63607f14d457b24b381fcf213d36f6f33 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1817,7 +1817,7 @@ public class CraftWorld implements World { +@@ -1805,7 +1805,7 @@ public class CraftWorld implements World { } else if (TNTPrimed.class.isAssignableFrom(clazz)) { entity = new EntityTNTPrimed(world, x, y, z, null); } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { diff --git a/Spigot-Server-Patches/0138-Cap-Entity-Collisions.patch b/Spigot-Server-Patches/0138-Cap-Entity-Collisions.patch index ade65b34bb..de5eb3ed93 100644 --- a/Spigot-Server-Patches/0138-Cap-Entity-Collisions.patch +++ b/Spigot-Server-Patches/0138-Cap-Entity-Collisions.patch @@ -27,10 +27,10 @@ index 255b4081314162cbe344b008158c6f4584795fb8..04ee0856a8c62e1afb438d4fddf40e60 + } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index bd270ea92404c2055c09324988e1ec28109a8815..912f5be0264b604df175f5825765b03b319a841c 100644 +index df77b4e6d5fb3e0ff795ae36402b4c902a613225..6684e17974e498108352870c3b5535cc6c8f63c0 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -185,6 +185,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -39,10 +39,10 @@ index bd270ea92404c2055c09324988e1ec28109a8815..912f5be0264b604df175f5825765b03b // Spigot end diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ed25f93bdb62104f6114e1ecc5e62d5e55bc3b05..8e5713b4a0ce5d6039a4718d2380a0bf7928e72d 100644 +index 8627486dab34f1dccdab96e42d2d429ac78b2e77..6aa83e4d5e734d32863f8c4421f3c8ebdb01efab 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2776,8 +2776,11 @@ public abstract class EntityLiving extends Entity { +@@ -2779,8 +2779,11 @@ public abstract class EntityLiving extends Entity { } } diff --git a/Spigot-Server-Patches/0140-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch b/Spigot-Server-Patches/0140-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch index 293fd16f1c..abdd74f66c 100644 --- a/Spigot-Server-Patches/0140-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch +++ b/Spigot-Server-Patches/0140-Make-targetSize-more-aggressive-in-the-chunk-unload-.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Make targetSize more aggressive in the chunk unload queue diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 2b4033cb2b3d42b776afb9c219d2f64b6c6b1e79..465beba397f05a31dcda9840375a0e9b97153e78 100644 +index 0542dde09d288488b88e17a044cc508d5d39782f..9c520643f415d5952a59c99da2a7726aae8d7ce3 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -75,7 +75,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { diff --git a/Spigot-Server-Patches/0141-Do-not-let-armorstands-drown.patch b/Spigot-Server-Patches/0141-Do-not-let-armorstands-drown.patch index 7d674d774b..76aa08b1de 100644 --- a/Spigot-Server-Patches/0141-Do-not-let-armorstands-drown.patch +++ b/Spigot-Server-Patches/0141-Do-not-let-armorstands-drown.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Do not let armorstands drown diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 3571ef9ac1299702ad274aad43070abf959bf9d9..0232ffba7b18174e0ce44d91285541a9869d07b9 100644 +index 73e5bd74f6f9b1532d4abf8d8a0383c851daf35f..9017b98799bde141002282a2709a3ad943999ccb 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -826,5 +826,10 @@ public class EntityArmorStand extends EntityLiving { +@@ -830,5 +830,10 @@ public class EntityArmorStand extends EntityLiving { super.move(moveType, vec3d); } } @@ -20,7 +20,7 @@ index 3571ef9ac1299702ad274aad43070abf959bf9d9..0232ffba7b18174e0ce44d91285541a9 // Paper end } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 0799f3b025c25204fddfd818b314ec1452a1ba1a..34f2821a64c7893ff0a8c33ae4b77ce883227f0c 100644 +index 6aa83e4d5e734d32863f8c4421f3c8ebdb01efab..729726782446085a6c3b811c4b540ff154c6c115 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -244,6 +244,7 @@ public abstract class EntityLiving extends Entity { diff --git a/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch b/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch index 11cd334237..d0fec90b2e 100644 --- a/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch +++ b/Spigot-Server-Patches/0142-Properly-handle-async-calls-to-restart-the-server.patch @@ -30,7 +30,7 @@ will have plugins and worlds saving to the disk has a high potential to result in corruption/dataloss. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 793d4d928bac4febf090291eb773871b492cdc6d..28478370fc182751178f7dd6c20435218174c700 100644 +index b9e757b94d7c00b8bea23102417b2afbe7eccd7a..42365b2f183a08e799533c1e9757cca13729d8fe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -91,6 +91,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -41,7 +41,7 @@ index 793d4d928bac4febf090291eb773871b492cdc6d..28478370fc182751178f7dd6c2043521 private boolean isStopped; private int ticks; protected final Proxy proxy; -@@ -741,7 +742,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -739,7 +740,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas if (this.playerList != null) { MinecraftServer.LOGGER.info("Saving players"); this.playerList.savePlayers(); @@ -50,7 +50,7 @@ index 793d4d928bac4febf090291eb773871b492cdc6d..28478370fc182751178f7dd6c2043521 try { Thread.sleep(100); } catch (InterruptedException ex) {} // CraftBukkit - SPIGOT-625 - give server at least a chance to send packets } -@@ -806,8 +807,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -804,8 +805,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas return this.isRunning; } @@ -64,7 +64,7 @@ index 793d4d928bac4febf090291eb773871b492cdc6d..28478370fc182751178f7dd6c2043521 if (flag) { try { this.serverThread.join(); -@@ -817,6 +823,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -815,6 +821,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } } @@ -73,10 +73,10 @@ index 793d4d928bac4febf090291eb773871b492cdc6d..28478370fc182751178f7dd6c2043521 // Spigot Start private static double calcTps(double avg, double exp, double tps) diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8bc8c20f0cbf909bd11f360d14926ba29637f779..ae75b114a1aee1bf267c678c581bbde4e875f963 100644 +index 8c2d49215f4ac4232cf5850b67fa5cc46477a9e9..6e4fb963cb5d8962a3021b1a614f81b08cb10bdb 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1072,10 +1072,15 @@ public abstract class PlayerList { +@@ -1084,10 +1084,15 @@ public abstract class PlayerList { entityplayer.playerInteractManager.b(worldserver.worldDataServer.getGameType()); // CraftBukkit } @@ -93,7 +93,7 @@ index 8bc8c20f0cbf909bd11f360d14926ba29637f779..ae75b114a1aee1bf267c678c581bbde4 } // CraftBukkit end -@@ -1087,6 +1092,7 @@ public abstract class PlayerList { +@@ -1099,6 +1104,7 @@ public abstract class PlayerList { } // Paper end } diff --git a/Spigot-Server-Patches/0143-Add-system-property-to-disable-book-size-limits.patch b/Spigot-Server-Patches/0143-Add-system-property-to-disable-book-size-limits.patch index 96849e6ed9..954456324c 100644 --- a/Spigot-Server-Patches/0143-Add-system-property-to-disable-book-size-limits.patch +++ b/Spigot-Server-Patches/0143-Add-system-property-to-disable-book-size-limits.patch @@ -11,7 +11,7 @@ to make books with as much data as they want. Do not use this without limiting incoming data from packets in some other way. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java -index d06262eb474ebd105b075282a1d70f2dfe84b9c3..26ff2f80c9ea4985d5a51eaaa1da9bd13648f2dd 100644 +index adc926f25c938fc0ba25586206d7daf89c6b7773..95ec299687cd4410146f71bd3429bd12ac291a26 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java @@ -35,6 +35,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta { diff --git a/Spigot-Server-Patches/0144-Add-option-to-make-parrots-stay-on-shoulders-despite.patch b/Spigot-Server-Patches/0144-Add-option-to-make-parrots-stay-on-shoulders-despite.patch index 8c3dc372e9..e81fe40e70 100644 --- a/Spigot-Server-Patches/0144-Add-option-to-make-parrots-stay-on-shoulders-despite.patch +++ b/Spigot-Server-Patches/0144-Add-option-to-make-parrots-stay-on-shoulders-despite.patch @@ -26,7 +26,7 @@ index 04ee0856a8c62e1afb438d4fddf40e605e82a074..0cc7ad571eba249199a2e5e8ec567a87 + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index d1cf7602a0c47723593be11c030d3c819426d4d4..0dc2ffcfceeffed2cb949d31c4f976bce639f110 100644 +index 485b69140f72a22b3eae53be74bcad003dd92e8f..196d1a7fa8ac9249ca061a704b2403c7bf1f4eb1 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -436,7 +436,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -39,10 +39,10 @@ index d1cf7602a0c47723593be11c030d3c819426d4d4..0dc2ffcfceeffed2cb949d31c4f976bc } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e04bb290a94f5cfc93b5bd2121e6b32610199237..f62357be4225fa48dd445f0843c99235276566c7 100644 +index cadeb30ef8f31fcc0d626c2cc7f079c3e778704d..bc084ade77cff987c41d148ce85fc61d6efb5feb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1818,6 +1818,13 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1812,6 +1812,13 @@ public class PlayerConnection implements PacketListenerPlayIn { switch (packetplayinentityaction.c()) { case PRESS_SHIFT_KEY: this.player.setSneaking(true); diff --git a/Spigot-Server-Patches/0145-Add-configuration-option-to-prevent-player-names-fro.patch b/Spigot-Server-Patches/0145-Add-configuration-option-to-prevent-player-names-fro.patch index ba0cac3c6a..c14a5efb3c 100644 --- a/Spigot-Server-Patches/0145-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/Spigot-Server-Patches/0145-Add-configuration-option-to-prevent-player-names-fro.patch @@ -20,10 +20,10 @@ index c4086de778cc2ccc958b1a94dd6e9cdb5065076c..5fa63d7ca20b88a44d8800b3ebf74e4c + } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c98157c561d1c75499f0a8cb8580a04aef24f2a1..e1f205ae83ed537bc7f73647c1518e383e046de0 100644 +index b233e48ce7cd173bad6f596f27ed920706e2fdfb..38d57b4769324c65ffa0812e8cc343ba0736a50e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2223,5 +2223,10 @@ public final class CraftServer implements Server { +@@ -2217,5 +2217,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch index 871305c843..018709a41f 100644 --- a/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/Spigot-Server-Patches/0146-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -19,7 +19,7 @@ Other changes: configuration diff --git a/pom.xml b/pom.xml -index 52834690de9f07c9c4838dbef50031567c1a72dc..6b4f56744d11029bdbac5479b45c88736f338fa9 100644 +index 3dfb494e1f09da7a6ebf6c740d4e9e06eb7d4121..acb8c50c14b3bf4cc2468a426b93196117882d88 100644 --- a/pom.xml +++ b/pom.xml @@ -44,10 +44,27 @@ @@ -144,7 +144,7 @@ index 0000000000000000000000000000000000000000..685deaa0e5d1ddc13e3a7c0471b1cfcf + +} diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index ce285b97cbdc9d74504d073fc659c295300dd720..af839f432d410601fbbe06b665e4e0fad801c17d 100644 +index 56a3ef812966f9dce9c53b105a56e1761cdb467b..44da68eb8e7c01800156e157cf7bc1c9003bef59 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -62,6 +62,9 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -186,7 +186,7 @@ index ce285b97cbdc9d74504d073fc659c295300dd720..af839f432d410601fbbe06b665e4e0fa System.setOut(new PrintStream(new LoggerOutputStream(logger, Level.INFO), true)); System.setErr(new PrintStream(new LoggerOutputStream(logger, Level.WARN), true)); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 28478370fc182751178f7dd6c20435218174c700..737159212c5139ba07dca2484c6cce8946167dba 100644 +index 42365b2f183a08e799533c1e9757cca13729d8fe..b10dc2e552a43cd632aaee336203ddccc64d43b9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -58,7 +58,7 @@ import org.apache.logging.log4j.LogManager; @@ -226,7 +226,7 @@ index 28478370fc182751178f7dd6c20435218174c700..737159212c5139ba07dca2484c6cce89 Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); } // CraftBukkit end -@@ -979,7 +983,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -977,7 +981,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas org.spigotmc.WatchdogThread.doStop(); // Spigot // CraftBukkit start - Restore terminal to original settings try { @@ -235,7 +235,7 @@ index 28478370fc182751178f7dd6c20435218174c700..737159212c5139ba07dca2484c6cce89 } catch (Exception ignored) { } // CraftBukkit end -@@ -1350,7 +1354,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1348,7 +1352,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @Override public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) { @@ -245,7 +245,7 @@ index 28478370fc182751178f7dd6c20435218174c700..737159212c5139ba07dca2484c6cce89 public KeyPair getKeyPair() { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index ae75b114a1aee1bf267c678c581bbde4e875f963..6f4a9603c30433e938ea73e69c8f7a6072f347da 100644 +index 6e4fb963cb5d8962a3021b1a614f81b08cb10bdb..847e132803afcedfaadbeb037f193841272942b7 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -79,8 +79,7 @@ public abstract class PlayerList { @@ -259,7 +259,7 @@ index ae75b114a1aee1bf267c678c581bbde4e875f963..6f4a9603c30433e938ea73e69c8f7a60 this.k = new GameProfileBanList(PlayerList.b); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e1f205ae83ed537bc7f73647c1518e383e046de0..0d4fe1690c375fb84d428f40655e3af2cb4baae5 100644 +index 38d57b4769324c65ffa0812e8cc343ba0736a50e..fb2bc9fabefc5126b56979247ca0273c080605cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -46,7 +46,7 @@ import java.util.function.Consumer; @@ -271,7 +271,7 @@ index e1f205ae83ed537bc7f73647c1518e383e046de0..0d4fe1690c375fb84d428f40655e3af2 import net.minecraft.server.Advancement; import net.minecraft.server.ArgumentEntity; import net.minecraft.server.BiomeManager; -@@ -1198,9 +1198,13 @@ public final class CraftServer implements Server { +@@ -1192,9 +1192,13 @@ public final class CraftServer implements Server { return logger; } @@ -286,7 +286,7 @@ index e1f205ae83ed537bc7f73647c1518e383e046de0..0d4fe1690c375fb84d428f40655e3af2 @Override public PluginCommand getPluginCommand(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 46ccad51bb60be735cee5f22fef234298882c6e4..2c0df8892461be6a139a36964f52c85fb8e28bcb 100644 +index 463915ca7afa9a6f4337590e9c289fa23148aea8..a6f1d016696bd4feb836d5d12358b53ec9347c0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -12,7 +12,7 @@ import java.util.logging.Level; diff --git a/Spigot-Server-Patches/0147-provide-a-configurable-option-to-disable-creeper-lin.patch b/Spigot-Server-Patches/0147-provide-a-configurable-option-to-disable-creeper-lin.patch index 682daa1e7d..a8d8aa12de 100644 --- a/Spigot-Server-Patches/0147-provide-a-configurable-option-to-disable-creeper-lin.patch +++ b/Spigot-Server-Patches/0147-provide-a-configurable-option-to-disable-creeper-lin.patch @@ -21,7 +21,7 @@ index 0cc7ad571eba249199a2e5e8ec567a874241c903..e30f48caf2ce4f48f371b2594b765c27 + } } diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index 302f795f27d67c1ce5257d3a8584866ffb5d2fef..af9ac84c2caf42d0714d6050ee7db7e39a47878b 100644 +index 5c6d48ef6e2159a5d74b83e64bace61eaad97aec..749c6e21cbd01a81196476728def640ba46a5783 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -226,7 +226,7 @@ public class EntityCreeper extends EntityMonster { diff --git a/Spigot-Server-Patches/0148-Item-canEntityPickup.patch b/Spigot-Server-Patches/0148-Item-canEntityPickup.patch index b8a554bc25..e665efa259 100644 --- a/Spigot-Server-Patches/0148-Item-canEntityPickup.patch +++ b/Spigot-Server-Patches/0148-Item-canEntityPickup.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Item#canEntityPickup diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 9715f10c790c0210435622ab9997ac40f98da185..a6aa7a1a8da787604b2d8f3f9ea119d4b6bc188d 100644 +index 69acb0f17577cb46a0302f1d6bbb3a42924aeda9..3b12724a7bfa7a901261ff0c67338a08ccc1fc6f 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -539,6 +539,11 @@ public abstract class EntityInsentient extends EntityLiving { @@ -21,7 +21,7 @@ index 9715f10c790c0210435622ab9997ac40f98da185..a6aa7a1a8da787604b2d8f3f9ea119d4 } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index ca1cc67fea6f1607a2d3d7869a0a023616c02ff7..159552192c2a6d62fb205ed5973f89a16e619d94 100644 +index 5c88bb23d1916cc2c0842c0df79a5d5de67fad70..a3266ba0e35d7a267ba477f38f8ad6a2a109dfa5 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -20,6 +20,7 @@ public class EntityItem extends Entity { diff --git a/Spigot-Server-Patches/0149-PlayerPickupItemEvent-setFlyAtPlayer.patch b/Spigot-Server-Patches/0149-PlayerPickupItemEvent-setFlyAtPlayer.patch index b3d01ce2d6..193382bc41 100644 --- a/Spigot-Server-Patches/0149-PlayerPickupItemEvent-setFlyAtPlayer.patch +++ b/Spigot-Server-Patches/0149-PlayerPickupItemEvent-setFlyAtPlayer.patch @@ -5,10 +5,10 @@ Subject: [PATCH] PlayerPickupItemEvent#setFlyAtPlayer diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 159552192c2a6d62fb205ed5973f89a16e619d94..2546a706ef107fd94e4c17c10091d6c0a7241a70 100644 +index a3266ba0e35d7a267ba477f38f8ad6a2a109dfa5..96a7310a1f275ac6380084ba0eebb79f1a0fec1e 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -331,6 +331,7 @@ public class EntityItem extends Entity { +@@ -336,6 +336,7 @@ public class EntityItem extends Entity { // CraftBukkit start - fire PlayerPickupItemEvent int canHold = entityhuman.inventory.canHold(itemstack); int remaining = i - canHold; @@ -16,7 +16,7 @@ index 159552192c2a6d62fb205ed5973f89a16e619d94..2546a706ef107fd94e4c17c10091d6c0 if (this.pickupDelay <= 0 && canHold > 0) { itemstack.setCount(canHold); -@@ -338,8 +339,14 @@ public class EntityItem extends Entity { +@@ -343,8 +344,14 @@ public class EntityItem extends Entity { PlayerPickupItemEvent playerEvent = new PlayerPickupItemEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), (org.bukkit.entity.Item) this.getBukkitEntity(), remaining); playerEvent.setCancelled(!entityhuman.canPickUpLoot); this.world.getServer().getPluginManager().callEvent(playerEvent); @@ -31,7 +31,7 @@ index 159552192c2a6d62fb205ed5973f89a16e619d94..2546a706ef107fd94e4c17c10091d6c0 return; } -@@ -363,7 +370,11 @@ public class EntityItem extends Entity { +@@ -373,7 +380,11 @@ public class EntityItem extends Entity { // CraftBukkit end if (this.pickupDelay == 0 && (this.owner == null || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { diff --git a/Spigot-Server-Patches/0150-PlayerAttemptPickupItemEvent.patch b/Spigot-Server-Patches/0150-PlayerAttemptPickupItemEvent.patch index 59b70943db..4fcf2f013b 100644 --- a/Spigot-Server-Patches/0150-PlayerAttemptPickupItemEvent.patch +++ b/Spigot-Server-Patches/0150-PlayerAttemptPickupItemEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerAttemptPickupItemEvent diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 2546a706ef107fd94e4c17c10091d6c0a7241a70..cc173445caa0a064e724bc29b4955232a1dc1816 100644 +index 96a7310a1f275ac6380084ba0eebb79f1a0fec1e..8eab278382a937da80b97a7dea212ca960d42289 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -9,6 +9,7 @@ import javax.annotation.Nullable; @@ -16,7 +16,7 @@ index 2546a706ef107fd94e4c17c10091d6c0a7241a70..cc173445caa0a064e724bc29b4955232 public class EntityItem extends Entity { -@@ -333,6 +334,22 @@ public class EntityItem extends Entity { +@@ -338,6 +339,22 @@ public class EntityItem extends Entity { int remaining = i - canHold; boolean flyAtPlayer = false; // Paper diff --git a/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch b/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch index e130c6ebae..37f841c7b8 100644 --- a/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch +++ b/Spigot-Server-Patches/0151-Add-UnknownCommandEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0d4fe1690c375fb84d428f40655e3af2cb4baae5..30b0fe2f9168de8549481909e5d32cbd8ce4d09d 100644 +index fb2bc9fabefc5126b56979247ca0273c080605cc..c9726b9fde2a1df09022f7a82ae91cd87693c873 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -105,6 +105,7 @@ import net.minecraft.server.WorldNBTStorage; +@@ -104,6 +104,7 @@ import net.minecraft.server.WorldNBTStorage; import net.minecraft.server.WorldServer; import net.minecraft.server.WorldSettings; import org.apache.commons.lang.Validate; @@ -16,7 +16,7 @@ index 0d4fe1690c375fb84d428f40655e3af2cb4baae5..30b0fe2f9168de8549481909e5d32cbd import org.bukkit.BanList; import org.bukkit.Bukkit; import org.bukkit.ChatColor; -@@ -177,6 +178,7 @@ import org.bukkit.craftbukkit.util.Versioning; +@@ -176,6 +177,7 @@ import org.bukkit.craftbukkit.util.Versioning; import org.bukkit.craftbukkit.util.permissions.CraftDefaultPermissions; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -24,7 +24,7 @@ index 0d4fe1690c375fb84d428f40655e3af2cb4baae5..30b0fe2f9168de8549481909e5d32cbd import org.bukkit.event.inventory.InventoryType; import org.bukkit.event.player.PlayerChatTabCompleteEvent; import org.bukkit.event.server.BroadcastMessageEvent; -@@ -785,7 +787,13 @@ public final class CraftServer implements Server { +@@ -784,7 +786,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { diff --git a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch index 431ed9ed5e..cb87118814 100644 --- a/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch +++ b/Spigot-Server-Patches/0152-Basic-PlayerProfile-API.patch @@ -423,22 +423,23 @@ index 0000000000000000000000000000000000000000..3aceb0ea8a1a3ed94dd8a9e954c52ecd + } +} diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index da7a325d070e194cd1664ed20dcb3a762c9a517a..797654c653ec6dc4d46b457cf8a6121b29eca7aa 100644 +index 17d73ebbe51a83f79f338bdb1b366cecd99f880d..39174bca00b4535e92f6b325b3fd058ceae41f8b 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -1,8 +1,11 @@ +@@ -1,9 +1,12 @@ package net.minecraft.server; import com.destroystokyo.paper.block.TargetBlockInfo; +import com.destroystokyo.paper.profile.CraftPlayerProfile; +import com.destroystokyo.paper.profile.PlayerProfile; import com.google.common.util.concurrent.ThreadFactoryBuilder; + import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; import org.apache.commons.lang.exception.ExceptionUtils; +import com.mojang.authlib.GameProfile; import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftWorld; -@@ -337,6 +340,10 @@ public final class MCUtil { +@@ -338,6 +341,10 @@ public final class MCUtil { return run.get(); } @@ -450,10 +451,10 @@ index da7a325d070e194cd1664ed20dcb3a762c9a517a..797654c653ec6dc4d46b457cf8a6121b * Calculates distance between 2 entities * @param e1 diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 11ad9ca7d030895662903a09558fd353dcc3e49e..52476513405a28b4125170650ff53a07deba0ec2 100644 +index 059b9634aeffc6f710d40112f5f8d9b877f2c7a3..d80235349ea8cc868b720b69f7f0812184e895c8 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -93,7 +93,7 @@ public class Main { +@@ -94,7 +94,7 @@ public class Main { } File file = (File) optionset.valueOf("universe"); // CraftBukkit @@ -463,28 +464,28 @@ index 11ad9ca7d030895662903a09558fd353dcc3e49e..52476513405a28b4125170650ff53a07 GameProfileRepository gameprofilerepository = yggdrasilauthenticationservice.createProfileRepository(); UserCache usercache = new UserCache(gameprofilerepository, new File(file, MinecraftServer.b.getName())); diff --git a/src/main/java/net/minecraft/server/UserCache.java b/src/main/java/net/minecraft/server/UserCache.java -index 4f769211cf98c3da720a904da3dcdcd4c7611f0b..a038397028848edb4f43cd4f7262546666e32883 100644 +index 7171bdf7fb0489e9678588dfa33410984015ea3f..2484293b12d9ec88b8a2570aa853a12f0d858193 100644 --- a/src/main/java/net/minecraft/server/UserCache.java +++ b/src/main/java/net/minecraft/server/UserCache.java -@@ -43,7 +43,7 @@ public class UserCache { +@@ -42,7 +42,7 @@ public class UserCache { - public static final SimpleDateFormat a = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); - private static boolean c; -- private final Map<String, UserCache.UserCacheEntry> d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper -+ private final Map<String, UserCache.UserCacheEntry> d = new java.util.concurrent.ConcurrentHashMap<>();private final Map<String, UserCache.UserCacheEntry> nameCache = d; // Paper - OBFHELPER // Paper - private final Map<UUID, UserCache.UserCacheEntry> e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - private final Deque<GameProfile> f = new java.util.concurrent.LinkedBlockingDeque<GameProfile>(); // CraftBukkit - private final GameProfileRepository g; -@@ -93,6 +93,7 @@ public class UserCache { - return UserCache.c; + private static final Logger LOGGER = LogManager.getLogger(); + private static boolean b; +- private final Map<String, UserCache.UserCacheEntry> c = Maps.newConcurrentMap(); ++ private final Map<String, UserCache.UserCacheEntry> c = Maps.newConcurrentMap();private final Map<String, UserCache.UserCacheEntry> nameCache = c; // Paper - OBFHELPER // Paper + private final Map<UUID, UserCache.UserCacheEntry> d = Maps.newConcurrentMap(); + private final GameProfileRepository e; + private final Gson f = (new GsonBuilder()).create(); +@@ -106,6 +106,7 @@ public class UserCache { + return UserCache.b; } + public void saveProfile(GameProfile gameprofile) { a(gameprofile); } // Paper - OBFHELPER - public void a(GameProfile gameprofile) { - this.a(gameprofile, (Date) null); - } -@@ -154,6 +155,13 @@ public class UserCache { - return usercache_usercacheentry == null ? null : usercache_usercacheentry.a(); + public synchronized void a(GameProfile gameprofile) { // Paper - synchronize + Calendar calendar = Calendar.getInstance(); + +@@ -155,6 +156,13 @@ public class UserCache { + return gameprofile; } + // Paper start @@ -496,21 +497,21 @@ index 4f769211cf98c3da720a904da3dcdcd4c7611f0b..a038397028848edb4f43cd4f72625466 + @Nullable public GameProfile getProfile(UUID uuid) { - UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.e.get(uuid); -@@ -262,7 +270,7 @@ public class UserCache { + UserCache.UserCacheEntry usercache_usercacheentry = (UserCache.UserCacheEntry) this.d.get(uuid); +@@ -337,7 +345,7 @@ public class UserCache { - class UserCacheEntry { + static class UserCacheEntry { -- private final GameProfile b; -+ private final GameProfile b;public GameProfile getProfile() { return b; } // Paper - OBFHELPER - private final Date c; +- private final GameProfile a; ++ private final GameProfile a;public GameProfile getProfile() { return a; } // Paper - OBFHELPER + private final Date b; + private volatile long c; - private UserCacheEntry(GameProfile gameprofile, Date date) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 30b0fe2f9168de8549481909e5d32cbd8ce4d09d..dd439acf4985ee7f4f329c63060988c10c6671f3 100644 +index c9726b9fde2a1df09022f7a82ae91cd87693c873..f7943251b81c06fcc7fc6b3eea80c521fd3f555d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -227,6 +227,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; +@@ -226,6 +226,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; import net.md_5.bungee.api.chat.BaseComponent; // Spigot @@ -520,7 +521,7 @@ index 30b0fe2f9168de8549481909e5d32cbd8ce4d09d..dd439acf4985ee7f4f329c63060988c1 public final class CraftServer implements Server { private final String serverName = "Paper"; // Paper private final String serverVersion; -@@ -2240,5 +2243,24 @@ public final class CraftServer implements Server { +@@ -2234,5 +2237,24 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0153-Shoulder-Entities-Release-API.patch b/Spigot-Server-Patches/0153-Shoulder-Entities-Release-API.patch index 0306aff2de..2e9505af2e 100644 --- a/Spigot-Server-Patches/0153-Shoulder-Entities-Release-API.patch +++ b/Spigot-Server-Patches/0153-Shoulder-Entities-Release-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Shoulder Entities Release API diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 0dc2ffcfceeffed2cb949d31c4f976bce639f110..69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0 100644 +index 196d1a7fa8ac9249ca061a704b2403c7bf1f4eb1..b64eecae09241360b6997200f931eb3a63470dab 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1779,20 +1779,44 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1783,20 +1783,44 @@ public abstract class EntityHuman extends EntityLiving { } @@ -58,7 +58,7 @@ index 0dc2ffcfceeffed2cb949d31c4f976bce639f110..69c0a4c7bfb1c753d544dcd074ad832d @Override public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 60ef17fdb179c3236b8c9d196a17d719d5261fb4..1f715fb44b85f14664affcce9a11928dfc82991b 100644 +index 1f1f53bfdf87315c611dd9e3c9a4f2f79589c8f2..79149583bae9c286a62ff4ea678925109b357775 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -487,6 +487,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/0155-Block-player-logins-during-server-shutdown.patch b/Spigot-Server-Patches/0155-Block-player-logins-during-server-shutdown.patch index 980f5758e7..6f7093cc2c 100644 --- a/Spigot-Server-Patches/0155-Block-player-logins-during-server-shutdown.patch +++ b/Spigot-Server-Patches/0155-Block-player-logins-during-server-shutdown.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Block player logins during server shutdown diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 7c016afc904d6d6958abf73fd0d87a25c9fa41ad..975499bca45acb4ba3196c48e3739310275cfc8b 100644 +index dfdc7598a47cc60d0877d2e48aea017cab92c8a2..a9ec9f123f94df2368347ef9e6673cfb80186cf4 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -48,6 +48,12 @@ public class LoginListener implements PacketLoginInListener { diff --git a/Spigot-Server-Patches/0156-Entity-fromMobSpawner.patch b/Spigot-Server-Patches/0156-Entity-fromMobSpawner.patch index 144ab6012e..5ea662a9dc 100644 --- a/Spigot-Server-Patches/0156-Entity-fromMobSpawner.patch +++ b/Spigot-Server-Patches/0156-Entity-fromMobSpawner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 912f5be0264b604df175f5825765b03b319a841c..2dfc881894753469080a5038c770e126cb19a806 100644 +index 6684e17974e498108352870c3b5535cc6c8f63c0..720bcc7855162a4578129adc5d4749763baa76fd 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -188,6 +188,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -185,6 +185,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -16,7 +16,7 @@ index 912f5be0264b604df175f5825765b03b319a841c..2dfc881894753469080a5038c770e126 protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end -@@ -1582,6 +1583,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1575,6 +1576,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (this.origin != null) { nbttagcompound.set("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ())); } @@ -27,7 +27,7 @@ index 912f5be0264b604df175f5825765b03b319a841c..2dfc881894753469080a5038c770e126 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -1704,6 +1709,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1697,6 +1702,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (!originTag.isEmpty()) { origin = new org.bukkit.Location(world.getWorld(), originTag.getDoubleAt(0), originTag.getDoubleAt(1), originTag.getDoubleAt(2)); } @@ -37,22 +37,22 @@ index 912f5be0264b604df175f5825765b03b319a841c..2dfc881894753469080a5038c770e126 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 2b7f020e00fc1ea456d0155e7e383969aee318b7..5fda5be52ee7dbf29ac791d0f49326dd74ff2d08 100644 +index 259713339217660e8b81a9500f57c6995ea59dde..8eb20c6b9a88d5d4056f91df1f496d3d35b473da 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -140,6 +140,7 @@ public abstract class MobSpawnerAbstract { +@@ -143,6 +143,7 @@ public abstract class MobSpawnerAbstract { + } + // Spigot End } - // Spigot End - } + entity.spawnedViaMobSpawner = true; // Paper - // Spigot Start - if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { - Entity vehicle = entity.getVehicle(); + // Spigot Start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { + Entity vehicle = entity.getVehicle(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 613081685e233074728366b9ff16642c04774c91..66edc6ae67084959503ffa0df2c04174fb29b8d8 100644 +index e7125c8a3a4b8374e3a5ea37dc097d383ba8bdc3..1d3e4d5c88368f89f8b6da40788592362df8c87f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1054,5 +1054,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1060,5 +1060,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { Location origin = getHandle().origin; return origin == null ? null : origin.clone(); } diff --git a/Spigot-Server-Patches/0159-Implement-getI18NDisplayName.patch b/Spigot-Server-Patches/0159-Implement-getI18NDisplayName.patch index 52f768cc48..2349a19f78 100644 --- a/Spigot-Server-Patches/0159-Implement-getI18NDisplayName.patch +++ b/Spigot-Server-Patches/0159-Implement-getI18NDisplayName.patch @@ -8,7 +8,7 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/net/minecraft/server/LocaleLanguage.java b/src/main/java/net/minecraft/server/LocaleLanguage.java -index ea7cb9943dc6da7a05e0841985eb1be4b6bc5169..c83ba9d9869f8ba51df17963d530536d2a08c263 100644 +index cc5b6512fa115f73800b6894a2d58107b6495e07..29d55483510d3644a1edd3a01d7314232c358ac6 100644 --- a/src/main/java/net/minecraft/server/LocaleLanguage.java +++ b/src/main/java/net/minecraft/server/LocaleLanguage.java @@ -29,7 +29,7 @@ public abstract class LocaleLanguage { @@ -20,7 +20,7 @@ index ea7cb9943dc6da7a05e0841985eb1be4b6bc5169..c83ba9d9869f8ba51df17963d530536d try { InputStream inputstream = LocaleLanguage.class.getResourceAsStream("/assets/minecraft/lang/en_us.json"); -@@ -91,10 +91,12 @@ public abstract class LocaleLanguage { +@@ -86,10 +86,12 @@ public abstract class LocaleLanguage { } diff --git a/Spigot-Server-Patches/0160-ProfileWhitelistVerifyEvent.patch b/Spigot-Server-Patches/0160-ProfileWhitelistVerifyEvent.patch index 68338e1861..5d94f97f65 100644 --- a/Spigot-Server-Patches/0160-ProfileWhitelistVerifyEvent.patch +++ b/Spigot-Server-Patches/0160-ProfileWhitelistVerifyEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ProfileWhitelistVerifyEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 6f4a9603c30433e938ea73e69c8f7a6072f347da..628a5f109d6c44ba97876c42aefb5570deef6eb3 100644 +index 847e132803afcedfaadbeb037f193841272942b7..c17245bd2016507cce1cac087e03d3b0f4ee6043 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -540,9 +540,9 @@ public abstract class PlayerList { @@ -20,7 +20,7 @@ index 6f4a9603c30433e938ea73e69c8f7a6072f347da..628a5f109d6c44ba97876c42aefb5570 } else if (getIPBans().isBanned(socketaddress) && !getIPBans().get(socketaddress).hasExpired()) { IpBanEntry ipbanentry = this.l.get(socketaddress); -@@ -923,9 +923,25 @@ public abstract class PlayerList { +@@ -935,9 +935,25 @@ public abstract class PlayerList { this.server.getCommandDispatcher().a(entityplayer); } @@ -46,4 +46,4 @@ index 6f4a9603c30433e938ea73e69c8f7a6072f347da..628a5f109d6c44ba97876c42aefb5570 + // Paper end public boolean isOp(GameProfile gameprofile) { - return this.operators.d(gameprofile) || this.server.a(gameprofile) && this.server.getSaveData().n() || this.v; + return this.operators.d(gameprofile) || this.server.a(gameprofile) && this.server.getSaveData().o() || this.v; diff --git a/Spigot-Server-Patches/0161-Fix-this-stupid-bullshit.patch b/Spigot-Server-Patches/0161-Fix-this-stupid-bullshit.patch index 3f2e7f4e99..b0317bb130 100644 --- a/Spigot-Server-Patches/0161-Fix-this-stupid-bullshit.patch +++ b/Spigot-Server-Patches/0161-Fix-this-stupid-bullshit.patch @@ -9,12 +9,12 @@ modified in order to prevent merge conflicts when Spigot changes/disables the wa and to provide some level of hint without being disruptive. diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 2c0df8892461be6a139a36964f52c85fb8e28bcb..d94d25481000c3cf98affdc2fbdf9fcedbc93d94 100644 +index a6f1d016696bd4feb836d5d12358b53ec9347c0e..7f9aec88ff40c63fc204e7790fb5e5a719a18cf2 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -218,10 +218,12 @@ public class Main { Calendar deadline = Calendar.getInstance(); - deadline.add(Calendar.DAY_OF_YEAR, -21); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { - System.err.println("*** Error, this build is outdated ***"); + // Paper start - This is some stupid bullshit diff --git a/Spigot-Server-Patches/0162-Ocelot-despawns-should-honor-nametags-and-leash.patch b/Spigot-Server-Patches/0162-Ocelot-despawns-should-honor-nametags-and-leash.patch index 6909dbae0d..7067dc37ad 100644 --- a/Spigot-Server-Patches/0162-Ocelot-despawns-should-honor-nametags-and-leash.patch +++ b/Spigot-Server-Patches/0162-Ocelot-despawns-should-honor-nametags-and-leash.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Ocelot despawns should honor nametags and leash diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java -index a88f15546e5cad8da5b342162c05228bdbbf5aad..9c1f019f911a1b91bbfa431e1558dec790624050 100644 +index 1ef2f13cba628305aec1c82a7e2426feccaca0d6..9dc55b78325292e55b2387db6b98dbca022dbbdf 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -81,7 +81,7 @@ public class EntityOcelot extends EntityAnimal { @@ -16,4 +16,4 @@ index a88f15546e5cad8da5b342162c05228bdbbf5aad..9c1f019f911a1b91bbfa431e1558dec7 + return !this.isTrusting() && !this.hasCustomName() && !this.isLeashed() /*&& this.ticksLived > 2400*/; // CraftBukkit // Paper - honor name and leash } - public static AttributeProvider.Builder eL() { + public static AttributeProvider.Builder eK() { diff --git a/Spigot-Server-Patches/0163-Reset-spawner-timer-when-spawner-event-is-cancelled.patch b/Spigot-Server-Patches/0163-Reset-spawner-timer-when-spawner-event-is-cancelled.patch index 14e130675b..91c5250462 100644 --- a/Spigot-Server-Patches/0163-Reset-spawner-timer-when-spawner-event-is-cancelled.patch +++ b/Spigot-Server-Patches/0163-Reset-spawner-timer-when-spawner-event-is-cancelled.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Reset spawner timer when spawner event is cancelled diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 5fda5be52ee7dbf29ac791d0f49326dd74ff2d08..efd4d2844c4ad638837a1fd971927758908e7db1 100644 +index 8eb20c6b9a88d5d4056f91df1f496d3d35b473da..34ab03fce7ab5c7702234590ffc9ca7fec72a86a 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -142,6 +142,7 @@ public abstract class MobSpawnerAbstract { - } +@@ -144,6 +144,7 @@ public abstract class MobSpawnerAbstract { + // Spigot End + } entity.spawnedViaMobSpawner = true; // Paper - // Spigot Start -+ flag = true; // Paper - if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { - Entity vehicle = entity.getVehicle(); - if (vehicle != null) { -@@ -160,7 +161,7 @@ public abstract class MobSpawnerAbstract { - ((EntityInsentient) entity).doSpawnEffect(); - } ++ flag = true; // Paper + // Spigot Start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { + Entity vehicle = entity.getVehicle(); +@@ -167,7 +168,7 @@ public abstract class MobSpawnerAbstract { + ((EntityInsentient) entity).doSpawnEffect(); + } -- flag = true; -+ /*flag = true;*/ // Paper - moved up above cancellable event +- flag = true; ++ /*flag = true;*/ // Paper - moved up above cancellable event + } } } - diff --git a/Spigot-Server-Patches/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch b/Spigot-Server-Patches/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch index 3cec2a2f85..67129232de 100644 --- a/Spigot-Server-Patches/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch +++ b/Spigot-Server-Patches/0164-Fix-MC-117075-TE-Unload-Lag-Spike.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix MC-117075: TE Unload Lag Spike diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a28071a2855c72fd125eb48d67796791a5a40fe0..f182fb60f572fe6e1f055cdb3ce28581a46783ad 100644 +index 74f92b44550ed93dcae2366bb44e6a6d210925c6..e4c4ff9de1f8c86c96baaca7aacbb0e0412ba50a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -709,7 +709,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -674,7 +674,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.enter("blockEntities"); timings.tileEntityTick.startTiming(); // Spigot if (!this.tileEntityListUnload.isEmpty()) { diff --git a/Spigot-Server-Patches/0165-Allow-specifying-a-custom-authentication-servers-dow.patch b/Spigot-Server-Patches/0165-Allow-specifying-a-custom-authentication-servers-dow.patch index f58baf0eab..1e3811a6ed 100644 --- a/Spigot-Server-Patches/0165-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/Spigot-Server-Patches/0165-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -27,7 +27,7 @@ index 5fa63d7ca20b88a44d8800b3ebf74e4c0e376d0b..cee8740e644c492e3d71fd58791e7d52 + } } diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 975499bca45acb4ba3196c48e3739310275cfc8b..723c73a8056d34136c64cd038f274d3d94749314 100644 +index a9ec9f123f94df2368347ef9e6673cfb80186cf4..e7e2566a019441b9b95ae5f38c75134e451f227f 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -246,6 +246,10 @@ public class LoginListener implements PacketLoginInListener { diff --git a/Spigot-Server-Patches/0166-LivingEntity-setKiller.patch b/Spigot-Server-Patches/0166-LivingEntity-setKiller.patch index 94fff6edc3..f6ffb926df 100644 --- a/Spigot-Server-Patches/0166-LivingEntity-setKiller.patch +++ b/Spigot-Server-Patches/0166-LivingEntity-setKiller.patch @@ -5,18 +5,18 @@ Subject: [PATCH] LivingEntity#setKiller diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 34f2821a64c7893ff0a8c33ae4b77ce883227f0c..7ec1a572efd99928e8aae9b75c0eed73430aa337 100644 +index 729726782446085a6c3b811c4b540ff154c6c115..e8e91a415daef307a3793dd36ebb71d3cbd7b079 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -86,7 +86,7 @@ public abstract class EntityLiving extends Entity { - public float aL; + public float aE; @Nullable public EntityHuman killer; - protected int lastDamageByPlayerTime; + public int lastDamageByPlayerTime; // Paper - protected -> public protected boolean killed; protected int ticksFarFromPlayer; - protected float aQ; + protected float aJ; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index d5b165e8275c012d775b77b8440489716a6c3c08..5e2642b33d36e0695d6adc879f9595030adaaf31 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java diff --git a/Spigot-Server-Patches/0167-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch b/Spigot-Server-Patches/0167-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch index b24ed01541..25cd5d72f6 100644 --- a/Spigot-Server-Patches/0167-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch +++ b/Spigot-Server-Patches/0167-Use-Log4j-IOStreams-to-redirect-System.out-err-to-lo.patch @@ -12,7 +12,7 @@ results in a separate line, even though it should not result in a line break. Log4j's implementation handles it correctly. diff --git a/pom.xml b/pom.xml -index 6b4f56744d11029bdbac5479b45c88736f338fa9..3ad7385df33fb9d4d6477648c847e6e0f8fc0469 100644 +index acb8c50c14b3bf4cc2468a426b93196117882d88..6b2dbe62d2cf463b1d8b0124a8e73e3819424fe6 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,11 @@ @@ -28,7 +28,7 @@ index 6b4f56744d11029bdbac5479b45c88736f338fa9..3ad7385df33fb9d4d6477648c847e6e0 <groupId>org.ow2.asm</groupId> <artifactId>asm</artifactId> diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index af839f432d410601fbbe06b665e4e0fad801c17d..13ae03d48a2a838ee9eb016072f3486d3c7192ef 100644 +index 44da68eb8e7c01800156e157cf7bc1c9003bef59..ea7f7f4a97ed5e1b878ec6ba2976bafbeb063df2 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -131,8 +131,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/0168-Handle-plugin-prefixes-using-Log4J-configuration.patch b/Spigot-Server-Patches/0168-Handle-plugin-prefixes-using-Log4J-configuration.patch index 70978a2b17..f748945c86 100644 --- a/Spigot-Server-Patches/0168-Handle-plugin-prefixes-using-Log4J-configuration.patch +++ b/Spigot-Server-Patches/0168-Handle-plugin-prefixes-using-Log4J-configuration.patch @@ -15,7 +15,7 @@ This may cause additional prefixes to be disabled for plugins bypassing the plugin logger. diff --git a/pom.xml b/pom.xml -index 3ad7385df33fb9d4d6477648c847e6e0f8fc0469..85fb15836cf4ca6a167d7a35f6df5e25056b13a9 100644 +index 6b2dbe62d2cf463b1d8b0124a8e73e3819424fe6..b49a13c5c1d56c8608a034b5fcb35165a8363d72 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ diff --git a/Spigot-Server-Patches/0169-Include-Log4J2-SLF4J-implementation.patch b/Spigot-Server-Patches/0169-Include-Log4J2-SLF4J-implementation.patch index d018f2a25d..70f70b576c 100644 --- a/Spigot-Server-Patches/0169-Include-Log4J2-SLF4J-implementation.patch +++ b/Spigot-Server-Patches/0169-Include-Log4J2-SLF4J-implementation.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Include Log4J2 SLF4J implementation diff --git a/pom.xml b/pom.xml -index 85fb15836cf4ca6a167d7a35f6df5e25056b13a9..accd4b6521b18495c933a50ed511b173cbb71861 100644 +index b49a13c5c1d56c8608a034b5fcb35165a8363d72..8cf6fe72894af9c359940a87dfa9937e5a78e79b 100644 --- a/pom.xml +++ b/pom.xml @@ -66,6 +66,12 @@ diff --git a/Spigot-Server-Patches/0171-Add-PlayerJumpEvent.patch b/Spigot-Server-Patches/0171-Add-PlayerJumpEvent.patch index ecca21391c..05f39172a5 100644 --- a/Spigot-Server-Patches/0171-Add-PlayerJumpEvent.patch +++ b/Spigot-Server-Patches/0171-Add-PlayerJumpEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerJumpEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index f62357be4225fa48dd445f0843c99235276566c7..0eb28ad05372a5692412e05974045826fa24abbe 100644 +index bc084ade77cff987c41d148ce85fc61d6efb5feb..3290e50440dc22f5530272c2817c594028d3432e 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -58,6 +58,8 @@ import org.bukkit.inventory.CraftingInventory; @@ -17,7 +17,7 @@ index f62357be4225fa48dd445f0843c99235276566c7..0eb28ad05372a5692412e05974045826 import co.aikar.timings.MinecraftTimings; // Paper // CraftBukkit end -@@ -945,7 +947,34 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -939,7 +941,34 @@ public class PlayerConnection implements PacketListenerPlayIn { boolean flag = d8 > 0.0D; if (this.player.isOnGround() && !packetplayinflying.b() && flag) { diff --git a/Spigot-Server-Patches/0172-handle-PacketPlayInKeepAlive-async.patch b/Spigot-Server-Patches/0172-handle-PacketPlayInKeepAlive-async.patch index 930c72a6ba..5342981e8c 100644 --- a/Spigot-Server-Patches/0172-handle-PacketPlayInKeepAlive-async.patch +++ b/Spigot-Server-Patches/0172-handle-PacketPlayInKeepAlive-async.patch @@ -15,10 +15,10 @@ also adding some additional logging in order to help work out what is causing random disconnections for clients. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0eb28ad05372a5692412e05974045826fa24abbe..1d28b2b382877bb24958f28739e90bacfe8b9a94 100644 +index 3290e50440dc22f5530272c2817c594028d3432e..01747ea997a68f55803553c330287b1bbe866c29 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2530,14 +2530,18 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2525,14 +2525,18 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInKeepAlive packetplayinkeepalive) { diff --git a/Spigot-Server-Patches/0173-Expose-client-protocol-version-and-virtual-host.patch b/Spigot-Server-Patches/0173-Expose-client-protocol-version-and-virtual-host.patch index f1a83c7bf5..92a2cab449 100644 --- a/Spigot-Server-Patches/0173-Expose-client-protocol-version-and-virtual-host.patch +++ b/Spigot-Server-Patches/0173-Expose-client-protocol-version-and-virtual-host.patch @@ -61,7 +61,7 @@ index 0000000000000000000000000000000000000000..5caca6439d2135e34880d501397fe2ea + +} diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index c0e3d18b0a528d6bca878f354bf8b4b417522c29..12fb251dc96bf179e393046ecc256ea80fdd79de 100644 +index ad2861cde180403069c96f5fd7e4d26ee918bbea..07d5036ce3b04c78f332deed65b9177b70b4361a 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -133,6 +133,10 @@ public class HandshakeListener implements PacketHandshakingInListener { @@ -76,7 +76,7 @@ index c0e3d18b0a528d6bca878f354bf8b4b417522c29..12fb251dc96bf179e393046ecc256ea8 @Override diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index c2fdccfb9192aa7ec55fd67c169cba71a695075c..33900c22d4123e0f8333b9bdb9601d302e26c972 100644 +index 5a0129d007459fbb868784f53585fd26f495358c..aeee6bfbc1c0113beef35bf33e8c6928a1db2844 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -60,6 +60,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { @@ -103,7 +103,7 @@ index 4f008e4723d2cb0bcabb2d5621203d63c40c4923..8545146fb1f093f821e3b966d9337049 return this.a; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index b03d7747ca582c212534b061369564daa74f5022..0121f5009b31b6d9cad0e89264fb78833177d83b 100644 +index 6ca7a7a3267d3c8477c8333dea9ac2bbad230056..6eb02d0a69a0375ba099f776636de765612911e5 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -188,6 +188,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { diff --git a/Spigot-Server-Patches/0174-revert-serverside-behavior-of-keepalives.patch b/Spigot-Server-Patches/0174-revert-serverside-behavior-of-keepalives.patch index 4c97ad9f57..cfe42a288a 100644 --- a/Spigot-Server-Patches/0174-revert-serverside-behavior-of-keepalives.patch +++ b/Spigot-Server-Patches/0174-revert-serverside-behavior-of-keepalives.patch @@ -17,7 +17,7 @@ from networking or during connections flood of chunk packets on slower clients, at the cost of dead connections being kept open for longer. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1d28b2b382877bb24958f28739e90bacfe8b9a94..76cd3ea9512f4355a055d9c683d939680dc5a1b7 100644 +index 01747ea997a68f55803553c330287b1bbe866c29..2eb2ddcb4456437bb449a86c18fb24c8629870a7 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -70,7 +70,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch b/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch index c06cd20829..5ba163ccdd 100644 --- a/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch +++ b/Spigot-Server-Patches/0175-Send-attack-SoundEffects-only-to-players-who-can-see.patch @@ -6,26 +6,10 @@ Subject: [PATCH] Send attack SoundEffects only to players who can see the diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542de2a0355 100644 +index b64eecae09241360b6997200f931eb3a63470dab..700cc4161163308c72f66c688a6afc1663e38284 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1002,6 +1002,15 @@ public abstract class EntityHuman extends EntityLiving { - return vec3d; - } - -+ // Paper start - send SoundEffect to everyone who can see fromEntity -+ private static void sendSoundEffect(EntityHuman fromEntity, double x, double y, double z, SoundEffect soundEffect, SoundCategory soundCategory, float volume, float pitch) { -+ fromEntity.world.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself -+ if (fromEntity instanceof EntityPlayer) { -+ ((EntityPlayer) fromEntity).playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(soundEffect, soundCategory, x, y, z, volume, pitch)); -+ } -+ } -+ // Paper end -+ - public void attack(Entity entity) { - if (entity.bH()) { - if (!entity.t(this)) { -@@ -1026,7 +1035,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1030,7 +1030,7 @@ public abstract class EntityHuman extends EntityLiving { int i = b0 + EnchantmentManager.b((EntityLiving) this); if (this.isSprinting() && flag) { @@ -34,7 +18,7 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542 ++i; flag1 = true; } -@@ -1101,7 +1110,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1105,7 +1105,7 @@ public abstract class EntityHuman extends EntityLiving { } } @@ -43,7 +27,7 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542 this.ew(); } -@@ -1129,15 +1138,15 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1133,15 +1133,15 @@ public abstract class EntityHuman extends EntityLiving { } if (flag2) { @@ -62,7 +46,7 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542 } } -@@ -1189,7 +1198,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1193,7 +1193,7 @@ public abstract class EntityHuman extends EntityLiving { this.applyExhaustion(world.spigotConfig.combatExhaustion); // Spigot - Change to use configurable value } else { @@ -71,3 +55,18 @@ index 69c0a4c7bfb1c753d544dcd074ad832d3e5ef3a0..8ea9e23649da37f853478e4e7a9b2542 if (flag4) { entity.extinguish(); } +@@ -1645,6 +1645,14 @@ public abstract class EntityHuman extends EntityLiving { + public int getExpToLevel() { + return this.expLevel >= 30 ? 112 + (this.expLevel - 30) * 9 : (this.expLevel >= 15 ? 37 + (this.expLevel - 15) * 5 : 7 + this.expLevel * 2); + } ++ // Paper start - send SoundEffect to everyone who can see fromEntity ++ private static void sendSoundEffect(EntityHuman fromEntity, double x, double y, double z, SoundEffect soundEffect, SoundCategory soundCategory, float volume, float pitch) { ++ fromEntity.world.playSound(fromEntity, x, y, z, soundEffect, soundCategory, volume, pitch); // This will not send the effect to the entity himself ++ if (fromEntity instanceof EntityPlayer) { ++ ((EntityPlayer) fromEntity).playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(soundEffect, soundCategory, x, y, z, volume, pitch)); ++ } ++ } ++ // Paper end + + public void applyExhaustion(float f) { + if (!this.abilities.isInvulnerable) { diff --git a/Spigot-Server-Patches/0176-Option-for-maximum-exp-value-when-merging-orbs.patch b/Spigot-Server-Patches/0176-Option-for-maximum-exp-value-when-merging-orbs.patch index b7d3679ebe..98e1293f7a 100644 --- a/Spigot-Server-Patches/0176-Option-for-maximum-exp-value-when-merging-orbs.patch +++ b/Spigot-Server-Patches/0176-Option-for-maximum-exp-value-when-merging-orbs.patch @@ -20,10 +20,10 @@ index e30f48caf2ce4f48f371b2594b765c27bc9e9778..2d8b354d707e8b5b0e7cd644fb93bc8f + } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index ad3467b32a58c9268f7667c1beea7e919e63212c..3b0402c1160f66b745be3d1fc47ec5bd8969a793 100644 +index dc8186b38930bf32f140a2da822cf359b6004a12..a96d6259f60dc5bfe477de54e837de5af066cca0 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -578,16 +578,32 @@ public class CraftEventFactory { +@@ -582,16 +582,32 @@ public class CraftEventFactory { EntityExperienceOrb xp = (EntityExperienceOrb) entity; double radius = world.spigotConfig.expMerge; if (radius > 0) { diff --git a/Spigot-Server-Patches/0177-Add-PlayerArmorChangeEvent.patch b/Spigot-Server-Patches/0177-Add-PlayerArmorChangeEvent.patch index 7e2f8c9162..d86b85b304 100644 --- a/Spigot-Server-Patches/0177-Add-PlayerArmorChangeEvent.patch +++ b/Spigot-Server-Patches/0177-Add-PlayerArmorChangeEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fc4c7dc452450b7a4253c344284a056425109cc8..35ec16b2bb0491e22ca834abc762f03fafdc764a 100644 +index e8e91a415daef307a3793dd36ebb71d3cbd7b079..edd9fd66780fa8f7d3b1d807918a0cd8adb42b66 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1,5 +1,6 @@ @@ -15,7 +15,7 @@ index fc4c7dc452450b7a4253c344284a056425109cc8..35ec16b2bb0491e22ca834abc762f03f import com.google.common.base.Objects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -@@ -2521,6 +2522,13 @@ public abstract class EntityLiving extends Entity { +@@ -2522,6 +2523,13 @@ public abstract class EntityLiving extends Entity { ItemStack itemstack1 = this.getEquipment(enumitemslot); if (!ItemStack.matches(itemstack1, itemstack)) { diff --git a/Spigot-Server-Patches/0178-Prevent-logins-from-being-processed-when-the-player-.patch b/Spigot-Server-Patches/0178-Prevent-logins-from-being-processed-when-the-player-.patch index f3a5b4b02f..108e3daa9f 100644 --- a/Spigot-Server-Patches/0178-Prevent-logins-from-being-processed-when-the-player-.patch +++ b/Spigot-Server-Patches/0178-Prevent-logins-from-being-processed-when-the-player-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Prevent logins from being processed when the player has diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 723c73a8056d34136c64cd038f274d3d94749314..3cc12e7b75b8ed21a0ea44f8453553cf856fb786 100644 +index e7e2566a019441b9b95ae5f38c75134e451f227f..05583872f118346f6d7e1cd0f2304966ab65b5d9 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -55,7 +55,11 @@ public class LoginListener implements PacketLoginInListener { diff --git a/Spigot-Server-Patches/0179-use-CB-BlockState-implementations-for-captured-block.patch b/Spigot-Server-Patches/0179-use-CB-BlockState-implementations-for-captured-block.patch index f45a9266cc..280b3e27b2 100644 --- a/Spigot-Server-Patches/0179-use-CB-BlockState-implementations-for-captured-block.patch +++ b/Spigot-Server-Patches/0179-use-CB-BlockState-implementations-for-captured-block.patch @@ -18,7 +18,7 @@ the blockstate that will be valid for restoration, as opposed to dropping information on restoration when the event is cancelled. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 16a87029aaa34601bc312db29925af1b0e568247..9c3c0a6ff57a8d1788cf6d7cd91571f4212eb701 100644 +index e4c4ff9de1f8c86c96baaca7aacbb0e0412ba50a..275442e07743e4e4e3f1468f58c50bb38ab7537a 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -71,7 +71,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -30,7 +30,7 @@ index 16a87029aaa34601bc312db29925af1b0e568247..9c3c0a6ff57a8d1788cf6d7cd91571f4 public Map<BlockPosition, TileEntity> capturedTileEntities = new HashMap<>(); public List<EntityItem> captureDrops; public long ticksPerAnimalSpawns; -@@ -329,7 +329,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -294,7 +294,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { @@ -39,7 +39,7 @@ index 16a87029aaa34601bc312db29925af1b0e568247..9c3c0a6ff57a8d1788cf6d7cd91571f4 if (blockstate == null) { blockstate = CapturedBlockState.getTreeBlockState(this, blockposition, i); this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); -@@ -349,7 +349,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -314,7 +314,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit start - capture blockstates boolean captured = false; if (this.captureBlockStates && !this.capturedBlockStates.containsKey(blockposition)) { @@ -48,7 +48,7 @@ index 16a87029aaa34601bc312db29925af1b0e568247..9c3c0a6ff57a8d1788cf6d7cd91571f4 this.capturedBlockStates.put(blockposition.immutableCopy(), blockstate); captured = true; } -@@ -607,7 +607,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -572,7 +572,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public IBlockData getType(BlockPosition blockposition) { // CraftBukkit start - tree generation if (captureTreeGeneration) { diff --git a/Spigot-Server-Patches/0180-API-to-get-a-BlockState-without-a-snapshot.patch b/Spigot-Server-Patches/0180-API-to-get-a-BlockState-without-a-snapshot.patch index ae64fe925e..f9e97f8f0e 100644 --- a/Spigot-Server-Patches/0180-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/Spigot-Server-Patches/0180-API-to-get-a-BlockState-without-a-snapshot.patch @@ -13,7 +13,7 @@ also Avoid NPE during CraftBlockEntityState load if could not get TE If Tile Entity was null, correct Sign to return empty lines instead of null diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 5e5bb5aaa3d8f4e8f4b00ba8bee059ec79f82b43..2b06c95b4fac97513e706ef073fdd7418e1f092c 100644 +index 6c4c804797fbbe73d179c6ed089427e64d0ebff4..6ccca984daa803ddf446a8f69aca0d86ee27fabc 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -231,7 +231,12 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -39,10 +39,10 @@ index 5e5bb5aaa3d8f4e8f4b00ba8bee059ec79f82b43..2b06c95b4fac97513e706ef073fdd741 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 606a89a905396a020a3497aa293f64a04c693c7b..12b8d544566888dc77bc2c8748d78f09c4bb3b76 100644 +index ac63b098f43a82eb7d32cf7df6057ae8ce01cb7e..af0d1c742e806f5855a08c887c0e0654da2c6f95 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -308,6 +308,20 @@ public class CraftBlock implements Block { +@@ -312,6 +312,20 @@ public class CraftBlock implements Block { @Override public BlockState getState() { diff --git a/Spigot-Server-Patches/0181-AsyncTabCompleteEvent.patch b/Spigot-Server-Patches/0181-AsyncTabCompleteEvent.patch index 76abad221a..745bf3dae3 100644 --- a/Spigot-Server-Patches/0181-AsyncTabCompleteEvent.patch +++ b/Spigot-Server-Patches/0181-AsyncTabCompleteEvent.patch @@ -14,10 +14,10 @@ completion, such as offline players. Also adds isCommand and getLocation to the sync TabCompleteEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 76cd3ea9512f4355a055d9c683d939680dc5a1b7..ccf083fbfa97b2a24338a3c1fe18e9a8c850feaf 100644 +index 2eb2ddcb4456437bb449a86c18fb24c8629870a7..4452a6e7f550f362145ce6533e6cc77c367793eb 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -527,10 +527,10 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -521,10 +521,10 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInTabComplete packetplayintabcomplete) { @@ -30,7 +30,7 @@ index 76cd3ea9512f4355a055d9c683d939680dc5a1b7..ccf083fbfa97b2a24338a3c1fe18e9a8 return; } // CraftBukkit end -@@ -540,12 +540,35 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -534,12 +534,35 @@ public class PlayerConnection implements PacketListenerPlayIn { stringreader.skip(); } @@ -72,10 +72,10 @@ index 76cd3ea9512f4355a055d9c683d939680dc5a1b7..ccf083fbfa97b2a24338a3c1fe18e9a8 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index dd439acf4985ee7f4f329c63060988c10c6671f3..a4114ed9f4aad72acc2cd21852614a11594569c4 100644 +index f7943251b81c06fcc7fc6b3eea80c521fd3f555d..bbca08b277d52e5fc32fc12d178d35be91a19dfe 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1796,7 +1796,7 @@ public final class CraftServer implements Server { +@@ -1790,7 +1790,7 @@ public final class CraftServer implements Server { offers = tabCompleteChat(player, message); } diff --git a/Spigot-Server-Patches/0182-Avoid-NPE-in-PathfinderGoalTempt.patch b/Spigot-Server-Patches/0182-Avoid-NPE-in-PathfinderGoalTempt.patch index 2e8bf42958..9beb581a00 100644 --- a/Spigot-Server-Patches/0182-Avoid-NPE-in-PathfinderGoalTempt.patch +++ b/Spigot-Server-Patches/0182-Avoid-NPE-in-PathfinderGoalTempt.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Avoid NPE in PathfinderGoalTempt diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java -index 351152ae32e162fa912d60e929abeec783140106..b115f40b0b11e89184960a5cce5b8295030469e9 100644 +index a6fa45eedc26ddf78a67281c29f6b6b05a85707c..a6f67e473cfe2c9eb3d4466f9bc23b9d0212126b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java @@ -55,7 +55,7 @@ public class PathfinderGoalTempt extends PathfinderGoal { diff --git a/Spigot-Server-Patches/0183-PlayerPickupExperienceEvent.patch b/Spigot-Server-Patches/0183-PlayerPickupExperienceEvent.patch index 1120cd9b70..8480e92991 100644 --- a/Spigot-Server-Patches/0183-PlayerPickupExperienceEvent.patch +++ b/Spigot-Server-Patches/0183-PlayerPickupExperienceEvent.patch @@ -6,15 +6,15 @@ Subject: [PATCH] PlayerPickupExperienceEvent Allows plugins to cancel a player picking up an experience orb diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index d9a0cd1e90445ff7a1d9e7cef2f71e27bd3686cb..e7fb982913f391bafd608c4626086cd9cab7fad7 100644 +index deebd63e0297b245b82a620bc380c9f1a502027b..e2370b8cf76d6f06cbdaba009feaf5df98b36da4 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -217,7 +217,7 @@ public class EntityExperienceOrb extends Entity { @Override public void pickup(EntityHuman entityhuman) { if (!this.world.isClientSide) { -- if (this.d == 0 && entityhuman.bB == 0) { -+ if (this.d == 0 && entityhuman.bB == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper - entityhuman.bB = 2; +- if (this.d == 0 && entityhuman.bu == 0) { ++ if (this.d == 0 && entityhuman.bu == 0 && new com.destroystokyo.paper.event.player.PlayerPickupExperienceEvent(((EntityPlayer) entityhuman).getBukkitEntity(), (org.bukkit.entity.ExperienceOrb) this.getBukkitEntity()).callEvent()) { // Paper + entityhuman.bu = 2; entityhuman.receive(this, 1); Entry<EnumItemSlot, ItemStack> entry = EnchantmentManager.a(Enchantments.MENDING, (EntityLiving) entityhuman, ItemStack::f); diff --git a/Spigot-Server-Patches/0184-ExperienceOrbMergeEvent.patch b/Spigot-Server-Patches/0184-ExperienceOrbMergeEvent.patch index 4a10151bd7..6c6e1be7ba 100644 --- a/Spigot-Server-Patches/0184-ExperienceOrbMergeEvent.patch +++ b/Spigot-Server-Patches/0184-ExperienceOrbMergeEvent.patch @@ -8,10 +8,10 @@ Plugins can cancel this if they want to ensure experience orbs do not lose impor metadata such as spawn reason, or conditionally move data from source to target. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3b0402c1160f66b745be3d1fc47ec5bd8969a793..f26c68157cc97d28c309787c63a35d41c0094c29 100644 +index a96d6259f60dc5bfe477de54e837de5af066cca0..6b67e509e8a714cdee69c20f4456c9a08574c848 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -588,7 +588,7 @@ public class CraftEventFactory { +@@ -592,7 +592,7 @@ public class CraftEventFactory { if (e instanceof EntityExperienceOrb) { EntityExperienceOrb loopItem = (EntityExperienceOrb) e; // Paper start diff --git a/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch b/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch index 276c8a8b48..9feda70428 100644 --- a/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch +++ b/Spigot-Server-Patches/0185-Ability-to-apply-mending-to-XP-API.patch @@ -10,7 +10,7 @@ of giving the player experience points. Both an API To standalone mend, and apply mending logic to .giveExp has been added. diff --git a/src/main/java/net/minecraft/server/EnchantmentManager.java b/src/main/java/net/minecraft/server/EnchantmentManager.java -index cea65c1d80a7bd303cf28a6fe2bd73d542a19557..7a4768c32c426ef3cf16904e0f565a7f8fdc753f 100644 +index 42d6aa4bedb1978eb6e6f94e2a73520c879ab71a..b6b0460de9d7c25fafec37f4e02c2d82dd7ef986 100644 --- a/src/main/java/net/minecraft/server/EnchantmentManager.java +++ b/src/main/java/net/minecraft/server/EnchantmentManager.java @@ -251,8 +251,8 @@ public class EnchantmentManager { @@ -25,7 +25,7 @@ index cea65c1d80a7bd303cf28a6fe2bd73d542a19557..7a4768c32c426ef3cf16904e0f565a7f return true; }); diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index e7fb982913f391bafd608c4626086cd9cab7fad7..86fb9286cfd4e0debc00e034c3a5ff33f0a1fe06 100644 +index e2370b8cf76d6f06cbdaba009feaf5df98b36da4..a2eaea4bd847ebe0b3dc35c95c4c29d6c73f4797 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -249,10 +249,12 @@ public class EntityExperienceOrb extends Entity { @@ -42,10 +42,10 @@ index e7fb982913f391bafd608c4626086cd9cab7fad7..86fb9286cfd4e0debc00e034c3a5ff33 return i * 2; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0121f5009b31b6d9cad0e89264fb78833177d83b..c1192c646a41a906fcb09c9b4aef611b451b1e26 100644 +index 6eb02d0a69a0375ba099f776636de765612911e5..cbeac436e57a68270b2681ddf564d84c167398bd 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1079,8 +1079,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1075,8 +1075,37 @@ public class CraftPlayer extends CraftHumanEntity implements Player { return GameMode.getByValue(getHandle().playerInteractManager.getGameMode().getId()); } diff --git a/Spigot-Server-Patches/0186-Make-max-squid-spawn-height-configurable.patch b/Spigot-Server-Patches/0186-Make-max-squid-spawn-height-configurable.patch index e652242856..b34e29e701 100644 --- a/Spigot-Server-Patches/0186-Make-max-squid-spawn-height-configurable.patch +++ b/Spigot-Server-Patches/0186-Make-max-squid-spawn-height-configurable.patch @@ -21,7 +21,7 @@ index 2d8b354d707e8b5b0e7cd644fb93bc8f1c4009f1..48fa2483fc657b36b8f2fd7d8b35703c + } } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 915a2736447b651ac892254ed6429bad5a56954e..9c9ec8226ab43beaae0ef4abc97632b503e2120c 100644 +index 37bac48f0427fef629f38ac416536248f05d0ff9..6a436c6edb4f2f17bbb165ff6497c15e476d3317 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -169,7 +169,8 @@ public class EntitySquid extends EntityWaterAnimal { diff --git a/Spigot-Server-Patches/0187-PreCreatureSpawnEvent.patch b/Spigot-Server-Patches/0187-PreCreatureSpawnEvent.patch index c4bc9d0189..2e3a332468 100644 --- a/Spigot-Server-Patches/0187-PreCreatureSpawnEvent.patch +++ b/Spigot-Server-Patches/0187-PreCreatureSpawnEvent.patch @@ -15,62 +15,66 @@ instead and save a lot of server resources. See: https://github.com/PaperMC/Paper/issues/917 diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index efd4d2844c4ad638837a1fd971927758908e7db1..45cd44335427a818a580158d57025289f37079bf 100644 +index 34ab03fce7ab5c7702234590ffc9ca7fec72a86a..2827026ba4bdd857f231028393726d6c95610072 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -105,6 +105,27 @@ public abstract class MobSpawnerAbstract { - double d5 = j >= 3 ? nbttaglist.h(2) : (double) blockposition.getZ() + (world.random.nextDouble() - world.random.nextDouble()) * (double) this.spawnRange + 0.5D; +@@ -108,6 +108,27 @@ public abstract class MobSpawnerAbstract { + WorldServer worldserver = (WorldServer) world; - if (world.b(((EntityTypes) optional.get()).a(d3, d4, d5)) && EntityPositionTypes.a((EntityTypes) optional.get(), world.getMinecraftWorld(), EnumMobSpawn.SPAWNER, new BlockPosition(d3, d4, d5), world.getRandom())) { -+ // Paper start -+ EntityTypes<?> entityType = optional.get(); -+ String key = EntityTypes.getName(entityType).getKey(); + if (EntityPositionTypes.a((EntityTypes) optional.get(), worldserver, EnumMobSpawn.SPAWNER, new BlockPosition(d3, d4, d5), world.getRandom())) { ++ // Paper start ++ EntityTypes<?> entityType = optional.get(); ++ String key = EntityTypes.getName(entityType).getKey(); + -+ org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); -+ if (type != null) { -+ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; -+ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( -+ MCUtil.toLocation(world, d3, d4, d5), -+ type, -+ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER -+ ); -+ if (!event.callEvent()) { -+ flag = true; -+ if (event.shouldAbortSpawn()) { -+ break; ++ org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); ++ if (type != null) { ++ com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; ++ event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( ++ MCUtil.toLocation(world, d3, d4, d5), ++ type, ++ org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER ++ ); ++ if (!event.callEvent()) { ++ flag = true; ++ if (event.shouldAbortSpawn()) { ++ break; ++ } ++ continue; + } -+ continue; + } -+ } -+ // Paper end - Entity entity = EntityTypes.a(nbttagcompound, world, (entity1) -> { - entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch); - return entity1; ++ // Paper end + Entity entity = EntityTypes.a(nbttagcompound, world, (entity1) -> { + entity1.setPositionRotation(d3, d4, d5, entity1.yaw, entity1.pitch); + return entity1; diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index e08de74543535072e63ecfc9bd3ada95c9dbfeb7..137fa3e51390e95f5939f2251e0d170accbfb469 100644 +index ca3dc5a113554381a2ff97cb3175eda1ec4034ae..eb637c32f7a4faa99d30596c273e62ebffe74f3b 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -185,7 +185,12 @@ public final class SpawnerCreature { - j1 = biomebase_biomemeta.d + worldserver.random.nextInt(1 + biomebase_biomemeta.e - biomebase_biomemeta.d); +@@ -184,9 +184,16 @@ public final class SpawnerCreature { + j1 = biomesettingsmobs_c.d + worldserver.random.nextInt(1 + biomesettingsmobs_c.e - biomesettingsmobs_c.d); } -- if (a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomebase_biomemeta, blockposition_mutableblockposition, d2) && spawnercreature_c.test(biomebase_biomemeta.c, blockposition_mutableblockposition, ichunkaccess)) { +- if (a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomesettingsmobs_c, blockposition_mutableblockposition, d2) && spawnercreature_c.test(biomesettingsmobs_c.c, blockposition_mutableblockposition, ichunkaccess)) { + // Paper start -+ Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomebase_biomemeta, blockposition_mutableblockposition, d2); ++ Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomesettingsmobs_c, blockposition_mutableblockposition, d2); + if (doSpawning == null) { + return; + } -+ if (doSpawning.booleanValue() && spawnercreature_c.test(biomebase_biomemeta.c, blockposition_mutableblockposition, ichunkaccess)) { // Paper end - EntityInsentient entityinsentient = a(worldserver, biomebase_biomemeta.c); ++ if (doSpawning && spawnercreature_c.test(biomesettingsmobs_c.c, blockposition_mutableblockposition, ichunkaccess)) { ++ // Paper end + EntityInsentient entityinsentient = a(worldserver, biomesettingsmobs_c.c); ++ if (entityinsentient == null) { -@@ -239,8 +244,24 @@ public final class SpawnerCreature { + return; + } +@@ -238,8 +245,24 @@ public final class SpawnerCreature { } } -- private static boolean a(WorldServer worldserver, EnumCreatureType enumcreaturetype, StructureManager structuremanager, ChunkGenerator chunkgenerator, BiomeBase.BiomeMeta biomebase_biomemeta, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { -+ private static Boolean a(WorldServer worldserver, EnumCreatureType enumcreaturetype, StructureManager structuremanager, ChunkGenerator chunkgenerator, BiomeBase.BiomeMeta biomebase_biomemeta, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { // Paper - EntityTypes<?> entitytypes = biomebase_biomemeta.c; +- private static boolean a(WorldServer worldserver, EnumCreatureType enumcreaturetype, StructureManager structuremanager, ChunkGenerator chunkgenerator, BiomeSettingsMobs.c biomesettingsmobs_c, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { ++ private static Boolean a(WorldServer worldserver, EnumCreatureType enumcreaturetype, StructureManager structuremanager, ChunkGenerator chunkgenerator, BiomeSettingsMobs.c biomesettingsmobs_c, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { // Paper + EntityTypes<?> entitytypes = biomesettingsmobs_c.c; + // Paper start + com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(EntityTypes.getName(entitytypes).getKey()); @@ -83,7 +87,7 @@ index e08de74543535072e63ecfc9bd3ada95c9dbfeb7..137fa3e51390e95f5939f2251e0d170a + if (event.shouldAbortSpawn()) { + return null; + } -+ return false; // TODO is this handled correctly? ++ return false; + } + } + // Paper end diff --git a/Spigot-Server-Patches/0188-PlayerNaturallySpawnCreaturesEvent.patch b/Spigot-Server-Patches/0188-PlayerNaturallySpawnCreaturesEvent.patch index 5e752bd19e..b71b6db1b7 100644 --- a/Spigot-Server-Patches/0188-PlayerNaturallySpawnCreaturesEvent.patch +++ b/Spigot-Server-Patches/0188-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,10 +9,10 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7abd3683f9cc21b90dc74739954de2decddf6478..6921def2dc8dd7f2b8ba9d46ab697a9f9b62cf4e 100644 +index 042031d2b7cb2f56d422145ffa7589fa46dd2e53..09cfd3ee900d0d1f523e6453163fdb806a0da6de 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -589,6 +589,15 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -590,6 +590,15 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().exit(); //List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper @@ -29,7 +29,7 @@ index 7abd3683f9cc21b90dc74739954de2decddf6478..6921def2dc8dd7f2b8ba9d46ab697a9f Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b94afac539a5d7a1e6ed39ef8f130385f8ea07b6..ef0f8a66eefefce5f78ff35833bfe45437885e0b 100644 +index 044fecfda9dc9f7f503f39b26adab55c98b909c4..4be86db18a77af058a4227f6cb23abd2c5e41051 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -1,5 +1,6 @@ @@ -39,7 +39,7 @@ index b94afac539a5d7a1e6ed39ef8f130385f8ea07b6..ef0f8a66eefefce5f78ff35833bfe454 import com.google.common.collect.Lists; import com.mojang.authlib.GameProfile; import com.mojang.datafixers.util.Either; -@@ -93,6 +94,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -95,6 +96,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean sentListPacket = false; public Integer clientViewDistance; // CraftBukkit end @@ -48,7 +48,7 @@ index b94afac539a5d7a1e6ed39ef8f130385f8ea07b6..ef0f8a66eefefce5f78ff35833bfe454 public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 465beba397f05a31dcda9840375a0e9b97153e78..4ae3e91677ecf9c2104a229b4e8b229d18b87aa4 100644 +index 9c520643f415d5952a59c99da2a7726aae8d7ce3..8862bbd73b627e37709d46e6aeeee70c89cbd821 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -912,12 +912,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { diff --git a/Spigot-Server-Patches/0195-Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/0195-Toggleable-player-crits-helps-mitigate-hacked-client.patch index 5e0ca8f083..a2d232af88 100644 --- a/Spigot-Server-Patches/0195-Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/0195-Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -21,10 +21,10 @@ index 48fa2483fc657b36b8f2fd7d8b35703cff2698a5..3804c7cf96087cdf94fd5fbdce4ebcda private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index eaed020982bd19dab72872849170fa62d75699eb..5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a 100644 +index 700cc4161163308c72f66c688a6afc1663e38284..de781fce74e5300be508f25aac23f402f97a2874 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1042,6 +1042,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1037,6 +1037,7 @@ public abstract class EntityHuman extends EntityLiving { boolean flag2 = flag && this.fallDistance > 0.0F && !this.onGround && !this.isClimbing() && !this.isInWater() && !this.hasEffect(MobEffects.BLINDNESS) && !this.isPassenger() && entity instanceof EntityLiving; diff --git a/Spigot-Server-Patches/0198-Disable-Explicit-Network-Manager-Flushing.patch b/Spigot-Server-Patches/0198-Disable-Explicit-Network-Manager-Flushing.patch index d7aad36191..bc9548b658 100644 --- a/Spigot-Server-Patches/0198-Disable-Explicit-Network-Manager-Flushing.patch +++ b/Spigot-Server-Patches/0198-Disable-Explicit-Network-Manager-Flushing.patch @@ -12,7 +12,7 @@ flushing on the netty event loop, so it won't do the flush on the main thread. Renable flushing by passing -Dpaper.explicit-flush=true diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 33900c22d4123e0f8333b9bdb9601d302e26c972..8cb29ddc0d5a5951ea35e1a16c023efb9b0be42d 100644 +index aeee6bfbc1c0113beef35bf33e8c6928a1db2844..2fda6f6965916e99e603ff87af4226b5ab8417ee 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -63,6 +63,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { diff --git a/Spigot-Server-Patches/0199-Implement-extended-PaperServerListPingEvent.patch b/Spigot-Server-Patches/0199-Implement-extended-PaperServerListPingEvent.patch index 988ed183f3..377ddf3666 100644 --- a/Spigot-Server-Patches/0199-Implement-extended-PaperServerListPingEvent.patch +++ b/Spigot-Server-Patches/0199-Implement-extended-PaperServerListPingEvent.patch @@ -177,7 +177,7 @@ index 0000000000000000000000000000000000000000..26ddf92f86fccc2b2562f7abf4788d1e + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5a5fc0626562d46f1ea6ce3e779e75de55611548..1698b42ed56a2932c5c1d60c655c9fd4cf5bed66 100644 +index b10dc2e552a43cd632aaee336203ddccc64d43b9..cf939069e5e77f79d598a91e77b42e04cecab671 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2,6 +2,9 @@ package net.minecraft.server; @@ -190,7 +190,7 @@ index 5a5fc0626562d46f1ea6ce3e779e75de55611548..1698b42ed56a2932c5c1d60c655c9fd4 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1120,7 +1123,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1118,7 +1121,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas if (i - this.T >= 5000000000L) { this.T = i; this.serverPing.setPlayerSample(new ServerPing.ServerPingPlayerSample(this.getMaxPlayers(), this.getPlayerCount())); diff --git a/Spigot-Server-Patches/0201-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/Spigot-Server-Patches/0201-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index 1e599aa258..9dcba07ef6 100644 --- a/Spigot-Server-Patches/0201-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/Spigot-Server-Patches/0201-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 3cc12e7b75b8ed21a0ea44f8453553cf856fb786..80a21dbc05ed3007f2e827f7a320131244c3044b 100644 +index 05583872f118346f6d7e1cd0f2304966ab65b5d9..98fada9761dafe1784c7d579a01b6737d0e29ad5 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -1,5 +1,7 @@ diff --git a/Spigot-Server-Patches/0202-Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/0202-Player.setPlayerProfile-API.patch index 29d7c59e32..88826cdf48 100644 --- a/Spigot-Server-Patches/0202-Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/0202-Player.setPlayerProfile-API.patch @@ -6,20 +6,20 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 5326e7433dc0a4ff0e1d0ca30aad95b1ec718d6a..74950d74e6a11d5552369e830f9fdd63c4306221 100644 +index de781fce74e5300be508f25aac23f402f97a2874..49f051a1f47c73a66cc462b3eecf72c4e932b648 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -65,7 +65,7 @@ public abstract class EntityHuman extends EntityLiving { - protected int bN; - protected final float bO = 0.02F; + protected int bG; + protected final float bH = 0.02F; private int g; -- private final GameProfile bQ; -+ private GameProfile bQ; public final void setProfile(final GameProfile profile) { this.bQ = profile; } // Paper - OBFHELPER - private ItemStack bS; - private final ItemCooldown bT; +- private final GameProfile bJ; ++ private GameProfile bJ; public final void setProfile(final GameProfile profile) { this.bJ = profile; } // Paper - OBFHELPER + private ItemStack bL; + private final ItemCooldown bM; @Nullable diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 80a21dbc05ed3007f2e827f7a320131244c3044b..e0f0a1e91a037f93b239e779aa8fd92be8a8c01f 100644 +index 98fada9761dafe1784c7d579a01b6737d0e29ad5..f2ab2f7f81b95546294debaf1f0395b0c094ab44 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -36,7 +36,7 @@ public class LoginListener implements PacketLoginInListener { @@ -48,27 +48,10 @@ index 80a21dbc05ed3007f2e827f7a320131244c3044b..e0f0a1e91a037f93b239e779aa8fd92b uniqueId = i.getId(); // Paper end diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2b98794c1 100644 +index cbeac436e57a68270b2681ddf564d84c167398bd..4bcf2ed3dd2a5d51e4490d4156978c8fff0df2b0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1,6 +1,8 @@ - package org.bukkit.craftbukkit.entity; - - import com.destroystokyo.paper.Title; -+import com.destroystokyo.paper.profile.CraftPlayerProfile; -+import com.destroystokyo.paper.profile.PlayerProfile; - import com.google.common.base.Preconditions; - import com.google.common.collect.ImmutableSet; - import com.google.common.io.BaseEncoding; -@@ -41,6 +43,7 @@ import net.minecraft.server.EnumColor; - import net.minecraft.server.EnumGamemode; - import net.minecraft.server.GenericAttributes; - import net.minecraft.server.IChatBaseComponent; -+import net.minecraft.server.MCUtil; - import net.minecraft.server.MapIcon; - import net.minecraft.server.MinecraftKey; - import net.minecraft.server.NBTTagCompound; -@@ -1237,8 +1240,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1233,8 +1233,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { hiddenPlayers.put(player.getUniqueId(), hidingPlugins); // Remove this player from the hidden player's EntityTrackerEntry @@ -83,7 +66,7 @@ index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2 PlayerChunkMap.EntityTracker entry = tracker.trackedEntities.get(other.getId()); if (entry != null) { entry.clear(getHandle()); -@@ -1279,8 +1287,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1275,8 +1280,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } hiddenPlayers.remove(player.getUniqueId()); @@ -98,7 +81,7 @@ index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2 getHandle().playerConnection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER, other)); -@@ -1289,6 +1302,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1285,6 +1295,50 @@ public class CraftPlayer extends CraftHumanEntity implements Player { entry.updatePlayer(getHandle()); } } @@ -109,9 +92,9 @@ index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2 + registerPlayer(player); + } + } -+ public void setPlayerProfile(PlayerProfile profile) { ++ public void setPlayerProfile(com.destroystokyo.paper.profile.PlayerProfile profile) { + EntityPlayer self = getHandle(); -+ self.setProfile(CraftPlayerProfile.asAuthlibCopy(profile)); ++ self.setProfile(com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile)); + if (!self.sentListPacket) { + return; + } @@ -121,8 +104,8 @@ index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2 + } + refreshPlayer(); + } -+ public PlayerProfile getPlayerProfile() { -+ return new CraftPlayerProfile(this).clone(); ++ public com.destroystokyo.paper.profile.PlayerProfile getPlayerProfile() { ++ return new com.destroystokyo.paper.profile.CraftPlayerProfile(this).clone(); + } + + private void refreshPlayer() { @@ -135,7 +118,7 @@ index c1192c646a41a906fcb09c9b4aef611b451b1e26..649c773795744956da0c5a0f8971f3a2 + + //Respawn the player then update their position and selected slot + WorldServer worldserver = handle.getWorldServer(); -+ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(worldserver.getTypeKey(), worldserver.getDimensionKey(), net.minecraft.server.BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true)); ++ connection.sendPacket(new net.minecraft.server.PacketPlayOutRespawn(worldserver.getDimensionManager(), worldserver.getDimensionKey(), net.minecraft.server.BiomeManager.a(worldserver.getSeed()), handle.playerInteractManager.getGameMode(), handle.playerInteractManager.c(), worldserver.isDebugWorld(), worldserver.isFlatWorld(), true)); + handle.updateAbilities(); + connection.sendPacket(new net.minecraft.server.PacketPlayOutPosition(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch(), new HashSet<>(), 0)); + net.minecraft.server.MinecraftServer.getServer().getPlayerList().updateClient(handle); diff --git a/Spigot-Server-Patches/0203-Fix-Dragon-Server-Crashes.patch b/Spigot-Server-Patches/0203-Fix-Dragon-Server-Crashes.patch index 018a36e91b..2d846a751a 100644 --- a/Spigot-Server-Patches/0203-Fix-Dragon-Server-Crashes.patch +++ b/Spigot-Server-Patches/0203-Fix-Dragon-Server-Crashes.patch @@ -7,7 +7,7 @@ If the dragon tries to find "ground" and hits a hole, or off edge, it will infinitely keep looking for non air and eventually crash. diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index d70a45f2530d9dd5e10aa48f20db33a97bbe952e..fbc2ec88f7c71c853c492301986a23dafc8fa7a6 100644 +index 99978948216ef39767cba16a85d52b4ddb77299c..771c0b10d171da56c5156a42a6ea70b51983c684 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -54,7 +54,7 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded diff --git a/Spigot-Server-Patches/0204-getPlayerUniqueId-API.patch b/Spigot-Server-Patches/0204-getPlayerUniqueId-API.patch index 8ac0396ea1..2388a121da 100644 --- a/Spigot-Server-Patches/0204-getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/0204-getPlayerUniqueId-API.patch @@ -9,10 +9,10 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a4114ed9f4aad72acc2cd21852614a11594569c4..90d0c8f4f48c514a003c119e47e869bc8d399839 100644 +index bbca08b277d52e5fc32fc12d178d35be91a19dfe..7bc98d983bec7a0164070571bdd53f9ff739b23a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1492,6 +1492,26 @@ public final class CraftServer implements Server { +@@ -1486,6 +1486,26 @@ public final class CraftServer implements Server { return recipients.size(); } diff --git a/Spigot-Server-Patches/0205-Make-player-data-saving-configurable.patch b/Spigot-Server-Patches/0205-Make-player-data-saving-configurable.patch index 87ddc9131f..b7a8d8814e 100644 --- a/Spigot-Server-Patches/0205-Make-player-data-saving-configurable.patch +++ b/Spigot-Server-Patches/0205-Make-player-data-saving-configurable.patch @@ -23,10 +23,10 @@ index cee8740e644c492e3d71fd58791e7d52d57e856d..f22bed69f690f6e4754b87dd61cebe9c + } } diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index ef9719bf20db92a7e6690bccb00cc54293d392a9..ae43d8d2af0daa68f13528d25bac1d94964662bc 100644 +index 9d81bb896e3688c644edf93cd9dfeadd9cdf8836..af9e94a87a946a4a9e2579a87f3f5a7adeb66f25 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -27,6 +27,7 @@ public class WorldNBTStorage { +@@ -25,6 +25,7 @@ public class WorldNBTStorage { } public void save(EntityHuman entityhuman) { diff --git a/Spigot-Server-Patches/0208-Flag-to-disable-the-channel-limit.patch b/Spigot-Server-Patches/0208-Flag-to-disable-the-channel-limit.patch index 9208815b0d..c5f31512b6 100644 --- a/Spigot-Server-Patches/0208-Flag-to-disable-the-channel-limit.patch +++ b/Spigot-Server-Patches/0208-Flag-to-disable-the-channel-limit.patch @@ -9,10 +9,10 @@ e.g. servers which allow and support the usage of mod packs. provide an optional flag to disable this check, at your own risk. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 649c773795744956da0c5a0f8971f3a2b98794c1..995d8e582a751e71516858a68bde3a34370f7d87 100644 +index 4bcf2ed3dd2a5d51e4490d4156978c8fff0df2b0..23889ce169baf956cfb39f1ec21a8369f80c5555 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -144,6 +144,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -141,6 +141,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper start private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; @@ -20,7 +20,7 @@ index 649c773795744956da0c5a0f8971f3a2b98794c1..995d8e582a751e71516858a68bde3a34 // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1508,7 +1509,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1501,7 +1502,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void addChannel(String channel) { diff --git a/Spigot-Server-Patches/0209-Add-method-to-open-already-placed-sign.patch b/Spigot-Server-Patches/0209-Add-method-to-open-already-placed-sign.patch index b1d6073ea4..fca74dafab 100644 --- a/Spigot-Server-Patches/0209-Add-method-to-open-already-placed-sign.patch +++ b/Spigot-Server-Patches/0209-Add-method-to-open-already-placed-sign.patch @@ -5,14 +5,13 @@ Subject: [PATCH] Add method to open already placed sign diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 1f715fb44b85f14664affcce9a11928dfc82991b..fe8a21202340c5892f5166ec294212c6e44ed3a5 100644 +index 79149583bae9c286a62ff4ea678925109b357775..41f6bc1c2c9307c21757555536b035547986c1ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -@@ -596,4 +596,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - entity.remove(); +@@ -597,6 +597,17 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { } } -+ + + // Paper start - Add method to open already placed sign + @Override + public void openSign(org.bukkit.block.Sign sign) { @@ -21,8 +20,9 @@ index 1f715fb44b85f14664affcce9a11928dfc82991b..fe8a21202340c5892f5166ec294212c6 + net.minecraft.server.TileEntitySign teSign = craftSign.getTileEntity(); + // Make sign editable temporarily, will be set back to false in PlayerConnection later + teSign.isEditable = true; -+ + getHandle().openSign(teSign); + } + // Paper end - } + @Override + public boolean dropItem(boolean dropAll) { + return getHandle().dropItem(dropAll); diff --git a/Spigot-Server-Patches/0210-Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/0210-Configurable-sprint-interruption-on-attack.patch index cb50a1f5d1..7fe953637f 100644 --- a/Spigot-Server-Patches/0210-Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/0210-Configurable-sprint-interruption-on-attack.patch @@ -20,10 +20,10 @@ index 3804c7cf96087cdf94fd5fbdce4ebcdafa9e0019..873f81c74a94f6d76edd45e34ddc476d + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 74950d74e6a11d5552369e830f9fdd63c4306221..e05e56f464c643925abfdf04bd745e3932ca001d 100644 +index 49f051a1f47c73a66cc462b3eecf72c4e932b648..9a55d1e6f4c6632c1f27d8c1fac55abc3c3d8204 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1091,7 +1091,11 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1086,7 +1086,11 @@ public abstract class EntityHuman extends EntityLiving { } this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); diff --git a/Spigot-Server-Patches/0211-Fix-exploit-that-allowed-colored-signs-to-be-created.patch b/Spigot-Server-Patches/0211-Fix-exploit-that-allowed-colored-signs-to-be-created.patch index 7d7c87ca1e..11517edabd 100644 --- a/Spigot-Server-Patches/0211-Fix-exploit-that-allowed-colored-signs-to-be-created.patch +++ b/Spigot-Server-Patches/0211-Fix-exploit-that-allowed-colored-signs-to-be-created.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix exploit that allowed colored signs to be created diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ccf083fbfa97b2a24338a3c1fe18e9a8c850feaf..411e6ff17ac50a410da038ad538ad56ba3aef8a8 100644 +index 4452a6e7f550f362145ce6533e6cc77c367793eb..f6d650ca21cef8961e88e07d767478eeb5ec15d1 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2542,7 +2542,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2537,7 +2537,7 @@ public class PlayerConnection implements PacketListenerPlayIn { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { diff --git a/Spigot-Server-Patches/0212-EndermanEscapeEvent.patch b/Spigot-Server-Patches/0212-EndermanEscapeEvent.patch index 1002240ce3..013fa77fa4 100644 --- a/Spigot-Server-Patches/0212-EndermanEscapeEvent.patch +++ b/Spigot-Server-Patches/0212-EndermanEscapeEvent.patch @@ -8,7 +8,7 @@ Fires an event anytime an enderman intends to teleport away from the player You may cancel this, enabling ranged attacks to damage the enderman for example. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5dcbe2002c 100644 +index eea2534be648bec49749bd8f55e36658dccdba57..f20283585464d54c4c5da294cf19261c2d258c97 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -19,7 +19,7 @@ index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5d import java.util.Random; import java.util.UUID; import java.util.function.Predicate; -@@ -56,6 +57,12 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -55,6 +56,12 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.UNKNOWN, true); } @@ -32,22 +32,22 @@ index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5d @Override public boolean setGoalTarget(EntityLiving entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason reason, boolean fireEvent) { if (!super.setGoalTarget(entityliving, reason, fireEvent)) { -@@ -209,7 +216,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - if (this.world.isDay() && this.ticksLived >= this.bz + 600) { - float f = this.aO(); +@@ -208,7 +215,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { + if (this.world.isDay() && this.ticksLived >= this.bs + 600) { + float f = this.aQ(); -- if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { -+ if (f > 0.5F && this.world.f(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper +- if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) { ++ if (f > 0.5F && this.world.e(this.getChunkCoordinates()) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F && this.tryEscape(EndermanEscapeEvent.Reason.RUNAWAY)) { // Paper this.setGoalTarget((EntityLiving) null); - this.eM(); + this.eL(); } -@@ -307,17 +314,19 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -306,17 +313,19 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { if (this.isInvulnerable(damagesource)) { return false; } else if (damagesource instanceof EntityDamageSourceIndirect) { + if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start for (int i = 0; i < 64; ++i) { - if (this.eM()) { + if (this.eL()) { return true; } } @@ -57,12 +57,12 @@ index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5d } else { boolean flag = super.damageEntity(damagesource, f); -- if (!this.world.s_() && this.random.nextInt(10) != 0) { -+ if (!this.world.s_() && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.CRITICAL_HIT)) { // Paper - this.eM(); +- if (!this.world.s_() && !(damagesource.getEntity() instanceof EntityLiving) && this.random.nextInt(10) != 0) { ++ if (!this.world.s_() && !(damagesource.getEntity() instanceof EntityLiving) && this.random.nextInt(10) != 0 && this.tryEscape(damagesource == DamageSource.DROWN ? EndermanEscapeEvent.Reason.DROWN : EndermanEscapeEvent.Reason.INDIRECT)) { // Paper - use to be critical hits as else, but mojang removed critical hits in 1.16.2 due to MC-185684 + this.eL(); } -@@ -459,7 +468,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -461,7 +470,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { static class PathfinderGoalPlayerWhoLookedAtTarget extends PathfinderGoalNearestAttackableTarget<EntityHuman> { @@ -71,12 +71,12 @@ index 37a4bce1cd24e04b70367484c1ad3beae047ab08..888e66520548a47dbfa1c452b0d3fa5d private EntityHuman j; private int k; private int l; -@@ -522,7 +531,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -524,7 +533,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { } else { if (this.c != null && !this.i.isPassenger()) { if (this.i.g((EntityHuman) this.c)) { - if (this.c.h((Entity) this.i) < 16.0D) { -+ if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { - this.i.eM(); ++ if (this.c.h((Entity) this.i) < 16.0D && this.getEnderman().tryEscape(EndermanEscapeEvent.Reason.STARE)) { // Paper + this.i.eL(); } diff --git a/Spigot-Server-Patches/0213-Enderman.teleportRandomly.patch b/Spigot-Server-Patches/0213-Enderman.teleportRandomly.patch index a068e22b2d..58fb313151 100644 --- a/Spigot-Server-Patches/0213-Enderman.teleportRandomly.patch +++ b/Spigot-Server-Patches/0213-Enderman.teleportRandomly.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Enderman.teleportRandomly() Ability to trigger the vanilla "teleport randomly" mechanic of an enderman. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 888e66520548a47dbfa1c452b0d3fa5dcbe2002c..67a678eceea5304d8ad1eaaee62c57c1088096f5 100644 +index f20283585464d54c4c5da294cf19261c2d258c97..c256fa48d64776ae7a7b21d42fb87c0a8ca7f3bc 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -225,6 +225,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -224,6 +224,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { super.mobTick(); } -+ public final boolean teleportRandomly() { return this.eM(); } // Paper - OBFHELPER - protected boolean eM() { ++ public final boolean teleportRandomly() { return this.eL(); } // Paper - OBFHELPER + protected boolean eL() { if (!this.world.s_() && this.isAlive()) { double d0 = this.locX() + (this.random.nextDouble() - 0.5D) * 64.0D; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderman.java diff --git a/Spigot-Server-Patches/0214-Block-Enderpearl-Travel-Exploit.patch b/Spigot-Server-Patches/0214-Block-Enderpearl-Travel-Exploit.patch index a17b0976b4..9cba82501e 100644 --- a/Spigot-Server-Patches/0214-Block-Enderpearl-Travel-Exploit.patch +++ b/Spigot-Server-Patches/0214-Block-Enderpearl-Travel-Exploit.patch @@ -27,7 +27,7 @@ index 873f81c74a94f6d76edd45e34ddc476dc525b47c..69009246f12cc3acb0055af746e01097 + } } diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index acdc5dcb18ade293923ef37dc8c29e96c0213942..dd4595ed07821f996e5a677dad5882656e19e7a2 100644 +index 676848e2b3cfc93b0b344b76b7a88e37549a25f2..0b62041f6dc9cb0151ea55407f6706cac134f1b5 100644 --- a/src/main/java/net/minecraft/server/IProjectile.java +++ b/src/main/java/net/minecraft/server/IProjectile.java @@ -48,6 +48,7 @@ public abstract class IProjectile extends Entity { diff --git a/Spigot-Server-Patches/0215-Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/0215-Expand-World.spawnParticle-API-and-add-Builder.patch index e584c43eda..3076171319 100644 --- a/Spigot-Server-Patches/0215-Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/0215-Expand-World.spawnParticle-API-and-add-Builder.patch @@ -10,10 +10,10 @@ Adds an option to control the force mode of the particle. This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 1ac19271391d437160e02983fbc4d707205c8893..5ccd9457f81dab2b2cb821960c0557c925623b50 100644 +index 173388ca55bd15ba88f730ec9108f738740d64c5..f841621a7fe1a2364f821ceb661972d6b03b3b9a 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -56,7 +56,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -57,7 +57,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { public final Int2ObjectMap<Entity> entitiesById = new Int2ObjectLinkedOpenHashMap(); private final Map<UUID, Entity> entitiesByUUID = Maps.newHashMap(); private final Queue<Entity> entitiesToAdd = Queues.newArrayDeque(); @@ -22,7 +22,7 @@ index 1ac19271391d437160e02983fbc4d707205c8893..5ccd9457f81dab2b2cb821960c0557c9 public final ChunkProviderServer chunkProvider; // Paper - public boolean tickingEntities; private final MinecraftServer server; -@@ -1309,12 +1309,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1348,12 +1348,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { } public <T extends ParticleParam> int sendParticles(EntityPlayer sender, T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6, boolean force) { @@ -43,10 +43,10 @@ index 1ac19271391d437160e02983fbc4d707205c8893..5ccd9457f81dab2b2cb821960c0557c9 if (this.a(entityplayer, force, d0, d1, d2, packetplayoutworldparticles)) { // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 214e3d1a626a3a3ff523904d15aec1e351b9957b..14e495f4889383c789acb880cca726c81c366d26 100644 +index be55c6c63607f14d457b24b381fcf213d36f6f33..ad9c067037c1575ac5fe7003b663eb0612deb11b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2329,11 +2329,17 @@ public class CraftWorld implements World { +@@ -2317,11 +2317,17 @@ public class CraftWorld implements World { @Override public <T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { diff --git a/Spigot-Server-Patches/0216-EndermanAttackPlayerEvent.patch b/Spigot-Server-Patches/0216-EndermanAttackPlayerEvent.patch index 0328ba25f6..42ae3cd790 100644 --- a/Spigot-Server-Patches/0216-EndermanAttackPlayerEvent.patch +++ b/Spigot-Server-Patches/0216-EndermanAttackPlayerEvent.patch @@ -8,10 +8,10 @@ Allow control over whether or not an enderman aggros a player. This allows you to override/extend the pumpkin/stare logic. diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 67a678eceea5304d8ad1eaaee62c57c1088096f5..7c13e5b711706c8aaa363d80350597a52920f12b 100644 +index c256fa48d64776ae7a7b21d42fb87c0a8ca7f3bc..d03c0b4ea5fad793a7bedad5ae3be0b779dc458c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -168,7 +168,15 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -167,7 +167,15 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { this.a((WorldServer) this.world, nbttagcompound); } diff --git a/Spigot-Server-Patches/0217-WitchConsumePotionEvent.patch b/Spigot-Server-Patches/0217-WitchConsumePotionEvent.patch index 164db395a9..562f3d81d0 100644 --- a/Spigot-Server-Patches/0217-WitchConsumePotionEvent.patch +++ b/Spigot-Server-Patches/0217-WitchConsumePotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index e146957d219960d0b6371b9460e73fb0ea150dde..a364ab990883bcdf84d8d92385a738200630864d 100644 +index 43bc7f509b00b40c3fa7031546a52154c39b093d..4f2212ed9abb00e86c3d80d7facc7298f7a07b89 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -85,7 +85,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { diff --git a/Spigot-Server-Patches/0218-WitchThrowPotionEvent.patch b/Spigot-Server-Patches/0218-WitchThrowPotionEvent.patch index 19bc42b807..09135fccfa 100644 --- a/Spigot-Server-Patches/0218-WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/0218-WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index a364ab990883bcdf84d8d92385a738200630864d..75d014ad49c701e4c693be4e2f8e7dc6d592fa5f 100644 +index 4f2212ed9abb00e86c3d80d7facc7298f7a07b89..2e085e3c4021719eeaefa0a3323f03567e988c81 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -185,9 +185,16 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { diff --git a/Spigot-Server-Patches/0219-Allow-spawning-Item-entities-with-World.spawnEntity.patch b/Spigot-Server-Patches/0219-Allow-spawning-Item-entities-with-World.spawnEntity.patch index 31fbe5481e..72cebe23f6 100644 --- a/Spigot-Server-Patches/0219-Allow-spawning-Item-entities-with-World.spawnEntity.patch +++ b/Spigot-Server-Patches/0219-Allow-spawning-Item-entities-with-World.spawnEntity.patch @@ -8,10 +8,10 @@ This API has more capabilities than .dropItem with the Consumer function Item can be set inside of the Consumer pre spawn function. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 14e495f4889383c789acb880cca726c81c366d26..1b04cb1c80f069bbe288857c5bd94cd7754ba49e 100644 +index ad9c067037c1575ac5fe7003b663eb0612deb11b..b092a01bc061563cb095b3d81e8595c26bf1e85e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1499,6 +1499,10 @@ public class CraftWorld implements World { +@@ -1485,6 +1485,10 @@ public class CraftWorld implements World { if (Boat.class.isAssignableFrom(clazz)) { entity = new EntityBoat(world, x, y, z); entity.setPositionRotation(x, y, z, yaw, pitch); diff --git a/Spigot-Server-Patches/0220-WitchReadyPotionEvent.patch b/Spigot-Server-Patches/0220-WitchReadyPotionEvent.patch index b609ec17fe..0b0c088d25 100644 --- a/Spigot-Server-Patches/0220-WitchReadyPotionEvent.patch +++ b/Spigot-Server-Patches/0220-WitchReadyPotionEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 75d014ad49c701e4c693be4e2f8e7dc6d592fa5f..a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf 100644 +index 2e085e3c4021719eeaefa0a3323f03567e988c81..fc58cce8455dcf244355189fabb1a76114c19368 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -118,7 +118,11 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { @@ -18,6 +18,6 @@ index 75d014ad49c701e4c693be4e2f8e7dc6d592fa5f..a6142ef24bc5bfa15a0ec84fbd8267ff + org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); + this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); + // Paper end - this.bx = this.getItemInMainHand().k(); + this.bq = this.getItemInMainHand().k(); this.v(true); if (!this.isSilent()) { diff --git a/Spigot-Server-Patches/0221-ItemStack-getMaxItemUseDuration.patch b/Spigot-Server-Patches/0221-ItemStack-getMaxItemUseDuration.patch index 0ef860b0f8..f4a31daa10 100644 --- a/Spigot-Server-Patches/0221-ItemStack-getMaxItemUseDuration.patch +++ b/Spigot-Server-Patches/0221-ItemStack-getMaxItemUseDuration.patch @@ -6,7 +6,7 @@ Subject: [PATCH] ItemStack#getMaxItemUseDuration Allows you to determine how long it takes to use a usable/consumable item diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index a62c2307a1d0f93c830fb3b125f03dc58757b8e6..d5350a382a70382a433e29a7c5a8879336c7568b 100644 +index 74de67380094261cb93264d760ddbbbd5cce8220..1a28e6f20340920c35bcd87a0dbfdcd745c79706 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -552,6 +552,7 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/0222-Implement-EntityTeleportEndGatewayEvent.patch b/Spigot-Server-Patches/0222-Implement-EntityTeleportEndGatewayEvent.patch index 4cf75627a4..e5691e15d8 100644 --- a/Spigot-Server-Patches/0222-Implement-EntityTeleportEndGatewayEvent.patch +++ b/Spigot-Server-Patches/0222-Implement-EntityTeleportEndGatewayEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement EntityTeleportEndGatewayEvent diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 4686880e1f37841ae0217654ed6aa8f813ad90a6..ea61a473d8e47428ed5cd4541a5855f0e2c50815 100644 +index 717c736cbc4defd24c5d08b501227bbd3e00a7e8..8eb1520d603aa59650418ee12cb1031168271fea 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -163,8 +163,19 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick +@@ -168,9 +168,20 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick } // CraftBukkit end @@ -22,10 +22,11 @@ index 4686880e1f37841ae0217654ed6aa8f813ad90a6..ea61a473d8e47428ed5cd4541a5855f0 + if (!event.callEvent()) { + return; + } ++ // Paper end + entity1.resetPortalCooldown(); - entity1.enderTeleportAndLoad((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D); -+ entity.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); -+ // Paper end - EntityTeleportEndGatewayEvent ++ entity1.enderTeleportAndLoad(event.getTo().getX(), event.getTo().getY(), event.getTo().getZ()); // Paper } this.h(); diff --git a/Spigot-Server-Patches/0223-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch b/Spigot-Server-Patches/0223-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch index 4f67347235..2a9b4bae77 100644 --- a/Spigot-Server-Patches/0223-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch +++ b/Spigot-Server-Patches/0223-Unset-Ignited-flag-on-cancel-of-Explosion-Event.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Unset Ignited flag on cancel of Explosion Event Otherwise the creeper infinite explodes diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index af9ac84c2caf42d0714d6050ee7db7e39a47878b..e4c1a7c152b2c1202c77e5d5d1c386d84007bc97 100644 +index 749c6e21cbd01a81196476728def640ba46a5783..055272e49ff522a009fcd335e2183172ada11c35 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -12,7 +12,7 @@ public class EntityCreeper extends EntityMonster { @@ -15,7 +15,7 @@ index af9ac84c2caf42d0714d6050ee7db7e39a47878b..e4c1a7c152b2c1202c77e5d5d1c386d8 private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); - private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); + private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER - private int bv; + private int bo; private int fuseTicks; public int maxFuseTicks = 30; @@ -217,6 +217,7 @@ public class EntityCreeper extends EntityMonster { diff --git a/Spigot-Server-Patches/0224-Fix-CraftEntity-hashCode.patch b/Spigot-Server-Patches/0224-Fix-CraftEntity-hashCode.patch index 6e4af9b3f9..f7555d389e 100644 --- a/Spigot-Server-Patches/0224-Fix-CraftEntity-hashCode.patch +++ b/Spigot-Server-Patches/0224-Fix-CraftEntity-hashCode.patch @@ -21,10 +21,10 @@ check is essentially the same as this.getHandle() == other.getHandle() However, replaced it too to make it clearer of intent. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 66edc6ae67084959503ffa0df2c04174fb29b8d8..51f027e8f98240fec989ea877095031bab087bda 100644 +index 1d3e4d5c88368f89f8b6da40788592362df8c87f..d55383d8fb471fe3441dbbc8e9344b42f1d7465b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -732,14 +732,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -738,14 +738,15 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { return false; } final CraftEntity other = (CraftEntity) obj; diff --git a/Spigot-Server-Patches/0226-Print-Error-details-when-failing-to-save-player-data.patch b/Spigot-Server-Patches/0226-Print-Error-details-when-failing-to-save-player-data.patch index 763ac896a6..353a864c72 100644 --- a/Spigot-Server-Patches/0226-Print-Error-details-when-failing-to-save-player-data.patch +++ b/Spigot-Server-Patches/0226-Print-Error-details-when-failing-to-save-player-data.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Print Error details when failing to save player data diff --git a/src/main/java/net/minecraft/server/WorldNBTStorage.java b/src/main/java/net/minecraft/server/WorldNBTStorage.java -index ae43d8d2af0daa68f13528d25bac1d94964662bc..41a1b93a9e0f16ed9415dfeccd490496650163cb 100644 +index af9e94a87a946a4a9e2579a87f3f5a7adeb66f25..859d604cf9bf72aff261af39eec495959a9ac04b 100644 --- a/src/main/java/net/minecraft/server/WorldNBTStorage.java +++ b/src/main/java/net/minecraft/server/WorldNBTStorage.java -@@ -38,7 +38,7 @@ public class WorldNBTStorage { +@@ -36,7 +36,7 @@ public class WorldNBTStorage { SystemUtils.a(file1, file, file2); } catch (Exception exception) { diff --git a/Spigot-Server-Patches/0227-Make-shield-blocking-delay-configurable.patch b/Spigot-Server-Patches/0227-Make-shield-blocking-delay-configurable.patch index 2b5c251881..e136dd9488 100644 --- a/Spigot-Server-Patches/0227-Make-shield-blocking-delay-configurable.patch +++ b/Spigot-Server-Patches/0227-Make-shield-blocking-delay-configurable.patch @@ -19,19 +19,19 @@ index 69009246f12cc3acb0055af746e01097fa668e1b..35075ffac394153e28039809e0ed48fe + } } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 35ec16b2bb0491e22ca834abc762f03fafdc764a..2fcae52461794f51d1ec0e3ca4817da026d3ae24 100644 +index edd9fd66780fa8f7d3b1d807918a0cd8adb42b66..a425ca17bfe5b6b4d1048e09d3723b0208dc8430 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3169,7 +3169,7 @@ public abstract class EntityLiving extends Entity { +@@ -3187,7 +3187,7 @@ public abstract class EntityLiving extends Entity { if (this.isHandRaised() && !this.activeItem.isEmpty()) { Item item = this.activeItem.getItem(); -- return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bk >= 5; -+ return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bk >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay +- return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bd >= 5; ++ return item.d_(this.activeItem) != EnumAnimation.BLOCK ? false : item.e_(this.activeItem) - this.bd >= getShieldBlockingDelay(); // Paper - shieldBlockingDelay } else { return false; } -@@ -3421,4 +3421,15 @@ public abstract class EntityLiving extends Entity { +@@ -3443,4 +3443,15 @@ public abstract class EntityLiving extends Entity { public void broadcastItemBreak(EnumHand enumhand) { this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } diff --git a/Spigot-Server-Patches/0228-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/0228-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 69070cfaed..765dfa9d49 100644 --- a/Spigot-Server-Patches/0228-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/0228-EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index 05ffe8af6a59e05d2c2e9567c675fd020d6b0723..84f83d48a8c41a26289ce0995aa9f5fd332c0ccb 100644 +index 3f4805af98aa5d27049ac12edd17455d78bf1827..1f7b50b559504d2e0b141525ef8c84c1ebd2225b 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -155,7 +155,7 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR @@ -72,10 +72,10 @@ index 1592e94c78611a4b968bfb24daf68570e778fadd..31c80bb0a2e403c34fb9cd4b3ee4e903 event.getProjectile().remove(); return; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index f26c68157cc97d28c309787c63a35d41c0094c29..8ec23b8eea3a5e27fb87f43aed12273b1c3f641a 100644 +index 6b67e509e8a714cdee69c20f4456c9a08574c848..0be27ad341ef59184d6c9f171e5e9f5a23d81f15 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -506,16 +506,16 @@ public class CraftEventFactory { +@@ -510,16 +510,16 @@ public class CraftEventFactory { /** * EntityShootBowEvent */ diff --git a/Spigot-Server-Patches/0229-PlayerReadyArrowEvent.patch b/Spigot-Server-Patches/0229-PlayerReadyArrowEvent.patch index a5613c4683..1f9af570a2 100644 --- a/Spigot-Server-Patches/0229-PlayerReadyArrowEvent.patch +++ b/Spigot-Server-Patches/0229-PlayerReadyArrowEvent.patch @@ -7,10 +7,10 @@ Called when a player is firing a bow and the server is choosing an arrow to use. Plugins can skip selection of certain arrows and control which is used. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index e05e56f464c643925abfdf04bd745e3932ca001d..a1cfa610eb3cc368b9641feeab709a4f5985ffbe 100644 +index 9a55d1e6f4c6632c1f27d8c1fac55abc3c3d8204..85d2f4bab52cef2822fb0431c9cf7b7becbd5ee7 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2045,6 +2045,17 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2044,6 +2044,17 @@ public abstract class EntityHuman extends EntityLiving { return ImmutableList.of(EntityPose.STANDING, EntityPose.CROUCHING, EntityPose.SWIMMING); } @@ -28,7 +28,7 @@ index e05e56f464c643925abfdf04bd745e3932ca001d..a1cfa610eb3cc368b9641feeab709a4f @Override public ItemStack f(ItemStack itemstack) { if (!(itemstack.getItem() instanceof ItemProjectileWeapon)) { -@@ -2061,7 +2072,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -2060,7 +2071,7 @@ public abstract class EntityHuman extends EntityLiving { for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack2 = this.inventory.getItem(i); diff --git a/Spigot-Server-Patches/0230-Fire-EntityShootBowEvent-for-Illusioner.patch b/Spigot-Server-Patches/0230-Fire-EntityShootBowEvent-for-Illusioner.patch index 947d348539..f57b41edb1 100644 --- a/Spigot-Server-Patches/0230-Fire-EntityShootBowEvent-for-Illusioner.patch +++ b/Spigot-Server-Patches/0230-Fire-EntityShootBowEvent-for-Illusioner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fire EntityShootBowEvent for Illusioner diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index 350c7f73e7c9dc43c57f6fb29b40760bf00826a3..76fd0513f3c89678809a28b9f1b22940fb5e5f23 100644 +index 2e03ddee685437061f123ede7c194b03d18076ee..1c82316208f83d539cb61b20abbeb46db66a8c0b 100644 --- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java @@ -134,8 +134,18 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan diff --git a/Spigot-Server-Patches/0231-Implement-EntityKnockbackByEntityEvent.patch b/Spigot-Server-Patches/0231-Implement-EntityKnockbackByEntityEvent.patch index 657df24ad4..1fb2f3891a 100644 --- a/Spigot-Server-Patches/0231-Implement-EntityKnockbackByEntityEvent.patch +++ b/Spigot-Server-Patches/0231-Implement-EntityKnockbackByEntityEvent.patch @@ -6,63 +6,63 @@ Subject: [PATCH] Implement EntityKnockbackByEntityEvent This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index a1cfa610eb3cc368b9641feeab709a4f5985ffbe..08141147f9795546e9397abed95834ed5e69a126 100644 +index 85d2f4bab52cef2822fb0431c9cf7b7becbd5ee7..0f7e162b342ac589dc357508a1dcd1ab02d1fe3e 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -1085,7 +1085,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1080,7 +1080,7 @@ public abstract class EntityHuman extends EntityLiving { if (flag5) { if (i > 0) { if (entity instanceof EntityLiving) { - ((EntityLiving) entity).a((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); + ((EntityLiving) entity).doKnockback((float) i * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper } else { - entity.h((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F)); + entity.i((double) (-MathHelper.sin(this.yaw * 0.017453292F) * (float) i * 0.5F), 0.1D, (double) (MathHelper.cos(this.yaw * 0.017453292F) * (float) i * 0.5F)); } -@@ -1109,7 +1109,7 @@ public abstract class EntityHuman extends EntityLiving { +@@ -1104,7 +1104,7 @@ public abstract class EntityHuman extends EntityLiving { if (entityliving != this && entityliving != entity && !this.r(entityliving) && (!(entityliving instanceof EntityArmorStand) || !((EntityArmorStand) entityliving).isMarker()) && this.h((Entity) entityliving) < 9.0D) { // CraftBukkit start - Only apply knockback if the damage hits if (entityliving.damageEntity(DamageSource.playerAttack(this).sweep(), f4)) { - entityliving.a(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); -+ entityliving.doKnockback(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); ++ entityliving.doKnockback(0.4F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper } // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index a6aa7a1a8da787604b2d8f3f9ea119d4b6bc188d..bb831658d91ffa7d78cd8597509e61f3f14b0890 100644 +index 3b12724a7bfa7a901261ff0c67338a08ccc1fc6f..bbb6dc6b7ca77779a1aab8b1437ee32509717efe 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1474,7 +1474,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1499,7 +1499,7 @@ public abstract class EntityInsentient extends EntityLiving { if (flag) { if (f1 > 0.0F && entity instanceof EntityLiving) { - ((EntityLiving) entity).a(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F))); -+ ((EntityLiving) entity).doKnockback(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); ++ ((EntityLiving) entity).doKnockback(f1 * 0.5F, (double) MathHelper.sin(this.yaw * 0.017453292F), (double) (-MathHelper.cos(this.yaw * 0.017453292F)), this); // Paper this.setMot(this.getMot().d(0.6D, 1.0D, 0.6D)); } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2fcae52461794f51d1ec0e3ca4817da026d3ae24..c549eda057b58b985bef98fabeaa642280cff1c3 100644 +index a425ca17bfe5b6b4d1048e09d3723b0208dc8430..fb1b1014c0538b84491c315e4f868b9854b4b640 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1239,7 +1239,7 @@ public abstract class EntityLiving extends Entity { } - this.aw = (float) (MathHelper.d(d1, d0) * 57.2957763671875D - (double) this.yaw); + this.ap = (float) (MathHelper.d(d1, d0) * 57.2957763671875D - (double) this.yaw); - this.a(0.4F, d0, d1); + this.doKnockback(0.4F, d0, d1, entity1); // Paper } else { - this.aw = (float) ((int) (Math.random() * 2.0D) * 180); + this.ap = (float) ((int) (Math.random() * 2.0D) * 180); } @@ -1287,7 +1287,7 @@ public abstract class EntityLiving extends Entity { } - protected void f(EntityLiving entityliving) { + protected void e(EntityLiving entityliving) { - entityliving.a(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ()); -+ entityliving.doKnockback(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ(), this); ++ entityliving.doKnockback(0.5F, entityliving.locX() - this.locX(), entityliving.locZ() - this.locZ(), this); // Paper } private boolean f(DamageSource damagesource) { -@@ -1522,6 +1522,11 @@ public abstract class EntityLiving extends Entity { +@@ -1523,6 +1523,11 @@ public abstract class EntityLiving extends Entity { } public void a(float f, double d0, double d1) { @@ -74,7 +74,7 @@ index 2fcae52461794f51d1ec0e3ca4817da026d3ae24..c549eda057b58b985bef98fabeaa6422 f = (float) ((double) f * (1.0D - this.b(GenericAttributes.KNOCKBACK_RESISTANCE))); if (f > 0.0F) { this.impulse = true; -@@ -1529,6 +1534,16 @@ public abstract class EntityLiving extends Entity { +@@ -1530,6 +1535,16 @@ public abstract class EntityLiving extends Entity { Vec3D vec3d1 = (new Vec3D(d0, 0.0D, d1)).d().a((double) f); this.setMot(vec3d.x / 2.0D - vec3d1.x, this.onGround ? Math.min(0.4D, vec3d.y / 2.0D + (double) f) : vec3d.y, vec3d.z / 2.0D - vec3d1.z); diff --git a/Spigot-Server-Patches/0232-Expand-Explosions-API.patch b/Spigot-Server-Patches/0232-Expand-Explosions-API.patch index e8e03b86c0..d9151a1682 100644 --- a/Spigot-Server-Patches/0232-Expand-Explosions-API.patch +++ b/Spigot-Server-Patches/0232-Expand-Explosions-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expand Explosions API Add Entity as a Source capability, and add more API choices, and on Location. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 1b04cb1c80f069bbe288857c5bd94cd7754ba49e..a8c88c676dacdf3397ce036ae2613ef0bcb7dcc5 100644 +index b092a01bc061563cb095b3d81e8595c26bf1e85e..f2badcd265fe717132a377da7ca8d11d64c32871 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -891,6 +891,11 @@ public class CraftWorld implements World { +@@ -877,6 +877,11 @@ public class CraftWorld implements World { public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { return !world.createExplosion(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? Explosion.Effect.BREAK : Explosion.Effect.NONE).wasCanceled; } diff --git a/Spigot-Server-Patches/0233-LivingEntity-Hand-Raised-Item-Use-API.patch b/Spigot-Server-Patches/0233-LivingEntity-Hand-Raised-Item-Use-API.patch index 509fe9cbd9..34a06a1e7f 100644 --- a/Spigot-Server-Patches/0233-LivingEntity-Hand-Raised-Item-Use-API.patch +++ b/Spigot-Server-Patches/0233-LivingEntity-Hand-Raised-Item-Use-API.patch @@ -6,25 +6,25 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API How long an entity has raised hands to charge an attack or use an item diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index c549eda057b58b985bef98fabeaa642280cff1c3..b7df37450c1fa4cdefa8267005d052180291d5ba 100644 +index fb1b1014c0538b84491c315e4f868b9854b4b640..84c330fd8f808775a42f0d0eddfe359b9d2f0c5b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -118,7 +118,7 @@ public abstract class EntityLiving extends Entity { - private float bB; + private float bu; private int jumpTicks; - private float bD; + private float bw; - protected ItemStack activeItem; + public ItemStack activeItem; // Paper - public - protected int bk; - protected int bl; - private BlockPosition bE; -@@ -3152,10 +3152,12 @@ public abstract class EntityLiving extends Entity { + protected int bd; + protected int be; + private BlockPosition bx; +@@ -3170,10 +3170,12 @@ public abstract class EntityLiving extends Entity { return this.activeItem; } + public int getItemUseRemainingTime() { return this.dY(); } // Paper - OBFHELPER public int dY() { - return this.bk; + return this.bd; } + public int getHandRaisedTime() { return this.dZ(); } // Paper - OBFHELPER diff --git a/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch b/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch index d633931458..23db1eb0bd 100644 --- a/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch +++ b/Spigot-Server-Patches/0235-Add-config-to-disable-ender-dragon-legacy-check.patch @@ -19,7 +19,7 @@ index 35075ffac394153e28039809e0ed48fe066a6223..6352051ab937d4d365e823a7112e76dc + } } diff --git a/src/main/java/net/minecraft/server/EnderDragonBattle.java b/src/main/java/net/minecraft/server/EnderDragonBattle.java -index 356defd19ebba5b051b7dbdcc21f0139bbdc4a84..e2c1de7ab246f1b4c8add06c513afc2eca97d796 100644 +index e77634bb4d33716ed41468722187080ae7243f3d..47182c5004f8023faeecec14a7fd090d40a14270 100644 --- a/src/main/java/net/minecraft/server/EnderDragonBattle.java +++ b/src/main/java/net/minecraft/server/EnderDragonBattle.java @@ -31,7 +31,7 @@ public class EnderDragonBattle { diff --git a/Spigot-Server-Patches/0236-Implement-World.getEntity-UUID-API.patch b/Spigot-Server-Patches/0236-Implement-World.getEntity-UUID-API.patch index 1bd8606751..b594abab1d 100644 --- a/Spigot-Server-Patches/0236-Implement-World.getEntity-UUID-API.patch +++ b/Spigot-Server-Patches/0236-Implement-World.getEntity-UUID-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement World.getEntity(UUID) API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a8c88c676dacdf3397ce036ae2613ef0bcb7dcc5..b1e51fa8593cd9459058a557f1b506817879bdd4 100644 +index f2badcd265fe717132a377da7ca8d11d64c32871..e5e27c2ecc92f1a8c33cc7442e7034de1b4a4a84 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1305,6 +1305,15 @@ public class CraftWorld implements World { +@@ -1291,6 +1291,15 @@ public class CraftWorld implements World { return list; } diff --git a/Spigot-Server-Patches/0237-InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/0237-InventoryCloseEvent-Reason-API.patch index 9396400529..5819d74b44 100644 --- a/Spigot-Server-Patches/0237-InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/0237-InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 08141147f9795546e9397abed95834ed5e69a126..d9e5d71a87140c90b79902887bd2f481f02956dc 100644 +index 0f7e162b342ac589dc357508a1dcd1ab02d1fe3e..cc20b73a993d021789840ed2ee7ba1fc8310dc5a 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -155,7 +155,7 @@ public abstract class EntityHuman extends EntityLiving { @@ -34,10 +34,10 @@ index 08141147f9795546e9397abed95834ed5e69a126..d9e5d71a87140c90b79902887bd2f481 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ffbcb26260 100644 +index 4be86db18a77af058a4227f6cb23abd2c5e41051..fa211442594c72c0d9b2fddc85472aa9939d6d1e 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -408,7 +408,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -412,7 +412,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // Paper end if (!this.world.isClientSide && !this.activeContainer.canUse(this)) { @@ -46,7 +46,7 @@ index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ff this.activeContainer = this.defaultContainer; } -@@ -582,7 +582,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -586,7 +586,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { // SPIGOT-943 - only call if they have an inventory open if (this.activeContainer != this.defaultContainer) { @@ -55,7 +55,7 @@ index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ff } String deathMessage = event.getDeathMessage(); -@@ -1163,7 +1163,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1138,7 +1138,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return OptionalInt.empty(); } else { if (this.activeContainer != this.defaultContainer) { @@ -64,7 +64,7 @@ index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ff } this.nextContainerCounter(); -@@ -1223,7 +1223,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1198,7 +1198,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end if (this.activeContainer != this.defaultContainer) { @@ -73,7 +73,7 @@ index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ff } // this.nextContainerCounter(); // CraftBukkit - moved up -@@ -1287,7 +1287,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1262,7 +1262,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @Override public void closeInventory() { @@ -88,10 +88,10 @@ index ef0f8a66eefefce5f78ff35833bfe45437885e0b..5053b1a09bd992b884a5871cb8f355ff this.o(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 411e6ff17ac50a410da038ad538ad56ba3aef8a8..201b2b0dcbaf6765390c18052f3b3450e63066e4 100644 +index f6d650ca21cef8961e88e07d767478eeb5ec15d1..5efc9dcafc3bbf5c1071ca12f1bd4413c05ee6ac 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2080,7 +2080,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2075,7 +2075,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinclosewindow, this, this.player.getWorldServer()); if (this.player.isFrozen()) return; // CraftBukkit @@ -101,7 +101,7 @@ index 411e6ff17ac50a410da038ad538ad56ba3aef8a8..201b2b0dcbaf6765390c18052f3b3450 this.player.o(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 628a5f109d6c44ba97876c42aefb5570deef6eb3..c4b0394d07b2af2ca14a68a300668197143e8fcc 100644 +index c17245bd2016507cce1cac087e03d3b0f4ee6043..8c77970d848b9628ddc4c66679d7ba8044641173 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -420,7 +420,7 @@ public abstract class PlayerList { @@ -114,10 +114,10 @@ index 628a5f109d6c44ba97876c42aefb5570deef6eb3..c4b0394d07b2af2ca14a68a300668197 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5ccd9457f81dab2b2cb821960c0557c925623b50..f8139831254e676c2142a39858e8c0629943badc 100644 +index f841621a7fe1a2364f821ceb661972d6b03b3b9a..d1699502eac193f25d2fc369526596a0b62574a3 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -966,7 +966,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1005,7 +1005,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { for (TileEntity tileentity : chunk.getTileEntities().values()) { if (tileentity instanceof IInventory) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((IInventory) tileentity).getViewers())) { @@ -126,7 +126,7 @@ index 5ccd9457f81dab2b2cb821960c0557c925623b50..f8139831254e676c2142a39858e8c062 } } } -@@ -1024,7 +1024,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1063,7 +1063,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Spigot Start if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) { for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { @@ -136,7 +136,7 @@ index 5ccd9457f81dab2b2cb821960c0557c925623b50..f8139831254e676c2142a39858e8c062 } // Spigot End diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index fe8a21202340c5892f5166ec294212c6e44ed3a5..00d67c9911c52ddcdf48fda7998bcd2a8a35f0eb 100644 +index 41f6bc1c2c9307c21757555536b035547986c1ab..af95aff8b0252917dd324faadf0dbc773cb38ba6 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -436,8 +436,13 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,10 +155,10 @@ index fe8a21202340c5892f5166ec294212c6e44ed3a5..00d67c9911c52ddcdf48fda7998bcd2a @Override public boolean isBlocking() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 995d8e582a751e71516858a68bde3a34370f7d87..59b3baaa84c2f1db2d17c677c9eb0299b1494329 100644 +index 23889ce169baf956cfb39f1ec21a8369f80c5555..25175230583bbd6fcfc864dcbae4111dcc0d3b33 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -797,7 +797,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -790,7 +790,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Close any foreign inventory if (getHandle().activeContainer != getHandle().defaultContainer) { @@ -168,10 +168,10 @@ index 995d8e582a751e71516858a68bde3a34370f7d87..59b3baaa84c2f1db2d17c677c9eb0299 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8ec23b8eea3a5e27fb87f43aed12273b1c3f641a..56ec85748aa8ea3956b3e8f67f27d9c4916e6082 100644 +index 0be27ad341ef59184d6c9f171e5e9f5a23d81f15..59bcf19d6c73ccc8f590a391b417f49178822cee 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1335,12 +1335,22 @@ public class CraftEventFactory { +@@ -1339,12 +1339,22 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0239-Vex-getSummoner-API.patch b/Spigot-Server-Patches/0238-Vex-getSummoner-API.patch index 82527c6c53..dc9166e4c2 100644 --- a/Spigot-Server-Patches/0239-Vex-getSummoner-API.patch +++ b/Spigot-Server-Patches/0238-Vex-getSummoner-API.patch @@ -6,15 +6,15 @@ Subject: [PATCH] Vex#getSummoner API Get's the NPC that summoned this Vex diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index 1eb39fd5cc4fd3b070dcaf64c467da76f99456fc..ab4ac736f8fcda1ed6b58abe0a4ecba58d3b5d43 100644 +index d69beb58d805d442e346725020fe47582841000f..a8e9b1e83969f4e49465fc5e8b5fb8a5efe5f81d 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java @@ -89,6 +89,7 @@ public class EntityVex extends EntityMonster { } -+ public EntityInsentient getOwner() { return eL(); } // Paper - OBFHELPER - public EntityInsentient eL() { ++ public EntityInsentient getOwner() { return eK(); } // Paper - OBFHELPER + public EntityInsentient eK() { return this.c; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVex.java diff --git a/Spigot-Server-Patches/0240-Refresh-player-inventory-when-cancelling-PlayerInter.patch b/Spigot-Server-Patches/0239-Refresh-player-inventory-when-cancelling-PlayerInter.patch index ffd4555d0d..625b42580a 100644 --- a/Spigot-Server-Patches/0240-Refresh-player-inventory-when-cancelling-PlayerInter.patch +++ b/Spigot-Server-Patches/0239-Refresh-player-inventory-when-cancelling-PlayerInter.patch @@ -16,10 +16,10 @@ Refresh the player inventory when PlayerInteractEntityEvent is cancelled to avoid this problem. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 201b2b0dcbaf6765390c18052f3b3450e63066e4..e3391017b3dcfbfc942b84118391928a6a5b807c 100644 +index 5efc9dcafc3bbf5c1071ca12f1bd4413c05ee6ac..229759f09687a61954b9c247d7e312a5a5f182b4 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1989,6 +1989,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1984,6 +1984,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } if (event.isCancelled()) { diff --git a/Spigot-Server-Patches/0241-Don-t-change-the-Entity-Random-seed-for-squids.patch b/Spigot-Server-Patches/0240-Don-t-change-the-Entity-Random-seed-for-squids.patch index 6b945b0334..735a4cde96 100644 --- a/Spigot-Server-Patches/0241-Don-t-change-the-Entity-Random-seed-for-squids.patch +++ b/Spigot-Server-Patches/0240-Don-t-change-the-Entity-Random-seed-for-squids.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Don't change the Entity Random seed for squids diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java -index 9c9ec8226ab43beaae0ef4abc97632b503e2120c..c9c0b2ab265666986cdedf920955ee55ebbedaf3 100644 +index 6a436c6edb4f2f17bbb165ff6497c15e476d3317..03d707ed09e08baf3992b3f4a0cc7e42e412d16b 100644 --- a/src/main/java/net/minecraft/server/EntitySquid.java +++ b/src/main/java/net/minecraft/server/EntitySquid.java @@ -21,7 +21,7 @@ public class EntitySquid extends EntityWaterAnimal { @@ -14,6 +14,6 @@ index 9c9ec8226ab43beaae0ef4abc97632b503e2120c..c9c0b2ab265666986cdedf920955ee55 super(entitytypes, world); - this.random.setSeed((long) this.getId()); + //this.random.setSeed((long) this.getId()); // Paper - this.bB = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; + this.bu = 1.0F / (this.random.nextFloat() + 1.0F) * 0.2F; } diff --git a/Spigot-Server-Patches/0242-Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/0241-Re-add-vanilla-entity-warnings-for-duplicates.patch index e5b9247967..7474f45c22 100644 --- a/Spigot-Server-Patches/0242-Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/0241-Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,16 +8,15 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f8139831254e676c2142a39858e8c0629943badc..161d489604faa34245bb5c831b1ee9e6d2a83dd4 100644 +index d1699502eac193f25d2fc369526596a0b62574a3..5e6a39ded0405d8ab8ba26d2a9f152cda0fa94fb 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -956,7 +956,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -958,7 +958,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { -- // WorldServer.LOGGER.warn("Keeping entity {} that already exists with UUID {}", EntityTypes.getName(entity1.getEntityType()), entity.getUniqueID().toString()); // CraftBukkit -+ WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", EntityTypes.getName(entity1.getEntityType()), entity.getUniqueID().toString()); // CraftBukkit // paper -+ WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper +- // WorldServer.LOGGER.warn("Trying to add entity with duplicated UUID {}. Existing {}#{}, new: {}#{}", uuid, EntityTypes.getName(entity1.getEntityType()), entity1.getId(), EntityTypes.getName(entity.getEntityType()), entity.getId()); // CraftBukkit ++ WorldServer.LOGGER.warn("Trying to add entity with duplicated UUID {}. Existing {}#{}, new: {}#{}", uuid, EntityTypes.getName(entity1.getEntityType()), entity1.getId(), EntityTypes.getName(entity.getEntityType()), entity.getId()); // CraftBukkit // Paper return true; } } diff --git a/Spigot-Server-Patches/0243-Avoid-item-merge-if-stack-size-above-max-stack-size.patch b/Spigot-Server-Patches/0242-Avoid-item-merge-if-stack-size-above-max-stack-size.patch index 84e8774cb6..8fd9abc479 100644 --- a/Spigot-Server-Patches/0243-Avoid-item-merge-if-stack-size-above-max-stack-size.patch +++ b/Spigot-Server-Patches/0242-Avoid-item-merge-if-stack-size-above-max-stack-size.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Avoid item merge if stack size above max stack size diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index cc173445caa0a064e724bc29b4955232a1dc1816..aad23b2c6cd674e05e609c4c019205978c6741f2 100644 +index 8eab278382a937da80b97a7dea212ca960d42289..d8f8d04d6cc25d468bee04e2cbcc02c6f8202a1d 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -177,6 +177,10 @@ public class EntityItem extends Entity { +@@ -182,6 +182,10 @@ public class EntityItem extends Entity { private void mergeNearby() { if (this.z()) { diff --git a/Spigot-Server-Patches/0244-Use-asynchronous-Log4j-2-loggers.patch b/Spigot-Server-Patches/0243-Use-asynchronous-Log4j-2-loggers.patch index a4a1825589..d756160de4 100644 --- a/Spigot-Server-Patches/0244-Use-asynchronous-Log4j-2-loggers.patch +++ b/Spigot-Server-Patches/0243-Use-asynchronous-Log4j-2-loggers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Use asynchronous Log4j 2 loggers diff --git a/pom.xml b/pom.xml -index accd4b6521b18495c933a50ed511b173cbb71861..6cde6f7dcbb3ff2fda0189a06573640777548d27 100644 +index 8cf6fe72894af9c359940a87dfa9937e5a78e79b..2c80b0933b09854228e1bfc19a0ae6278f8c662e 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,13 @@ diff --git a/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch b/Spigot-Server-Patches/0244-add-more-information-to-Entity.toString.patch index 6012b118f9..4487153687 100644 --- a/Spigot-Server-Patches/0245-add-more-information-to-Entity.toString.patch +++ b/Spigot-Server-Patches/0244-add-more-information-to-Entity.toString.patch @@ -6,10 +6,10 @@ Subject: [PATCH] add more information to Entity.toString() UUID, ticks lived, valid, dead diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b6a989378d1b6f6d05a52b20b0215feb093688f1..4647f3d38953c941d03f8b68dcc62a74e1cc4bd4 100644 +index 720bcc7855162a4578129adc5d4749763baa76fd..d62d25af15dee1457df85dbc4db6f7f0a632ecba 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2435,7 +2435,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2422,7 +2422,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public String toString() { diff --git a/Spigot-Server-Patches/0246-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/Spigot-Server-Patches/0245-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index a2ec272854..be9d6f8377 100644 --- a/Spigot-Server-Patches/0246-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/Spigot-Server-Patches/0245-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Debug Entities option to debug dupe uuid issues Add -Ddebug.entities=true to your JVM flags to gain more information diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 50f9d217494ab2823596523839d5992fc480912d..8e128fa303b345a10535630fd58442435ef1e439 100644 +index d62d25af15dee1457df85dbc4db6f7f0a632ecba..b1d7c30690e09f60075b9d2cff47d6a53115118b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -76,6 +76,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -78,6 +78,8 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; @@ -19,7 +19,7 @@ index 50f9d217494ab2823596523839d5992fc480912d..8e128fa303b345a10535630fd5844243 if (bukkitEntity == null) { bukkitEntity = CraftEntity.getEntity(world.getServer(), this); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 4ae3e91677ecf9c2104a229b4e8b229d18b87aa4..458802dc4b1f923b159168efff0546bb731da07b 100644 +index 8862bbd73b627e37709d46e6aeeee70c89cbd821..4bbcd00950405a4bf3ce391b557049a3b1d4aee8 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1093,6 +1093,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -40,7 +40,7 @@ index 4ae3e91677ecf9c2104a229b4e8b229d18b87aa4..458802dc4b1f923b159168efff0546bb protected void g() { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9c3c0a6ff57a8d1788cf6d7cd91571f4212eb701..530f204b9bcacdac127a44554e06aabac3897766 100644 +index 275442e07743e4e4e3f1468f58c50bb38ab7537a..b6af67e7625dd6e24fad5812d4b563b6ce91bede 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -68,6 +68,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -52,10 +52,10 @@ index 9c3c0a6ff57a8d1788cf6d7cd91571f4212eb701..530f204b9bcacdac127a44554e06aaba public boolean captureBlockStates = false; public boolean captureTreeGeneration = false; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 161d489604faa34245bb5c831b1ee9e6d2a83dd4..4907bfc3110dbf17a7d4ff255c04bf39697342f6 100644 +index 5e6a39ded0405d8ab8ba26d2a9f152cda0fa94fb..bd0e35fac15ca559d6508df8c7f593af036ab551 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -83,6 +83,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -84,6 +84,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { public final Convertable.ConversionSession convertable; public final UUID uuid; boolean hasPhysicsEvent = true; // Paper @@ -65,7 +65,7 @@ index 161d489604faa34245bb5c831b1ee9e6d2a83dd4..4907bfc3110dbf17a7d4ff255c04bf39 @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkProvider.getChunkAt(x, z, false); -@@ -918,8 +921,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -919,8 +922,28 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -95,7 +95,7 @@ index 161d489604faa34245bb5c831b1ee9e6d2a83dd4..4907bfc3110dbf17a7d4ff255c04bf39 // WorldServer.LOGGER.warn("Tried to add entity {} but it was marked as removed already", EntityTypes.getName(entity.getEntityType())); // CraftBukkit return false; } else if (this.isUUIDTaken(entity)) { -@@ -1079,7 +1102,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1117,7 +1140,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } diff --git a/Spigot-Server-Patches/0247-EnderDragon-Events.patch b/Spigot-Server-Patches/0246-EnderDragon-Events.patch index 1577dc2d0a..130b52ec2b 100644 --- a/Spigot-Server-Patches/0247-EnderDragon-Events.patch +++ b/Spigot-Server-Patches/0246-EnderDragon-Events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] EnderDragon Events diff --git a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java -index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..0d860d5dbef667b40a137127fcb73fd6611dcba8 100644 +index 771c0b10d171da56c5156a42a6ea70b51983c684..1ff1e2c788bb6c10132e45ef1c939725bac8fcbe 100644 --- a/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java +++ b/src/main/java/net/minecraft/server/DragonControllerLandedFlame.java @@ -71,7 +71,11 @@ public class DragonControllerLandedFlame extends AbstractDragonControllerLanded @@ -32,7 +32,7 @@ index fbc2ec88f7c71c853c492301986a23dafc8fa7a6..0d860d5dbef667b40a137127fcb73fd6 this.d.die(); this.d = null; diff --git a/src/main/java/net/minecraft/server/DragonControllerStrafe.java b/src/main/java/net/minecraft/server/DragonControllerStrafe.java -index 7c94faa59c2b9887292c6d88fa2e3bb46e3e67c7..ac546ff959510a2d0120c24c90bf13ff83873161 100644 +index 740d8a3bdf8a4097b7e1b75a08e0c9dc0eb6059a..48afea81d81ee3272389f88e2115ef8c851f81f0 100644 --- a/src/main/java/net/minecraft/server/DragonControllerStrafe.java +++ b/src/main/java/net/minecraft/server/DragonControllerStrafe.java @@ -71,7 +71,9 @@ public class DragonControllerStrafe extends AbstractDragonController { @@ -44,9 +44,9 @@ index 7c94faa59c2b9887292c6d88fa2e3bb46e3e67c7..ac546ff959510a2d0120c24c90bf13ff + else entitydragonfireball.die(); // Paper this.c = 0; if (this.d != null) { - while (!this.d.b()) { + while (!this.d.c()) { diff --git a/src/main/java/net/minecraft/server/EntityDragonFireball.java b/src/main/java/net/minecraft/server/EntityDragonFireball.java -index 743a08d18df8890a61eeb48984c0882bb353e15c..96fdf9d068c2df154dbc2fb7978b0ba7a030c834 100644 +index b75810cbe27ad3b0881259470b9838006c70f4b6..27032abad4f3da1d1b28a3cec49e3fc079deadb9 100644 --- a/src/main/java/net/minecraft/server/EntityDragonFireball.java +++ b/src/main/java/net/minecraft/server/EntityDragonFireball.java @@ -46,8 +46,10 @@ public class EntityDragonFireball extends EntityFireball { diff --git a/Spigot-Server-Patches/0248-PlayerElytraBoostEvent.patch b/Spigot-Server-Patches/0247-PlayerElytraBoostEvent.patch index f53dfa1f00..f53dfa1f00 100644 --- a/Spigot-Server-Patches/0248-PlayerElytraBoostEvent.patch +++ b/Spigot-Server-Patches/0247-PlayerElytraBoostEvent.patch diff --git a/Spigot-Server-Patches/0249-Improve-BlockPosition-inlining.patch b/Spigot-Server-Patches/0248-Improve-BlockPosition-inlining.patch index 340f7147c2..6e0a810ec9 100644 --- a/Spigot-Server-Patches/0249-Improve-BlockPosition-inlining.patch +++ b/Spigot-Server-Patches/0248-Improve-BlockPosition-inlining.patch @@ -21,7 +21,7 @@ This is based upon conclusions drawn from inspecting the assenmbly generated byt They had 'callq' (invoke) instead of 'mov' (get from memory) instructions. diff --git a/src/main/java/net/minecraft/server/BaseBlockPosition.java b/src/main/java/net/minecraft/server/BaseBlockPosition.java -index 8b202b342f899a38b989b683bd8be4f5c4061f48..1842e69839a65e7b8d2c47fd30ec8f3179f04470 100644 +index e126f9d1d03de085f2d09d53fe8bcc1972aedeff..4d574f83aff9fc295fb03c83cdb640a29fb40942 100644 --- a/src/main/java/net/minecraft/server/BaseBlockPosition.java +++ b/src/main/java/net/minecraft/server/BaseBlockPosition.java @@ -39,7 +39,7 @@ public class BaseBlockPosition implements Comparable<BaseBlockPosition> { @@ -62,10 +62,10 @@ index 8b202b342f899a38b989b683bd8be4f5c4061f48..1842e69839a65e7b8d2c47fd30ec8f31 } diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index f1ad6ad22a59b28d2e8aeb2c0f4c21bce6070bc5..48410cfbfe203dbe533294a7e4f261dba9c327cb 100644 +index 64e8088d394ddcda59d0209883b778ab74638c02..f112fe95cb89f6196a41252193e9eb44008cfc5f 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -81,6 +81,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -82,6 +82,7 @@ public class BlockPosition extends BaseBlockPosition { return a(this.getX(), this.getY(), this.getZ()); } diff --git a/Spigot-Server-Patches/0250-Optimize-RegistryID.c.patch b/Spigot-Server-Patches/0249-Optimize-RegistryID.c.patch index 73cc0f8294..192c4e4166 100644 --- a/Spigot-Server-Patches/0250-Optimize-RegistryID.c.patch +++ b/Spigot-Server-Patches/0249-Optimize-RegistryID.c.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize RegistryID.c() This is a frequent hotspot for world loading/saving. diff --git a/src/main/java/net/minecraft/server/RegistryID.java b/src/main/java/net/minecraft/server/RegistryID.java -index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610ecfb53a7b 100644 +index 5078a5ce391b445b64b2a16b123a3e3d5841619b..c35764009faeb3d2bb505b135dc542c7a580f254 100644 --- a/src/main/java/net/minecraft/server/RegistryID.java +++ b/src/main/java/net/minecraft/server/RegistryID.java @@ -14,12 +14,14 @@ public class RegistryID<K> implements Registry<K> { @@ -23,8 +23,8 @@ index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610e + this.usedIds = new java.util.BitSet(); // Paper } - public int getId(@Nullable K k0) { -@@ -48,9 +50,14 @@ public class RegistryID<K> implements Registry<K> { + // Paper start - decompile fix +@@ -51,9 +53,14 @@ public class RegistryID<K> implements Registry<K> { } private int c() { @@ -39,7 +39,7 @@ index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610e return this.e; } -@@ -64,6 +71,7 @@ public class RegistryID<K> implements Registry<K> { +@@ -67,6 +74,7 @@ public class RegistryID<K> implements Registry<K> { this.d = (K[]) (new Object[i]); // Paper - decompile fix this.e = 0; this.f = 0; @@ -47,7 +47,7 @@ index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610e for (int j = 0; j < ak.length; ++j) { if (ak[j] != null) { -@@ -89,6 +97,7 @@ public class RegistryID<K> implements Registry<K> { +@@ -92,6 +100,7 @@ public class RegistryID<K> implements Registry<K> { this.b[k] = k0; this.c[k] = i; this.d[i] = k0; @@ -55,7 +55,7 @@ index 6cdd4d46d987132c3c241800b5d59cee2dfa25e2..f9692408a1d177ba4668261070d7610e ++this.f; if (i == this.e) { ++this.e; -@@ -153,6 +162,7 @@ public class RegistryID<K> implements Registry<K> { +@@ -156,6 +165,7 @@ public class RegistryID<K> implements Registry<K> { Arrays.fill(this.d, (Object) null); this.e = 0; this.f = 0; diff --git a/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch b/Spigot-Server-Patches/0250-Option-to-prevent-armor-stands-from-doing-entity-loo.patch index 2942a85e48..c401592747 100644 --- a/Spigot-Server-Patches/0251-Option-to-prevent-armor-stands-from-doing-entity-loo.patch +++ b/Spigot-Server-Patches/0250-Option-to-prevent-armor-stands-from-doing-entity-loo.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Option to prevent armor stands from doing entity lookups diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index d6a3d882e375ac5a2b6ec8920532db615f4fe4ef..14bb9d843f05058cae5cc64de8149d2c97264f1a 100644 +index 6352051ab937d4d365e823a7112e76dc3ec34225..92ddf96f7db08a2b390ef3f49b0643f9d90bbea4 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -383,4 +383,9 @@ public class PaperWorldConfig { - log("Bed Search Radius: " + bedSearchRadius); - } +@@ -372,4 +372,9 @@ public class PaperWorldConfig { + private void scanForLegacyEnderDragon() { + scanForLegacyEnderDragon = getBoolean("game-mechanics.scan-for-legacy-ender-dragon", true); } + + public boolean armorStandEntityLookups = true; @@ -19,10 +19,10 @@ index d6a3d882e375ac5a2b6ec8920532db615f4fe4ef..14bb9d843f05058cae5cc64de8149d2c + } } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a970599a2a2faf604d1c79645c27610e39d73d82..66ad97dd4987544f7560b20afc6c72134968287b 100644 +index b6af67e7625dd6e24fad5812d4b563b6ce91bede..6202788306bea557c4699698a61c9336eb63a55d 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -837,6 +837,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -802,6 +802,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // Paper end } } diff --git a/Spigot-Server-Patches/0252-Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/0251-Vanished-players-don-t-have-rights.patch index e33e6d30b4..9d5df0dfaa 100644 --- a/Spigot-Server-Patches/0252-Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/0251-Vanished-players-don-t-have-rights.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Vanished players don't have rights diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 26d446077bb563ca3c5bb0339695b3364a3e41bf..88a1db211286fc8a6164312d7eb0839c00969e0e 100644 +index e7052aba9d63a296873044623808e003b3b453b7..916fb9b063f061d64da1c2ade1863a84313523cc 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java @@ -453,6 +453,7 @@ public abstract class BlockBase { @@ -17,10 +17,10 @@ index 26d446077bb563ca3c5bb0339695b3364a3e41bf..88a1db211286fc8a6164312d7eb0839c return this.getBlock().c(this.p(), iblockaccess, blockposition, voxelshapecollision); } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 8e128fa303b345a10535630fd58442435ef1e439..af6f0c391e6e410f0bf4e4e6ddf6fd18bb4d26ed 100644 +index b1d7c30690e09f60075b9d2cff47d6a53115118b..90f5d8c9d04463d65bf8ab936b07d829b2b9f55d 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -98,7 +98,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -100,7 +100,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private static double e = 1.0D; private final EntityTypes<?> f; private int id; @@ -29,20 +29,8 @@ index 8e128fa303b345a10535630fd58442435ef1e439..af6f0c391e6e410f0bf4e4e6ddf6fd18 public final List<Entity> passengers; protected int j; @Nullable -diff --git a/src/main/java/net/minecraft/server/EntityFireworks.java b/src/main/java/net/minecraft/server/EntityFireworks.java -index 5ac7957016d1ca6bc78ced0bcf3767d358677f45..ca92579304d060e2b718aab6f3e3f006d52f93e5 100644 ---- a/src/main/java/net/minecraft/server/EntityFireworks.java -+++ b/src/main/java/net/minecraft/server/EntityFireworks.java -@@ -118,7 +118,6 @@ public class EntityFireworks extends IProjectile { - this.move(EnumMoveType.SELF, vec3d); - this.setMot(vec3d); - } -- - MovingObjectPosition movingobjectposition = ProjectileHelper.a(this, this::a, RayTrace.BlockCollisionOption.COLLIDER); - - if (!this.noclip) { diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index dd4595ed07821f996e5a677dad5882656e19e7a2..f544178fa6ffd95c41cb721440d3a701c5c4331c 100644 +index 0b62041f6dc9cb0151ea55407f6706cac134f1b5..97aed437adb98bc468ec757df8b6d375b5101834 100644 --- a/src/main/java/net/minecraft/server/IProjectile.java +++ b/src/main/java/net/minecraft/server/IProjectile.java @@ -129,8 +129,14 @@ public abstract class IProjectile extends Entity { @@ -62,7 +50,7 @@ index dd4595ed07821f996e5a677dad5882656e19e7a2..f544178fa6ffd95c41cb721440d3a701 return false; } diff --git a/src/main/java/net/minecraft/server/ItemBlock.java b/src/main/java/net/minecraft/server/ItemBlock.java -index d83bd0169bb4b8c25f44ae3582e58b8fea97ecbd..63d2294da4f0da628e62b782b71e34cb3eb959b5 100644 +index 3bfcde5f7fa7f7f6393a9687e48fae8dc3aa33a0..bbb1de7d1adce6e986467db234b27518df4dd87f 100644 --- a/src/main/java/net/minecraft/server/ItemBlock.java +++ b/src/main/java/net/minecraft/server/ItemBlock.java @@ -154,7 +154,8 @@ public class ItemBlock extends Item { @@ -76,7 +64,7 @@ index d83bd0169bb4b8c25f44ae3582e58b8fea97ecbd..63d2294da4f0da628e62b782b71e34cb BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(blockactioncontext.getWorld(), blockactioncontext.getClickPosition()), player, CraftBlockData.fromData(iblockdata), defaultReturn); diff --git a/src/main/java/net/minecraft/server/VoxelShape.java b/src/main/java/net/minecraft/server/VoxelShape.java -index e985b0efc20f7d271be1c7ffc2670ab89fc3a6a7..c2b8c9820663f95f58f0c3a62cd9ec99c835a82f 100644 +index 30ddad5d98817eeb621de66a1a333d5013bfa9b1..eb926b74e17fb2f88c1d6ce2fb546541f8e6e274 100644 --- a/src/main/java/net/minecraft/server/VoxelShape.java +++ b/src/main/java/net/minecraft/server/VoxelShape.java @@ -46,6 +46,7 @@ public abstract class VoxelShape { @@ -88,7 +76,7 @@ index e985b0efc20f7d271be1c7ffc2670ab89fc3a6a7..c2b8c9820663f95f58f0c3a62cd9ec99 return (VoxelShape) (this.isEmpty() ? VoxelShapes.a() : new VoxelShapeArray(this.a, new DoubleListOffset(this.a(EnumDirection.EnumAxis.X), d0), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Y), d1), new DoubleListOffset(this.a(EnumDirection.EnumAxis.Z), d2))); } diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 86f6f082fe2991ea9065b09c9680b76ca1cf7154..b6e2a3d8d0cf510f497c6f974356fafaf2adc13b 100644 +index ed0f9c5d29c4f88b7beee4b0ecdd7a56de2d7a9e..881cea7c466f29ff4a89db28d104e8500a548b1f 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -35,6 +35,7 @@ public final class VoxelShapes { @@ -106,12 +94,12 @@ index 86f6f082fe2991ea9065b09c9680b76ca1cf7154..b6e2a3d8d0cf510f497c6f974356fafa + public static final boolean applyOperation(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { return VoxelShapes.c(voxelshape, voxelshape1, operatorboolean); } // Paper - OBFHELPER public static boolean c(VoxelShape voxelshape, VoxelShape voxelshape1, OperatorBoolean operatorboolean) { if (operatorboolean.apply(false, false)) { - throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException()); + throw (IllegalArgumentException) SystemUtils.c((Throwable) (new IllegalArgumentException())); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 26f6b50b202bc13cfb85c2d57580d6fff163e252..9b6912f6e7b3c289948325a6985d9c961a8a8e30 100644 +index 6202788306bea557c4699698a61c9336eb63a55d..5e6aa9cd63a103b9460c221a3e6c1e431d209d36 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -172,6 +172,46 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -178,6 +178,46 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.tileLimiter = new org.spigotmc.TickLimiter(spigotConfig.tileMaxTickTime); } @@ -159,10 +147,10 @@ index 26f6b50b202bc13cfb85c2d57580d6fff163e252..9b6912f6e7b3c289948325a6985d9c96 public boolean s_() { return this.isClientSide; diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 56ec85748aa8ea3956b3e8f67f27d9c4916e6082..2aa843b1f43540b92b5ba5b700203c71f16276fa 100644 +index 59bcf19d6c73ccc8f590a391b417f49178822cee..108289ba7ac5fdf08229bb23059847a178910695 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1206,6 +1206,14 @@ public class CraftEventFactory { +@@ -1210,6 +1210,14 @@ public class CraftEventFactory { Projectile projectile = (Projectile) entity.getBukkitEntity(); org.bukkit.entity.Entity collided = position.getEntity().getBukkitEntity(); com.destroystokyo.paper.event.entity.ProjectileCollideEvent event = new com.destroystokyo.paper.event.entity.ProjectileCollideEvent(projectile, collided); diff --git a/Spigot-Server-Patches/0253-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch b/Spigot-Server-Patches/0252-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch index 3cf45230b2..eba8fb9bb6 100644 --- a/Spigot-Server-Patches/0253-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch +++ b/Spigot-Server-Patches/0252-Mark-chunk-dirty-anytime-entities-change-to-guarante.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Mark chunk dirty anytime entities change to guarantee it diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fdc02b512f2d4bc968977564d520bc7ec7189c69..a27f91e6c3d1f5dd0adf8a3b48a640cc63676114 100644 +index e33711fc14323777c86a485dee20ebaeb3989614..bc249e399befa84cdf07cc58cd0072bb9cb5cced 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -519,6 +519,7 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0254-Add-some-Debug-to-Chunk-Entity-slices.patch b/Spigot-Server-Patches/0253-Add-some-Debug-to-Chunk-Entity-slices.patch index 3bb6f213ff..e1d2957add 100644 --- a/Spigot-Server-Patches/0254-Add-some-Debug-to-Chunk-Entity-slices.patch +++ b/Spigot-Server-Patches/0253-Add-some-Debug-to-Chunk-Entity-slices.patch @@ -9,7 +9,7 @@ This should hopefully avoid duplicate entities ever being created if the entity was to end up in 2 different chunk slices diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a27f91e6c3d1f5dd0adf8a3b48a640cc63676114..3ba19f75d24a1539c94f4fed9b8f90aecc918cdc 100644 +index bc249e399befa84cdf07cc58cd0072bb9cb5cced..3b3cae92513a85ba842d403c68f5a1fb8fde785d 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -510,6 +510,25 @@ public class Chunk implements IChunkAccess { @@ -58,10 +58,10 @@ index a27f91e6c3d1f5dd0adf8a3b48a640cc63676114..3ba19f75d24a1539c94f4fed9b8f90ae return; } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index af6f0c391e6e410f0bf4e4e6ddf6fd18bb4d26ed..b0338278f3cfecdb30e1d2febf1ff2a04d0cc66d 100644 +index 90f5d8c9d04463d65bf8ab936b07d829b2b9f55d..5e96d7a8adc043ff7e1451d4ecdacb2cfc9d08c6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -71,6 +71,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -73,6 +73,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } } }; diff --git a/Spigot-Server-Patches/0256-SkeletonHorse-Additions.patch b/Spigot-Server-Patches/0254-SkeletonHorse-Additions.patch index 4699e18102..acfb3783ac 100644 --- a/Spigot-Server-Patches/0256-SkeletonHorse-Additions.patch +++ b/Spigot-Server-Patches/0254-SkeletonHorse-Additions.patch @@ -5,15 +5,15 @@ Subject: [PATCH] SkeletonHorse Additions diff --git a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java -index 2aee4c592cbf7e083c522a35846735bdb7a2e448..43e605f682709708f5b79c70398691dc195ef925 100644 +index 187c21efe4899f84666af4007f34b488e3e7f7d4..abbc12c8e0767cf70ae5558979f1e49e8e52dd5c 100644 --- a/src/main/java/net/minecraft/server/EntityHorseSkeleton.java +++ b/src/main/java/net/minecraft/server/EntityHorseSkeleton.java @@ -6,7 +6,7 @@ public class EntityHorseSkeleton extends EntityHorseAbstract { - private final PathfinderGoalHorseTrap bD = new PathfinderGoalHorseTrap(this); - private boolean bE; -- private int bF; -+ private int bF; public int getTrapTime() { return this.bF; } // Paper - OBFHELPER + private final PathfinderGoalHorseTrap bw = new PathfinderGoalHorseTrap(this); + private boolean bx; +- private int by; ++ private int by; public int getTrapTime() { return this.by; } // Paper - OBFHELPER public EntityHorseSkeleton(EntityTypes<? extends EntityHorseSkeleton> entitytypes, World world) { super(entitytypes, world); @@ -21,25 +21,25 @@ index 2aee4c592cbf7e083c522a35846735bdb7a2e448..43e605f682709708f5b79c70398691dc return 0.96F; } -+ public boolean isTrap() { return this.eN(); } // Paper - OBFHELPER - public boolean eN() { - return this.bE; ++ public boolean isTrap() { return this.eM(); } // Paper - OBFHELPER + public boolean eM() { + return this.bx; } + public void setTrap(boolean trap) { this.t(trap); } // Paper - OBFHELPER public void t(boolean flag) { - if (flag != this.bE) { - this.bE = flag; + if (flag != this.bx) { + this.bx = flag; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -index d6b02adf9fe8287d600d76fb1c3be86fdee1fa77..b37e4aa37b35863d74cb6ef95562fba65486bdf9 100644 +index 8433a1a9a7de6a705a7fbecb593742ffa2e544f0..6a9af67d03737041a8f78c85a166c79a841ec8e5 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalHorseTrap.java -@@ -15,6 +15,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { - +@@ -16,6 +16,7 @@ public class PathfinderGoalHorseTrap extends PathfinderGoal { @Override public void e() { + WorldServer worldserver = (WorldServer) this.a.world; + if (!new com.destroystokyo.paper.event.entity.SkeletonHorseTrapEvent((org.bukkit.entity.SkeletonHorse) this.a.getBukkitEntity()).callEvent()) return; // Paper - DifficultyDamageScaler difficultydamagescaler = this.a.world.getDamageScaler(this.a.getChunkCoordinates()); + DifficultyDamageScaler difficultydamagescaler = worldserver.getDamageScaler(this.a.getChunkCoordinates()); this.a.t(false); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeletonHorse.java diff --git a/Spigot-Server-Patches/0255-EntityTransformedEvent.patch b/Spigot-Server-Patches/0255-EntityTransformedEvent.patch deleted file mode 100644 index a48a90a43a..0000000000 --- a/Spigot-Server-Patches/0255-EntityTransformedEvent.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Anthony MacAllister <[email protected]> -Date: Thu, 26 Jul 2018 15:30:03 -0400 -Subject: [PATCH] EntityTransformedEvent - - -diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index bb831658d91ffa7d78cd8597509e61f3f14b0890..8a79302b9cc178bfe4e0909293e3a87c01d344ca 100644 ---- a/src/main/java/net/minecraft/server/EntityInsentient.java -+++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1244,6 +1244,7 @@ public abstract class EntityInsentient extends EntityLiving { - if (CraftEventFactory.callEntityTransformEvent(this, t0, EntityTransformEvent.TransformReason.DROWNED).isCancelled()) { - return null; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), t0.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.DROWNED).callEvent()) return null; // Paper - this.world.addEntity(t0, CreatureSpawnEvent.SpawnReason.DROWNED); - // CraftBukkit end - this.die(); -diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java -index 48d7e0f971d3147218e3be774a75cdb10d8b55a6..23ef033067e388b7b7b2a981df8655e240a30594 100644 ---- a/src/main/java/net/minecraft/server/EntityMushroomCow.java -+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java -@@ -150,6 +150,7 @@ public class EntityMushroomCow extends EntityCow implements IShearable { - if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) { - return; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitycow.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHEARED).callEvent()) return; // Paper - this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED); - - this.die(); // CraftBukkit - from above -diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 00183a7f6e2000ce045ce50454f1296c4c93b148..a23c8d54a30a1ed1a3ed4d158da08229f59ca4c5 100644 ---- a/src/main/java/net/minecraft/server/EntityVillager.java -+++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -733,6 +733,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) { - return; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitywitch.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.LIGHTNING).callEvent()) return; // Paper - this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING); - // CraftBukkit end - this.die(); -diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 951cf5546af11434971a26dca15c20c25e6c555e..bb7f62fa52b758ed83db7def9053b79da3d97dcd 100644 ---- a/src/main/java/net/minecraft/server/EntityZombie.java -+++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -399,6 +399,7 @@ public class EntityZombie extends EntityMonster { - if (CraftEventFactory.callEntityTransformEvent(this, entityzombievillager, EntityTransformEvent.TransformReason.INFECTION).isCancelled()) { - return; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) return; // Paper - entityvillager.die(); // CraftBukkit - from above - this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason - // CraftBukkit end -diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java -index 2fb6356940b57e112d1ef35bfd3aee9cd98e5754..9b920332bd397f9711f0c99702245d54b9d3841b 100644 ---- a/src/main/java/net/minecraft/server/EntityZombieVillager.java -+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java -@@ -212,6 +212,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo - ((ZombieVillager) getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam - return; - } -+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.CURED).callEvent()) return; // Paper - this.die(); // CraftBukkit - from above - worldserver.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason - // CraftBukkit end diff --git a/Spigot-Server-Patches/0257-Prevent-Saving-Bad-entities-to-chunks.patch b/Spigot-Server-Patches/0255-Prevent-Saving-Bad-entities-to-chunks.patch index 466f028c4d..49a729621f 100644 --- a/Spigot-Server-Patches/0257-Prevent-Saving-Bad-entities-to-chunks.patch +++ b/Spigot-Server-Patches/0255-Prevent-Saving-Bad-entities-to-chunks.patch @@ -18,7 +18,7 @@ an invalid entity. This should reduce log occurrences of dupe uuid messages. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 28039aa8421207ce04840cc90e03d21bc8b7269f..17b8c4445af2bd2ed907d05ed3c396d4290dc63d 100644 +index f30071fe5c1f33386829cc61d8c6976a39eff24f..1e28061dd83a4bf2daab38aee84ddba3329b28dc 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -301,6 +301,7 @@ public class ChunkRegionLoader { @@ -80,10 +80,10 @@ index 28039aa8421207ce04840cc90e03d21bc8b7269f..17b8c4445af2bd2ed907d05ed3c396d4 public static ChunkStatus.Type a(@Nullable NBTTagCompound nbttagcompound) { if (nbttagcompound != null) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4907bfc3110dbf17a7d4ff255c04bf39697342f6..fb1e774f5868da170891de7183b63dc3a89ca935 100644 +index bd0e35fac15ca559d6508df8c7f593af036ab551..35116b1c893d0374359cc81bd8a29b5936940576 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -999,6 +999,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1037,6 +1037,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { List[] aentityslice = chunk.getEntitySlices(); // Spigot int i = aentityslice.length; @@ -91,8 +91,8 @@ index 4907bfc3110dbf17a7d4ff255c04bf39697342f6..fb1e774f5868da170891de7183b63dc3 for (int j = 0; j < i; ++j) { List<Entity> entityslice = aentityslice[j]; // Spigot Iterator iterator = entityslice.iterator(); -@@ -1011,11 +1012,25 @@ public class WorldServer extends World implements GeneratorAccessSeed { - throw (IllegalStateException) SystemUtils.c(new IllegalStateException("Removing entity while ticking!")); +@@ -1049,11 +1050,25 @@ public class WorldServer extends World implements GeneratorAccessSeed { + throw (IllegalStateException) SystemUtils.c((Throwable) (new IllegalStateException("Removing entity while ticking!"))); } + // Paper start - move out entities that shouldn't be in this chunk before it unloads diff --git a/Spigot-Server-Patches/0258-Don-t-call-getItemMeta-on-hasItemMeta.patch b/Spigot-Server-Patches/0256-Don-t-call-getItemMeta-on-hasItemMeta.patch index 69fb6e318b..69fb6e318b 100644 --- a/Spigot-Server-Patches/0258-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/Spigot-Server-Patches/0256-Don-t-call-getItemMeta-on-hasItemMeta.patch diff --git a/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch b/Spigot-Server-Patches/0257-Ignore-Dead-Entities-in-entityList-iteration.patch index d8411a6872..5a865aa927 100644 --- a/Spigot-Server-Patches/0259-Ignore-Dead-Entities-in-entityList-iteration.patch +++ b/Spigot-Server-Patches/0257-Ignore-Dead-Entities-in-entityList-iteration.patch @@ -23,7 +23,7 @@ index 9cb2f3b31921870ddba044840e99eb04babe26bb..f0a836db74ad3e20778d3863223bc9a3 MutablePair<Integer, Map<ChunkCoordIntPair, Integer>> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 170218bf175dc836da749f125b4775e9c5e4d5a8..795c9da02089fca71a1d5ff25fcbf1bcee9aed02 100644 +index 3b3cae92513a85ba842d403c68f5a1fb8fde785d..5ee581d1634f44a98756c5d11def9c3d46fd53e9 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -818,6 +818,7 @@ public class Chunk implements IChunkAccess { @@ -51,10 +51,10 @@ index 170218bf175dc836da749f125b4775e9c5e4d5a8..795c9da02089fca71a1d5ff25fcbf1bc if (oclass.isInstance(t0) && t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { // Spigot - instance check list.add(t0); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 953b9090da35dc1d40c1d89b2072b84d5b971da2..64a8efb51bef235644bb40836a59e5420fbc0d48 100644 +index 5e96d7a8adc043ff7e1451d4ecdacb2cfc9d08c6..1a05de09824360c451a4b0354d1a8f486432ec7b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -195,6 +195,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -192,6 +192,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end @@ -63,10 +63,10 @@ index 953b9090da35dc1d40c1d89b2072b84d5b971da2..64a8efb51bef235644bb40836a59e542 public float getBukkitYaw() { return this.yaw; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index fb1e774f5868da170891de7183b63dc3a89ca935..9cdb6ee9a718ed3464b525a4d79256b54617c2fb 100644 +index 35116b1c893d0374359cc81bd8a29b5936940576..13370a4a0d210bd3b14a26f60b1cd9a9a3a6c941 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1151,6 +1151,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1189,6 +1189,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.origin = entity.getBukkitEntity().getLocation(); } // Paper end @@ -74,7 +74,7 @@ index fb1e774f5868da170891de7183b63dc3a89ca935..9cdb6ee9a718ed3464b525a4d79256b5 new com.destroystokyo.paper.event.entity.EntityAddToWorldEvent(entity.getBukkitEntity()).callEvent(); // Paper - fire while valid } -@@ -1163,6 +1164,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1201,6 +1202,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.removeEntityFromChunk(entity); this.entitiesById.remove(entity.getId()); this.unregisterEntity(entity); @@ -83,10 +83,10 @@ index fb1e774f5868da170891de7183b63dc3a89ca935..9cdb6ee9a718ed3464b525a4d79256b5 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 5a434feea44b2564f154914569628aa205451836..f3c10aacb27bbefdf5519043acc7631a049c3f69 100644 +index e5e27c2ecc92f1a8c33cc7442e7034de1b4a4a84..fd314d9d530c347f9f78e81763a9a079b44aa751 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1041,6 +1041,7 @@ public class CraftWorld implements World { +@@ -1027,6 +1027,7 @@ public class CraftWorld implements World { for (Object o : world.entitiesById.values()) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -94,7 +94,7 @@ index 5a434feea44b2564f154914569628aa205451836..f3c10aacb27bbefdf5519043acc7631a Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -1060,6 +1061,7 @@ public class CraftWorld implements World { +@@ -1046,6 +1047,7 @@ public class CraftWorld implements World { for (Object o : world.entitiesById.values()) { if (o instanceof net.minecraft.server.Entity) { net.minecraft.server.Entity mcEnt = (net.minecraft.server.Entity) o; @@ -102,7 +102,7 @@ index 5a434feea44b2564f154914569628aa205451836..f3c10aacb27bbefdf5519043acc7631a Entity bukkitEntity = mcEnt.getBukkitEntity(); // Assuming that bukkitEntity isn't null -@@ -1086,6 +1088,7 @@ public class CraftWorld implements World { +@@ -1072,6 +1074,7 @@ public class CraftWorld implements World { for (Object entity: world.entitiesById.values()) { if (entity instanceof net.minecraft.server.Entity) { @@ -110,7 +110,7 @@ index 5a434feea44b2564f154914569628aa205451836..f3c10aacb27bbefdf5519043acc7631a Entity bukkitEntity = ((net.minecraft.server.Entity) entity).getBukkitEntity(); if (bukkitEntity == null) { -@@ -1109,6 +1112,7 @@ public class CraftWorld implements World { +@@ -1095,6 +1098,7 @@ public class CraftWorld implements World { for (Object entity: world.entitiesById.values()) { if (entity instanceof net.minecraft.server.Entity) { diff --git a/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch b/Spigot-Server-Patches/0258-Implement-Expanded-ArmorStand-API.patch index 7516179ce7..35ce86f43f 100644 --- a/Spigot-Server-Patches/0260-Implement-Expanded-ArmorStand-API.patch +++ b/Spigot-Server-Patches/0258-Implement-Expanded-ArmorStand-API.patch @@ -8,31 +8,31 @@ Add the following: - Enable/Disable slot interactions diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 0232ffba7b18174e0ce44d91285541a9869d07b9..8beb3cb9efbb8953dd24390fe58240f3b9841e79 100644 +index 9017b98799bde141002282a2709a3ad943999ccb..944c34a7011a0cfc447014e2931c8742f324fe59 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -36,7 +36,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -38,7 +38,7 @@ public class EntityArmorStand extends EntityLiving { private final NonNullList<ItemStack> armorItems; private boolean armorStandInvisible; - public long bp; -- private int bA; -+ private int bA; public final void setDisabledSlots(int i) { bA = i; } public final int getDisabledSlots() { return bA; } // Paper - OBFHELPER + public long bi; +- public int bv; //PAIL private -> public, rename disabledSlots ++ public int bv; public final void setDisabledSlots(int i) { bv = i; } public final int getDisabledSlots() { return bv; } // Paper - OBFHELPER public Vector3f headPose; public Vector3f bodyPose; public Vector3f leftArmPose; -@@ -385,6 +385,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -387,6 +387,7 @@ public class EntityArmorStand extends EntityLiving { return enumitemslot; } + public final boolean isSlotDisabled(EnumItemSlot slot) { return this.d(slot); } // Paper - OBFHELPER private boolean d(EnumItemSlot enumitemslot) { - return (this.bA & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); + return (this.bv & 1 << enumitemslot.c()) != 0 || enumitemslot.a() == EnumItemSlot.Function.HAND && !this.hasArms(); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index 124c3185bc5c344555f684629c8818130d80ab3d..d1d689e5d78c569313c4059c4652724605dc07d2 100644 +index 76176a3de05295a5493e0990116759505029dedc..83838500017025005b89361c0926b15eed003761 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -30,11 +30,13 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -32,11 +32,13 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { } @Override @@ -46,7 +46,7 @@ index 124c3185bc5c344555f684629c8818130d80ab3d..d1d689e5d78c569313c4059c46527246 public void setItemInHand(ItemStack item) { getEquipment().setItemInHand(item); } -@@ -222,5 +224,78 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -238,5 +240,78 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public void setCanMove(boolean move) { getHandle().canMove = move; } diff --git a/Spigot-Server-Patches/0261-AnvilDamageEvent.patch b/Spigot-Server-Patches/0259-AnvilDamageEvent.patch index d8bc4d00aa..d8bc4d00aa 100644 --- a/Spigot-Server-Patches/0261-AnvilDamageEvent.patch +++ b/Spigot-Server-Patches/0259-AnvilDamageEvent.patch diff --git a/Spigot-Server-Patches/0262-Add-TNTPrimeEvent.patch b/Spigot-Server-Patches/0260-Add-TNTPrimeEvent.patch index 86b01ed819..bdb3b686c1 100644 --- a/Spigot-Server-Patches/0262-Add-TNTPrimeEvent.patch +++ b/Spigot-Server-Patches/0260-Add-TNTPrimeEvent.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Add TNTPrimeEvent diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index 9c3b79c1314dedae06278328b6ca722d5ff1e60d..a11a775a929c5f868f1b84c56d7e1715a91db236 100644 +index 48b52b58ff4779fe92d17ab3b3c4cf608917a325..acd0ec4bf30c5d559d99ec449fef166ce59076e6 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java -@@ -2,6 +2,7 @@ package net.minecraft.server; - +@@ -3,6 +3,7 @@ package net.minecraft.server; + import com.google.common.collect.ImmutableMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; +import com.destroystokyo.paper.event.block.TNTPrimeEvent; // Paper - TNTPrimeEvent import java.util.Map; import java.util.Random; - -@@ -253,7 +254,7 @@ public class BlockFire extends BlockFireAbstract { + import java.util.function.Function; +@@ -269,7 +270,7 @@ public class BlockFire extends BlockFireAbstract { world.setTypeAndData(blockposition, this.a(world, blockposition, l), 3); } else { @@ -25,7 +25,7 @@ index 9c3b79c1314dedae06278328b6ca722d5ff1e60d..a11a775a929c5f868f1b84c56d7e1715 } Block block = iblockdata.getBlock(); -@@ -261,6 +262,13 @@ public class BlockFire extends BlockFireAbstract { +@@ -277,6 +278,13 @@ public class BlockFire extends BlockFireAbstract { if (block instanceof BlockTNT) { BlockTNT blocktnt = (BlockTNT) block; @@ -115,7 +115,7 @@ index c6fe9c1f7ef06c4524533130b493ca5e72bd1693..7b601955f3fd36f06c838b896b455a60 world.a(blockposition, false); } diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..3cb8ce58c4675564fb239338d6c40ea511a9a97c 100644 +index 6ad63e5bb4b7bec976d1aef74547ff96f64204c6..8da02467dff4b9da644aa12e453d127b7a01e259 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -11,6 +11,7 @@ import org.bukkit.craftbukkit.block.CraftBlock; @@ -128,7 +128,7 @@ index 05b7cdb33b45a4f503cd7fe4130b54d59e7b6452..3cb8ce58c4675564fb239338d6c40ea5 public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -466,6 +467,11 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { }); - craftBlock.getNMS().dropNaturally(world, blockposition, ItemStack.b); + craftBlock.getNMS().dropNaturally((WorldServer) world, blockposition, ItemStack.b); } + // Paper start - TNTPrimeEvent + org.bukkit.block.Block tntBlock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); diff --git a/Spigot-Server-Patches/0263-Break-up-and-make-tab-spam-limits-configurable.patch b/Spigot-Server-Patches/0261-Break-up-and-make-tab-spam-limits-configurable.patch index d3b964a7a4..fd498c1f5a 100644 --- a/Spigot-Server-Patches/0263-Break-up-and-make-tab-spam-limits-configurable.patch +++ b/Spigot-Server-Patches/0261-Break-up-and-make-tab-spam-limits-configurable.patch @@ -45,7 +45,7 @@ index c8a7d8092a2849b62a8d83d7970756fd76100025..2e5c71d6b7d120a308076d95a3d5b73c + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e3391017b3dcfbfc942b84118391928a6a5b807c..351cb9643b05e83f97a7976979346325e76f44da 100644 +index 229759f09687a61954b9c247d7e312a5a5f182b4..b02d1abd65ca113de622328f520bd4c8b56e3409 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -76,6 +76,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -64,7 +64,7 @@ index e3391017b3dcfbfc942b84118391928a6a5b807c..351cb9643b05e83f97a7976979346325 /* Use thread-safe field access instead if (this.chatThrottle > 0) { --this.chatThrottle; -@@ -529,7 +531,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -523,7 +525,7 @@ public class PlayerConnection implements PacketListenerPlayIn { public void a(PacketPlayInTabComplete packetplayintabcomplete) { // PlayerConnectionUtils.ensureMainThread(packetplayintabcomplete, this, this.player.getWorldServer()); // Paper - run this async // CraftBukkit start diff --git a/Spigot-Server-Patches/0264-Add-hand-to-bucket-events.patch b/Spigot-Server-Patches/0262-Add-hand-to-bucket-events.patch index f737594a60..1724bad964 100644 --- a/Spigot-Server-Patches/0264-Add-hand-to-bucket-events.patch +++ b/Spigot-Server-Patches/0262-Add-hand-to-bucket-events.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add hand to bucket events diff --git a/src/main/java/net/minecraft/server/EntityCow.java b/src/main/java/net/minecraft/server/EntityCow.java -index 28f97aea9c64678c6e6f821482ad47388af83089..30ee6df6b47c7cfa555a757a01270b986e4fdf9e 100644 +index c20484220edc849e43a1067d169d4d36f0059836..42e6761c8b18b79ffd3f4d5e853ea87a2c153c23 100644 --- a/src/main/java/net/minecraft/server/EntityCow.java +++ b/src/main/java/net/minecraft/server/EntityCow.java @@ -58,7 +58,7 @@ public class EntityCow extends EntityAnimal { @@ -73,10 +73,10 @@ index 48958308a89cbe39e1b4dddcdd8d1d0b5ece6339..120bf8436fd82294c339add2e7bff1cd int i = blockposition.getX(); int j = blockposition.getY(); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9b6912f6e7b3c289948325a6985d9c961a8a8e30..a0f93486b21e3bdbcf3b705c005c2e13f75589ed 100644 +index 5e6aa9cd63a103b9460c221a3e6c1e431d209d36..b46c6f7f5e8bf586235b3144dee4e4ce64e89947 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -212,6 +212,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -218,6 +218,17 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } // Paper end @@ -95,11 +95,11 @@ index 9b6912f6e7b3c289948325a6985d9c961a8a8e30..a0f93486b21e3bdbcf3b705c005c2e13 public boolean s_() { return this.isClientSide; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 9cdb6ee9a718ed3464b525a4d79256b54617c2fb..74d672b6a1beef5c4af8a2fcfc72486696fdcd05 100644 +index 13370a4a0d210bd3b14a26f60b1cd9a9a3a6c941..0b7047863bb3a3f3d61491bb1924b94a0305e40a 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1482,15 +1482,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { - this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition)); +@@ -1527,15 +1527,17 @@ public class WorldServer extends World implements GeneratorAccessSeed { + this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition, f)); } - public BlockPosition getSpawn() { @@ -123,13 +123,13 @@ index 9cdb6ee9a718ed3464b525a4d79256b54617c2fb..74d672b6a1beef5c4af8a2fcfc724866 + //} + // Paper end - public LongSet getForceLoadedChunks() { - ForcedChunk forcedchunk = (ForcedChunk) this.getWorldPersistentData().b(ForcedChunk::new, "chunks"); + public float v() { + return this.worldData.d(); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 2aa843b1f43540b92b5ba5b700203c71f16276fa..a86939235a1a5624710744ec3550e6131482c284 100644 +index 108289ba7ac5fdf08229bb23059847a178910695..c40004cc3a9583c9ece058ff8eb059731385c415 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -229,7 +229,7 @@ public class CraftEventFactory { +@@ -233,7 +233,7 @@ public class CraftEventFactory { public static Entity entityDamage; // For use in EntityDamageByEntityEvent // helper methods @@ -138,7 +138,7 @@ index 2aa843b1f43540b92b5ba5b700203c71f16276fa..a86939235a1a5624710744ec3550e613 int spawnSize = Bukkit.getServer().getSpawnRadius(); if (world.getDimensionKey() != World.OVERWORLD) return true; -@@ -408,6 +408,20 @@ public class CraftEventFactory { +@@ -412,6 +412,20 @@ public class CraftEventFactory { } private static PlayerEvent getPlayerBucketEvent(boolean isFilling, WorldServer world, EntityHuman who, BlockPosition changed, BlockPosition clicked, EnumDirection clickedFace, ItemStack itemstack, net.minecraft.server.Item item) { @@ -159,7 +159,7 @@ index 2aa843b1f43540b92b5ba5b700203c71f16276fa..a86939235a1a5624710744ec3550e613 Player player = (Player) who.getBukkitEntity(); CraftItemStack itemInHand = CraftItemStack.asNewCraftStack(item); Material bucket = CraftMagicNumbers.getMaterial(itemstack.getItem()); -@@ -420,10 +434,10 @@ public class CraftEventFactory { +@@ -424,10 +438,10 @@ public class CraftEventFactory { PlayerEvent event; if (isFilling) { diff --git a/Spigot-Server-Patches/0265-MC-135506-Experience-should-save-as-Integers.patch b/Spigot-Server-Patches/0263-MC-135506-Experience-should-save-as-Integers.patch index d04dfa6a4b..a2dd4567f0 100644 --- a/Spigot-Server-Patches/0265-MC-135506-Experience-should-save-as-Integers.patch +++ b/Spigot-Server-Patches/0263-MC-135506-Experience-should-save-as-Integers.patch @@ -5,7 +5,7 @@ Subject: [PATCH] MC-135506: Experience should save as Integers diff --git a/src/main/java/net/minecraft/server/EntityExperienceOrb.java b/src/main/java/net/minecraft/server/EntityExperienceOrb.java -index 7f2d8de12473c5413bbfc10ea0947d6a30802645..2396b4d6ffda648c24fc39cef22792c7d9247456 100644 +index a2eaea4bd847ebe0b3dc35c95c4c29d6c73f4797..e33a42dcd52ab1d027df542e044d84d42970559c 100644 --- a/src/main/java/net/minecraft/server/EntityExperienceOrb.java +++ b/src/main/java/net/minecraft/server/EntityExperienceOrb.java @@ -202,7 +202,7 @@ public class EntityExperienceOrb extends Entity { diff --git a/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch b/Spigot-Server-Patches/0264-Fix-client-rendering-skulls-from-same-user.patch index 0178734bcb..65eac974b0 100644 --- a/Spigot-Server-Patches/0266-Fix-client-rendering-skulls-from-same-user.patch +++ b/Spigot-Server-Patches/0264-Fix-client-rendering-skulls-from-same-user.patch @@ -12,7 +12,7 @@ This allows the client to render multiple skull textures from the same user, for when different skins were used when skull was made. diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index d5350a382a70382a433e29a7c5a8879336c7568b..95dc7e4a604e613751eb16b127e3203027c8c26d 100644 +index 1a28e6f20340920c35bcd87a0dbfdcd745c79706..64e9d50be03cbefa521bf8c2e6dba5ceadda78b6 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -60,7 +60,7 @@ public final class ItemStack { @@ -25,10 +25,10 @@ index d5350a382a70382a433e29a7c5a8879336c7568b..95dc7e4a604e613751eb16b127e32030 private Entity k; private ShapeDetectorBlock l; diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..7e116d83a62ef42e241ee9e05fdd7ecb30a2ed95 100644 +index 2976e8cc2da6e54e08e50ca1f5de5669823ef3f7..ee24acdd5e843e5421bf83bd6c069a4ecca09115 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java -@@ -274,9 +274,18 @@ public class PacketDataSerializer extends ByteBuf { +@@ -284,9 +284,18 @@ public class PacketDataSerializer extends ByteBuf { if (item.usesDurability() || item.n()) { // Spigot start - filter itemstack = itemstack.cloneItemStack(); @@ -48,7 +48,7 @@ index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..7e116d83a62ef42e241ee9e05fdd7ecb } this.a(nbttagcompound); -@@ -296,7 +305,16 @@ public class PacketDataSerializer extends ByteBuf { +@@ -306,7 +315,16 @@ public class PacketDataSerializer extends ByteBuf { itemstack.setTag(this.l()); // CraftBukkit start if (itemstack.getTag() != null) { @@ -67,10 +67,10 @@ index 6e049c2e2a142ce022b9dc278a3bb302f723e42c..7e116d83a62ef42e241ee9e05fdd7ecb // CraftBukkit end return itemstack; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index e336437207f9d6adbab69ef2785c129ff2ec1b36..72ff0a1e6428a1776f49c26e1715f5f2428ba242 100644 +index 36a7e41cc5036345929ebf4d2fa160a8c16c2c0a..0ef4fbb19fc816f578ad741c4406790f4185093d 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -60,6 +60,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -58,6 +58,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { if (this.f() || (i & 1 << j) != 0) { NBTTagCompound nbttagcompound = tileentity.b(); diff --git a/Spigot-Server-Patches/0267-Add-Early-Warning-Feature-to-WatchDog.patch b/Spigot-Server-Patches/0265-Add-Early-Warning-Feature-to-WatchDog.patch index 1601c8ca54..fc0c325694 100644 --- a/Spigot-Server-Patches/0267-Add-Early-Warning-Feature-to-WatchDog.patch +++ b/Spigot-Server-Patches/0265-Add-Early-Warning-Feature-to-WatchDog.patch @@ -36,10 +36,10 @@ index 2e5c71d6b7d120a308076d95a3d5b73c5aca8bc9..1b21911c3e4fd1d4a3305176bb8477c3 public static int tabSpamLimit = 500; private static void tabSpamLimiters() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 1698b42ed56a2932c5c1d60c655c9fd4cf5bed66..b13d8ec9aa0a51d5432129f1b0ecef3beb5b7276 100644 +index cf939069e5e77f79d598a91e77b42e04cecab671..64bf641e0c4e168526c56dd46a3dca7fb09a8d3f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -899,6 +899,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -897,6 +897,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.a(this.serverPing); // Spigot start @@ -48,10 +48,10 @@ index 1698b42ed56a2932c5c1d60c655c9fd4cf5bed66..b13d8ec9aa0a51d5432129f1b0ecef3b long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop lastTick = start - TICK_TIME; // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 90d0c8f4f48c514a003c119e47e869bc8d399839..599381fce26d81fdeb4bc277d93a672720aee35b 100644 +index 7bc98d983bec7a0164070571bdd53f9ff739b23a..20bf7dbfb206bc74f1b12c1bbf206ab5ce1ad3f4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -805,6 +805,7 @@ public final class CraftServer implements Server { +@@ -804,6 +804,7 @@ public final class CraftServer implements Server { @Override public void reload() { @@ -59,7 +59,7 @@ index 90d0c8f4f48c514a003c119e47e869bc8d399839..599381fce26d81fdeb4bc277d93a6727 reloadCount++; configuration = YamlConfiguration.loadConfiguration(getConfigFile()); commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile()); -@@ -923,6 +924,7 @@ public final class CraftServer implements Server { +@@ -922,6 +923,7 @@ public final class CraftServer implements Server { enablePlugins(PluginLoadOrder.STARTUP); enablePlugins(PluginLoadOrder.POSTWORLD); getPluginManager().callEvent(new ServerLoadEvent(ServerLoadEvent.LoadType.RELOAD)); diff --git a/Spigot-Server-Patches/0268-Make-EnderDragon-implement-Mob.patch b/Spigot-Server-Patches/0266-Make-EnderDragon-implement-Mob.patch index b2f36dac22..b2f36dac22 100644 --- a/Spigot-Server-Patches/0268-Make-EnderDragon-implement-Mob.patch +++ b/Spigot-Server-Patches/0266-Make-EnderDragon-implement-Mob.patch diff --git a/Spigot-Server-Patches/0269-Use-ConcurrentHashMap-in-JsonList.patch b/Spigot-Server-Patches/0267-Use-ConcurrentHashMap-in-JsonList.patch index 7ca2e839d1..143d413f65 100644 --- a/Spigot-Server-Patches/0269-Use-ConcurrentHashMap-in-JsonList.patch +++ b/Spigot-Server-Patches/0267-Use-ConcurrentHashMap-in-JsonList.patch @@ -122,7 +122,7 @@ index 5b01e4edb3c0f8bc785b70128cbe31b14356e4fb..9213bfb78e92b838189161045e394558 this.d.values().stream().map((jsonlistentry) -> { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index c4b0394d07b2af2ca14a68a300668197143e8fcc..d4e1fd05cbff3e0c0973a6188ec0469cd53c63f7 100644 +index 8c77970d848b9628ddc4c66679d7ba8044641173..3501588adf539a05a5056c9a4f45d49d9d656a37 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -543,7 +543,7 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0270-Use-a-Queue-for-Queueing-Commands.patch b/Spigot-Server-Patches/0268-Use-a-Queue-for-Queueing-Commands.patch index e805d87b65..881e330aa8 100644 --- a/Spigot-Server-Patches/0270-Use-a-Queue-for-Queueing-Commands.patch +++ b/Spigot-Server-Patches/0268-Use-a-Queue-for-Queueing-Commands.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use a Queue for Queueing Commands Lists are bad as Queues mmmkay. diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 13ae03d48a2a838ee9eb016072f3486d3c7192ef..e923835634f7440e5b88a9d5c62a70fcec8b688a 100644 +index ea7f7f4a97ed5e1b878ec6ba2976bafbeb063df2..b197aa44307aca7f0385ae9d2f5622e72bbffc0f 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -38,7 +38,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -18,7 +18,7 @@ index 13ae03d48a2a838ee9eb016072f3486d3c7192ef..e923835634f7440e5b88a9d5c62a70fc private RemoteStatusListener remoteStatusListener; public final RemoteControlCommandListener remoteControlCommandListener; private RemoteControlListener remoteControlListener; -@@ -395,8 +395,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -393,8 +393,10 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer public void handleCommandQueue() { MinecraftTimings.serverCommandTimer.startTiming(); // Spigot diff --git a/Spigot-Server-Patches/0271-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch b/Spigot-Server-Patches/0269-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch index 0d6ca14a7c..32a24fd889 100644 --- a/Spigot-Server-Patches/0271-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch +++ b/Spigot-Server-Patches/0269-Ability-to-get-Tile-Entities-from-a-chunk-without-sn.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ability to get Tile Entities from a chunk without snapshots diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index e34ecdeb21f262046fe5d4cf9f1d6ecd57d72ba9..2bd7d7959ce2845dbc09e198122e3574593dca58 100644 +index eaa60f89bf57f348a6be287b2478b33ca2320d07..3d18a95c9ce9e2fbe142b522d41045992002f715 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -128,9 +128,16 @@ public class CraftChunk implements Chunk { +@@ -129,9 +129,16 @@ public class CraftChunk implements Chunk { @Override public BlockState[] getTileEntities() { @@ -25,7 +25,7 @@ index e34ecdeb21f262046fe5d4cf9f1d6ecd57d72ba9..2bd7d7959ce2845dbc09e198122e3574 int index = 0; net.minecraft.server.Chunk chunk = getHandle(); -@@ -142,7 +149,7 @@ public class CraftChunk implements Chunk { +@@ -143,7 +150,7 @@ public class CraftChunk implements Chunk { } BlockPosition position = (BlockPosition) obj; diff --git a/Spigot-Server-Patches/0272-Allow-disabling-armour-stand-ticking.patch b/Spigot-Server-Patches/0270-Allow-disabling-armour-stand-ticking.patch index da966fa3fc..cc0a727b76 100644 --- a/Spigot-Server-Patches/0272-Allow-disabling-armour-stand-ticking.patch +++ b/Spigot-Server-Patches/0270-Allow-disabling-armour-stand-ticking.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow disabling armour stand ticking diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 14bb9d843f05058cae5cc64de8149d2c97264f1a..661694da6cfbed5e3e26de2355e67a5a6d17a3fc 100644 +index 92ddf96f7db08a2b390ef3f49b0643f9d90bbea4..414b9077317022e4efc0b1e547d7f387610146dc 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -388,4 +388,10 @@ public class PaperWorldConfig { +@@ -377,4 +377,10 @@ public class PaperWorldConfig { private void armorStandEntityLookups() { armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true); } @@ -20,10 +20,10 @@ index 14bb9d843f05058cae5cc64de8149d2c97264f1a..661694da6cfbed5e3e26de2355e67a5a + } } diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afdbd76b709 100644 +index 944c34a7011a0cfc447014e2931c8742f324fe59..4a4c2a7b117428137bed65ed66f207d693b90c4b 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -44,6 +44,12 @@ public class EntityArmorStand extends EntityLiving { +@@ -46,9 +46,16 @@ public class EntityArmorStand extends EntityLiving { public Vector3f leftLegPose; public Vector3f rightLegPose; public boolean canMove = true; // Paper @@ -36,15 +36,11 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) { super(entitytypes, world); -@@ -55,6 +61,7 @@ public class EntityArmorStand extends EntityLiving { - this.rightArmPose = EntityArmorStand.bt; - this.leftLegPose = EntityArmorStand.bu; - this.rightLegPose = EntityArmorStand.bv; + if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking - this.G = 0.0F; - } - -@@ -135,6 +142,7 @@ public class EntityArmorStand extends EntityLiving { + this.handItems = NonNullList.a(2, ItemStack.b); + this.armorItems = NonNullList.a(4, ItemStack.b); + this.headPose = EntityArmorStand.bj; +@@ -137,6 +144,7 @@ public class EntityArmorStand extends EntityLiving { this.armorItems.set(enumitemslot.b(), itemstack); } @@ -52,7 +48,7 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd } @Override -@@ -215,6 +223,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -217,6 +225,7 @@ public class EntityArmorStand extends EntityLiving { } nbttagcompound.set("Pose", this.B()); @@ -60,7 +56,7 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd } @Override -@@ -246,6 +255,12 @@ public class EntityArmorStand extends EntityLiving { +@@ -248,6 +257,12 @@ public class EntityArmorStand extends EntityLiving { this.setBasePlate(nbttagcompound.getBoolean("NoBasePlate")); this.setMarker(nbttagcompound.getBoolean("Marker")); this.noclip = !this.A(); @@ -73,7 +69,7 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd NBTTagCompound nbttagcompound1 = nbttagcompound.getCompound("Pose"); this.g(nbttagcompound1); -@@ -600,7 +615,29 @@ public class EntityArmorStand extends EntityLiving { +@@ -602,7 +617,29 @@ public class EntityArmorStand extends EntityLiving { @Override public void tick() { @@ -103,7 +99,7 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd Vector3f vector3f = (Vector3f) this.datawatcher.get(EntityArmorStand.c); if (!this.headPose.equals(vector3f)) { -@@ -723,31 +760,37 @@ public class EntityArmorStand extends EntityLiving { +@@ -725,29 +762,36 @@ public class EntityArmorStand extends EntityLiving { public void setHeadPose(Vector3f vector3f) { this.headPose = vector3f; this.datawatcher.set(EntityArmorStand.c, vector3f); @@ -129,35 +125,34 @@ index a70b1a17fe884980ef7c3c0a36e567a0e69ef7f0..d5c09152acc93b25d626284071599afd } public void setLeftLegPose(Vector3f vector3f) { ++ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking this.leftLegPose = vector3f; this.datawatcher.set(EntityArmorStand.g, vector3f); -+ this.noTickPoseDirty = true; // Paper - Allow updates when not ticking ++ } public void setRightLegPose(Vector3f vector3f) { - this.rightLegPose = vector3f; - this.datawatcher.set(EntityArmorStand.bo, vector3f); + this.noTickPoseDirty = true; // Paper - Allow updates when not ticking + this.rightLegPose = vector3f; + this.datawatcher.set(EntityArmorStand.bh, vector3f); } - - public Vector3f r() { diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index b7df37450c1fa4cdefa8267005d052180291d5ba..1aa9e57daa84f54271781cadc9826f12dc80201b 100644 +index 84c330fd8f808775a42f0d0eddfe359b9d2f0c5b..adc2ba97b0f258ae9fdbde0bcee02f63fc9fbac7 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2501,6 +2501,7 @@ public abstract class EntityLiving extends Entity { +@@ -2502,6 +2502,7 @@ public abstract class EntityLiving extends Entity { } } -+ public void updateEntityEquipment() { q(); }; // Paper - private void q() { - Map<EnumItemSlot, ItemStack> map = this.r(); ++ public final void updateEntityEquipment() { p(); }; // Paper - OBFHELPER + private void p() { + Map<EnumItemSlot, ItemStack> map = this.q(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -index d1d689e5d78c569313c4059c4652724605dc07d2..ac105270d5c7e2070f52782fc7dbdcd381db33a5 100644 +index 83838500017025005b89361c0926b15eed003761..4936266b1be1c0acd49fb8eabd7bc909b2f6de9e 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java -@@ -297,5 +297,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { +@@ -313,5 +313,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { public boolean isSlotDisabled(org.bukkit.inventory.EquipmentSlot slot) { return getHandle().isSlotDisabled(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot)); } diff --git a/Spigot-Server-Patches/0273-Optimize-BlockPosition-helper-methods.patch b/Spigot-Server-Patches/0271-Optimize-BlockPosition-helper-methods.patch index 5547e3f88a..593fcdf42c 100644 --- a/Spigot-Server-Patches/0273-Optimize-BlockPosition-helper-methods.patch +++ b/Spigot-Server-Patches/0271-Optimize-BlockPosition-helper-methods.patch @@ -6,17 +6,18 @@ Subject: [PATCH] Optimize BlockPosition helper methods Resolves #1338 diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 48410cfbfe203dbe533294a7e4f261dba9c327cb..b50d86b39d2296e1dfb9aaaeb8f8f6f62a4e7430 100644 +index f112fe95cb89f6196a41252193e9eb44008cfc5f..f068436960c96b0df427bcdf337a4dcc6a9f66f5 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -113,57 +113,74 @@ public class BlockPosition extends BaseBlockPosition { - } +@@ -115,58 +115,75 @@ public class BlockPosition extends BaseBlockPosition { + @Override public BlockPosition up() { - return this.shift(EnumDirection.UP); + return new BlockPosition(this.getX(), this.getY() + 1, this.getZ()); // Paper - Optimize BlockPosition } + @Override public BlockPosition up(int i) { - return this.shift(EnumDirection.UP, i); + return i == 0 ? this : new BlockPosition(this.getX(), this.getY() + i, this.getZ()); // Paper - Optimize BlockPosition diff --git a/Spigot-Server-Patches/0274-Restore-vanlla-default-mob-spawn-range.patch b/Spigot-Server-Patches/0272-Restore-vanlla-default-mob-spawn-range.patch index 85e9776191..85e9776191 100644 --- a/Spigot-Server-Patches/0274-Restore-vanlla-default-mob-spawn-range.patch +++ b/Spigot-Server-Patches/0272-Restore-vanlla-default-mob-spawn-range.patch diff --git a/Spigot-Server-Patches/0276-Slime-Pathfinder-Events.patch b/Spigot-Server-Patches/0273-Slime-Pathfinder-Events.patch index ba88f01bb1..740c5b7dfe 100644 --- a/Spigot-Server-Patches/0276-Slime-Pathfinder-Events.patch +++ b/Spigot-Server-Patches/0273-Slime-Pathfinder-Events.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Slime Pathfinder Events diff --git a/src/main/java/net/minecraft/server/EntitySlime.java b/src/main/java/net/minecraft/server/EntitySlime.java -index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3e1ef6496 100644 +index cb7cf185cc93813de97fbab830856573af8b6e73..f74c827850ebb894af94aecadcaa0e3ff8c6254c 100644 --- a/src/main/java/net/minecraft/server/EntitySlime.java +++ b/src/main/java/net/minecraft/server/EntitySlime.java -@@ -3,6 +3,14 @@ package net.minecraft.server; - import java.util.EnumSet; +@@ -5,6 +5,14 @@ import java.util.Objects; + import java.util.Optional; import java.util.Random; import javax.annotation.Nullable; +// Paper start @@ -24,25 +24,25 @@ index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3 import java.util.ArrayList; import java.util.List; @@ -65,6 +73,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { + @Override + public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); - nbttagcompound.setInt("Size", this.getSize() - 1); - nbttagcompound.setBoolean("wasOnGround", this.bw); + nbttagcompound.setBoolean("Paper.canWander", this.canWander); // Paper + nbttagcompound.setInt("Size", this.getSize() - 1); + nbttagcompound.setBoolean("wasOnGround", this.bp); } +@@ -79,6 +88,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { - @Override -@@ -78,6 +87,11 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.setSize(i + 1, false); super.loadData(nbttagcompound); - this.bw = nbttagcompound.getBoolean("wasOnGround"); + // Paper start - check exists before loading or this will be loaded as false + if (nbttagcompound.hasKey("Paper.canWander")) { + this.canWander = nbttagcompound.getBoolean("Paper.canWander"); + } + // Paper end + this.bp = nbttagcompound.getBoolean("wasOnGround"); } - public boolean eR() { @@ -358,7 +372,7 @@ public class EntitySlime extends EntityInsentient implements IMonster { @Override @@ -56,8 +56,8 @@ index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3 @Override public boolean a() { -- return (this.a.isInWater() || this.a.aN()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; -+ return (this.a.isInWater() || this.a.aN()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper +- return (this.a.isInWater() || this.a.aP()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; ++ return (this.a.isInWater() || this.a.aP()) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander && new SlimeSwimEvent((Slime) this.a.getBukkitEntity()).callEvent(); // Paper } @Override @@ -65,8 +65,8 @@ index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3 @Override public boolean a() { -- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aN() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; -+ return this.a.canWander && this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aN() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; +- return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aP() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime; ++ return this.a.getGoalTarget() == null && (this.a.onGround || this.a.isInWater() || this.a.aP() || this.a.hasEffect(MobEffects.LEVITATION)) && this.a.getControllerMove() instanceof EntitySlime.ControllerMoveSlime && this.a.canWander; // Paper - add canWander } @Override @@ -118,7 +118,7 @@ index 9c83389c56083d9febf604bf30da47c89330902e..a4642cc7390b08580d00689a853d59e3 @Override @@ -454,6 +488,13 @@ public class EntitySlime extends EntityInsentient implements IMonster { this.a.a((Entity) this.a.getGoalTarget(), 10.0F, 10.0F); - ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.eM()); + ((EntitySlime.ControllerMoveSlime) this.a.getControllerMove()).a(this.a.yaw, this.a.eL()); } + + // Paper start - clear timer and target when goal resets diff --git a/Spigot-Server-Patches/0277-Configurable-speed-for-water-flowing-over-lava.patch b/Spigot-Server-Patches/0274-Configurable-speed-for-water-flowing-over-lava.patch index f5c9d3c60c..17c5bc0881 100644 --- a/Spigot-Server-Patches/0277-Configurable-speed-for-water-flowing-over-lava.patch +++ b/Spigot-Server-Patches/0274-Configurable-speed-for-water-flowing-over-lava.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Configurable speed for water flowing over lava diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 661694da6cfbed5e3e26de2355e67a5a6d17a3fc..37bd28f18d3f48767d8141bde3395b8443d5650a 100644 +index 414b9077317022e4efc0b1e547d7f387610146dc..098c99793c68ac916b52776f9a1cc2c6510c0057 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -394,4 +394,10 @@ public class PaperWorldConfig { +@@ -383,4 +383,10 @@ public class PaperWorldConfig { this.armorStandTick = this.getBoolean("armor-stands-tick", this.armorStandTick); log("ArmorStand ticking is " + (this.armorStandTick ? "enabled" : "disabled") + " by default"); } @@ -20,7 +20,7 @@ index 661694da6cfbed5e3e26de2355e67a5a6d17a3fc..37bd28f18d3f48767d8141bde3395b84 + } } diff --git a/src/main/java/net/minecraft/server/BlockFluids.java b/src/main/java/net/minecraft/server/BlockFluids.java -index f00b403e1e12acbb8eb6ad55da219b257219a8f4..a28ac8b00b22a8c7afc2b64f9720a4e32b653e5f 100644 +index 4c076dd29cc221b43f9a53e484594dbb4dee56f5..07a9d462abad9a432dd5a153277839feeabad4bf 100644 --- a/src/main/java/net/minecraft/server/BlockFluids.java +++ b/src/main/java/net/minecraft/server/BlockFluids.java @@ -76,11 +76,28 @@ public class BlockFluids extends Block implements IFluidSource { diff --git a/Spigot-Server-Patches/0275-Fix-MC-124320.patch b/Spigot-Server-Patches/0275-Fix-MC-124320.patch deleted file mode 100644 index 7e383aa390..0000000000 --- a/Spigot-Server-Patches/0275-Fix-MC-124320.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: BillyGalbreath <[email protected]> -Date: Thu, 23 Aug 2018 09:25:30 -0500 -Subject: [PATCH] Fix MC-124320 - - -diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 247d9300a755aa22c2ca3bcef86b3b25f3ed75ee..bbd2e1be0f401d7e267dcfa2c905f42c2a475dd7 100644 ---- a/src/main/java/net/minecraft/server/Block.java -+++ b/src/main/java/net/minecraft/server/Block.java -@@ -93,6 +93,7 @@ public class Block extends BlockBase implements IMaterial { - return this == block; - } - -+ public static IBlockData getValidBlockForPosition(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { return Block.b(iblockdata, generatoraccess, blockposition); } // Paper - OBFHELPER - public static IBlockData b(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) { - IBlockData iblockdata1 = iblockdata; - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); -diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 7c13e5b711706c8aaa363d80350597a52920f12b..8da3b10cd6db379cf5d9d667154dd8911813284b 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderman.java -+++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -391,8 +391,9 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - if (block.a((Tag) TagsBlock.ENDERMAN_HOLDABLE) && flag) { - // CraftBukkit start - Pickup event - if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { -- this.enderman.setCarried(iblockdata); -+ //this.enderman.setCarried(iblockdata); // Paper - moved down - world.a(blockposition, false); -+ this.enderman.setCarried(Block.getValidBlockForPosition(iblockdata, this.enderman.world, blockposition)); // Paper - Fix MC-124320 - } - // CraftBukkit end - } -@@ -402,6 +403,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - - static class PathfinderGoalEndermanPlaceBlock extends PathfinderGoal { - -+ private EntityEnderman getEnderman() { return this.a; } // Paper - OBFHELPER - private final EntityEnderman a; - - public PathfinderGoalEndermanPlaceBlock(EntityEnderman entityenderman) { -@@ -424,7 +426,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { - IBlockData iblockdata = world.getType(blockposition); - BlockPosition blockposition1 = blockposition.down(); - IBlockData iblockdata1 = world.getType(blockposition1); -- IBlockData iblockdata2 = this.a.getCarried(); -+ IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320 - - if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) { - // CraftBukkit start - Place event diff --git a/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch b/Spigot-Server-Patches/0275-Optimize-CraftBlockData-Creation.patch index 637c01089a..636c1dc210 100644 --- a/Spigot-Server-Patches/0278-Optimize-CraftBlockData-Creation.patch +++ b/Spigot-Server-Patches/0275-Optimize-CraftBlockData-Creation.patch @@ -7,7 +7,7 @@ Avoids a hashmap lookup by cacheing a reference to the CraftBlockData and cloning it when one is needed. diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 88a1db211286fc8a6164312d7eb0839c00969e0e..aa4bfc9fe8e917c1c19838b0a7b045a11fc9300b 100644 +index 916fb9b063f061d64da1c2ade1863a84313523cc..4b1f8ceee358ed7dc17ff09c230ad7ec65e8f194 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java @@ -323,6 +323,14 @@ public abstract class BlockBase { diff --git a/Spigot-Server-Patches/0276-Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/0276-Optimize-RegistryMaterials.patch new file mode 100644 index 0000000000..c3f7153786 --- /dev/null +++ b/Spigot-Server-Patches/0276-Optimize-RegistryMaterials.patch @@ -0,0 +1,61 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +Date: Sun, 26 Aug 2018 20:49:50 -0400 +Subject: [PATCH] Optimize RegistryMaterials + +Use larger initial sizes to increase bucket capacity on the BiMap + +BiMap.get was seen to be using a good bit of CPU time. + +diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java +index 6000711dd40628bd80a681e63c053a403c88a883..b9de548c9049fca7a24b5259b6c9a01fca0f16ae 100644 +--- a/src/main/java/net/minecraft/server/RegistryMaterials.java ++++ b/src/main/java/net/minecraft/server/RegistryMaterials.java +@@ -26,6 +26,7 @@ import java.util.OptionalInt; + import java.util.Random; + import java.util.Set; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap; // Paper + import org.apache.commons.lang3.Validate; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -34,7 +35,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { + + protected static final Logger LOGGER = LogManager.getLogger(); + private final ObjectList<T> bf = new ObjectArrayList(256); +- private final Object2IntMap<T> bg = new Object2IntOpenCustomHashMap(SystemUtils.k()); ++ private final Reference2IntOpenHashMap<T> bg = new Reference2IntOpenHashMap<T>(2048);// Paper - use bigger expected size to reduce collisions and direct intent for FastUtil to be identity map + private final BiMap<MinecraftKey, T> bh; + private final BiMap<ResourceKey<T>, T> bi; + private final Map<T, Lifecycle> bj; +@@ -45,9 +46,9 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { + public RegistryMaterials(ResourceKey<? extends IRegistry<T>> resourcekey, Lifecycle lifecycle) { + super(resourcekey, lifecycle); + this.bg.defaultReturnValue(-1); +- this.bh = HashBiMap.create(); +- this.bi = HashBiMap.create(); +- this.bj = Maps.newIdentityHashMap(); ++ this.bh = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions ++ this.bi = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions ++ this.bj = new java.util.IdentityHashMap<>(2048); // Paper - use bigger expected size to reduce collisions + this.bk = lifecycle; + } + +@@ -191,7 +192,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { + this.b = collection.toArray(new Object[collection.size()]); + } + +- return SystemUtils.a(this.b, random); ++ return (T) SystemUtils.a(this.b, random); // Paper - Decompile fix + } + + public static <T> Codec<RegistryMaterials<T>> a(ResourceKey<? extends IRegistry<T>> resourcekey, Lifecycle lifecycle, Codec<T> codec) { +@@ -211,7 +212,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { + Iterator iterator = registrymaterials.iterator(); + + while (iterator.hasNext()) { +- T t0 = iterator.next(); ++ T t0 = (T) iterator.next(); // Paper - Decompile fix + + builder.add(new RegistryMaterials.a<>((ResourceKey) registrymaterials.c(t0).get(), registrymaterials.a(t0), t0)); + } diff --git a/Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch b/Spigot-Server-Patches/0277-Add-PhantomPreSpawnEvent.patch index 1fa24c5c4d..ac81226fe7 100644 --- a/Spigot-Server-Patches/0280-Add-PhantomPreSpawnEvent.patch +++ b/Spigot-Server-Patches/0277-Add-PhantomPreSpawnEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add PhantomPreSpawnEvent diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 457be7b726ccfdd7723a8eb5da69af96abc86870..47d82722e15c5b91a86af1a09807ccc37a1b37be 100644 +index 84edac9e18e4beab31c12e74e5e1ad51d3eae579..0605cb3e9873f92835e9f121b18c35e8eca5ccbb 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java @@ -125,6 +125,11 @@ public class EntityPhantom extends EntityFlying implements IMonster { @@ -48,7 +48,7 @@ index 457be7b726ccfdd7723a8eb5da69af96abc86870..47d82722e15c5b91a86af1a09807ccc3 private final PathfinderTargetCondition b; diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index c1ea64e2a474d58139a217d271c44f219b9ef0b6..39c5350373f6a5ad30f41e8886573d6b315924c6 100644 +index 8947c7dfb0d7520b6a8fb0a75ddaf8163fd4baa5..2e3d8d78c7a2b6c9a76c3446f8532137c537c79c 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java @@ -53,8 +53,17 @@ public class MobSpawnerPhantom implements MobSpawner { @@ -69,7 +69,7 @@ index c1ea64e2a474d58139a217d271c44f219b9ef0b6..39c5350373f6a5ad30f41e8886573d6b + entityphantom.spawningEntity = entityhuman.uniqueID; // Paper entityphantom.setPositionRotation(blockposition1, 0.0F, 0.0F); groupdataentity = entityphantom.prepare(worldserver, difficultydamagescaler, EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); - worldserver.addEntity(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit + worldserver.addAllEntities(entityphantom, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.NATURAL); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java index 9f9ee9239037acced498bbebe0ea396473b487ec..2b97313694605171ea4627edde036e3754b5e03b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPhantom.java diff --git a/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch b/Spigot-Server-Patches/0278-Add-More-Creeper-API.patch index e6f7752c89..7a61fd5280 100644 --- a/Spigot-Server-Patches/0281-Add-More-Creeper-API.patch +++ b/Spigot-Server-Patches/0278-Add-More-Creeper-API.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Add More Creeper API diff --git a/src/main/java/net/minecraft/server/EntityCreeper.java b/src/main/java/net/minecraft/server/EntityCreeper.java -index e4c1a7c152b2c1202c77e5d5d1c386d84007bc97..5e7f3af37b7cb068183fc2a7637b4c770fd5f936 100644 +index 055272e49ff522a009fcd335e2183172ada11c35..ad422dfafbfcf62f6aa483dafa9764c274414d8d 100644 --- a/src/main/java/net/minecraft/server/EntityCreeper.java +++ b/src/main/java/net/minecraft/server/EntityCreeper.java @@ -14,7 +14,7 @@ public class EntityCreeper extends EntityMonster { private static final DataWatcherObject<Boolean> POWERED = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> d = DataWatcher.a(EntityCreeper.class, DataWatcherRegistry.i); private static final DataWatcherObject<Boolean> isIgnitedDW = d; // Paper OBFHELPER - private int bv; + private int bo; - private int fuseTicks; + public int fuseTicks; // Paper - public public int maxFuseTicks = 30; public int explosionRadius = 3; - private int bz; + private int bs; @@ -254,7 +254,18 @@ public class EntityCreeper extends EntityMonster { } diff --git a/Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch b/Spigot-Server-Patches/0279-Inventory-removeItemAnySlot.patch index 7950dac2d1..fb782929de 100644 --- a/Spigot-Server-Patches/0282-Inventory-removeItemAnySlot.patch +++ b/Spigot-Server-Patches/0279-Inventory-removeItemAnySlot.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Inventory#removeItemAnySlot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index 98aea6b2917faa73ac2f1a070545449a4a195cf2..a04213325b8266623b076f1233539512a0a0207f 100644 +index 28b8f5f61872f4c21c81c524029454a2aaf74ea6..5e0180ac658db9d7c9d90fd3d3c4eddf6f34c90d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java @@ -223,10 +223,16 @@ public class CraftInventory implements Inventory { @@ -26,7 +26,7 @@ index 98aea6b2917faa73ac2f1a070545449a4a195cf2..a04213325b8266623b076f1233539512 for (int i = 0; i < inventory.length; i++) { if (inventory[i] == null) continue; -@@ -344,6 +350,17 @@ public class CraftInventory implements Inventory { +@@ -349,6 +355,17 @@ public class CraftInventory implements Inventory { @Override public HashMap<Integer, ItemStack> removeItem(ItemStack... items) { @@ -44,7 +44,7 @@ index 98aea6b2917faa73ac2f1a070545449a4a195cf2..a04213325b8266623b076f1233539512 Validate.notNull(items, "Items cannot be null"); HashMap<Integer, ItemStack> leftover = new HashMap<Integer, ItemStack>(); -@@ -354,7 +371,10 @@ public class CraftInventory implements Inventory { +@@ -359,7 +376,10 @@ public class CraftInventory implements Inventory { int toDelete = item.getAmount(); while (true) { diff --git a/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch b/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch deleted file mode 100644 index 3a6e2f060e..0000000000 --- a/Spigot-Server-Patches/0279-Optimize-RegistryMaterials.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Sun, 26 Aug 2018 20:49:50 -0400 -Subject: [PATCH] Optimize RegistryMaterials - -Use larger initial sizes to increase bucket capacity on the BiMap - -BiMap.get was seen to be using a good bit of CPU time. - -diff --git a/src/main/java/net/minecraft/server/RegistryMaterials.java b/src/main/java/net/minecraft/server/RegistryMaterials.java -index c60140a283df47edf23fe4f54a2c1d2fca7593f8..79817e3ffcac372e00b92c5b6bcb44653fcb73db 100644 ---- a/src/main/java/net/minecraft/server/RegistryMaterials.java -+++ b/src/main/java/net/minecraft/server/RegistryMaterials.java -@@ -25,9 +25,9 @@ import org.apache.logging.log4j.Logger; - public class RegistryMaterials<T> extends IRegistryWritable<T> { - - protected static final Logger LOGGER = LogManager.getLogger(); -- protected final RegistryID<T> b = new RegistryID<>(256); -- protected final BiMap<MinecraftKey, T> c = HashBiMap.create(); -- private final BiMap<ResourceKey<T>, T> bb = HashBiMap.create(); -+ protected final RegistryID<T> b = new RegistryID<>(2048); // Paper - use bigger expected size to reduce collisions -+ protected final BiMap<MinecraftKey, T> c = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions -+ private final BiMap<ResourceKey<T>, T> bb = HashBiMap.create(2048); // Paper - use bigger expected size to reduce collisions - private final Set<ResourceKey<T>> bc = Sets.newIdentityHashSet(); - protected Object[] d; - private int bd; -@@ -124,7 +124,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { - this.d = collection.toArray(new Object[collection.size()]); - } - -- return SystemUtils.a(this.d, random); -+ return (T) SystemUtils.a(this.d, random); // Paper - Decompile fix - } - - @Override -@@ -164,7 +164,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { - Iterator iterator = registrymaterials.b.iterator(); - - while (iterator.hasNext()) { -- T t0 = iterator.next(); -+ T t0 = (T) iterator.next(); // Paper - Decompile fix - - builder.add(Pair.of(registrymaterials.c(t0).get(), t0)); - } -@@ -191,7 +191,7 @@ public class RegistryMaterials<T> extends IRegistryWritable<T> { - - registrymaterials.bb.entrySet().stream().filter((entry) -> { - return registrymaterials.c((ResourceKey) entry.getKey()); -- }).forEach(com_google_common_collect_immutablemap_builder::put); -+ }).forEach(entry1 -> com_google_common_collect_immutablemap_builder.put((java.util.Map.Entry<? extends net.minecraft.server.ResourceKey<T>,? extends T>) entry1)); // Paper - compiler fix (expand method reference + add cast) - return com_google_common_collect_immutablemap_builder.build(); - }); - } diff --git a/Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch b/Spigot-Server-Patches/0280-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch index 0383b12533..8bc8afa5e4 100644 --- a/Spigot-Server-Patches/0283-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch +++ b/Spigot-Server-Patches/0280-Make-CraftWorld-loadChunk-int-int-false-load-unconve.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Make CraftWorld#loadChunk(int, int, false) load unconverted diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 898b97b52dd1bf8c5aa0b436b01ed0d83681810e..f0ce6bc613c85c6c76d1bb80701907720838d92d 100644 +index fd314d9d530c347f9f78e81763a9a079b44aa751..d193667beca3da156d8ae17cd80f4bf4c1dbfc8c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -502,7 +502,7 @@ public class CraftWorld implements World { +@@ -507,7 +507,7 @@ public class CraftWorld implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot diff --git a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch b/Spigot-Server-Patches/0281-Add-ray-tracing-methods-to-LivingEntity.patch index 0c3f7df803..511b48afa1 100644 --- a/Spigot-Server-Patches/0284-Add-ray-tracing-methods-to-LivingEntity.patch +++ b/Spigot-Server-Patches/0281-Add-ray-tracing-methods-to-LivingEntity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ray tracing methods to LivingEntity diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 1aa9e57daa84f54271781cadc9826f12dc80201b..ac5f11a2f5598584ff112a208bfd16aeb574e580 100644 +index adc2ba97b0f258ae9fdbde0bcee02f63fc9fbac7..5ebd2d25cc52de3f1a091f0620d6b46be4fca784 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3440,6 +3440,23 @@ public abstract class EntityLiving extends Entity { +@@ -3462,6 +3462,23 @@ public abstract class EntityLiving extends Entity { this.broadcastItemBreak(enumhand == EnumHand.MAIN_HAND ? EnumItemSlot.MAINHAND : EnumItemSlot.OFFHAND); } // Paper start diff --git a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch b/Spigot-Server-Patches/0282-Expose-attack-cooldown-methods-for-Player.patch index 9494e8d803..ad405aae6d 100644 --- a/Spigot-Server-Patches/0285-Expose-attack-cooldown-methods-for-Player.patch +++ b/Spigot-Server-Patches/0282-Expose-attack-cooldown-methods-for-Player.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Expose attack cooldown methods for Player diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 073faedf0c4fcf9e46be17b3a25d6467c2f1f880..fa656a424cebe42f12c3f8ecf82204e9d837c868 100644 +index cc20b73a993d021789840ed2ee7ba1fc8310dc5a..a6265c71973b67a0b49a41e2163a6f48876f1b41 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java -@@ -2006,6 +2006,7 @@ public abstract class EntityHuman extends EntityLiving { - this.datawatcher.set(EntityHuman.bs, nbttagcompound); +@@ -2005,6 +2005,7 @@ public abstract class EntityHuman extends EntityLiving { + this.datawatcher.set(EntityHuman.bl, nbttagcompound); } -+ public float getCooldownPeriod() { return this.eR(); } // Paper - OBFHELPER - public float eR() { ++ public float getCooldownPeriod() { return this.eQ(); } // Paper - OBFHELPER + public float eQ() { return (float) (1.0D / this.b(GenericAttributes.ATTACK_SPEED) * 20.0D); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 59b3baaa84c2f1db2d17c677c9eb0299b1494329..585e1b6de2a513a3c360e283ade360ed191cd643 100644 +index 25175230583bbd6fcfc864dcbae4111dcc0d3b33..b90b35c08cdc9bb44aaf9f4824289fd0824c937f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1977,6 +1977,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1970,6 +1970,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { getInventory().setItemInMainHand(hand); } diff --git a/Spigot-Server-Patches/0286-Improve-death-events.patch b/Spigot-Server-Patches/0283-Improve-death-events.patch index 58335c9550..a6fc3d8718 100644 --- a/Spigot-Server-Patches/0286-Improve-death-events.patch +++ b/Spigot-Server-Patches/0283-Improve-death-events.patch @@ -27,10 +27,10 @@ index 6281f7900afab3ef1c9ba3c034b91cbfa1900f50..7f3401d5d7878e4a0f407e92bf110dbe int i = this.f ? 300 : 100; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 64a8efb51bef235644bb40836a59e5420fbc0d48..b54b6c85188f231e768048c60c6cb7096a80df84 100644 +index 1a05de09824360c451a4b0354d1a8f486432ec7b..f3b69a5eb5d15738d7061e10643ace23bd3718c4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1460,6 +1460,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1453,6 +1453,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end @@ -38,19 +38,19 @@ index 64a8efb51bef235644bb40836a59e5420fbc0d48..b54b6c85188f231e768048c60c6cb709 public void a(Entity entity, int i, DamageSource damagesource) { if (entity instanceof EntityPlayer) { CriterionTriggers.c.a((EntityPlayer) entity, this, damagesource); -@@ -2349,6 +2350,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2336,6 +2337,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.fallDistance = 0.0F; } -+ public final void onKill(EntityLiving entityLiving) { this.a_(entityLiving); } // Paper - OBFHELPER - public void a_(EntityLiving entityliving) {} ++ public final void onKill(WorldServer worldserver, EntityLiving entityLiving) { this.a(worldserver, entityLiving); } // Paper - OBFHELPER + public void a(WorldServer worldserver, EntityLiving entityliving) {} - protected void k(double d0, double d1, double d2) { + protected void l(double d0, double d1, double d2) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index c3dcccd7ae8267e5db942b46d48ee8b71a680960..6606ef0c168556ce3961f7a98b21c49fcc23e5ca 100644 +index 4a4c2a7b117428137bed65ed66f207d693b90c4b..587e8e582dfe9c3127ca2b298c4e1db79c2d6c8e 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -701,7 +701,8 @@ public class EntityArmorStand extends EntityLiving { +@@ -703,7 +703,8 @@ public class EntityArmorStand extends EntityLiving { @Override public void killEntity() { @@ -61,10 +61,10 @@ index c3dcccd7ae8267e5db942b46d48ee8b71a680960..6606ef0c168556ce3961f7a98b21c49f } diff --git a/src/main/java/net/minecraft/server/EntityFox.java b/src/main/java/net/minecraft/server/EntityFox.java -index 95874526516291607a44ae2213d4d6d65edfe18d..e6275a9fe6cd988fe4661966fd48149c3e73408c 100644 +index 83fa99b1cf784eb7f30b14f9f0743cbab7136563..0ac0364ffeb81ac3f379848f6e1afae641658c73 100644 --- a/src/main/java/net/minecraft/server/EntityFox.java +++ b/src/main/java/net/minecraft/server/EntityFox.java -@@ -576,15 +576,25 @@ public class EntityFox extends EntityAnimal { +@@ -577,15 +577,25 @@ public class EntityFox extends EntityAnimal { } @Override @@ -94,7 +94,7 @@ index 95874526516291607a44ae2213d4d6d65edfe18d..e6275a9fe6cd988fe4661966fd48149c public static boolean a(EntityFox entityfox, EntityLiving entityliving) { diff --git a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java -index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e212040ed3 100644 +index 29d1b9bb4e481b6d6fb7185d9adf17f5ec07d4a1..c14d722e9b1ed61d2878ca752797871b6de39ac9 100644 --- a/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java +++ b/src/main/java/net/minecraft/server/EntityHorseChestedAbstract.java @@ -50,11 +50,19 @@ public abstract class EntityHorseChestedAbstract extends EntityHorseAbstract { @@ -119,18 +119,18 @@ index c2a3bd8f25e91f79723074d93f6a646a8ce76d8c..4934e71225fe1242615660a379e797e2 public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8a142125e 100644 +index 5ebd2d25cc52de3f1a091f0620d6b46be4fca784..b4b45d93188494ae0639ae4eb9c764a48fe21607 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -95,7 +95,7 @@ public abstract class EntityLiving extends Entity { - protected float aS; - protected float aT; - protected float aU; -- protected int aV; -+ protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER + protected float aL; + protected float aM; + protected float aN; +- protected int aO; ++ protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER public float lastDamage; protected boolean jumping; - public float aY; + public float aR; @@ -139,6 +139,7 @@ public abstract class EntityLiving extends Entity { public Set<UUID> collidableExemptions = new HashSet<>(); public boolean canPickUpLoot; @@ -161,15 +161,15 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 } } else if (flag1) { this.c(damagesource); -@@ -1392,6 +1397,7 @@ public abstract class EntityLiving extends Entity { +@@ -1393,6 +1398,7 @@ public abstract class EntityLiving extends Entity { Entity entity = damagesource.getEntity(); EntityLiving entityliving = this.getKillingEntity(); -+ /* // Paper - move down to make death event cancellable - if (this.aV >= 0 && entityliving != null) { - entityliving.a(this, this.aV, damagesource); ++ /* // Paper - move down to make death event cancellable - this is the runKillTrigger below + if (this.aO >= 0 && entityliving != null) { + entityliving.a(this, this.aO, damagesource); } -@@ -1403,16 +1409,36 @@ public abstract class EntityLiving extends Entity { +@@ -1400,20 +1406,40 @@ public abstract class EntityLiving extends Entity { if (this.isSleeping()) { this.entityWakeup(); } @@ -177,28 +177,33 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 this.killed = true; - this.getCombatTracker().g(); -+ //this.getCombatTracker().g(); // Paper - if (!this.world.isClientSide) { ++ // this.getCombatTracker().g(); // Paper - moved into if below as .reset() + if (this.world instanceof WorldServer) { + if (entity != null) { +- entity.a((WorldServer) this.world, this); ++ // entity.a((WorldServer) this.world, this); // Paper - move below into if for onKill + } + - this.d(damagesource); ++ // Paper start + org.bukkit.event.entity.EntityDeathEvent deathEvent = this.d(damagesource); + if (deathEvent == null || !deathEvent.isCancelled()) { + if (this.getKillCount() >= 0 && entityliving != null) { + entityliving.runKillTrigger(this, this.getKillCount(), damagesource); + } -+ if (entity != null) { -+ entity.onKill(this); -+ } + if (this.isSleeping()) { + this.entityWakeup(); + } + this.getCombatTracker().reset(); ++ if (entity != null) { ++ entity.onKill((WorldServer) this.world, this); ++ } + } else { + this.killed = false; + this.setHealth((float) deathEvent.getReviveHealth()); + } + // Paper end -+ - this.g(entityliving); + this.f(entityliving); } + if (this.killed) { // Paper @@ -208,7 +213,7 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 } } -@@ -1420,7 +1446,7 @@ public abstract class EntityLiving extends Entity { +@@ -1421,7 +1447,7 @@ public abstract class EntityLiving extends Entity { if (!this.world.isClientSide) { boolean flag = false; @@ -217,7 +222,7 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 if (this.world.getGameRules().getBoolean(GameRules.MOB_GRIEFING)) { BlockPosition blockposition = this.getChunkCoordinates(); IBlockData iblockdata = Blocks.WITHER_ROSE.getBlockData(); -@@ -1441,7 +1467,8 @@ public abstract class EntityLiving extends Entity { +@@ -1442,7 +1468,8 @@ public abstract class EntityLiving extends Entity { } } @@ -227,7 +232,7 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 Entity entity = damagesource.getEntity(); int i; -@@ -1459,15 +1486,18 @@ public abstract class EntityLiving extends Entity { +@@ -1460,15 +1487,18 @@ public abstract class EntityLiving extends Entity { this.dropDeathLoot(damagesource, i, flag); } // CraftBukkit start - Call death event @@ -247,7 +252,7 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 // CraftBukkit start public int getExpReward() { -@@ -1552,6 +1582,7 @@ public abstract class EntityLiving extends Entity { +@@ -1553,6 +1583,7 @@ public abstract class EntityLiving extends Entity { return SoundEffects.ENTITY_GENERIC_HURT; } @@ -255,7 +260,7 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 @Nullable protected SoundEffect getSoundDeath() { return SoundEffects.ENTITY_GENERIC_DEATH; -@@ -2071,10 +2102,12 @@ public abstract class EntityLiving extends Entity { +@@ -2072,10 +2103,12 @@ public abstract class EntityLiving extends Entity { } @@ -269,10 +274,10 @@ index ac5f11a2f5598584ff112a208bfd16aeb574e580..fb53d8e178b5a8e229036f90fafb48a8 return this.isBaby() ? (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.5F : (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 5053b1a09bd992b884a5871cb8f355ffbcb26260..c272bab87f9248cc3e7afe3607522f0b5e9c48d1 100644 +index fa211442594c72c0d9b2fddc85472aa9939d6d1e..32aba006312ef30401e09cf05325dd1fa82bfed0 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -80,6 +80,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -82,6 +82,10 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int ping; public boolean viewingCredits; private int containerUpdateDelay; // Paper @@ -283,7 +288,7 @@ index 5053b1a09bd992b884a5871cb8f355ffbcb26260..c272bab87f9248cc3e7afe3607522f0b // CraftBukkit start public String displayName; -@@ -579,6 +583,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -583,6 +587,15 @@ public class EntityPlayer extends EntityHuman implements ICrafting { String deathmessage = defaultMessage.getString(); org.bukkit.event.entity.PlayerDeathEvent event = CraftEventFactory.callPlayerDeathEvent(this, loot, deathmessage, keepInventory); @@ -299,7 +304,7 @@ index 5053b1a09bd992b884a5871cb8f355ffbcb26260..c272bab87f9248cc3e7afe3607522f0b // SPIGOT-943 - only call if they have an inventory open if (this.activeContainer != this.defaultContainer) { -@@ -730,8 +743,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -734,8 +747,17 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } } @@ -320,10 +325,10 @@ index 5053b1a09bd992b884a5871cb8f355ffbcb26260..c272bab87f9248cc3e7afe3607522f0b } } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftSound.java b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e3a88f515 100644 +index 9a2e6bedfc50fba10f37c01d825f80415bfb69d3..a4afe638515471159d505a5e402a934206d8c1f5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftSound.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftSound.java -@@ -996,6 +996,22 @@ public enum CraftSound { +@@ -1003,6 +1003,22 @@ public enum CraftSound { WEATHER_RAIN_ABOVE("weather.rain.above"); private final String minecraftKey; @@ -347,10 +352,10 @@ index 7b565ddfffd0b9c78392ee115ef9c20ab89a3380..d78b9fd608da691220f1edeff506b36e this.minecraftKey = minecraftKey; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 585e1b6de2a513a3c360e283ade360ed191cd643..d0fd47a4f8b80ea52b53e6e0071b998e15ac018c 100644 +index b90b35c08cdc9bb44aaf9f4824289fd0824c937f..28a04cb8a90ad82b86f658ad17675ab58f7e8d41 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -1768,7 +1768,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1761,7 +1761,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void sendHealthUpdate() { @@ -368,10 +373,10 @@ index 585e1b6de2a513a3c360e283ade360ed191cd643..d0fd47a4f8b80ea52b53e6e0071b998e public void injectScaledMaxHealth(Collection<AttributeModifiable> collection, boolean force) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index a86939235a1a5624710744ec3550e6131482c284..1d6977a8e0a2d817311687cb386552fb96840466 100644 +index c40004cc3a9583c9ece058ff8eb059731385c415..be7e98dc6f8faf4ebfd24df035ade809a3e4c918 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -784,9 +784,16 @@ public class CraftEventFactory { +@@ -788,9 +788,16 @@ public class CraftEventFactory { public static EntityDeathEvent callEntityDeathEvent(EntityLiving victim, List<org.bukkit.inventory.ItemStack> drops) { CraftLivingEntity entity = (CraftLivingEntity) victim.getBukkitEntity(); EntityDeathEvent event = new EntityDeathEvent(entity, drops, victim.getExpReward()); @@ -388,7 +393,7 @@ index a86939235a1a5624710744ec3550e6131482c284..1d6977a8e0a2d817311687cb386552fb victim.expToDrop = event.getDroppedExp(); for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { -@@ -802,8 +809,15 @@ public class CraftEventFactory { +@@ -806,8 +813,15 @@ public class CraftEventFactory { CraftPlayer entity = victim.getBukkitEntity(); PlayerDeathEvent event = new PlayerDeathEvent(entity, drops, victim.getExpReward(), 0, deathMessage); event.setKeepInventory(keepInventory); @@ -404,7 +409,7 @@ index a86939235a1a5624710744ec3550e6131482c284..1d6977a8e0a2d817311687cb386552fb victim.keepLevel = event.getKeepLevel(); victim.newLevel = event.getNewLevel(); -@@ -820,6 +834,31 @@ public class CraftEventFactory { +@@ -824,6 +838,31 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch b/Spigot-Server-Patches/0284-Allow-chests-to-be-placed-with-NBT-data.patch index dc47e3b328..d0d8c8149d 100644 --- a/Spigot-Server-Patches/0287-Allow-chests-to-be-placed-with-NBT-data.patch +++ b/Spigot-Server-Patches/0284-Allow-chests-to-be-placed-with-NBT-data.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow chests to be placed with NBT data diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 95dc7e4a604e613751eb16b127e3203027c8c26d..dea478d4790be0c0d6e14cd7673d161abfc46e08 100644 +index 64e9d50be03cbefa521bf8c2e6dba5ceadda78b6..63aa474c73f506737cb5de31977bffcd17d4dc11 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -244,6 +244,7 @@ public final class ItemStack { @@ -17,7 +17,7 @@ index 95dc7e4a604e613751eb16b127e3203027c8c26d..dea478d4790be0c0d6e14cd7673d161a for (BlockState blockstate : blocks) { blockstate.update(true, false); diff --git a/src/main/java/net/minecraft/server/TileEntityChest.java b/src/main/java/net/minecraft/server/TileEntityChest.java -index 47ed08c414dca46720a3d4808ea71f999232e70c..17498eae50560fd26402a2e7032fe94eb924989b 100644 +index 52f64460ba1bfb298f343f71a923c8f34de9e39d..d429c6a4154497fea813ef98d1a30eef2ca5e5e0 100644 --- a/src/main/java/net/minecraft/server/TileEntityChest.java +++ b/src/main/java/net/minecraft/server/TileEntityChest.java @@ -300,7 +300,7 @@ public class TileEntityChest extends TileEntityLootable { // Paper - Remove ITic diff --git a/Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch b/Spigot-Server-Patches/0285-Mob-Pathfinding-API.patch index 6f0d89713c..691fae81eb 100644 --- a/Spigot-Server-Patches/0288-Mob-Pathfinding-API.patch +++ b/Spigot-Server-Patches/0285-Mob-Pathfinding-API.patch @@ -153,7 +153,7 @@ index 0000000000000000000000000000000000000000..af1bac9680028130e99c5e7130f258c1 + } +} diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index b06c76a369f1dc9de8d782272c3ff0573af89361..cca6242e38fc286eea810eb8f2e4d1ab5429b9df 100644 +index 85ffe76b80adfeaf15f057085de4b383e01b3b55..7645fc16c3393364389562899d460ea6670a070d 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -78,7 +78,7 @@ public abstract class NavigationAbstract { @@ -200,7 +200,7 @@ index b06c76a369f1dc9de8d782272c3ff0573af89361..cca6242e38fc286eea810eb8f2e4d1ab this.c = null; } diff --git a/src/main/java/net/minecraft/server/PathEntity.java b/src/main/java/net/minecraft/server/PathEntity.java -index 662932360bc7a9391fde99a88b60aac47f29467e..9154c01a22bc7b6d2dd390bb7b6e21ef52c8006c 100644 +index bf9f9166f265e9f79c6c964a31a08c85cef95746..c81a5d50c480b064ab60ed6f25f9e2c0bedb6ece 100644 --- a/src/main/java/net/minecraft/server/PathEntity.java +++ b/src/main/java/net/minecraft/server/PathEntity.java @@ -5,13 +5,14 @@ import javax.annotation.Nullable; @@ -220,25 +220,24 @@ index 662932360bc7a9391fde99a88b60aac47f29467e..9154c01a22bc7b6d2dd390bb7b6e21ef public PathEntity(List<PathPoint> list, BlockPosition blockposition, boolean flag) { this.a = list; -@@ -28,8 +29,7 @@ public class PathEntity { - return this.e >= this.a.size(); +@@ -33,7 +34,7 @@ public class PathEntity { } -- @Nullable -- public PathPoint c() { -+ public PathPoint getFinalPoint() { return c(); } @Nullable public PathPoint c() { // Paper - OBFHELPER + @Nullable +- public PathPoint d() { ++ public PathPoint getFinalPoint() { return d(); } @Nullable public PathPoint d() { // Paper - OBFHELPER return !this.a.isEmpty() ? (PathPoint) this.a.get(this.a.size() - 1) : null; } -@@ -77,7 +77,7 @@ public class PathEntity { +@@ -81,7 +82,7 @@ public class PathEntity { return this.a(entity, this.e); } -- public BaseBlockPosition g() { -+ public BaseBlockPosition getNext() { return g(); } public BaseBlockPosition g() { // Paper - OBFHELPER - PathPoint pathpoint = this.h(); +- public BlockPosition g() { ++ public BlockPosition getNext() { return g(); } public BlockPosition g() { // Paper - OBFHELPER + return ((PathPoint) this.a.get(this.e)).a(); + } - return new BaseBlockPosition(pathpoint.a, pathpoint.b, pathpoint.c); diff --git a/src/main/java/net/minecraft/server/PathPoint.java b/src/main/java/net/minecraft/server/PathPoint.java index b69d6bc433711e94e3fbfa2a89c091209c95484d..e9fb295bdf727cd4543cbe5a18447ceba3d41ee0 100644 --- a/src/main/java/net/minecraft/server/PathPoint.java diff --git a/Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch b/Spigot-Server-Patches/0286-Prevent-chunk-loading-from-Fluid-Flowing.patch index d90ae0901c..d90ae0901c 100644 --- a/Spigot-Server-Patches/0289-Prevent-chunk-loading-from-Fluid-Flowing.patch +++ b/Spigot-Server-Patches/0286-Prevent-chunk-loading-from-Fluid-Flowing.patch diff --git a/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/Spigot-Server-Patches/0287-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index ee3c5f208c..2cbc9b18f7 100644 --- a/Spigot-Server-Patches/0290-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/Spigot-Server-Patches/0287-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/net/minecraft/server/ArgumentBlock.java b/src/main/java/net/minecraft/server/ArgumentBlock.java -index b986a8e318733bdae766202bef93d4d25f18b58d..e1894fe66911adb991989ff5322d2a9e9446fce7 100644 +index dc7a320c83802159aab2440b4fca26543be2524a..892f99c8b9385e80381058ead72d4346b8a61fee 100644 --- a/src/main/java/net/minecraft/server/ArgumentBlock.java +++ b/src/main/java/net/minecraft/server/ArgumentBlock.java @@ -45,7 +45,7 @@ public class ArgumentBlock { diff --git a/Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch b/Spigot-Server-Patches/0288-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch index 147617e735..b268fc31d0 100644 --- a/Spigot-Server-Patches/0291-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch +++ b/Spigot-Server-Patches/0288-Prevent-Mob-AI-Rules-from-Loading-Chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent Mob AI Rules from Loading Chunks diff --git a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java -index ed29186791ac615c7d23ef8e7b8aea6a3ab8222d..29efbdd2ca77833e6be59e5b5b4c38633e43588d 100644 +index 537e7224b9f9dbbe107537c5d7ef9d3bb4cbb422..c03ebbc933197be3e7097ea3f7b7cd08c90db7bb 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalRemoveBlock.java @@ -12,11 +12,13 @@ public class PathfinderGoalRemoveBlock extends PathfinderGoalGotoTarget { @@ -52,7 +52,7 @@ index ed29186791ac615c7d23ef8e7b8aea6a3ab8222d..29efbdd2ca77833e6be59e5b5b4c3863 return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a(this.g) && ichunkaccess.getType(blockposition.up()).isAir() && ichunkaccess.getType(blockposition.up(2)).isAir(); } diff --git a/src/main/java/net/minecraft/server/RandomPositionGenerator.java b/src/main/java/net/minecraft/server/RandomPositionGenerator.java -index 39b08086d111f614286675fd4a993da12cf24ccc..dc89c707b10c5544eca06a634a625bce0dd778f0 100644 +index 8dc028a4b1f5cf7bac0e3f1319bca5b5eb0e2482..aaa89a39bf697bd0f3354005b428d858f065f66b 100644 --- a/src/main/java/net/minecraft/server/RandomPositionGenerator.java +++ b/src/main/java/net/minecraft/server/RandomPositionGenerator.java @@ -116,6 +116,7 @@ public class RandomPositionGenerator { diff --git a/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch b/Spigot-Server-Patches/0289-Prevent-mob-spawning-from-loading-generating-chunks.patch index 8a09eb039a..dbcd15f53a 100644 --- a/Spigot-Server-Patches/0292-Prevent-mob-spawning-from-loading-generating-chunks.patch +++ b/Spigot-Server-Patches/0289-Prevent-mob-spawning-from-loading-generating-chunks.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Prevent mob spawning from loading/generating chunks also prevents if out of world border bounds diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 137fa3e51390e95f5939f2251e0d170accbfb469..6426f67afb3cc3522ff79b1c8515c1f97cd2f0c1 100644 +index eb637c32f7a4faa99d30596c273e62ebffe74f3b..2561ba9b9c02ccb59bd7284ddfe62889911d4220 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java -@@ -144,9 +144,9 @@ public final class SpawnerCreature { +@@ -143,9 +143,9 @@ public final class SpawnerCreature { StructureManager structuremanager = worldserver.getStructureManager(); ChunkGenerator chunkgenerator = worldserver.getChunkProvider().getChunkGenerator(); int i = blockposition.getY(); @@ -21,12 +21,12 @@ index 137fa3e51390e95f5939f2251e0d170accbfb469..6426f67afb3cc3522ff79b1c8515c1f9 BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); int j = 0; int k = 0; -@@ -175,7 +175,7 @@ public final class SpawnerCreature { +@@ -174,7 +174,7 @@ public final class SpawnerCreature { if (entityhuman != null) { - double d2 = entityhuman.g(d0, (double) i, d1); + double d2 = entityhuman.h(d0, (double) i, d1); - if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2)) { + if (a(worldserver, ichunkaccess, blockposition_mutableblockposition, d2) && worldserver.isLoadedAndInBounds(blockposition_mutableblockposition)) { // Paper - don't load chunks for mob spawn - if (biomebase_biomemeta == null) { - biomebase_biomemeta = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, (BlockPosition) blockposition_mutableblockposition); - if (biomebase_biomemeta == null) { + if (biomesettingsmobs_c == null) { + biomesettingsmobs_c = a(worldserver, structuremanager, chunkgenerator, enumcreaturetype, worldserver.random, (BlockPosition) blockposition_mutableblockposition); + if (biomesettingsmobs_c == null) { diff --git a/Spigot-Server-Patches/0290-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0290-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch new file mode 100644 index 0000000000..27a0183193 --- /dev/null +++ b/Spigot-Server-Patches/0290-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch @@ -0,0 +1,92 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +Date: Wed, 12 Sep 2018 21:47:01 -0400 +Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning + +Uses an EnumMap as well as a Set paired List for O(1) contains calls. + +diff --git a/src/main/java/net/minecraft/server/BiomeSettingsMobs.java b/src/main/java/net/minecraft/server/BiomeSettingsMobs.java +index 558344a2fa7f755152d4674c698d7f47ba1beaa2..a18ca3f0001a771f21012bd39711f581efb2fef0 100644 +--- a/src/main/java/net/minecraft/server/BiomeSettingsMobs.java ++++ b/src/main/java/net/minecraft/server/BiomeSettingsMobs.java +@@ -24,18 +24,27 @@ public class BiomeSettingsMobs { + }, (enumcreaturetype) -> { + return ImmutableList.of(); + })), ImmutableMap.of(), false); ++ // Paper start- decompile error workaround ++ private static class bProxy extends BiomeSettingsMobs.b { ++ private bProxy(double d0, double d1) { ++ super(d0, d1); ++ } ++ } ++ private static class cProxy extends BiomeSettingsMobs.c { ++ public cProxy(EntityTypes<?> entitytypes, int i, int j, int k) { ++ super(entitytypes, i, j, k); ++ } ++ }; ++ // Paper end + public static final MapCodec<BiomeSettingsMobs> c = RecordCodecBuilder.mapCodec((instance) -> { +- RecordCodecBuilder recordcodecbuilder = Codec.FLOAT.optionalFieldOf("creature_spawn_probability", 0.1F).forGetter((biomesettingsmobs) -> { ++ RecordCodecBuilder<BiomeSettingsMobs, Float> recordcodecbuilder = Codec.FLOAT.optionalFieldOf("creature_spawn_probability", 0.1F).forGetter((biomesettingsmobs) -> { // Paper - add type to builder + return biomesettingsmobs.d; + }); +- Codec codec = EnumCreatureType.g; +- Codec codec1 = BiomeSettingsMobs.c.b.listOf(); +- Logger logger = BiomeSettingsMobs.LOGGER; ++ // Paper - remove unused vars + +- logger.getClass(); +- return instance.group(recordcodecbuilder, Codec.simpleMap(codec, codec1.promotePartial(SystemUtils.a("Spawn data: ", logger::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter((biomesettingsmobs) -> { ++ return instance.group(recordcodecbuilder, Codec.simpleMap(EnumCreatureType.g, cProxy.b.listOf().promotePartial(SystemUtils.a("Spawn data: ", BiomeSettingsMobs.LOGGER::error)), INamable.a(EnumCreatureType.values())).fieldOf("spawners").forGetter((biomesettingsmobs) -> { // Paper - inline codec, cProxy, LOGGER + return biomesettingsmobs.e; +- }), Codec.simpleMap(IRegistry.ENTITY_TYPE, BiomeSettingsMobs.b.a, IRegistry.ENTITY_TYPE).fieldOf("spawn_costs").forGetter((biomesettingsmobs) -> { ++ }), Codec.simpleMap(IRegistry.ENTITY_TYPE, bProxy.a, IRegistry.ENTITY_TYPE).fieldOf("spawn_costs").forGetter((biomesettingsmobs) -> { // Paper - decompile error - bProxy + return biomesettingsmobs.f; + }), Codec.BOOL.fieldOf("player_spawn_friendly").orElse(false).forGetter(BiomeSettingsMobs::b)).apply(instance, BiomeSettingsMobs::new); + }); +@@ -70,11 +79,43 @@ public class BiomeSettingsMobs { + + public static class a { + +- private final Map<EnumCreatureType, List<BiomeSettingsMobs.c>> a = (Map) Stream.of(EnumCreatureType.values()).collect(ImmutableMap.toImmutableMap((enumcreaturetype) -> { ++ // Paper start - keep track of data in a pair set to give O(1) contains calls - we have to hook removals incase plugins mess with it ++ public static class MobList extends java.util.ArrayList<BiomeSettingsMobs.c> { ++ java.util.Set<BiomeSettingsMobs.c> biomes = new java.util.HashSet<>(); ++ ++ @Override ++ public boolean contains(Object o) { ++ return biomes.contains(o); ++ } ++ ++ @Override ++ public boolean add(BiomeSettingsMobs.c BiomeSettingsMobs) { ++ biomes.add(BiomeSettingsMobs); ++ return super.add(BiomeSettingsMobs); ++ } ++ ++ @Override ++ public BiomeSettingsMobs.c remove(int index) { ++ BiomeSettingsMobs.c removed = super.remove(index); ++ if (removed != null) { ++ biomes.remove(removed); ++ } ++ return removed; ++ } ++ ++ @Override ++ public void clear() { ++ biomes.clear(); ++ super.clear(); ++ } ++ } ++ // use toImmutableEnumMap collector ++ private final Map<EnumCreatureType, List<BiomeSettingsMobs.c>> a = (Map) Stream.of(EnumCreatureType.values()).collect(Maps.toImmutableEnumMap((enumcreaturetype) -> { + return enumcreaturetype; + }, (enumcreaturetype) -> { +- return Lists.newArrayList(); ++ return new MobList(); // Use MobList instead of ArrayList + })); ++ // Paper end + private final Map<EntityTypes<?>, BiomeSettingsMobs.b> b = Maps.newLinkedHashMap(); + private float c = 0.1F; + private boolean d; diff --git a/Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch b/Spigot-Server-Patches/0291-Implement-furnace-cook-speed-multiplier-API.patch index a5612b1d3e..b2e2061138 100644 --- a/Spigot-Server-Patches/0294-Implement-furnace-cook-speed-multiplier-API.patch +++ b/Spigot-Server-Patches/0291-Implement-furnace-cook-speed-multiplier-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Implement furnace cook speed multiplier API Signed-off-by: Tassu <[email protected]> diff --git a/src/main/java/net/minecraft/server/TileEntityFurnace.java b/src/main/java/net/minecraft/server/TileEntityFurnace.java -index 623cd63711c6cb79dce7a46056e193fdb13334a5..f4f50fb8375fec3f6868bbccc50bc78a5cd81965 100644 +index 99b20fa5feff0f766124d4ec9474852e33e329f2..1d3c2dd93657fb5dc71ee6b444c585b54619d1e8 100644 --- a/src/main/java/net/minecraft/server/TileEntityFurnace.java +++ b/src/main/java/net/minecraft/server/TileEntityFurnace.java @@ -10,6 +10,7 @@ import java.util.List; diff --git a/Spigot-Server-Patches/0295-PreSpawnerSpawnEvent.patch b/Spigot-Server-Patches/0292-PreSpawnerSpawnEvent.patch index 7126767ccf..8bb560a403 100644 --- a/Spigot-Server-Patches/0295-PreSpawnerSpawnEvent.patch +++ b/Spigot-Server-Patches/0292-PreSpawnerSpawnEvent.patch @@ -9,21 +9,21 @@ SpawnerSpawnEvent gets called instead of the CreatureSpawnEvent for spawners. diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 45cd44335427a818a580158d57025289f37079bf..e2f5354709819e56f9bc66b8c8d5e095bc8387b4 100644 +index 2827026ba4bdd857f231028393726d6c95610072..1aecc84479b00a019a5b68f5e726d1c2965ae0f7 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -111,11 +111,11 @@ public abstract class MobSpawnerAbstract { +@@ -114,11 +114,11 @@ public abstract class MobSpawnerAbstract { - org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); - if (type != null) { -- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; -- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( + org.bukkit.entity.EntityType type = org.bukkit.entity.EntityType.fromName(key); + if (type != null) { +- com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent event; +- event = new com.destroystokyo.paper.event.entity.PreCreatureSpawnEvent( + com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent event; + event = new com.destroystokyo.paper.event.entity.PreSpawnerSpawnEvent( - MCUtil.toLocation(world, d3, d4, d5), - type, -- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER + MCUtil.toLocation(world, d3, d4, d5), + type, +- org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER + MCUtil.toLocation(world, blockposition) - ); - if (!event.callEvent()) { - flag = true; + ); + if (!event.callEvent()) { + flag = true; diff --git a/Spigot-Server-Patches/0296-Catch-JsonParseException-in-Entity-and-TE-names.patch b/Spigot-Server-Patches/0293-Catch-JsonParseException-in-Entity-and-TE-names.patch index 26c0bd7f92..447710c667 100644 --- a/Spigot-Server-Patches/0296-Catch-JsonParseException-in-Entity-and-TE-names.patch +++ b/Spigot-Server-Patches/0293-Catch-JsonParseException-in-Entity-and-TE-names.patch @@ -26,10 +26,10 @@ index 850e79b764513bd68a28b675e075f804f59b75a8..7e13b1cf6d92c3e0f2dab1ba1d42bd4f if (nbttagcompound.hasKeyOfType("TrackOutput", 1)) { diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 797654c653ec6dc4d46b457cf8a6121b29eca7aa..2eacc5de340ca5558d9a0cba9baa26bbebef714d 100644 +index 39174bca00b4535e92f6b325b3fd058ceae41f8b..816d55b17ea531bc2f25b92c003b127fe6e04112 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -506,4 +506,19 @@ public final class MCUtil { +@@ -507,4 +507,19 @@ public final class MCUtil { return null; } } diff --git a/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch b/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch deleted file mode 100644 index 9e95ad585c..0000000000 --- a/Spigot-Server-Patches/0293-Optimize-Biome-Mob-Lookups-for-Mob-Spawning.patch +++ /dev/null @@ -1,77 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Wed, 12 Sep 2018 21:47:01 -0400 -Subject: [PATCH] Optimize Biome Mob Lookups for Mob Spawning - -Uses an EnumMap as well as a Set paired List for O(1) contains calls. - -diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index ae0ac8d383ca11a683465d8c83a8b8a66e567079..30aeb45d63394b7d91c2dd7b92cfc9cefa3c088c 100644 ---- a/src/main/java/net/minecraft/server/BiomeBase.java -+++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -119,7 +119,7 @@ public class BiomeBase { - this.r.put(worldgenstage_decoration, Lists.newArrayList()); - } - -- this.v = Maps.newHashMap(); -+ this.v = Maps.newEnumMap(EnumCreatureType.class); // Paper - EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); - - i = aenumcreaturetype.length; -@@ -127,7 +127,7 @@ public class BiomeBase { - for (j = 0; j < i; ++j) { - EnumCreatureType enumcreaturetype = aenumcreaturetype[j]; - -- this.v.put(enumcreaturetype, Lists.newArrayList()); -+ this.v.put(enumcreaturetype, new MobList()); // Paper - } - - } else { -@@ -150,7 +150,7 @@ public class BiomeBase { - this.u = (Map) list.stream().collect(Collectors.toMap((structurefeature) -> { - return structurefeature.b; - }, Function.identity())); -- this.v = map2; -+ this.v = Maps.newEnumMap(EnumCreatureType.class); this.v.putAll(map2); // Paper - this.x = list1; - this.l = (String) optional.orElse(null); // Paper - decompile fix - Stream stream = map1.values().stream().flatMap(Collection::stream).filter((worldgenfeatureconfigured) -> { -@@ -433,6 +433,38 @@ public class BiomeBase { - return this.l; - } - -+ // Paper start - keep track of data in a pair set to give O(1) contains calls - we have to hook removals incase plugins mess with it -+ public static class MobList extends java.util.ArrayList<BiomeMeta> { -+ java.util.Set<BiomeMeta> biomes = new java.util.HashSet<>(); -+ -+ @Override -+ public boolean contains(Object o) { -+ return biomes.contains(o); -+ } -+ -+ @Override -+ public boolean add(BiomeMeta biomeMeta) { -+ biomes.add(biomeMeta); -+ return super.add(biomeMeta); -+ } -+ -+ @Override -+ public BiomeMeta remove(int index) { -+ BiomeMeta removed = super.remove(index); -+ if (removed != null) { -+ biomes.remove(removed); -+ } -+ return removed; -+ } -+ -+ @Override -+ public void clear() { -+ biomes.clear(); -+ super.clear(); -+ } -+ } -+ // Paper end -+ - public static class d { - - public static final Codec<BiomeBase.d> a = RecordCodecBuilder.create((instance) -> { diff --git a/Spigot-Server-Patches/0297-Honor-EntityAgeable.ageLock.patch b/Spigot-Server-Patches/0294-Honor-EntityAgeable.ageLock.patch index f25452fae7..6d9375d3f4 100644 --- a/Spigot-Server-Patches/0297-Honor-EntityAgeable.ageLock.patch +++ b/Spigot-Server-Patches/0294-Honor-EntityAgeable.ageLock.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Honor EntityAgeable.ageLock diff --git a/src/main/java/net/minecraft/server/EntityAgeable.java b/src/main/java/net/minecraft/server/EntityAgeable.java -index 8665ac06c6d2eb70127f1a12cb8c44de569a97f9..d861a96b4cb5a5480deb93708207002da782bb51 100644 +index 03f7979e34355842e405ec32c713ecc34c5a7a8b..026e75e5ae9e231e3f898823825adab30237d53d 100644 --- a/src/main/java/net/minecraft/server/EntityAgeable.java +++ b/src/main/java/net/minecraft/server/EntityAgeable.java @@ -73,6 +73,7 @@ public abstract class EntityAgeable extends EntityCreature { diff --git a/Spigot-Server-Patches/0298-Configurable-connection-throttle-kick-message.patch b/Spigot-Server-Patches/0295-Configurable-connection-throttle-kick-message.patch index 2f52cbd807..2d6c8b8a82 100644 --- a/Spigot-Server-Patches/0298-Configurable-connection-throttle-kick-message.patch +++ b/Spigot-Server-Patches/0295-Configurable-connection-throttle-kick-message.patch @@ -21,7 +21,7 @@ index 1b21911c3e4fd1d4a3305176bb8477c370256906..d5c97bb6503c9bfafd819dd62397b9de private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/net/minecraft/server/HandshakeListener.java b/src/main/java/net/minecraft/server/HandshakeListener.java -index 12fb251dc96bf179e393046ecc256ea80fdd79de..1672c48c106d95e588b251727cbdb1f6002dc62a 100644 +index 07d5036ce3b04c78f332deed65b9177b70b4361a..ad9324a6052d9fedd40fb8b0899c6ded6e60b315 100644 --- a/src/main/java/net/minecraft/server/HandshakeListener.java +++ b/src/main/java/net/minecraft/server/HandshakeListener.java @@ -37,7 +37,7 @@ public class HandshakeListener implements PacketHandshakingInListener { diff --git a/Spigot-Server-Patches/0299-Hook-into-CB-plugin-rewrites.patch b/Spigot-Server-Patches/0296-Hook-into-CB-plugin-rewrites.patch index 78e4ee9dce..5ee73e0eda 100644 --- a/Spigot-Server-Patches/0299-Hook-into-CB-plugin-rewrites.patch +++ b/Spigot-Server-Patches/0296-Hook-into-CB-plugin-rewrites.patch @@ -8,7 +8,7 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index ac48431777b70c200f9e4113c8a0c03957126e90..455989e82be5ba8e6ca3e724235d3f55a9698498 100644 +index ac48431777b70c200f9e4113c8a0c03957126e90..fbaf078b154a0f376b4a5a076a50a5c306504663 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java @@ -6,7 +6,9 @@ import java.io.FileOutputStream; @@ -52,7 +52,7 @@ index ac48431777b70c200f9e4113c8a0c03957126e90..455989e82be5ba8e6ca3e724235d3f55 + if ( Boolean.getBoolean( "debug.rewriteForIde" ) ) + { + // unversion incoming calls for pre-relocate debug work -+ final String NMS_REVISION_PACKAGE = "v1_16_R1/"; ++ final String NMS_REVISION_PACKAGE = "v1_16_R2/"; + + getAndRemove.put( "net/minecraft/".concat( "server/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); + getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); diff --git a/Spigot-Server-Patches/0300-Allow-setting-the-vex-s-summoner.patch b/Spigot-Server-Patches/0297-Allow-setting-the-vex-s-summoner.patch index 1ec7fb6b26..8501d294f9 100644 --- a/Spigot-Server-Patches/0300-Allow-setting-the-vex-s-summoner.patch +++ b/Spigot-Server-Patches/0297-Allow-setting-the-vex-s-summoner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Allow setting the vex's summoner diff --git a/src/main/java/net/minecraft/server/EntityVex.java b/src/main/java/net/minecraft/server/EntityVex.java -index ab4ac736f8fcda1ed6b58abe0a4ecba58d3b5d43..99a98e37ebd292f8fb1c3613348bd6dd51e9191b 100644 +index a8e9b1e83969f4e49465fc5e8b5fb8a5efe5f81d..ae05856f25b092d193ec709ac6971c1089482242 100644 --- a/src/main/java/net/minecraft/server/EntityVex.java +++ b/src/main/java/net/minecraft/server/EntityVex.java @@ -130,6 +130,7 @@ public class EntityVex extends EntityMonster { diff --git a/Spigot-Server-Patches/0301-Add-sun-related-API.patch b/Spigot-Server-Patches/0298-Add-sun-related-API.patch index a8f966d282..2063d3d19e 100644 --- a/Spigot-Server-Patches/0301-Add-sun-related-API.patch +++ b/Spigot-Server-Patches/0298-Add-sun-related-API.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Add sun related API diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index 8a79302b9cc178bfe4e0909293e3a87c01d344ca..e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34 100644 +index bbb6dc6b7ca77779a1aab8b1437ee32509717efe..6279f00bc8ca0334d34305590b8eed0637ccdf46 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java -@@ -1504,6 +1504,7 @@ public abstract class EntityInsentient extends EntityLiving { +@@ -1528,6 +1528,7 @@ public abstract class EntityInsentient extends EntityLiving { } -+ public boolean isInDaylight() { return this.eH(); } // Paper - OBFHELPER - protected boolean eH() { ++ public boolean isInDaylight() { return this.eG(); } // Paper - OBFHELPER + protected boolean eG() { if (this.world.isDay() && !this.world.isClientSide) { - float f = this.aO(); + float f = this.aQ(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f0ce6bc613c85c6c76d1bb80701907720838d92d..a27bd3032028dd3a4ed8efc4230a792cffd1833c 100644 +index d193667beca3da156d8ae17cd80f4bf4c1dbfc8c..98af366848dba468d526d037a5e78fde4a4eda59 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -872,6 +872,13 @@ public class CraftWorld implements World { +@@ -858,6 +858,13 @@ public class CraftWorld implements World { } } diff --git a/Spigot-Server-Patches/0302-Turtle-API.patch b/Spigot-Server-Patches/0299-Turtle-API.patch index 2d624e05db..316fac7b98 100644 --- a/Spigot-Server-Patches/0302-Turtle-API.patch +++ b/Spigot-Server-Patches/0299-Turtle-API.patch @@ -5,65 +5,64 @@ Subject: [PATCH] Turtle API diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index dd745894614982fad6277e77b98bed75fc2a2f55..cf90ebf0614422879f5f5da05c925728f94ef8be 100644 +index 40a632434e43211710815944ad4aefa207f78780..1fd2a41050de39b47a0fe6e52f7a6727a8475757 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java -@@ -30,8 +30,7 @@ public class EntityTurtle extends EntityAnimal { - public void setHomePos(BlockPosition blockposition) { - this.datawatcher.set(EntityTurtle.bw, blockposition); +@@ -31,7 +31,7 @@ public class EntityTurtle extends EntityAnimal { + this.datawatcher.set(EntityTurtle.bp, blockposition); } -- + - private BlockPosition getHomePos() { + public BlockPosition getHomePos() { // Paper - public - return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); + return (BlockPosition) this.datawatcher.get(EntityTurtle.bp); } -@@ -47,31 +46,37 @@ public class EntityTurtle extends EntityAnimal { - return (Boolean) this.datawatcher.get(EntityTurtle.bx); +@@ -47,31 +47,37 @@ public class EntityTurtle extends EntityAnimal { + return (Boolean) this.datawatcher.get(EntityTurtle.bq); } - private void setHasEgg(boolean flag) { + public void setHasEgg(boolean flag) { // Paper - this.datawatcher.set(EntityTurtle.bx, flag); + this.datawatcher.set(EntityTurtle.bq, flag); } -+ public final boolean isDigging() { return this.eM(); } // Paper - OBFHELPER - public boolean eM() { - return (Boolean) this.datawatcher.get(EntityTurtle.by); ++ public final boolean isDigging() { return this.eL(); } // Paper - OBFHELPER + public boolean eL() { + return (Boolean) this.datawatcher.get(EntityTurtle.br); } + public final void setDigging(boolean digging) { this.u(digging); } // Paper - OBFHELPER private void u(boolean flag) { - this.bC = flag ? 1 : 0; - this.datawatcher.set(EntityTurtle.by, flag); + this.bv = flag ? 1 : 0; + this.datawatcher.set(EntityTurtle.br, flag); } -+ public final boolean isGoingHome() { return this.eV(); } // Paper - OBFHELPER - private boolean eV() { - return (Boolean) this.datawatcher.get(EntityTurtle.bA); ++ public final boolean isGoingHome() { return this.eU(); } // Paper - OBFHELPER + private boolean eU() { + return (Boolean) this.datawatcher.get(EntityTurtle.bt); } + public final void setGoingHome(boolean goingHome) { this.v(goingHome); } // Paper - OBFHELPER private void v(boolean flag) { - this.datawatcher.set(EntityTurtle.bA, flag); + this.datawatcher.set(EntityTurtle.bt, flag); } -+ public final boolean isTravelling() { return this.eW(); } // Paper - OBFHELPER - private boolean eW() { - return (Boolean) this.datawatcher.get(EntityTurtle.bB); ++ public final boolean isTravelling() { return this.eV(); } // Paper - OBFHELPER + private boolean eV() { + return (Boolean) this.datawatcher.get(EntityTurtle.bu); } + public final void setTravelling(boolean travelling) { this.w(travelling); } // Paper - OBFHELPER private void w(boolean flag) { - this.datawatcher.set(EntityTurtle.bB, flag); + this.datawatcher.set(EntityTurtle.bu, flag); } -@@ -438,14 +443,17 @@ public class EntityTurtle extends EntityAnimal { +@@ -438,14 +444,17 @@ public class EntityTurtle extends EntityAnimal { - if (!this.g.isInWater() && this.k()) { - if (this.g.bC < 1) { + if (!this.g.isInWater() && this.l()) { + if (this.g.bv < 1) { - this.g.u(true); -+ this.g.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.e)).callEvent()); // Paper - } else if (this.g.bC > 200) { ++ this.g.setDigging(new com.destroystokyo.paper.event.entity.TurtleStartDiggingEvent((org.bukkit.entity.Turtle) this.g.getBukkitEntity(), MCUtil.toLocation(this.g.world, this.getTargetPosition())).callEvent()); // Paper + } else if (this.g.bv > 200) { World world = this.g.world; // CraftBukkit start @@ -78,7 +77,7 @@ index dd745894614982fad6277e77b98bed75fc2a2f55..cf90ebf0614422879f5f5da05c925728 } // CraftBukkit end this.g.setHasEgg(false); -@@ -574,7 +582,7 @@ public class EntityTurtle extends EntityAnimal { +@@ -574,7 +583,7 @@ public class EntityTurtle extends EntityAnimal { @Override public boolean a() { @@ -87,6 +86,19 @@ index dd745894614982fad6277e77b98bed75fc2a2f55..cf90ebf0614422879f5f5da05c925728 } @Override +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +index 1295cb02ab9e39519d73e2c260a50b64d44929a1..9b0511e996a5e3952c6f975e7c93299c532a8ea1 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +@@ -9,7 +9,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { + protected int c; + protected int d; + private int g; +- protected BlockPosition e; ++ protected BlockPosition e;public final BlockPosition getTargetPosition() { return this.e; } // Paper - OBFHELPER + private boolean h; + private final int i; + private final int j; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java index 123a2c75cad410d079cfb23223ab509e4b4c63f7..f2b09a1e66dfbcd943612b5170d20bb284fbcc68 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTurtle.java diff --git a/Spigot-Server-Patches/0303-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch b/Spigot-Server-Patches/0300-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch index 09d75f11a4..f37963a65c 100644 --- a/Spigot-Server-Patches/0303-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch +++ b/Spigot-Server-Patches/0300-MC-50319-Check-other-worlds-for-shooter-of-projectil.patch @@ -11,7 +11,7 @@ If the projectile fails to find the shooter in the current world, check other worlds. diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index f544178fa6ffd95c41cb721440d3a701c5c4331c..ff137b15de7670f8e5fcb9f4dde3dc8251e3075c 100644 +index 97aed437adb98bc468ec757df8b6d375b5101834..8d26521bc414b3d34f496e966f0c918b023f4833 100644 --- a/src/main/java/net/minecraft/server/IProjectile.java +++ b/src/main/java/net/minecraft/server/IProjectile.java @@ -29,7 +29,18 @@ public abstract class IProjectile extends Entity { diff --git a/Spigot-Server-Patches/0304-Call-player-spectator-target-events-and-improve-impl.patch b/Spigot-Server-Patches/0301-Call-player-spectator-target-events-and-improve-impl.patch index 9871341ba6..8c19ebfb0c 100644 --- a/Spigot-Server-Patches/0304-Call-player-spectator-target-events-and-improve-impl.patch +++ b/Spigot-Server-Patches/0301-Call-player-spectator-target-events-and-improve-impl.patch @@ -19,10 +19,10 @@ spectate the target entity. Co-authored-by: Spottedleaf <[email protected]> diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index c272bab87f9248cc3e7afe3607522f0b5e9c48d1..0909c926b9298d99b36c43dcbec9db071444cc7c 100644 +index 32aba006312ef30401e09cf05325dd1fa82bfed0..da4f0ef74898eb327449f0dccb34afb63235b3b1 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1694,15 +1694,59 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1659,15 +1659,59 @@ public class EntityPlayer extends EntityHuman implements ICrafting { return (Entity) (this.spectatedEntity == null ? this : this.spectatedEntity); } @@ -88,10 +88,10 @@ index c272bab87f9248cc3e7afe3607522f0b5e9c48d1..0909c926b9298d99b36c43dcbec9db07 @Override diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 351cb9643b05e83f97a7976979346325e76f44da..d33657d94a4e9c6563fbc7826e18624528c498f5 100644 +index b02d1abd65ca113de622328f520bd4c8b56e3409..58f6588f475e000aafede740adf4570d41a71009 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1133,6 +1133,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1127,6 +1127,7 @@ public class PlayerConnection implements PacketListenerPlayIn { } // CraftBukkit start - Delegate to teleport(Location) diff --git a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch b/Spigot-Server-Patches/0302-Add-Velocity-IP-Forwarding-Support.patch index d7242c3144..4c8c1231dc 100644 --- a/Spigot-Server-Patches/0305-Add-Velocity-IP-Forwarding-Support.patch +++ b/Spigot-Server-Patches/0302-Add-Velocity-IP-Forwarding-Support.patch @@ -130,7 +130,7 @@ index 0000000000000000000000000000000000000000..fdd8708f974700c7cde6e436c2f189d9 + } +} diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..d1f62864fd2785702a770397eee7831dd9cb2cdb 100644 +index f2ab2f7f81b95546294debaf1f0395b0c094ab44..44054552a1e0efaba0f69573bfb67f4a126507c6 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -25,6 +25,7 @@ import org.bukkit.craftbukkit.util.Waitable; @@ -214,7 +214,7 @@ index e0f0a1e91a037f93b239e779aa8fd92be8a8c01f..d1f62864fd2785702a770397eee7831d } diff --git a/src/main/java/net/minecraft/server/PacketDataSerializer.java b/src/main/java/net/minecraft/server/PacketDataSerializer.java -index 7e116d83a62ef42e241ee9e05fdd7ecb30a2ed95..31e7fb56206a522a335f5e78afd09324d1c38864 100644 +index ee24acdd5e843e5421bf83bd6c069a4ecca09115..f43193c1090238f2241b878120247d1b3d0d4e57 100644 --- a/src/main/java/net/minecraft/server/PacketDataSerializer.java +++ b/src/main/java/net/minecraft/server/PacketDataSerializer.java @@ -164,6 +164,7 @@ public class PacketDataSerializer extends ByteBuf { @@ -233,7 +233,7 @@ index 7e116d83a62ef42e241ee9e05fdd7ecb30a2ed95..31e7fb56206a522a335f5e78afd09324 public UUID k() { return new UUID(this.readLong(), this.readLong()); } -@@ -321,6 +323,7 @@ public class PacketDataSerializer extends ByteBuf { +@@ -331,6 +333,7 @@ public class PacketDataSerializer extends ByteBuf { } } @@ -257,7 +257,7 @@ index 4d1f44139535cae0df90615d29121ff85cc964de..c1ca6f950162f53ebcb16efabb306480 public PacketLoginInCustomPayload() {} diff --git a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java -index ae74dc9e183e66062455cf2a18ab43ae87976046..7eb230f1b27eddf48f1b12fc78877a3678d802df 100644 +index b52e8b72eaee87e227b7cc2fd66101550262cb7e..990cfea6c2339cd3cf688e4645de76dcee1d351a 100644 --- a/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java +++ b/src/main/java/net/minecraft/server/PacketLoginOutCustomPayload.java @@ -10,6 +10,14 @@ public class PacketLoginOutCustomPayload implements Packet<PacketLoginOutListene @@ -276,10 +276,10 @@ index ae74dc9e183e66062455cf2a18ab43ae87976046..7eb230f1b27eddf48f1b12fc78877a36 public void a(PacketDataSerializer packetdataserializer) throws IOException { this.a = packetdataserializer.i(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 599381fce26d81fdeb4bc277d93a672720aee35b..d7aec47c3ba553fb505b5f956850aa2e9077dd24 100644 +index 20bf7dbfb206bc74f1b12c1bbf206ab5ce1ad3f4..b430aca723a1e15707bb80e70fdd5e46a01c0eaa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -677,7 +677,7 @@ public final class CraftServer implements Server { +@@ -676,7 +676,7 @@ public final class CraftServer implements Server { @Override public long getConnectionThrottle() { // Spigot Start - Automatically set connection throttle for bungee configurations diff --git a/Spigot-Server-Patches/0306-Add-more-Witch-API.patch b/Spigot-Server-Patches/0303-Add-more-Witch-API.patch index 34eb5813ce..9a7ab12787 100644 --- a/Spigot-Server-Patches/0306-Add-more-Witch-API.patch +++ b/Spigot-Server-Patches/0303-Add-more-Witch-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add more Witch API diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf..e8d8935b8ef2db0d4405ee1ff8e2f0f2e17a91b3 100644 +index fc58cce8455dcf244355189fabb1a76114c19368..0ef981e5ad1c928fbcf32e83e28285e690df1775 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -1,5 +1,11 @@ @@ -20,17 +20,14 @@ index a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf..e8d8935b8ef2db0d4405ee1ff8e2f0f2 import java.util.Iterator; import java.util.List; import java.util.UUID; -@@ -8,9 +14,9 @@ import java.util.function.Predicate; - public class EntityWitch extends EntityRaider implements IRangedEntity { - +@@ -10,7 +16,7 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { private static final UUID b = UUID.fromString("5CD17E52-A79A-43D3-A529-90FDE04B181E"); -- private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); -+ private static final AttributeModifier bv = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); private static final AttributeModifier DRINKING_SPEED = bv; // Paper - OBFHELPER - private static final DataWatcherObject<Boolean> bw = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i); -- private int bx; -+ private int bx; public int getPotionUseTimeLeft() { return bx; } public void setPotionUseTimeLeft(int timeLeft) { bx = timeLeft; } // Paper - OBFHELPER - private PathfinderGoalNearestHealableRaider<EntityRaider> by; - private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bz; + private static final AttributeModifier bo = new AttributeModifier(EntityWitch.b, "Drinking speed penalty", -0.25D, AttributeModifier.Operation.ADDITION); + private static final DataWatcherObject<Boolean> bp = DataWatcher.a(EntityWitch.class, DataWatcherRegistry.i); +- private int bq; ++ private int bq; public int getPotionUseTimeLeft() { return bq; } public void setPotionUseTimeLeft(int timeLeft) { bq = timeLeft; } // Paper - OBFHELPER + private PathfinderGoalNearestHealableRaider<EntityRaider> br; + private PathfinderGoalNearestAttackableTargetWitch<EntityHuman> bs; @@ -56,10 +62,12 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { return SoundEffects.ENTITY_WITCH_DEATH; @@ -38,77 +35,80 @@ index a6142ef24bc5bfa15a0ec84fbd8267ffab4e25bf..e8d8935b8ef2db0d4405ee1ff8e2f0f2 + public void setDrinkingPotion(boolean drinkingPotion) { v(drinkingPotion); } // Paper - OBFHELPER public void v(boolean flag) { - this.getDataWatcher().set(EntityWitch.bw, flag); + this.getDataWatcher().set(EntityWitch.bp, flag); } + public boolean isDrinkingPotion() { return m(); } // Paper - OBFHELPER public boolean m() { - return (Boolean) this.getDataWatcher().get(EntityWitch.bw); + return (Boolean) this.getDataWatcher().get(EntityWitch.bp); } -@@ -118,21 +126,22 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -118,21 +126,24 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { } if (potionregistry != null) { - // Paper start -- ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); + ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); - org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); - this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); -- // Paper end -- this.bx = this.getItemInMainHand().k(); ++ // Paper start - logic moved into setDrinkingPotion, copy exact impl into the method and then comment out ++ this.setDrinkingPotion(potion); ++// org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); ++// this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); ++// // Paper end ++// this.bq = this.getItemInMainHand().k(); ++// this.v(true); ++// if (!this.isSilent()) { ++// this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); ++// } ++// ++// AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); ++// ++// attributemodifiable.removeModifier(EntityWitch.bo); ++// attributemodifiable.b(EntityWitch.bo); + // Paper end +- this.bq = this.getItemInMainHand().k(); - this.v(true); - if (!this.isSilent()) { - this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); - } -- + - AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); - -- attributemodifiable.removeModifier(EntityWitch.bv); -- attributemodifiable.b(EntityWitch.bv); -+ //// Paper start -+ //ItemStack potion = PotionUtil.a(new ItemStack(Items.POTION), potionregistry); -+ //org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); -+ //this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); -+ //// Paper end -+ //this.bx = this.getItemInMainHand().k(); -+ //this.v(true); -+ //if (!this.isSilent()) { -+ // this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); -+ //} -+ // -+ //AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); -+ // -+ //attributemodifiable.removeModifier(EntityWitch.bv); -+ //attributemodifiable.b(EntityWitch.bv); -+ this.setDrinkingPotion(PotionUtil.addPotionToItemStack(new ItemStack(Items.POTION), potionregistry)); +- attributemodifiable.removeModifier(EntityWitch.bo); +- attributemodifiable.b(EntityWitch.bo); } } -@@ -144,6 +153,20 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { +@@ -144,6 +155,24 @@ public class EntityWitch extends EntityRaider implements IRangedEntity { super.movementTick(); } + // Paper start - moved to its own method + public void setDrinkingPotion(ItemStack potion) { -+ setSlot(EnumItemSlot.MAINHAND, CraftItemStack.asNMSCopy(WitchReadyPotionEvent.process((Witch) getBukkitEntity(), CraftItemStack.asCraftMirror(potion)))); -+ setPotionUseTimeLeft(getItemInMainHand().getItemUseMaxDuration()); -+ setDrinkingPotion(true); ++ org.bukkit.inventory.ItemStack bukkitStack = com.destroystokyo.paper.event.entity.WitchReadyPotionEvent.process((org.bukkit.entity.Witch) this.getBukkitEntity(), org.bukkit.craftbukkit.inventory.CraftItemStack.asCraftMirror(potion)); ++ this.setSlot(EnumItemSlot.MAINHAND, org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(bukkitStack)); ++ // Paper end ++ this.bq = this.getItemInMainHand().k(); ++ this.v(true); + if (!this.isSilent()) { + this.world.playSound((EntityHuman) null, this.locX(), this.locY(), this.locZ(), SoundEffects.ENTITY_WITCH_DRINK, this.getSoundCategory(), 1.0F, 0.8F + this.random.nextFloat() * 0.4F); + } ++ + AttributeModifiable attributemodifiable = this.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED); -+ attributemodifiable.removeModifier(EntityWitch.bv); -+ attributemodifiable.b(EntityWitch.bv); ++ ++ attributemodifiable.removeModifier(EntityWitch.bo); ++ attributemodifiable.b(EntityWitch.bo); + } + // Paper end + @Override - public SoundEffect eM() { + public SoundEffect eL() { return SoundEffects.ENTITY_WITCH_CELEBRATE; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -index bae107e76e4c8df446d4a7be8dda291d820074d7..b43a2bbd5bfd613887a7ae1519f6e729faf9bcc2 100644 +index bae107e76e4c8df446d4a7be8dda291d820074d7..c3138a6d24df1e71910791e67284983d8cd500f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWitch.java -@@ -1,12 +1,18 @@ +@@ -1,10 +1,16 @@ package org.bukkit.craftbukkit.entity; -import com.destroystokyo.paper.entity.CraftRangedEntity; // Paper @@ -124,11 +124,8 @@ index bae107e76e4c8df446d4a7be8dda291d820074d7..b43a2bbd5bfd613887a7ae1519f6e729 +import org.bukkit.inventory.ItemStack; +// Paper end --public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> { // Paper -+public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> { + public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity<EntityWitch> { // Paper public CraftWitch(CraftServer server, EntityWitch entity) { - super(server, entity); - } @@ -25,4 +31,23 @@ public class CraftWitch extends CraftRaider implements Witch, CraftRangedEntity< public EntityType getType() { return EntityType.WITCH; diff --git a/Spigot-Server-Patches/0307-Check-Drowned-for-Villager-Aggression-Config.patch b/Spigot-Server-Patches/0304-Check-Drowned-for-Villager-Aggression-Config.patch index 7a253dc8f2..7648bb5758 100644 --- a/Spigot-Server-Patches/0307-Check-Drowned-for-Villager-Aggression-Config.patch +++ b/Spigot-Server-Patches/0304-Check-Drowned-for-Villager-Aggression-Config.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Check Drowned for Villager Aggression Config diff --git a/src/main/java/net/minecraft/server/EntityDrowned.java b/src/main/java/net/minecraft/server/EntityDrowned.java -index 1f1f77776d840c6fa1156239a1da9bb97a328fb1..e6425bdf1a85e773f5555db1aebe7e159f7cd37c 100644 +index 958bdb8ff25a1605ab7f99816bf80908b444a3fb..ea7934060d7b7c3ca1c7fdc303168377a59c21a3 100644 --- a/src/main/java/net/minecraft/server/EntityDrowned.java +++ b/src/main/java/net/minecraft/server/EntityDrowned.java -@@ -29,7 +29,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { +@@ -31,7 +31,7 @@ public class EntityDrowned extends EntityZombie implements IRangedEntity { this.goalSelector.a(7, new PathfinderGoalRandomStroll(this, 1.0D)); this.targetSelector.a(1, (new PathfinderGoalHurtByTarget(this, new Class[]{EntityDrowned.class})).a(EntityPigZombie.class)); - this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::j)); + this.targetSelector.a(2, new PathfinderGoalNearestAttackableTarget<>(this, EntityHuman.class, 10, true, false, this::i)); - this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); + if ( world.spigotConfig.zombieAggressiveTowardsVillager ) this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityVillagerAbstract.class, false)); // Paper this.targetSelector.a(3, new PathfinderGoalNearestAttackableTarget<>(this, EntityIronGolem.class, true)); - this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bv)); + this.targetSelector.a(5, new PathfinderGoalNearestAttackableTarget<>(this, EntityTurtle.class, 10, true, false, EntityTurtle.bo)); } diff --git a/Spigot-Server-Patches/0308-Here-s-Johnny.patch b/Spigot-Server-Patches/0305-Here-s-Johnny.patch index ce187e9c8f..b621c44e52 100644 --- a/Spigot-Server-Patches/0308-Here-s-Johnny.patch +++ b/Spigot-Server-Patches/0305-Here-s-Johnny.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Here's Johnny! diff --git a/src/main/java/net/minecraft/server/EntityVindicator.java b/src/main/java/net/minecraft/server/EntityVindicator.java -index 9c152b79164710d3d4175d0acbc9548d61390097..58315906b641ba46ce73b6fefc43ea333bb0a088 100644 +index a959006185afaa3306fdd228f52d8177b58286a7..fd34d88c0b64dea75b82a5b23a79b119eca22a4a 100644 --- a/src/main/java/net/minecraft/server/EntityVindicator.java +++ b/src/main/java/net/minecraft/server/EntityVindicator.java @@ -11,7 +11,7 @@ public class EntityVindicator extends EntityIllagerAbstract { private static final Predicate<EnumDifficulty> b = (enumdifficulty) -> { return enumdifficulty == EnumDifficulty.NORMAL || enumdifficulty == EnumDifficulty.HARD; }; -- private boolean bv; -+ private boolean bv; public boolean isJohnny() { return bv; } public void setJohnny(boolean johnny) { bv = johnny; } // Paper - OBFHELPER +- private boolean bo; ++ private boolean bo; public boolean isJohnny() { return bo; } public void setJohnny(boolean johnny) { bo = johnny; } // Paper - OBFHELPER public EntityVindicator(EntityTypes<? extends EntityVindicator> entitytypes, World world) { super(entitytypes, world); diff --git a/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch b/Spigot-Server-Patches/0306-Add-option-to-prevent-players-from-moving-into-unloa.patch index f69f424d70..1ea461c3f8 100644 --- a/Spigot-Server-Patches/0309-Add-option-to-prevent-players-from-moving-into-unloa.patch +++ b/Spigot-Server-Patches/0306-Add-option-to-prevent-players-from-moving-into-unloa.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add option to prevent players from moving into unloaded diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 37bd28f18d3f48767d8141bde3395b8443d5650a..a73b88d51608ce94f6e4c9013c8c4de97523fe42 100644 +index 098c99793c68ac916b52776f9a1cc2c6510c0057..15e1f9f65280043853544d3bf796f991df2482de 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -400,4 +400,9 @@ public class PaperWorldConfig { +@@ -389,4 +389,9 @@ public class PaperWorldConfig { waterOverLavaFlowSpeed = getInt("water-over-lava-flow-speed", 5); log("Water over lava flow speed: " + waterOverLavaFlowSpeed); } @@ -20,7 +20,7 @@ index 37bd28f18d3f48767d8141bde3395b8443d5650a..a73b88d51608ce94f6e4c9013c8c4de9 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index d33657d94a4e9c6563fbc7826e18624528c498f5..b1bad421650a8c93cdc38d1f4f83ab1c39e2f624 100644 +index 58f6588f475e000aafede740adf4570d41a71009..ef274f5eac1c3cea0f459955432b925e37866026 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -350,6 +350,13 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -37,7 +37,7 @@ index d33657d94a4e9c6563fbc7826e18624528c498f5..b1bad421650a8c93cdc38d1f4f83ab1c if (d10 - d9 > Math.max(100.0D, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isExemptPlayer()) { // CraftBukkit end PlayerConnection.LOGGER.warn("{} (vehicle of {}) moved too quickly! {},{},{}", entity.getDisplayName().getString(), this.player.getDisplayName().getString(), d6, d7, d8); -@@ -919,9 +926,9 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -913,9 +920,9 @@ public class PlayerConnection implements PacketListenerPlayIn { double d1 = this.player.locY(); double d2 = this.player.locZ(); double d3 = this.player.locY(); @@ -49,7 +49,7 @@ index d33657d94a4e9c6563fbc7826e18624528c498f5..b1bad421650a8c93cdc38d1f4f83ab1c float f = packetplayinflying.a(this.player.yaw); float f1 = packetplayinflying.b(this.player.pitch); double d7 = d4 - this.l; -@@ -960,6 +967,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -954,6 +961,12 @@ public class PlayerConnection implements PacketListenerPlayIn { } else { speed = player.abilities.walkSpeed * 10f; } diff --git a/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch b/Spigot-Server-Patches/0307-Reset-players-airTicks-on-respawn.patch index 1813551648..5f5552da48 100644 --- a/Spigot-Server-Patches/0310-Reset-players-airTicks-on-respawn.patch +++ b/Spigot-Server-Patches/0307-Reset-players-airTicks-on-respawn.patch @@ -5,22 +5,22 @@ Subject: [PATCH] Reset players airTicks on respawn diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index b54b6c85188f231e768048c60c6cb7096a80df84..3c2cfca679e88aa07be6c747822317ecb28f091d 100644 +index f3b69a5eb5d15738d7061e10643ace23bd3718c4..f13cb4fec9da1773729630bc0e8bd01ba7bb9344 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2262,6 +2262,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2249,6 +2249,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } -+ public final int getMaxAirTicks() { return bD(); } // Paper - OBFHELPER - public int bD() { ++ public final int getMaxAirTicks() { return bG(); } // Paper - OBFHELPER + public int bG() { return 300; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0909c926b9298d99b36c43dcbec9db071444cc7c..f1b05b6c23240caa5844ae04f08ce07a6436753d 100644 +index da4f0ef74898eb327449f0dccb34afb63235b3b1..aaa4f3e26f52fd978ca421d2339627b9647c18e2 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -2025,6 +2025,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1996,6 +1996,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } this.setHealth(this.getMaxHealth()); diff --git a/Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch b/Spigot-Server-Patches/0308-Don-t-sleep-after-profile-lookups-if-not-needed.patch index 01be147e24..01be147e24 100644 --- a/Spigot-Server-Patches/0311-Don-t-sleep-after-profile-lookups-if-not-needed.patch +++ b/Spigot-Server-Patches/0308-Don-t-sleep-after-profile-lookups-if-not-needed.patch diff --git a/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch b/Spigot-Server-Patches/0309-Improve-Server-Thread-Pool-and-Thread-Priorities.patch index 7e86a5ff23..c0c580f305 100644 --- a/Spigot-Server-Patches/0312-Improve-Server-Thread-Pool-and-Thread-Priorities.patch +++ b/Spigot-Server-Patches/0309-Improve-Server-Thread-Pool-and-Thread-Priorities.patch @@ -12,7 +12,7 @@ server threads Allow usage of a single thread executor by not using ForkJoin so single core CPU's. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b13d8ec9aa0a51d5432129f1b0ecef3beb5b7276..f4c93a65c28eeca4a07aaf9b00507d5c6649d137 100644 +index 64bf641e0c4e168526c56dd46a3dca7fb09a8d3f..d3349c2654537f0308800e5e464f0d3fb2b1261d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -175,6 +175,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -56,10 +56,10 @@ index 0000000000000000000000000000000000000000..703f45da2954272a7b92e2b11087c80a + } +} diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index d72ba7f76c42fd525a5b59a999a0c08e35d0ef78..5579044782f155f587de1e2ea5115bde6053f722 100644 +index cc14e4b4609fa7013df666181c0e02a53970c123..391eca025b69ea96f16403459c7908378cf48eff 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -76,14 +76,17 @@ public class SystemUtils { +@@ -80,14 +80,17 @@ public class SystemUtils { } private static ExecutorService a(String s) { @@ -81,7 +81,7 @@ index d72ba7f76c42fd525a5b59a999a0c08e35d0ef78..5579044782f155f587de1e2ea5115bde protected void onTermination(Throwable throwable) { if (throwable != null) { SystemUtils.LOGGER.warn("{} died", this.getName(), throwable); -@@ -99,6 +102,7 @@ public class SystemUtils { +@@ -103,6 +106,7 @@ public class SystemUtils { return forkjoinworkerthread; }, SystemUtils::a, true); } diff --git a/Spigot-Server-Patches/0313-Optimize-World-Time-Updates.patch b/Spigot-Server-Patches/0310-Optimize-World-Time-Updates.patch index 30b4a87913..aea015f193 100644 --- a/Spigot-Server-Patches/0313-Optimize-World-Time-Updates.patch +++ b/Spigot-Server-Patches/0310-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f4c93a65c28eeca4a07aaf9b00507d5c6649d137..60067369f1d708ba53da9ad74be5a8330062a684 100644 +index d3349c2654537f0308800e5e464f0d3fb2b1261d..29e797135ec38af22a3dcee583742cb01abf76d5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1196,12 +1196,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1194,12 +1194,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Send time updates to everyone, it will get the right time from the world the player is in. diff --git a/Spigot-Server-Patches/0314-Restore-custom-InventoryHolder-support.patch b/Spigot-Server-Patches/0311-Restore-custom-InventoryHolder-support.patch index 247173fb9d..247173fb9d 100644 --- a/Spigot-Server-Patches/0314-Restore-custom-InventoryHolder-support.patch +++ b/Spigot-Server-Patches/0311-Restore-custom-InventoryHolder-support.patch diff --git a/Spigot-Server-Patches/0315-Use-Vanilla-Minecart-Speeds.patch b/Spigot-Server-Patches/0312-Use-Vanilla-Minecart-Speeds.patch index 0f4e7d8b42..239990878f 100644 --- a/Spigot-Server-Patches/0315-Use-Vanilla-Minecart-Speeds.patch +++ b/Spigot-Server-Patches/0312-Use-Vanilla-Minecart-Speeds.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use Vanilla Minecart Speeds CraftBukkit changed the values on flying speed, restore back to vanilla diff --git a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java -index 9124d00521463157df6348b84260f91a47e1f076..6e038905ea6e5245190e5970481195ba668f3247 100644 +index a033000a2c85043822b7cab0dee796043ce2520f..13fcb666ec20f844846eb48265ec9f77484b397a 100644 --- a/src/main/java/net/minecraft/server/EntityMinecartAbstract.java +++ b/src/main/java/net/minecraft/server/EntityMinecartAbstract.java @@ -62,9 +62,9 @@ public abstract class EntityMinecartAbstract extends Entity { diff --git a/Spigot-Server-Patches/0316-Fix-SpongeAbsortEvent-handling.patch b/Spigot-Server-Patches/0313-Fix-SpongeAbsortEvent-handling.patch index a549abd489..9b11c8ea7c 100644 --- a/Spigot-Server-Patches/0316-Fix-SpongeAbsortEvent-handling.patch +++ b/Spigot-Server-Patches/0313-Fix-SpongeAbsortEvent-handling.patch @@ -6,20 +6,19 @@ Subject: [PATCH] Fix SpongeAbsortEvent handling Only process drops when the block is actually going to be removed diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index bbd2e1be0f401d7e267dcfa2c905f42c2a475dd7..4f9c6b25f152b348a00dadf4b8f58ec3adc3476e 100644 +index b537385d12463adc82751e40b479b047b32fa5bd..b364ceafb4c3412b0d11b3b2e8b4321ed96769bb 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -197,7 +197,7 @@ public class Block extends BlockBase implements IMaterial { +@@ -189,6 +189,7 @@ public class Block extends BlockBase implements IMaterial { - iblockdata.dropNaturally(world, blockposition, ItemStack.b); } -- -+ public static void dropNaturally(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, world, blockposition, tileentity); } - public static void a(IBlockData iblockdata, World world, BlockPosition blockposition, @Nullable TileEntity tileentity) { - if (world instanceof WorldServer) { - a(iblockdata, (WorldServer) world, blockposition, tileentity).forEach((itemstack) -> { + ++ public static void dropNaturally(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) { a(iblockdata, generatoraccess, blockposition, tileentity); } + public static void a(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, @Nullable TileEntity tileentity) { + if (generatoraccess instanceof WorldServer) { + a(iblockdata, (WorldServer) generatoraccess, blockposition, tileentity).forEach((itemstack) -> { diff --git a/src/main/java/net/minecraft/server/BlockSponge.java b/src/main/java/net/minecraft/server/BlockSponge.java -index e3e4837dab995dba3c509d0e192bbfed5a1b8bc1..362750bd85bc65c304f5fece344ecdeddebaf4ee 100644 +index 7051d9bf19f989a1176c1f12e1114240ab4762c4..db73fe0e51bde67d9238ce3f9f6f008c2d8a9d4d 100644 --- a/src/main/java/net/minecraft/server/BlockSponge.java +++ b/src/main/java/net/minecraft/server/BlockSponge.java @@ -115,8 +115,11 @@ public class BlockSponge extends Block { diff --git a/Spigot-Server-Patches/0317-Don-t-allow-digging-into-unloaded-chunks.patch b/Spigot-Server-Patches/0314-Don-t-allow-digging-into-unloaded-chunks.patch index 9529562b8b..498c9709f2 100644 --- a/Spigot-Server-Patches/0317-Don-t-allow-digging-into-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0314-Don-t-allow-digging-into-unloaded-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't allow digging into unloaded chunks diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index b1bad421650a8c93cdc38d1f4f83ab1c39e2f624..a628f6b2aa792e53f223d40b2fd6a51826bc5c2a 100644 +index ef274f5eac1c3cea0f459955432b925e37866026..7f9e959377bbb2233c9e5971d8b87d8c60defa99 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1297,6 +1297,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1291,6 +1291,11 @@ public class PlayerConnection implements PacketListenerPlayIn { case START_DESTROY_BLOCK: case ABORT_DESTROY_BLOCK: case STOP_DESTROY_BLOCK: diff --git a/Spigot-Server-Patches/0318-Book-Size-Limits.patch b/Spigot-Server-Patches/0315-Book-Size-Limits.patch index c40a9f4282..1484c2fb5c 100644 --- a/Spigot-Server-Patches/0318-Book-Size-Limits.patch +++ b/Spigot-Server-Patches/0315-Book-Size-Limits.patch @@ -22,7 +22,7 @@ index 478856f190a8d0177dee39dab4692fc54f9c8ed4..01d48da8b2f89ad3a615ad10c044c5f0 + } } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index a628f6b2aa792e53f223d40b2fd6a51826bc5c2a..148d5037db35437136242af07f6cb5aacee6177f 100644 +index 7f9e959377bbb2233c9e5971d8b87d8c60defa99..1d054e76e126bc3f0f604ecb2538f2f5fa3db338 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -14,6 +14,7 @@ import java.util.Optional; @@ -33,7 +33,7 @@ index a628f6b2aa792e53f223d40b2fd6a51826bc5c2a..148d5037db35437136242af07f6cb5aa import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -814,6 +815,42 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -808,6 +809,42 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInBEdit packetplayinbedit) { diff --git a/Spigot-Server-Patches/0319-Make-the-default-permission-message-configurable.patch b/Spigot-Server-Patches/0316-Make-the-default-permission-message-configurable.patch index 82350df56e..389039c9aa 100644 --- a/Spigot-Server-Patches/0319-Make-the-default-permission-message-configurable.patch +++ b/Spigot-Server-Patches/0316-Make-the-default-permission-message-configurable.patch @@ -29,10 +29,10 @@ index 01d48da8b2f89ad3a615ad10c044c5f0a08ee4ed..f9b1b198299166759fe0bd0a36d8d88c private static void savePlayerData() { savePlayerData = getBoolean("settings.save-player-data", savePlayerData); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d7aec47c3ba553fb505b5f956850aa2e9077dd24..97cf3c094ceea2ee5ea8d5fe82ac992caf38bd66 100644 +index b430aca723a1e15707bb80e70fdd5e46a01c0eaa..2e30ae110e54009be4acad119da33819129fab11 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2266,6 +2266,11 @@ public final class CraftServer implements Server { +@@ -2260,6 +2260,11 @@ public final class CraftServer implements Server { return com.destroystokyo.paper.PaperConfig.suggestPlayersWhenNullTabCompletions; } diff --git a/Spigot-Server-Patches/0320-Prevent-rayTrace-from-loading-chunks.patch b/Spigot-Server-Patches/0317-Prevent-rayTrace-from-loading-chunks.patch index 125c3c3bc2..704f44f8b9 100644 --- a/Spigot-Server-Patches/0320-Prevent-rayTrace-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0317-Prevent-rayTrace-from-loading-chunks.patch @@ -7,7 +7,7 @@ ray tracing into an unloaded chunk should be treated as a miss this saves a ton of lag for when AI tries to raytrace near unloaded chunks. diff --git a/src/main/java/net/minecraft/server/IBlockAccess.java b/src/main/java/net/minecraft/server/IBlockAccess.java -index 077fcb67f6248156aaebe7545e370ade4311b9e4..a59df0e48a9bcbb32c51ec0013f634d474f68e52 100644 +index a168218c6f41bb798557461a80efb785eea99b25..b90c9990668f7956e8ef67413bcfc5d7d9616db1 100644 --- a/src/main/java/net/minecraft/server/IBlockAccess.java +++ b/src/main/java/net/minecraft/server/IBlockAccess.java @@ -46,7 +46,15 @@ public interface IBlockAccess { diff --git a/Spigot-Server-Patches/0321-Handle-Large-Packets-disconnecting-client.patch b/Spigot-Server-Patches/0318-Handle-Large-Packets-disconnecting-client.patch index 60c1f1ac66..733717eaa5 100644 --- a/Spigot-Server-Patches/0321-Handle-Large-Packets-disconnecting-client.patch +++ b/Spigot-Server-Patches/0318-Handle-Large-Packets-disconnecting-client.patch @@ -7,7 +7,7 @@ If a players inventory is too big to send in a single packet, split the inventory set into multiple packets instead. diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index 2916119507ec5ecd9266569b0003d0504a79f6c4..e7b4c7f2d7b0eed4c145f6476f35b637d861551e 100644 +index 2fda6f6965916e99e603ff87af4226b5ab8417ee..9ea4ce3aa6a43906eb7bf9593de0191a94242da2 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -12,6 +12,7 @@ import io.netty.channel.epoll.EpollEventLoopGroup; @@ -88,10 +88,10 @@ index 63c4dbd327beb7b6ab42eb44650d68accd3b0de6..b0cfef52cbb5e23beae528668e4e98ce + // Paper end } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 72ff0a1e6428a1776f49c26e1715f5f2428ba242..6e1426127fc5b5ddc205603b8d03b98a046f9741 100644 +index 0ef4fbb19fc816f578ad741c4406790f4185093d..34e92e544f37167317d58af4242acde49e588673 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -82,7 +82,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -79,7 +79,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { int i = packetdataserializer.i(); @@ -101,7 +101,7 @@ index 72ff0a1e6428a1776f49c26e1715f5f2428ba242..6e1426127fc5b5ddc205603b8d03b98a } else { this.f = new byte[i]; diff --git a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java -index ac42c913246f1aa9425fdf6eca48adf29e917c90..901a5df3f7d3f9ee60485ec1044a05e8aff89ccb 100644 +index e32db2baf84dcb192800e6048cadf3511da28181..6fb3168fd6de0074b1b378e992e4706c50ae15ab 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutWindowItems.java @@ -9,6 +9,15 @@ public class PacketPlayOutWindowItems implements Packet<PacketListenerPlayOut> { diff --git a/Spigot-Server-Patches/0322-force-entity-dismount-during-teleportation.patch b/Spigot-Server-Patches/0319-force-entity-dismount-during-teleportation.patch index a0ad49af1d..5f07686078 100644 --- a/Spigot-Server-Patches/0322-force-entity-dismount-during-teleportation.patch +++ b/Spigot-Server-Patches/0319-force-entity-dismount-during-teleportation.patch @@ -20,16 +20,16 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 1a677783baa0b9a3dcfcd84caccba61d76fad2fb..5c37d6f2523ead3eee082dc615d9b0c9fbd71443 100644 +index f13cb4fec9da1773729630bc0e8bd01ba7bb9344..c3bf2328f2ebeefe81a35846f0c1b2f0b178920f 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1948,12 +1948,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1943,12 +1943,15 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } -- public void bb() { +- public void be() { + // Paper start -+ public void bb() { stopRiding(false); } ++ public void be() { stopRiding(false); } + public void stopRiding(boolean suppressCancellation) { + // Paper end if (this.vehicle != null) { @@ -41,7 +41,7 @@ index 1a677783baa0b9a3dcfcd84caccba61d76fad2fb..5c37d6f2523ead3eee082dc615d9b0c9 } } -@@ -2008,7 +2011,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2003,7 +2006,10 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return true; // CraftBukkit } @@ -53,7 +53,7 @@ index 1a677783baa0b9a3dcfcd84caccba61d76fad2fb..5c37d6f2523ead3eee082dc615d9b0c9 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2018,7 +2024,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2013,7 +2019,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) getBukkitEntity(), @@ -62,7 +62,7 @@ index 1a677783baa0b9a3dcfcd84caccba61d76fad2fb..5c37d6f2523ead3eee082dc615d9b0c9 ); // Suppress during worldgen if (this.valid) { -@@ -2032,7 +2038,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2027,7 +2033,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // CraftBukkit end // Spigot start @@ -72,7 +72,7 @@ index 1a677783baa0b9a3dcfcd84caccba61d76fad2fb..5c37d6f2523ead3eee082dc615d9b0c9 if (this.valid) { Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index afc665bfe9d527ca8d19f3ab9df0900d87f2d3f2..7916421fe1dd8eadfd1c9bd15c4bbbb7331faca6 100644 +index a6265c71973b67a0b49a41e2163a6f48876f1b41..272f4ff0a59350a088d6699a9fcb6bb9f8e95551 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -942,9 +942,11 @@ public abstract class EntityHuman extends EntityLiving { @@ -80,10 +80,10 @@ index afc665bfe9d527ca8d19f3ab9df0900d87f2d3f2..7916421fe1dd8eadfd1c9bd15c4bbbb7 } - @Override -- public void bb() { -- super.bb(); +- public void be() { +- super.be(); + // Paper start -+ @Override public void bb() { stopRiding(false); } ++ @Override public void be() { stopRiding(false); } + @Override public void stopRiding(boolean suppressCancellation) { + // Paper end + super.stopRiding(suppressCancellation); // Paper - suppress @@ -91,11 +91,11 @@ index afc665bfe9d527ca8d19f3ab9df0900d87f2d3f2..7916421fe1dd8eadfd1c9bd15c4bbbb7 } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fb53d8e178b5a8e229036f90fafb48a8a142125e..2e298126405764fd342d05f8fb87ed60fb9a813d 100644 +index b4b45d93188494ae0639ae4eb9c764a48fe21607..7c239b95c9f8dfa76d397979e6b3fdcc9ff55022 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2889,11 +2889,13 @@ public abstract class EntityLiving extends Entity { - return ((Byte) this.datawatcher.get(EntityLiving.an) & 4) != 0; +@@ -2892,11 +2892,13 @@ public abstract class EntityLiving extends Entity { + return ((Byte) this.datawatcher.get(EntityLiving.ag) & 4) != 0; } - @Override @@ -112,10 +112,10 @@ index fb53d8e178b5a8e229036f90fafb48a8a142125e..2e298126405764fd342d05f8fb87ed60 this.a(entity); } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index f1b05b6c23240caa5844ae04f08ce07a6436753d..0a6367dc8b62049cb210d905394183d051a357c0 100644 +index aaa4f3e26f52fd978ca421d2339627b9647c18e2..f68d5931a3d2df5f69032c49a4b2b80a0783f504 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1131,11 +1131,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1106,11 +1106,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } } diff --git a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch b/Spigot-Server-Patches/0320-Add-more-Zombie-API.patch index 65f547ca92..341b7d7469 100644 --- a/Spigot-Server-Patches/0323-Add-more-Zombie-API.patch +++ b/Spigot-Server-Patches/0320-Add-more-Zombie-API.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Add more Zombie API diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index bb7f62fa52b758ed83db7def9053b79da3d97dcd..641d0b462d326dc9b5f6ce2d7f620e428dc25539 100644 +index 12f954723ac2f0058081d810ce83aed99532caad..02a845f99bb445fb4aa66a90273469a848195747 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -33,6 +33,7 @@ public class EntityZombie extends EntityMonster { - private int bA; + private int bt; public int drownedConversionTime; private int lastTick = MinecraftServer.currentTick; // CraftBukkit - add field + private boolean shouldBurnInDay = true; // Paper public EntityZombie(EntityTypes<? extends EntityZombie> entitytypes, World world) { super(entitytypes, world); -@@ -206,6 +207,13 @@ public class EntityZombie extends EntityMonster { - this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, true); +@@ -201,6 +202,12 @@ public class EntityZombie extends EntityMonster { + super.movementTick(); } + // Paper start @@ -26,18 +26,16 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..641d0b462d326dc9b5f6ce2d7f620e42 + this.getDataWatcher().set(EntityZombie.DROWN_CONVERTING, false); + } + // Paper end -+ - protected void eQ() { - this.c(EntityTypes.DROWNED); - if (!this.isSilent()) { -@@ -225,10 +233,17 @@ public class EntityZombie extends EntityMonster { + public void startDrownedConversion(int i) { + this.lastTick = MinecraftServer.currentTick; // CraftBukkit + this.drownedConversionTime = i; +@@ -226,10 +233,17 @@ public class EntityZombie extends EntityMonster { } -+ public boolean shouldBurnInDay() { return U_(); } // Paper - OBFHELPER - protected boolean U_() { -- return true; -+ return shouldBurnInDay; ++ public boolean shouldBurnInDay() { return T_(); } // Paper - OBFHELPER + protected boolean T_() { + return true; } + // Paper start @@ -48,16 +46,16 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..641d0b462d326dc9b5f6ce2d7f620e42 + @Override public boolean damageEntity(DamageSource damagesource, float f) { - if (super.damageEntity(damagesource, f)) { -@@ -348,6 +363,7 @@ public class EntityZombie extends EntityMonster { - nbttagcompound.setBoolean("CanBreakDoors", this.eV()); - nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bA : -1); + if (!super.damageEntity(damagesource, f)) { +@@ -349,6 +363,7 @@ public class EntityZombie extends EntityMonster { + nbttagcompound.setBoolean("CanBreakDoors", this.eU()); + nbttagcompound.setInt("InWaterTime", this.isInWater() ? this.bt : -1); nbttagcompound.setInt("DrownedConversionTime", this.isDrownConverting() ? this.drownedConversionTime : -1); + nbttagcompound.setBoolean("Paper.ShouldBurnInDay", shouldBurnInDay); // Paper } @Override -@@ -362,7 +378,11 @@ public class EntityZombie extends EntityMonster { +@@ -360,7 +375,11 @@ public class EntityZombie extends EntityMonster { if (nbttagcompound.hasKeyOfType("DrownedConversionTime", 99) && nbttagcompound.getInt("DrownedConversionTime") > -1) { this.startDrownedConversion(nbttagcompound.getInt("DrownedConversionTime")); } @@ -71,14 +69,13 @@ index bb7f62fa52b758ed83db7def9053b79da3d97dcd..641d0b462d326dc9b5f6ce2d7f620e42 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -index 0429cf020e462d3655bf1159ec857cad33544b71..30004ea3a36029827e90e587017a1dad2ede4435 100644 +index 2387f17acb0de1d1c297fd85217f514e7b4577f3..d334e656ea0f442a14864a05d4701df162487851 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java -@@ -80,4 +80,41 @@ public class CraftZombie extends CraftMonster implements Zombie { - getHandle().startDrownedConversion(time); - } +@@ -94,6 +94,42 @@ public class CraftZombie extends CraftMonster implements Zombie { + @Override + public void setAgeLock(boolean b) { } -+ + // Paper start + @Override + public boolean isDrowning() { @@ -115,4 +112,6 @@ index 0429cf020e462d3655bf1159ec857cad33544b71..30004ea3a36029827e90e587017a1dad + getHandle().setShouldBurnInDay(shouldBurnInDay); + } + // Paper end - } + + @Override + public boolean getAgeLock() { diff --git a/Spigot-Server-Patches/0324-Add-PlayerConnectionCloseEvent.patch b/Spigot-Server-Patches/0321-Add-PlayerConnectionCloseEvent.patch index c87e62b8ae..54d2ab96fe 100644 --- a/Spigot-Server-Patches/0324-Add-PlayerConnectionCloseEvent.patch +++ b/Spigot-Server-Patches/0321-Add-PlayerConnectionCloseEvent.patch @@ -34,7 +34,7 @@ how PlayerPreLoginEvent interacts with PlayerConnectionCloseEvent is undefined. diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 7d65ce89622b00a121ce0353f697b07d9e99d0ce..50163f7291474062bde81631c9220e8a9f5bb718 100644 +index 44054552a1e0efaba0f69573bfb67f4a126507c6..c053c40a940bbfebbae48464d5f9e263f54af523 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -35,9 +35,9 @@ public class LoginListener implements PacketLoginInListener { @@ -50,15 +50,15 @@ index 7d65ce89622b00a121ce0353f697b07d9e99d0ce..50163f7291474062bde81631c9220e8a private SecretKey loginKey; private EntityPlayer l; diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index e7b4c7f2d7b0eed4c145f6476f35b637d861551e..c84ee96cbed69cca311dd546e562a5322a03fd20 100644 +index 9ea4ce3aa6a43906eb7bf9593de0191a94242da2..8508f5f5136791ffcdf200f0087548ea636a9a7f 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java -@@ -336,6 +336,26 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { - this.i().a(new ChatMessage("multiplayer.disconnect.generic")); +@@ -340,6 +340,26 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { + this.j().a(new ChatMessage("multiplayer.disconnect.generic")); } this.packetQueue.clear(); // Free up packet queue. + // Paper start - Add PlayerConnectionCloseEvent -+ final PacketListener packetListener = this.i(); ++ final PacketListener packetListener = this.j(); + if (packetListener instanceof PlayerConnection) { + /* Player was logged in */ + final PlayerConnection playerConnection = (PlayerConnection) packetListener; diff --git a/Spigot-Server-Patches/0325-Prevent-Enderman-from-loading-chunks.patch b/Spigot-Server-Patches/0322-Prevent-Enderman-from-loading-chunks.patch index b94647d3de..6bc9fda007 100644 --- a/Spigot-Server-Patches/0325-Prevent-Enderman-from-loading-chunks.patch +++ b/Spigot-Server-Patches/0322-Prevent-Enderman-from-loading-chunks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent Enderman from loading chunks diff --git a/src/main/java/net/minecraft/server/EntityEnderman.java b/src/main/java/net/minecraft/server/EntityEnderman.java -index 8da3b10cd6db379cf5d9d667154dd8911813284b..b61de33513989a9097e2729f0bd733dda687644d 100644 +index d03c0b4ea5fad793a7bedad5ae3be0b779dc458c..03176e83ae31aff4c2c75702e249afaef3240f50 100644 --- a/src/main/java/net/minecraft/server/EntityEnderman.java +++ b/src/main/java/net/minecraft/server/EntityEnderman.java -@@ -381,7 +381,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -380,7 +380,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { int j = MathHelper.floor(this.enderman.locY() + random.nextDouble() * 3.0D); int k = MathHelper.floor(this.enderman.locZ() - 2.0D + random.nextDouble() * 4.0D); BlockPosition blockposition = new BlockPosition(i, j, k); @@ -18,7 +18,7 @@ index 8da3b10cd6db379cf5d9d667154dd8911813284b..b61de33513989a9097e2729f0bd733dd Block block = iblockdata.getBlock(); Vec3D vec3d = new Vec3D((double) MathHelper.floor(this.enderman.locX()) + 0.5D, (double) j + 0.5D, (double) MathHelper.floor(this.enderman.locZ()) + 0.5D); Vec3D vec3d1 = new Vec3D((double) i + 0.5D, (double) j + 0.5D, (double) k + 0.5D); -@@ -423,7 +424,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { +@@ -420,7 +421,8 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable { int j = MathHelper.floor(this.a.locY() + random.nextDouble() * 2.0D); int k = MathHelper.floor(this.a.locZ() - 1.0D + random.nextDouble() * 2.0D); BlockPosition blockposition = new BlockPosition(i, j, k); @@ -27,4 +27,4 @@ index 8da3b10cd6db379cf5d9d667154dd8911813284b..b61de33513989a9097e2729f0bd733dd + if (iblockdata == null) return; // Paper BlockPosition blockposition1 = blockposition.down(); IBlockData iblockdata1 = world.getType(blockposition1); - IBlockData iblockdata2 = Block.getValidBlockForPosition(getEnderman().getCarried(), getEnderman().world, blockposition); // Paper - Fix MC-124320 + IBlockData iblockdata2 = this.a.getCarried(); diff --git a/Spigot-Server-Patches/0326-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch b/Spigot-Server-Patches/0323-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch index e21f0be9d3..566b08c3b6 100644 --- a/Spigot-Server-Patches/0326-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch +++ b/Spigot-Server-Patches/0323-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch @@ -16,10 +16,10 @@ intent to remove) and replace it with two new methods, clearly named and documented as to their purpose. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0a6367dc8b62049cb210d905394183d051a357c0..999f474ab2ac5a3189eab2755f3a1c9b6cf58011 100644 +index f68d5931a3d2df5f69032c49a4b2b80a0783f504..ce43462b9a9a393b51a2c4b96467ebd007fd7126 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -80,6 +80,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -82,6 +82,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int ping; public boolean viewingCredits; private int containerUpdateDelay; // Paper @@ -28,7 +28,7 @@ index 0a6367dc8b62049cb210d905394183d051a357c0..999f474ab2ac5a3189eab2755f3a1c9b public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d4e1fd05cbff3e0c0973a6188ec0469cd53c63f7..bbace0cf80a7cc85a4e70a8cd760a932e33cc72c 100644 +index 3501588adf539a05a5056c9a4f45d49d9d656a37..fdc541c6867a7b7c03d622bddeb55f528086407b 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -97,6 +97,7 @@ public abstract class PlayerList { @@ -106,10 +106,10 @@ index 00333548b470435aa89fb0f4b29047eb1461e992..5770d4183c1b9ab6119a25930283c023 public Location getBedSpawnLocation() { NBTTagCompound data = getData(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 139ea71a17a014be2be735395c99c1d5354a4383..96ce5f7f5a31df8c1e73eb1afc2d15f7ac716c06 100644 +index 28a04cb8a90ad82b86f658ad17675ab58f7e8d41..806c621c6dfec93b7d0e46471dc2757998c90486 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -145,6 +145,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -142,6 +142,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { private org.bukkit.event.player.PlayerResourcePackStatusEvent.Status resourcePackStatus; private String resourcePackHash; private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit @@ -117,7 +117,7 @@ index 139ea71a17a014be2be735395c99c1d5354a4383..96ce5f7f5a31df8c1e73eb1afc2d15f7 // Paper end public CraftPlayer(CraftServer server, EntityPlayer entity) { -@@ -1412,6 +1413,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1405,6 +1406,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player { this.firstPlayed = firstPlayed; } @@ -136,7 +136,7 @@ index 139ea71a17a014be2be735395c99c1d5354a4383..96ce5f7f5a31df8c1e73eb1afc2d15f7 public void readExtraData(NBTTagCompound nbttagcompound) { hasPlayedBefore = true; if (nbttagcompound.hasKey("bukkit")) { -@@ -1434,6 +1447,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1427,6 +1440,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } public void setExtraData(NBTTagCompound nbttagcompound) { @@ -145,7 +145,7 @@ index 139ea71a17a014be2be735395c99c1d5354a4383..96ce5f7f5a31df8c1e73eb1afc2d15f7 if (!nbttagcompound.hasKey("bukkit")) { nbttagcompound.set("bukkit", new NBTTagCompound()); } -@@ -1448,6 +1463,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -1441,6 +1456,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { data.setLong("firstPlayed", getFirstPlayed()); data.setLong("lastPlayed", System.currentTimeMillis()); data.setString("lastKnownName", handle.getName()); diff --git a/Spigot-Server-Patches/0327-Fix-PlayerEditBookEvent.patch b/Spigot-Server-Patches/0324-Fix-PlayerEditBookEvent.patch index cd794ac620..e6639a108c 100644 --- a/Spigot-Server-Patches/0327-Fix-PlayerEditBookEvent.patch +++ b/Spigot-Server-Patches/0324-Fix-PlayerEditBookEvent.patch @@ -10,10 +10,10 @@ it impossible to properly cancel the event or modify the book meta cancelled writing diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 148d5037db35437136242af07f6cb5aacee6177f..6787046ca28e6942794abfae1a23e75314bd3435 100644 +index 1d054e76e126bc3f0f604ecb2538f2f5fa3db338..071826eb4def7e2a09659b078da5c636b6929476 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -890,9 +890,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -884,9 +884,11 @@ public class PlayerConnection implements PacketListenerPlayIn { itemstack2.a("pages", (NBTBase) nbttaglist); this.player.a(packetplayinbedit.d(), CraftEventFactory.handleEditBookEvent(player, enumitemslot, itemstack1, itemstack2)); // CraftBukkit } else { diff --git a/Spigot-Server-Patches/0328-Workaround-for-vehicle-tracking-issue-on-disconnect.patch b/Spigot-Server-Patches/0325-Workaround-for-vehicle-tracking-issue-on-disconnect.patch index 9d5172356b..eb751c2067 100644 --- a/Spigot-Server-Patches/0328-Workaround-for-vehicle-tracking-issue-on-disconnect.patch +++ b/Spigot-Server-Patches/0325-Workaround-for-vehicle-tracking-issue-on-disconnect.patch @@ -5,12 +5,12 @@ Subject: [PATCH] Workaround for vehicle tracking issue on disconnect diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 999f474ab2ac5a3189eab2755f3a1c9b6cf58011..0704af149368991eccfbe274c3aa5c3d910dfd9e 100644 +index ce43462b9a9a393b51a2c4b96467ebd007fd7126..717786be86f76c384b4a1f56169b948e2297de38 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1397,6 +1397,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1372,6 +1372,13 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void p() { - this.co = true; + this.ch = true; this.ejectPassengers(); + + // Paper start - Workaround an issue where the vehicle doesn't track the passenger disconnection dismount. diff --git a/Spigot-Server-Patches/0329-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch b/Spigot-Server-Patches/0326-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch index d40aa8bc37..968b9a8862 100644 --- a/Spigot-Server-Patches/0329-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch +++ b/Spigot-Server-Patches/0326-Fire-BlockPistonRetractEvent-for-all-empty-pistons.patch @@ -24,7 +24,7 @@ Instead we opt to remove the check entirely so that the event fires for all piston types. diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index d4e2c68d32aa7113cf344a154777f2314ca03cca..c068a4115e3b82f4886d822d2472e8b522946674 100644 +index 9f56471cdd180950d279883b8da71700604a9e31..417d1a6c3dbd23905672a847939d92a953bbc91c 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -112,7 +112,7 @@ public class BlockPiston extends BlockDirectional { diff --git a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch b/Spigot-Server-Patches/0327-Block-Entity-remove-from-being-called-on-Players.patch index c974b87209..9133d11307 100644 --- a/Spigot-Server-Patches/0330-Block-Entity-remove-from-being-called-on-Players.patch +++ b/Spigot-Server-Patches/0327-Block-Entity-remove-from-being-called-on-Players.patch @@ -12,10 +12,10 @@ Player we will look at limiting the scope of this change. It appears to be unintentional in the few cases we've seen so far. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f34b029e23b273b2243e8fbb8459d6f5e33e722c..4c19e3f6176a31f5447e72f5750e3eab61bc261e 100644 +index 806c621c6dfec93b7d0e46471dc2757998c90486..d43ada6dccb45060ea37acf7a2a8ea6a4d74ab18 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2022,6 +2022,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2015,6 +2015,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void resetCooldown() { getHandle().resetAttackCooldown(); } diff --git a/Spigot-Server-Patches/0331-BlockDestroyEvent.patch b/Spigot-Server-Patches/0328-BlockDestroyEvent.patch index ea42113e24..12eae33a12 100644 --- a/Spigot-Server-Patches/0331-BlockDestroyEvent.patch +++ b/Spigot-Server-Patches/0328-BlockDestroyEvent.patch @@ -11,10 +11,10 @@ floating in the air. This can replace many uses of BlockPhysicsEvent diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a0f93486b21e3bdbcf3b705c005c2e13f75589ed..722db2c45da211ef376fff4aa17964009b2e53e2 100644 +index b46c6f7f5e8bf586235b3144dee4e4ce64e89947..12ea2c5f6e282f4732890188ef6501b7053ba008 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -535,8 +535,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -500,8 +500,20 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return false; } else { Fluid fluid = this.getFluid(blockposition); diff --git a/Spigot-Server-Patches/0332-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch b/Spigot-Server-Patches/0329-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch index 620202d82d..1518fcffe0 100644 --- a/Spigot-Server-Patches/0332-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch +++ b/Spigot-Server-Patches/0329-Fix-Custom-Shapeless-Custom-Crafting-Recipes.patch @@ -10,7 +10,7 @@ This made the Bukkit RecipeChoice API not work for Shapeless. This reimplements vanilla logic using the same test logic as Shaped diff --git a/src/main/java/net/minecraft/server/ShapelessRecipes.java b/src/main/java/net/minecraft/server/ShapelessRecipes.java -index fe03a35cc862d58fffa88325e34bad011a0a0ff7..fb481e65862b4aaa08e2302a517fdd8253d63812 100644 +index 7ba4196a9e71085c35e732b5440db3109121b195..213e8cf55c3e1aeefc77729b872763bbff891578 100644 --- a/src/main/java/net/minecraft/server/ShapelessRecipes.java +++ b/src/main/java/net/minecraft/server/ShapelessRecipes.java @@ -63,16 +63,46 @@ public class ShapelessRecipes implements RecipeCrafting { diff --git a/Spigot-Server-Patches/0333-Fix-sign-edit-memory-leak.patch b/Spigot-Server-Patches/0330-Fix-sign-edit-memory-leak.patch index d0b11be34f..1dcd8a292b 100644 --- a/Spigot-Server-Patches/0333-Fix-sign-edit-memory-leak.patch +++ b/Spigot-Server-Patches/0330-Fix-sign-edit-memory-leak.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix sign edit memory leak when a player edits a sign, a reference to their Entity is never cleand up. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6787046ca28e6942794abfae1a23e75314bd3435..1c843fb1f877855117b5e20bdc0d040da1752295 100644 +index 071826eb4def7e2a09659b078da5c636b6929476..8f22e0ec85d48b65dab20f1db70944fca3bf28e6 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2587,7 +2587,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2582,7 +2582,7 @@ public class PlayerConnection implements PacketListenerPlayIn { TileEntitySign tileentitysign = (TileEntitySign) tileentity; @@ -19,12 +19,12 @@ index 6787046ca28e6942794abfae1a23e75314bd3435..1c843fb1f877855117b5e20bdc0d040d this.sendPacket(tileentity.getUpdatePacket()); // CraftBukkit return; diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 8e77c662f7d970d8ff86f6c5b9bccc598442594d..2746cb4d4950b303f4d6b4822223d26b51ebe5a4 100644 +index 2b249e7e2018a283b80b9462fbc129420e47ec06..7bee21d9ae9e8c27fe129605060455b55093afda 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -11,6 +11,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // private EntityHuman c; - private final IChatFormatted[] g; + private final FormattedString[] g; private EnumColor color; + public java.util.UUID signEditor; // Paper diff --git a/Spigot-Server-Patches/0334-Limit-Client-Sign-length-more.patch b/Spigot-Server-Patches/0331-Limit-Client-Sign-length-more.patch index 3643dfba93..5854981199 100644 --- a/Spigot-Server-Patches/0334-Limit-Client-Sign-length-more.patch +++ b/Spigot-Server-Patches/0331-Limit-Client-Sign-length-more.patch @@ -22,7 +22,7 @@ it only impacts data sent from the client. Set -DPaper.maxSignLength=XX to change limit or -1 to disable diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 1c843fb1f877855117b5e20bdc0d040da1752295..0aac20a6a1e72f0528532edb9421b89e8461e23e 100644 +index 8f22e0ec85d48b65dab20f1db70944fca3bf28e6..5473b3763d7187a555de05764af7cae957d554b5 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -103,6 +103,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -33,7 +33,7 @@ index 1c843fb1f877855117b5e20bdc0d040da1752295..0aac20a6a1e72f0528532edb9421b89e private static final long KEEPALIVE_LIMIT = Long.getLong("paper.playerconnection.keepalive", 30) * 1000; // Paper - provide property to set keepalive limit public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { -@@ -2603,6 +2604,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2598,6 +2599,15 @@ public class PlayerConnection implements PacketListenerPlayIn { String[] lines = new String[4]; for (int i = 0; i < astring.length; ++i) { diff --git a/Spigot-Server-Patches/0335-Don-t-check-ConvertSigns-boolean-every-sign-save.patch b/Spigot-Server-Patches/0332-Don-t-check-ConvertSigns-boolean-every-sign-save.patch index e334dde496..8b9d0b57a5 100644 --- a/Spigot-Server-Patches/0335-Don-t-check-ConvertSigns-boolean-every-sign-save.patch +++ b/Spigot-Server-Patches/0332-Don-t-check-ConvertSigns-boolean-every-sign-save.patch @@ -7,11 +7,11 @@ property lookups arent super cheap. they synchronize, validate and check security managers. diff --git a/src/main/java/net/minecraft/server/TileEntitySign.java b/src/main/java/net/minecraft/server/TileEntitySign.java -index 2746cb4d4950b303f4d6b4822223d26b51ebe5a4..c4b0d8720e71c7bf2cac7ed962b8fd33cf0b49b3 100644 +index 7bee21d9ae9e8c27fe129605060455b55093afda..2b9d5724c1b63f5e55010f9e3450004821c098a4 100644 --- a/src/main/java/net/minecraft/server/TileEntitySign.java +++ b/src/main/java/net/minecraft/server/TileEntitySign.java @@ -12,6 +12,7 @@ public class TileEntitySign extends TileEntity implements ICommandListener { // - private final IChatFormatted[] g; + private final FormattedString[] g; private EnumColor color; public java.util.UUID signEditor; // Paper + private static final boolean CONVERT_LEGACY_SIGNS = Boolean.getBoolean("convertLegacySigns"); // Paper diff --git a/Spigot-Server-Patches/0336-Optimize-Network-Manager-and-add-advanced-packet-sup.patch b/Spigot-Server-Patches/0333-Optimize-Network-Manager-and-add-advanced-packet-sup.patch index da0b8abdb4..6639a9f915 100644 --- a/Spigot-Server-Patches/0336-Optimize-Network-Manager-and-add-advanced-packet-sup.patch +++ b/Spigot-Server-Patches/0333-Optimize-Network-Manager-and-add-advanced-packet-sup.patch @@ -28,7 +28,7 @@ and then catch exceptions and close if they fire. Part of this commit was authored by: Spottedleaf diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java -index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a71dd845e 100644 +index 8508f5f5136791ffcdf200f0087548ea636a9a7f..48fc9f40050685ea08af8da54ae8a00cf3d8ee36 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -65,6 +65,10 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { @@ -99,7 +99,7 @@ index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a public void sendPacket(Packet<?> packet, @Nullable GenericFutureListener<? extends Future<? super Void>> genericfuturelistener) { - if (this.isConnected()) { -- this.o(); +- this.p(); - this.b(packet, genericfuturelistener); - } else { - this.packetQueue.add(new NetworkManager.QueuedPacket(packet, genericfuturelistener)); @@ -212,14 +212,14 @@ index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a } -- private void sendPacketQueue() { this.o(); } // Paper - OBFHELPER -- private void o() { +- private void sendPacketQueue() { this.p(); } // Paper - OBFHELPER +- private void p() { - if (this.channel != null && this.channel.isOpen()) { - Queue queue = this.packetQueue; - -+ // Paper start - rewrite this to be safer on -+ private boolean sendPacketQueue() { return this.o(); } // OBFHELPER // void -> boolean -+ private boolean o() { // void -> boolean ++ // Paper start - rewrite this to be safer if ran off main thread ++ private boolean sendPacketQueue() { return this.p(); } // OBFHELPER // void -> boolean ++ private boolean p() { // void -> boolean + if (!isConnected()) { + return true; + } @@ -264,8 +264,8 @@ index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a + // Paper end public void a() { - this.o(); -@@ -257,9 +390,21 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { + this.p(); +@@ -261,9 +394,21 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { return this.socketAddress; } @@ -287,7 +287,7 @@ index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a // Spigot End if (this.channel.isOpen()) { this.channel.close(); // We can't wait as this may be called from an event loop. -@@ -327,7 +472,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { +@@ -331,7 +476,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { public void handleDisconnection() { if (this.channel != null && !this.channel.isOpen()) { if (this.o) { @@ -295,15 +295,15 @@ index c84ee96cbed69cca311dd546e562a5322a03fd20..d5cc2af83a1c08db969bfb8a832e450a + //NetworkManager.LOGGER.warn("handleDisconnection() called twice"); // Paper - Do not log useless message } else { this.o = true; - if (this.j() != null) { -@@ -335,7 +480,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { - } else if (this.i() != null) { - this.i().a(new ChatMessage("multiplayer.disconnect.generic")); + if (this.k() != null) { +@@ -339,7 +484,7 @@ public class NetworkManager extends SimpleChannelInboundHandler<Packet<?>> { + } else if (this.j() != null) { + this.j().a(new ChatMessage("multiplayer.disconnect.generic")); } - this.packetQueue.clear(); // Free up packet queue. + clearPacketQueue(); // Paper // Paper start - Add PlayerConnectionCloseEvent - final PacketListener packetListener = this.i(); + final PacketListener packetListener = this.j(); if (packetListener instanceof PlayerConnection) { diff --git a/src/main/java/net/minecraft/server/Packet.java b/src/main/java/net/minecraft/server/Packet.java index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..545dbe6ddcce1d172f465b4a7ab85654ee5fdbb4 100644 @@ -338,10 +338,10 @@ index 2d8e6a2f4a0c3c5d74a647d7164b0028781d3bf5..545dbe6ddcce1d172f465b4a7ab85654 return false; } diff --git a/src/main/java/net/minecraft/server/ServerConnection.java b/src/main/java/net/minecraft/server/ServerConnection.java -index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..0438126662e7c635d9a4f7b8c54fe7c50403ffe8 100644 +index 8fcd8f4056620713d0c02fdd9b829053ba95e851..5f4dacf9c93c2495a07df2647fe0411f796da6af 100644 --- a/src/main/java/net/minecraft/server/ServerConnection.java +++ b/src/main/java/net/minecraft/server/ServerConnection.java -@@ -15,6 +15,7 @@ import io.netty.channel.epoll.EpollServerSocketChannel; +@@ -16,6 +16,7 @@ import io.netty.channel.epoll.EpollServerSocketChannel; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.ServerSocketChannel; import io.netty.channel.socket.nio.NioServerSocketChannel; @@ -349,7 +349,7 @@ index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..0438126662e7c635d9a4f7b8c54fe7c5 import io.netty.handler.timeout.ReadTimeoutHandler; import java.io.IOException; import java.net.InetAddress; -@@ -40,10 +41,12 @@ public class ServerConnection { +@@ -41,10 +42,12 @@ public class ServerConnection { private final List<NetworkManager> connectedChannels = Collections.synchronizedList(Lists.newArrayList()); // Paper start - prevent blocking on adding a new network manager while the server is ticking private final java.util.Queue<NetworkManager> pending = new java.util.concurrent.ConcurrentLinkedQueue<>(); @@ -362,11 +362,11 @@ index 7abb122943b8a5ce0e888d16d1592a127bb9bb6f..0438126662e7c635d9a4f7b8c54fe7c5 } } // Paper end -@@ -78,6 +81,7 @@ public class ServerConnection { +@@ -79,6 +82,7 @@ public class ServerConnection { ; } + if (!disableFlushConsolidation) channel.pipeline().addFirst(new FlushConsolidationHandler()); // Paper channel.pipeline().addLast("timeout", new ReadTimeoutHandler(30)).addLast("legacy_query", new LegacyPingHandler(ServerConnection.this)).addLast("splitter", new PacketSplitter()).addLast("decoder", new PacketDecoder(EnumProtocolDirection.SERVERBOUND)).addLast("prepender", new PacketPrepender()).addLast("encoder", new PacketEncoder(EnumProtocolDirection.CLIENTBOUND)); - NetworkManager networkmanager = new NetworkManager(EnumProtocolDirection.SERVERBOUND); - + int j = ServerConnection.this.e.k(); + Object object = j > 0 ? new NetworkManagerServer(j) : new NetworkManager(EnumProtocolDirection.SERVERBOUND); diff --git a/Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch b/Spigot-Server-Patches/0334-Handle-Oversized-Tile-Entities-in-chunks.patch index 0adb9b89ea..f30ce86df4 100644 --- a/Spigot-Server-Patches/0337-Handle-Oversized-Tile-Entities-in-chunks.patch +++ b/Spigot-Server-Patches/0334-Handle-Oversized-Tile-Entities-in-chunks.patch @@ -9,34 +9,34 @@ creating too large of a packet to sed. Co authored by Spottedleaf diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 6e1426127fc5b5ddc205603b8d03b98a046f9741..900f16efde29ace3f073b1cbc01df8bafc360a9a 100644 +index 34e92e544f37167317d58af4242acde49e588673..5fae0ec8933cef2b87d2f465c8019af0af2e130d 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -@@ -24,6 +24,15 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -22,7 +22,15 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { + private boolean h; public PacketPlayOutMapChunk() {} - + // Paper start + private final java.util.List<Packet> extraPackets = new java.util.ArrayList<>(); + private static final int TE_LIMIT = Integer.getInteger("Paper.excessiveTELimit", 750); -+ + + @Override + public java.util.List<Packet> getExtraPackets() { + return extraPackets; + } + // Paper end - public PacketPlayOutMapChunk(Chunk chunk, int i, boolean flag) { + public PacketPlayOutMapChunk(Chunk chunk, int i) { ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); -@@ -51,6 +60,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { - this.c = this.a(new PacketDataSerializer(this.k()), chunk, i); +@@ -49,6 +57,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { + this.c = this.a(new PacketDataSerializer(this.j()), chunk, i); this.g = Lists.newArrayList(); iterator = chunk.getTileEntities().entrySet().iterator(); + int totalTileEntities = 0; // Paper while (iterator.hasNext()) { entry = (Entry) iterator.next(); -@@ -59,6 +69,15 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -57,6 +66,15 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { int j = blockposition.getY() >> 4; if (this.f() || (i & 1 << j) != 0) { diff --git a/Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch b/Spigot-Server-Patches/0335-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch index e449ff240a..38f46bd79e 100644 --- a/Spigot-Server-Patches/0338-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch +++ b/Spigot-Server-Patches/0335-MC-145260-Fix-Whitelist-On-Off-inconsistency.patch @@ -11,10 +11,10 @@ everything to the Whitelist object. https://github.com/PaperMC/Paper/issues/1880 diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index bbace0cf80a7cc85a4e70a8cd760a932e33cc72c..5f9cbdcbaca06d0228411b75665054092334069a 100644 +index fdc541c6867a7b7c03d622bddeb55f528086407b..843c0cffdd0578f0f820bb77e7a0e225c799bb22 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -930,9 +930,9 @@ public abstract class PlayerList { +@@ -942,9 +942,9 @@ public abstract class PlayerList { } public boolean isWhitelisted(GameProfile gameprofile, org.bukkit.event.player.PlayerLoginEvent loginEvent) { boolean isOp = this.operators.d(gameprofile); diff --git a/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch b/Spigot-Server-Patches/0336-Set-Zombie-last-tick-at-start-of-drowning-process.patch index cd037bb19d..1cabbc9d85 100644 --- a/Spigot-Server-Patches/0339-Set-Zombie-last-tick-at-start-of-drowning-process.patch +++ b/Spigot-Server-Patches/0336-Set-Zombie-last-tick-at-start-of-drowning-process.patch @@ -6,14 +6,14 @@ Subject: [PATCH] Set Zombie last tick at start of drowning process Fixes GH-1887 diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index 641d0b462d326dc9b5f6ce2d7f620e428dc25539..e436b0f4691154e200b9a5c28566074ff8bc0df9 100644 +index 02a845f99bb445fb4aa66a90273469a848195747..45c470ebeca1552e0a849b607fde95de437e8bb4 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -161,6 +161,7 @@ public class EntityZombie extends EntityMonster { - ++this.bA; - if (this.bA >= 600) { +@@ -162,6 +162,7 @@ public class EntityZombie extends EntityMonster { + ++this.bt; + if (this.bt >= 600) { this.startDrownedConversion(300); + this.lastTick = MinecraftServer.currentTick; // Paper - Make sure this is set at start of process - GH-1887 } } else { - this.bA = -1; + this.bt = -1; diff --git a/Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch b/Spigot-Server-Patches/0337-Allow-Saving-of-Oversized-Chunks.patch index b0975133d8..9bbd55e097 100644 --- a/Spigot-Server-Patches/0340-Allow-Saving-of-Oversized-Chunks.patch +++ b/Spigot-Server-Patches/0337-Allow-Saving-of-Oversized-Chunks.patch @@ -31,18 +31,18 @@ this fix, as the data will remain in the oversized file. Once the server returns to a jar with this fix, the data will be restored. diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index c9be8c7f40917056091f63d36311a10d6302acbb..f48b62af436de47484eb1cf496e97a29168586b0 100644 +index f9738fb0df2704251af0a45b56e34cc005c6ec37..6e6cabc03bc3822ee973bdafef8f4adb61b6c263 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -@@ -70,6 +70,7 @@ public class NBTCompressedStreamTools { +@@ -128,6 +128,7 @@ public class NBTCompressedStreamTools { } -+ public static NBTTagCompound readNBT(DataInputStream datainputstream) throws IOException { return a(datainputstream); } // Paper - OBFHELPER - public static NBTTagCompound a(DataInputStream datainputstream) throws IOException { - return a((DataInput) datainputstream, NBTReadLimiter.a); ++ public static NBTTagCompound readNBT(DataInput datainput) throws IOException { return a(datainput); } // Paper - OBFHELPER + public static NBTTagCompound a(DataInput datainput) throws IOException { + return a(datainput, NBTReadLimiter.a); } -@@ -90,6 +91,7 @@ public class NBTCompressedStreamTools { +@@ -148,6 +149,7 @@ public class NBTCompressedStreamTools { } } @@ -51,10 +51,10 @@ index c9be8c7f40917056091f63d36311a10d6302acbb..f48b62af436de47484eb1cf496e97a29 a((NBTBase) nbttagcompound, dataoutput); } diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 26b55108ecf4cd48762b00da625b0ce1d2f42c67..f781bb12a1c37d8b3088d0f638eae80d5b80aca4 100644 +index be7165098fcb814d7b301a1670c33c78461d8d95..2fb4131e5972d3b554a763098709470e8a725280 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -17,6 +17,8 @@ import java.nio.file.Files; +@@ -18,6 +18,8 @@ import java.nio.file.Files; import java.nio.file.LinkOption; import java.nio.file.StandardCopyOption; import java.nio.file.StandardOpenOption; @@ -63,27 +63,28 @@ index 26b55108ecf4cd48762b00da625b0ce1d2f42c67..f781bb12a1c37d8b3088d0f638eae80d import javax.annotation.Nullable; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -@@ -32,13 +34,16 @@ public class RegionFile implements AutoCloseable { - private final IntBuffer g; - private final IntBuffer h; - private final RegionFileBitSet freeSectors; -+ public final File file; +@@ -34,6 +36,7 @@ public class RegionFile implements AutoCloseable { + private final IntBuffer i; + @VisibleForTesting + protected final RegionFileBitSet freeSectors; ++ public final File file; // Paper public RegionFile(File file, File file1, boolean flag) throws IOException { this(file.toPath(), file1.toPath(), RegionFileCompression.b, flag); - } +@@ -41,6 +44,8 @@ public class RegionFile implements AutoCloseable { public RegionFile(java.nio.file.Path java_nio_file_path, java.nio.file.Path java_nio_file_path1, RegionFileCompression regionfilecompression, boolean flag) throws IOException { + this.g = ByteBuffer.allocateDirect(8192); + this.file = java_nio_file_path.toFile(); // Paper - this.f = ByteBuffer.allocateDirect(8192); -+ initOversizedState(); ++ initOversizedState(); // Paper this.freeSectors = new RegionFileBitSet(); - this.e = regionfilecompression; + this.f = regionfilecompression; if (!Files.isDirectory(java_nio_file_path1, new LinkOption[0])) { -@@ -389,6 +394,74 @@ public class RegionFile implements AutoCloseable { +@@ -404,6 +409,74 @@ public class RegionFile implements AutoCloseable { void run() throws IOException; } ++ // Paper start + private final byte[] oversized = new byte[1024]; + private int oversizedCount = 0; + @@ -146,20 +147,19 @@ index 26b55108ecf4cd48762b00da625b0ce1d2f42c67..f781bb12a1c37d8b3088d0f638eae80d + synchronized NBTTagCompound getOversizedData(int x, int z) throws IOException { + File file = getOversizedFile(x, z); + try (DataInputStream out = new DataInputStream(new BufferedInputStream(new InflaterInputStream(new java.io.FileInputStream(file))))) { -+ return NBTCompressedStreamTools.readNBT(out); ++ return NBTCompressedStreamTools.readNBT((java.io.DataInput) out); + } + + } + // Paper end -+ class ChunkBuffer extends ByteArrayOutputStream { private final ChunkCoordIntPair b; diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 0305f3c93e8485552890dd5eca8e79277e2bb886..02bd568af727633a6e834d5328683a9ff67b9dd7 100644 +index 6be04e230fe96c1f2345a00de4f648d9eb712a82..de926992e20da3ec433f9c7b4bc73805fd9d36ab 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -44,6 +44,74 @@ public final class RegionFileCache implements AutoCloseable { +@@ -45,6 +45,74 @@ public final class RegionFileCache implements AutoCloseable { } } @@ -188,7 +188,7 @@ index 0305f3c93e8485552890dd5eca8e79277e2bb886..02bd568af727633a6e834d5328683a9f + synchronized (regionfile) { + try (DataInputStream datainputstream = regionfile.getReadStream(chunkCoordinate)) { + NBTTagCompound oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z); -+ NBTTagCompound chunk = NBTCompressedStreamTools.readNBT(datainputstream); ++ NBTTagCompound chunk = NBTCompressedStreamTools.readNBT((DataInput) datainputstream); + if (oversizedData == null) { + return chunk; + } @@ -234,7 +234,7 @@ index 0305f3c93e8485552890dd5eca8e79277e2bb886..02bd568af727633a6e834d5328683a9f @Nullable public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException { // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing -@@ -53,6 +121,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -54,6 +122,12 @@ public final class RegionFileCache implements AutoCloseable { } // CraftBukkit end DataInputStream datainputstream = regionfile.a(chunkcoordintpair); @@ -247,11 +247,11 @@ index 0305f3c93e8485552890dd5eca8e79277e2bb886..02bd568af727633a6e834d5328683a9f Throwable throwable = null; NBTTagCompound nbttagcompound; -@@ -93,6 +167,7 @@ public final class RegionFileCache implements AutoCloseable { +@@ -94,6 +168,7 @@ public final class RegionFileCache implements AutoCloseable { try { NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); -+ regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // We don't do this anymore ++ regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // Paper - We don't do this anymore, mojang stores differently, but clear old meta flag if it exists to get rid of our own meta file once last oversized is gone } catch (Throwable throwable1) { throwable = throwable1; throw throwable1; diff --git a/Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch b/Spigot-Server-Patches/0338-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch index ef318239c9..868626c35b 100644 --- a/Spigot-Server-Patches/0341-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch +++ b/Spigot-Server-Patches/0338-Call-WhitelistToggleEvent-when-whitelist-is-toggled.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Call WhitelistToggleEvent when whitelist is toggled diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 5f9cbdcbaca06d0228411b75665054092334069a..d8b06c9892264b3eaf9e1ed3c9b4c0954b47d05f 100644 +index 843c0cffdd0578f0f820bb77e7a0e225c799bb22..81a808c05ecc4262d9c5d1db26f649c4e709a0e5 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1048,6 +1048,7 @@ public abstract class PlayerList { +@@ -1060,6 +1060,7 @@ public abstract class PlayerList { } public void setHasWhitelist(boolean flag) { diff --git a/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch b/Spigot-Server-Patches/0339-Add-LivingEntity-getTargetEntity.patch index 0cd1d0f5e6..e483dfb0f4 100644 --- a/Spigot-Server-Patches/0342-Add-LivingEntity-getTargetEntity.patch +++ b/Spigot-Server-Patches/0339-Add-LivingEntity-getTargetEntity.patch @@ -46,10 +46,10 @@ index 02c09f39848399a86d46bd17569b4f01a7b5ab1f..ed9b2f9adfecdc6d1b9925579ec51065 double[] adouble = new double[]{1.0D}; double d0 = vec3d1.x - vec3d.x; diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 5c37d6f2523ead3eee082dc615d9b0c9fbd71443..c5abac3eb3f98a948ff7a3423cfcad70abae86ff 100644 +index c3bf2328f2ebeefe81a35846f0c1b2f0b178920f..431091b87370a8416a6945c560981ba1882894d4 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1426,6 +1426,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1419,6 +1419,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.c(f - 90.0F, f1); } @@ -57,19 +57,19 @@ index 5c37d6f2523ead3eee082dc615d9b0c9fbd71443..c5abac3eb3f98a948ff7a3423cfcad70 public final Vec3D j(float f) { if (f == 1.0F) { return new Vec3D(this.locX(), this.getHeadY(), this.locZ()); -@@ -2057,6 +2058,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2052,6 +2053,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.getPassengers().size() < 1; } -+ public final float getCollisionBorderSize() { return bc(); } // Paper - OBFHELPER - public float bc() { ++ public final float getCollisionBorderSize() { return bf(); } // Paper - OBFHELPER + public float bf() { return 0.0F; } diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 2e298126405764fd342d05f8fb87ed60fb9a813d..a6f38a95b78ac43a2250f575a755e833d1baea33 100644 +index 7c239b95c9f8dfa76d397979e6b3fdcc9ff55022..aecb5ca746be20e31f047a68f729d5c5a3699140 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3492,6 +3492,37 @@ public abstract class EntityLiving extends Entity { +@@ -3514,6 +3514,37 @@ public abstract class EntityLiving extends Entity { return world.rayTrace(raytrace); } @@ -108,7 +108,7 @@ index 2e298126405764fd342d05f8fb87ed60fb9a813d..a6f38a95b78ac43a2250f575a755e833 public int getShieldBlockingDelay() { diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index d7e3580067bcbca09b66f05f02e8736863bd7ef5..28f10ab2e427872c04bc97ebc392cf6d58854cf9 100644 +index b88a99221933108141b558adef6aa91f0cedc136..c13bb708ccd14c3848afbc9afaf6439c1a574f22 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -18,6 +18,7 @@ public final class IEntitySelector { diff --git a/Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch b/Spigot-Server-Patches/0340-Use-proper-max-length-when-serialising-BungeeCord-te.patch index 2918d2ee68..2918d2ee68 100644 --- a/Spigot-Server-Patches/0343-Use-proper-max-length-when-serialising-BungeeCord-te.patch +++ b/Spigot-Server-Patches/0340-Use-proper-max-length-when-serialising-BungeeCord-te.patch diff --git a/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch b/Spigot-Server-Patches/0341-Entity-getEntitySpawnReason.patch index 083c74756c..0787594146 100644 --- a/Spigot-Server-Patches/0344-Entity-getEntitySpawnReason.patch +++ b/Spigot-Server-Patches/0341-Entity-getEntitySpawnReason.patch @@ -10,10 +10,10 @@ persistenting Living Entity, SPAWNER for spawners, or DEFAULT since data was not stored. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c5abac3eb3f98a948ff7a3423cfcad70abae86ff..4502ea222d98872a4c33714a8c3149c6d42dee46 100644 +index 431091b87370a8416a6945c560981ba1882894d4..a40e6d2f83b9f142d716b4b00dba05123d9e1c0a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -72,6 +72,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -74,6 +74,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } }; List<Entity> entitySlice = null; @@ -21,7 +21,7 @@ index c5abac3eb3f98a948ff7a3423cfcad70abae86ff..4502ea222d98872a4c33714a8c3149c6 // Paper end public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper -@@ -1589,6 +1590,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1582,6 +1583,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (this.origin != null) { nbttagcompound.set("Paper.Origin", this.createList(origin.getX(), origin.getY(), origin.getZ())); } @@ -31,7 +31,7 @@ index c5abac3eb3f98a948ff7a3423cfcad70abae86ff..4502ea222d98872a4c33714a8c3149c6 // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbttagcompound.setBoolean("Paper.FromMobSpawner", true); -@@ -1717,6 +1721,26 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1710,6 +1714,26 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status @@ -59,19 +59,19 @@ index c5abac3eb3f98a948ff7a3423cfcad70abae86ff..4502ea222d98872a4c33714a8c3149c6 } catch (Throwable throwable) { diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index e2f5354709819e56f9bc66b8c8d5e095bc8387b4..df5ac3295ea64fa9bb15f0565610265d55651b87 100644 +index 1aecc84479b00a019a5b68f5e726d1c2965ae0f7..c3a5db97fd85b31c6b4bce93527b9d0e16a79a45 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -162,6 +162,7 @@ public abstract class MobSpawnerAbstract { - // Spigot End - } +@@ -165,6 +165,7 @@ public abstract class MobSpawnerAbstract { + // Spigot End + } entity.spawnedViaMobSpawner = true; // Paper -+ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER; // Paper - // Spigot Start - flag = true; // Paper - if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { ++ entity.spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER; // Paper + flag = true; // Paper + // Spigot Start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, blockposition).isCancelled()) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index d8b06c9892264b3eaf9e1ed3c9b4c0954b47d05f..85694a0ad7e32e4a98d8b0589f8d4dca91625bb3 100644 +index 81a808c05ecc4262d9c5d1db26f649c4e709a0e5..77262daa02b52e4f3e44f770060a4a56494f642c 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -262,7 +262,7 @@ public abstract class PlayerList { @@ -84,10 +84,10 @@ index d8b06c9892264b3eaf9e1ed3c9b4c0954b47d05f..85694a0ad7e32e4a98d8b0589f8d4dca }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 74d672b6a1beef5c4af8a2fcfc72486696fdcd05..c08391411648206b244896c30e3b9b6b199095aa 100644 +index 0b7047863bb3a3f3d61491bb1924b94a0305e40a..ad9633747c4fc8546924c4d86ad45eb611c12102 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -921,6 +921,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -922,6 +922,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit start private boolean addEntity0(Entity entity, CreatureSpawnEvent.SpawnReason spawnReason) { org.spigotmc.AsyncCatcher.catchOp("entity add"); // Spigot @@ -96,10 +96,10 @@ index 74d672b6a1beef5c4af8a2fcfc72486696fdcd05..c08391411648206b244896c30e3b9b6b if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 51f027e8f98240fec989ea877095031bab087bda..821417610fdb23791bd83e263977026b9d09e31a 100644 +index d55383d8fb471fe3441dbbc8e9344b42f1d7465b..a479ca88dcf60866650c236e885dd55f47915858 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1060,5 +1060,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1066,5 +1066,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public boolean fromMobSpawner() { return getHandle().spawnedViaMobSpawner; } diff --git a/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch b/Spigot-Server-Patches/0342-Update-entity-Metadata-for-all-tracked-players.patch index 5acf6c5f92..ad991666dd 100644 --- a/Spigot-Server-Patches/0345-Update-entity-Metadata-for-all-tracked-players.patch +++ b/Spigot-Server-Patches/0342-Update-entity-Metadata-for-all-tracked-players.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Update entity Metadata for all tracked players diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index b5a76f37c27cde25b2561a23c7c0fe7bdd992fee..9b89c0c8a3f1dada4e9b2aaeed0b92e56229b7ca 100644 +index bbb3f88bb15c70aec7f4d223dd3c0cc986c6eb21..b8fa8a582c4e440990f7e9c426c40bb576a3af66 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -392,6 +392,12 @@ public class EntityTrackerEntry { @@ -22,10 +22,10 @@ index b5a76f37c27cde25b2561a23c7c0fe7bdd992fee..9b89c0c8a3f1dada4e9b2aaeed0b92e5 this.f.accept(packet); if (this.tracker instanceof EntityPlayer) { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 0aac20a6a1e72f0528532edb9421b89e8461e23e..c03ddd05032c75bf723bcdc12d37cc3dbfebc9cc 100644 +index 5473b3763d7187a555de05764af7cae957d554b5..6e5194e7b06b82ec256fce4124154051f4b2c7cc 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2046,7 +2046,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2041,7 +2041,14 @@ public class PlayerConnection implements PacketListenerPlayIn { if (event.isCancelled() || this.player.inventory.getItemInHand() == null || this.player.inventory.getItemInHand().getItem() != origItem) { // Refresh the current entity metadata diff --git a/Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch b/Spigot-Server-Patches/0343-Implement-PlayerPostRespawnEvent.patch index 69ec85d603..b66b0efff8 100644 --- a/Spigot-Server-Patches/0346-Implement-PlayerPostRespawnEvent.patch +++ b/Spigot-Server-Patches/0343-Implement-PlayerPostRespawnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement PlayerPostRespawnEvent diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 85694a0ad7e32e4a98d8b0589f8d4dca91625bb3..8a659688ddc608fafe19e452c55e69f132f05fca 100644 +index 77262daa02b52e4f3e44f770060a4a56494f642c..531b64e96b30b4f5ae80ecc0b2fb3d656ca4ade9 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -664,9 +664,14 @@ public abstract class PlayerList { +@@ -665,9 +665,14 @@ public abstract class PlayerList { // this.a(entityplayer1, entityplayer, worldserver1); // CraftBukkit - removed boolean flag2 = false; @@ -24,7 +24,7 @@ index 85694a0ad7e32e4a98d8b0589f8d4dca91625bb3..8a659688ddc608fafe19e452c55e69f1 WorldServer worldserver1 = this.server.getWorldServer(entityplayer.getSpawnDimension()); if (worldserver1 != null) { Optional optional; -@@ -707,6 +712,7 @@ public abstract class PlayerList { +@@ -719,6 +724,7 @@ public abstract class PlayerList { location = respawnEvent.getRespawnLocation(); if (!flag) entityplayer.reset(); // SPIGOT-4785 @@ -32,7 +32,7 @@ index 85694a0ad7e32e4a98d8b0589f8d4dca91625bb3..8a659688ddc608fafe19e452c55e69f1 } else { location.setWorld(worldserver.getWorld()); } -@@ -764,6 +770,13 @@ public abstract class PlayerList { +@@ -776,6 +782,13 @@ public abstract class PlayerList { if (entityplayer.playerConnection.isDisconnected()) { this.savePlayerFile(entityplayer); } diff --git a/Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch b/Spigot-Server-Patches/0344-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch index 761fcc4931..1a5b3c1005 100644 --- a/Spigot-Server-Patches/0347-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch +++ b/Spigot-Server-Patches/0344-don-t-go-below-0-for-pickupDelay-breaks-picking-up-i.patch @@ -6,7 +6,7 @@ Subject: [PATCH] don't go below 0 for pickupDelay, breaks picking up items vanilla checks for == 0 diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index aad23b2c6cd674e05e609c4c019205978c6741f2..465550656356394074ebf4cc8d6188455daded88 100644 +index d8f8d04d6cc25d468bee04e2cbcc02c6f8202a1d..42f020be9c954e2c58896520c99be546f7b8531e 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -60,6 +60,7 @@ public class EntityItem extends Entity { @@ -17,7 +17,7 @@ index aad23b2c6cd674e05e609c4c019205978c6741f2..465550656356394074ebf4cc8d618845 if (this.age != -32768) this.age += elapsedTicks; this.lastTick = MinecraftServer.currentTick; // CraftBukkit end -@@ -147,6 +148,7 @@ public class EntityItem extends Entity { +@@ -152,6 +153,7 @@ public class EntityItem extends Entity { // CraftBukkit start - Use wall time for pickup and despawn timers int elapsedTicks = MinecraftServer.currentTick - this.lastTick; if (this.pickupDelay != 32767) this.pickupDelay -= elapsedTicks; diff --git a/Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch b/Spigot-Server-Patches/0345-Implement-getters-and-setters-for-EntityItem-owner-a.patch index fdb1990678..fdb1990678 100644 --- a/Spigot-Server-Patches/0348-Implement-getters-and-setters-for-EntityItem-owner-a.patch +++ b/Spigot-Server-Patches/0345-Implement-getters-and-setters-for-EntityItem-owner-a.patch diff --git a/Spigot-Server-Patches/0349-Server-Tick-Events.patch b/Spigot-Server-Patches/0346-Server-Tick-Events.patch index 0ebe46e856..a37e2e751e 100644 --- a/Spigot-Server-Patches/0349-Server-Tick-Events.patch +++ b/Spigot-Server-Patches/0346-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 60067369f1d708ba53da9ad74be5a8330062a684..a97e6bc15dd07594379475e5dec0fc957ca1314a 100644 +index 29e797135ec38af22a3dcee583742cb01abf76d5..57dfc992cecdbe6f04f4015151a51abe1f7e593c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1119,6 +1119,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1117,6 +1117,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); // Paper end @@ -17,7 +17,7 @@ index 60067369f1d708ba53da9ad74be5a8330062a684..a97e6bc15dd07594379475e5dec0fc95 ++this.ticks; this.b(booleansupplier); -@@ -1162,6 +1163,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1160,6 +1161,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } // Paper end diff --git a/Spigot-Server-Patches/0350-PlayerDeathEvent-getItemsToKeep.patch b/Spigot-Server-Patches/0347-PlayerDeathEvent-getItemsToKeep.patch index a38aca4937..940e5a33cc 100644 --- a/Spigot-Server-Patches/0350-PlayerDeathEvent-getItemsToKeep.patch +++ b/Spigot-Server-Patches/0347-PlayerDeathEvent-getItemsToKeep.patch @@ -8,10 +8,10 @@ Exposes a mutable array on items a player should keep on death Example Usage: https://gist.github.com/aikar/5bb202de6057a051a950ce1f29feb0b4 diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 0704af149368991eccfbe274c3aa5c3d910dfd9e..2f0759ebc6f7adb3dc0856e19f856b406a21845e 100644 +index 717786be86f76c384b4a1f56169b948e2297de38..8f9f1bb7f30632edcba4feae414a11d795610e05 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -556,6 +556,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -560,6 +560,46 @@ public class EntityPlayer extends EntityHuman implements ICrafting { }); } @@ -58,7 +58,7 @@ index 0704af149368991eccfbe274c3aa5c3d910dfd9e..2f0759ebc6f7adb3dc0856e19f856b40 @Override public void die(DamageSource damagesource) { boolean flag = this.world.getGameRules().getBoolean(GameRules.SHOW_DEATH_MESSAGES); -@@ -645,7 +685,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -649,7 +689,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.dropExperience(); // we clean the player's inventory after the EntityDeathEvent is called so plugins can get the exact state of the inventory. if (!event.getKeepInventory()) { diff --git a/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch b/Spigot-Server-Patches/0348-Optimize-Captured-TileEntity-Lookup.patch index 14325c5f73..f13a358191 100644 --- a/Spigot-Server-Patches/0351-Optimize-Captured-TileEntity-Lookup.patch +++ b/Spigot-Server-Patches/0348-Optimize-Captured-TileEntity-Lookup.patch @@ -10,10 +10,10 @@ Optimize to check if the captured list even has values in it, and also to just do a get call since the value can never be null. diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index a520b18f15a9f4b4d65ed185894c3741daa65f7f..cad22702ad981f57fdd8760ffd6b0d0218732325 100644 +index 12ea2c5f6e282f4732890188ef6501b7053ba008..61dff39b610cb8cfd24db98025d74cd97367ad83 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -940,12 +940,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -905,12 +905,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return null; } else { // CraftBukkit start @@ -29,4 +29,4 @@ index a520b18f15a9f4b4d65ed185894c3741daa65f7f..cad22702ad981f57fdd8760ffd6b0d02 + //TileEntity tileentity = null; // Paper - move up if (this.tickingTileEntities) { - tileentity = this.D(blockposition); + tileentity = this.E(blockposition); diff --git a/Spigot-Server-Patches/0352-Add-Heightmap-API.patch b/Spigot-Server-Patches/0349-Add-Heightmap-API.patch index 803f824e7d..d8f8bb5858 100644 --- a/Spigot-Server-Patches/0352-Add-Heightmap-API.patch +++ b/Spigot-Server-Patches/0349-Add-Heightmap-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add Heightmap API diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 40f778ceefdb97f4702edba6f78c0569a414cf80..a56604127e603721838cd9c322952cd64bca54e0 100644 +index 61dff39b610cb8cfd24db98025d74cd97367ad83..7c7c038dde32c2acd10cd653c6c85bca466d3a6c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -645,8 +645,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -610,8 +610,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } } @@ -20,7 +20,7 @@ index 40f778ceefdb97f4702edba6f78c0569a414cf80..a56604127e603721838cd9c322952cd6 if (i >= -30000000 && j >= -30000000 && i < 30000000 && j < 30000000) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index a27bd3032028dd3a4ed8efc4230a792cffd1833c..2cf4510e7bc06735915f7368db75dccaac4583f2 100644 +index 98af366848dba468d526d037a5e78fde4a4eda59..69159ae999af8b48542f69eb60ad0822eca2809d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -342,6 +342,29 @@ public class CraftWorld implements World { diff --git a/Spigot-Server-Patches/0353-Mob-Spawner-API-Enhancements.patch b/Spigot-Server-Patches/0350-Mob-Spawner-API-Enhancements.patch index 4a35f2915b..300f20423d 100644 --- a/Spigot-Server-Patches/0353-Mob-Spawner-API-Enhancements.patch +++ b/Spigot-Server-Patches/0350-Mob-Spawner-API-Enhancements.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Mob Spawner API Enhancements diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index df5ac3295ea64fa9bb15f0565610265d55651b87..1ceee84d724142c8a9e969ac1ceb567b2a334a41 100644 +index c3a5db97fd85b31c6b4bce93527b9d0e16a79a45..c2e830db7aa2944a477624e149a3ba66d112b68a 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java +++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java @@ -47,6 +47,7 @@ public abstract class MobSpawnerAbstract { @@ -16,7 +16,7 @@ index df5ac3295ea64fa9bb15f0565610265d55651b87..1ceee84d724142c8a9e969ac1ceb567b private boolean h() { BlockPosition blockposition = this.b(); -@@ -208,6 +209,7 @@ public abstract class MobSpawnerAbstract { +@@ -203,6 +204,7 @@ public abstract class MobSpawnerAbstract { } } @@ -24,7 +24,7 @@ index df5ac3295ea64fa9bb15f0565610265d55651b87..1ceee84d724142c8a9e969ac1ceb567b private void i() { if (this.maxSpawnDelay <= this.minSpawnDelay) { this.spawnDelay = this.minSpawnDelay; -@@ -225,7 +227,13 @@ public abstract class MobSpawnerAbstract { +@@ -220,7 +222,13 @@ public abstract class MobSpawnerAbstract { } public void a(NBTTagCompound nbttagcompound) { @@ -38,7 +38,7 @@ index df5ac3295ea64fa9bb15f0565610265d55651b87..1ceee84d724142c8a9e969ac1ceb567b this.mobs.clear(); if (nbttagcompound.hasKeyOfType("SpawnPotentials", 9)) { NBTTagList nbttaglist = nbttagcompound.getList("SpawnPotentials", 10); -@@ -240,10 +248,15 @@ public abstract class MobSpawnerAbstract { +@@ -235,10 +243,15 @@ public abstract class MobSpawnerAbstract { } else if (!this.mobs.isEmpty()) { this.setSpawnData((MobSpawnerData) WeightedRandom.a(this.a().random, this.mobs)); } @@ -57,7 +57,7 @@ index df5ac3295ea64fa9bb15f0565610265d55651b87..1ceee84d724142c8a9e969ac1ceb567b this.spawnCount = nbttagcompound.getShort("SpawnCount"); } -@@ -268,9 +281,20 @@ public abstract class MobSpawnerAbstract { +@@ -263,9 +276,20 @@ public abstract class MobSpawnerAbstract { if (minecraftkey == null) { return nbttagcompound; } else { diff --git a/Spigot-Server-Patches/0354-Per-Player-View-Distance-API-placeholders.patch b/Spigot-Server-Patches/0351-Per-Player-View-Distance-API-placeholders.patch index 8b89c30666..d9d3b0936e 100644 --- a/Spigot-Server-Patches/0354-Per-Player-View-Distance-API-placeholders.patch +++ b/Spigot-Server-Patches/0351-Per-Player-View-Distance-API-placeholders.patch @@ -7,7 +7,7 @@ I hope to look at this more in-depth soon. It appears doable. However this should not block the update. diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 3cb8ce58c4675564fb239338d6c40ea511a9a97c..96f898acdeae1917a4aaf99ec4a48bccf3904488 100644 +index 8da02467dff4b9da644aa12e453d127b7a01e259..0e7c5dd9224d06fecf75c00c0c56d610a8fa8f4c 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -576,9 +576,10 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { @@ -24,7 +24,7 @@ index 3cb8ce58c4675564fb239338d6c40ea511a9a97c..96f898acdeae1917a4aaf99ec4a48bcc double deltaZ = this.locZ() - player.locZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java -index 9331f96f68f121b41ce74904d624520291b7c72e..1074995e8c8a83f6cdb94019123fbffa309d5e08 100644 +index dd4d12f4e3ab5385b85504bde962adce2981dfb5..1511212cbfbece279d9f66473bd6b5bc46b9e8e0 100644 --- a/src/main/java/net/minecraft/server/EntityWither.java +++ b/src/main/java/net/minecraft/server/EntityWither.java @@ -208,9 +208,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { @@ -40,10 +40,10 @@ index 9331f96f68f121b41ce74904d624520291b7c72e..1074995e8c8a83f6cdb94019123fbffa double deltaZ = this.locZ() - player.locZ(); double distanceSquared = deltaX * deltaX + deltaZ * deltaZ; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index ff602df37c0a621cfe6ebce13ae6cc777378e591..c3d84b1d53e835cf467c42c7adaeb774010366af 100644 +index d43ada6dccb45060ea37acf7a2a8ea6a4d74ab18..747dd3c06d24b395d9d940413fe47a63b66e65d0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2031,6 +2031,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2024,6 +2024,16 @@ public class CraftPlayer extends CraftHumanEntity implements Player { super.remove(); } } diff --git a/Spigot-Server-Patches/0355-Fix-CB-call-to-changed-postToMainThread-method.patch b/Spigot-Server-Patches/0352-Fix-CB-call-to-changed-postToMainThread-method.patch index d128cf841e..157ee9e0fb 100644 --- a/Spigot-Server-Patches/0355-Fix-CB-call-to-changed-postToMainThread-method.patch +++ b/Spigot-Server-Patches/0352-Fix-CB-call-to-changed-postToMainThread-method.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fix CB call to changed postToMainThread method diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index c03ddd05032c75bf723bcdc12d37cc3dbfebc9cc..62a0db6c08047be4ab28f5c23f4ae12694cf003f 100644 +index 6e5194e7b06b82ec256fce4124154051f4b2c7cc..76be1b78e3959e4237708a091ed9198eacfad834 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -285,7 +285,7 @@ public class PlayerConnection implements PacketListenerPlayIn { diff --git a/Spigot-Server-Patches/0356-Fix-sounds-when-item-frames-are-modified-MC-123450.patch b/Spigot-Server-Patches/0353-Fix-sounds-when-item-frames-are-modified-MC-123450.patch index 60c5a17aca..1355d47cdf 100644 --- a/Spigot-Server-Patches/0356-Fix-sounds-when-item-frames-are-modified-MC-123450.patch +++ b/Spigot-Server-Patches/0353-Fix-sounds-when-item-frames-are-modified-MC-123450.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Fix sounds when item frames are modified (MC-123450) This also fixes the adding sound playing when the item frame direction is changed. diff --git a/src/main/java/net/minecraft/server/EntityItemFrame.java b/src/main/java/net/minecraft/server/EntityItemFrame.java -index bb40f21d969e8166c9af365eabcc2fcb7511eef4..e20915578720f6d18955a4ddc6fb436af807acb3 100644 +index 0a0f06d03b01103f0bbe911b0e8c543f9ad53f8a..b61876affd09b4bcd2062fd725b8525edc68b054 100644 --- a/src/main/java/net/minecraft/server/EntityItemFrame.java +++ b/src/main/java/net/minecraft/server/EntityItemFrame.java @@ -247,7 +247,7 @@ public class EntityItemFrame extends EntityHanging { @@ -19,7 +19,7 @@ index bb40f21d969e8166c9af365eabcc2fcb7511eef4..e20915578720f6d18955a4ddc6fb436a } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java -index 79d443abb7975a1c181dee3cd17f8aa9164ad05d..8a43416ae2a9b923e3fa2b207931cb48cdb6bbd2 100644 +index 072c56b8a28d850e1171149a34d6b410d5a6fa5a..d59977ab3898c5a615bd3093b3ddd6c07f5e7e58 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftItemFrame.java @@ -49,7 +49,7 @@ public class CraftItemFrame extends CraftHanging implements ItemFrame { diff --git a/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch b/Spigot-Server-Patches/0354-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch index 4ffe072665..c8206bda47 100644 --- a/Spigot-Server-Patches/0357-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch +++ b/Spigot-Server-Patches/0354-Fix-CraftServer-isPrimaryThread-and-MinecraftServer-.patch @@ -16,7 +16,7 @@ handling that should have been handled synchronously will be handled synchronously when the server gets shut down. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0ec47d6ae36570ce1bdd7361fde223c13672f02d..3cef06734e2c6d9b49dd6307f285d00127b66233 100644 +index 57dfc992cecdbe6f04f4015151a51abe1f7e593c..f4c1804fc956b2415d80e7704c1dd20c4a4b8264 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -2064,7 +2064,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -29,10 +29,10 @@ index 0ec47d6ae36570ce1bdd7361fde223c13672f02d..3cef06734e2c6d9b49dd6307f285d001 public boolean isDebugging() { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 97cf3c094ceea2ee5ea8d5fe82ac992caf38bd66..80ed8abb4e5b1d13a17ba7d87b628c23944bea92 100644 +index 2e30ae110e54009be4acad119da33819129fab11..0a67b6d56f7eb3ba488ae77dba624a56e9939caa 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1792,7 +1792,7 @@ public final class CraftServer implements Server { +@@ -1786,7 +1786,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { diff --git a/Spigot-Server-Patches/0358-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch b/Spigot-Server-Patches/0355-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch index 4bf067aaed..2d1c242854 100644 --- a/Spigot-Server-Patches/0358-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch +++ b/Spigot-Server-Patches/0355-Fix-issues-with-entity-loss-due-to-unloaded-chunks.patch @@ -19,10 +19,10 @@ This change ensures the chunks are always loaded when entities are added to the world, or a valid entity moves between chunks. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c08391411648206b244896c30e3b9b6b199095aa..4bed372d302abe0247c2be4fc0071de50689b089 100644 +index ad9633747c4fc8546924c4d86ad45eb611c12102..74a7fe5094a488a05352f4118ff350a5c17f96ba 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -734,11 +734,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -735,11 +735,18 @@ public class WorldServer extends World implements GeneratorAccessSeed { int k = MathHelper.floor(entity.locZ() / 16.0D); if (!entity.inChunk || entity.chunkX != i || entity.chunkY != j || entity.chunkZ != k) { @@ -42,7 +42,7 @@ index c08391411648206b244896c30e3b9b6b199095aa..4bed372d302abe0247c2be4fc0071de5 if (entity.inChunk) { WorldServer.LOGGER.warn("Entity {} left loaded chunk area", entity); } -@@ -953,7 +960,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -954,7 +961,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { return false; } // CraftBukkit end diff --git a/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch b/Spigot-Server-Patches/0356-Duplicate-UUID-Resolve-Option.patch index 8fbcf316ac..3b8a5b4488 100644 --- a/Spigot-Server-Patches/0359-Duplicate-UUID-Resolve-Option.patch +++ b/Spigot-Server-Patches/0356-Duplicate-UUID-Resolve-Option.patch @@ -33,10 +33,10 @@ But for those who are ok with leaving this inconsistent behavior, you may use WA It is recommended you regenerate the entities, as these were legit entities, and deserve your love. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a73b88d51608ce94f6e4c9013c8c4de97523fe42..6e29e3294d0661cc35d53b4201d980a2db4f5c93 100644 +index 15e1f9f65280043853544d3bf796f991df2482de..21910dfd1a533e923a8a73e92fea25685a07b445 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -405,4 +405,43 @@ public class PaperWorldConfig { +@@ -394,4 +394,43 @@ public class PaperWorldConfig { private void preventMovingIntoUnloadedChunks() { preventMovingIntoUnloadedChunks = getBoolean("prevent-moving-into-unloaded-chunks", false); } @@ -81,7 +81,7 @@ index a73b88d51608ce94f6e4c9013c8c4de97523fe42..6e29e3294d0661cc35d53b4201d980a2 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 795c9da02089fca71a1d5ff25fcbf1bcee9aed02..81b7b6c110dfce7185ab59d41d7ef7d648522787 100644 +index 5ee581d1634f44a98756c5d11def9c3d46fd53e9..8e3244fc5c6e5fff22857637b4ab5944d6b1e165 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -499,6 +499,7 @@ public class Chunk implements IChunkAccess { @@ -93,19 +93,19 @@ index 795c9da02089fca71a1d5ff25fcbf1bcee9aed02..81b7b6c110dfce7185ab59d41d7ef7d6 int k = MathHelper.floor(entity.locY() / 16.0D); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 84df0d90f19f7b541198a9b935a1491e41c015f3..668b720f17760de7d893bcdd95661f13601fcbd3 100644 +index a40e6d2f83b9f142d716b4b00dba05123d9e1c0a..7d679c8651bca6041e330abc8b17102175ff5f7b 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2682,6 +2682,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2690,6 +2690,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke }); } + public final void setUUID(UUID uuid) { a_(uuid); } // Paper - OBFHELPER public void a_(UUID uuid) { this.uniqueID = uuid; - this.al = this.uniqueID.toString(); + this.ae = this.uniqueID.toString(); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 458802dc4b1f923b159168efff0546bb731da07b..936be3fd8954933ac218f62a172df6878d128ec9 100644 +index 4bbcd00950405a4bf3ce391b557049a3b1d4aee8..2db0f3e060850ae65033f878ed46b678686a03f9 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -1,6 +1,7 @@ @@ -197,10 +197,10 @@ index 458802dc4b1f923b159168efff0546bb731da07b..936be3fd8954933ac218f62a172df687 ChunkCoordIntPair chunkcoordintpair = playerchunk.i(); CompletableFuture<Either<List<IChunkAccess>, PlayerChunk.Failure>> completablefuture = this.a(chunkcoordintpair, 1, (i) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 4bed372d302abe0247c2be4fc0071de50689b089..41c68de8119dc53a033ac005d69cd57d38b4f719 100644 +index 74a7fe5094a488a05352f4118ff350a5c17f96ba..9e3a519b14e4736ffb5b579fcc491003d4d08b83 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -5,6 +5,8 @@ import com.google.common.collect.ImmutableList; +@@ -4,6 +4,8 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.Iterables; import co.aikar.timings.TimingHistory; // Paper import co.aikar.timings.Timings; // Paper @@ -209,20 +209,17 @@ index 4bed372d302abe0247c2be4fc0071de50689b089..41c68de8119dc53a033ac005d69cd57d import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Queues; -@@ -987,8 +989,24 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -989,7 +991,22 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (entity1 == null) { return false; } else { -- WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", EntityTypes.getName(entity1.getEntityType()), entity.getUniqueID().toString()); // CraftBukkit // paper + // Paper start + if (entity1.dead) { + unregisterEntity(entity1); // remove the existing entity + return false; + } + // Paper end -+ WorldServer.LOGGER.error("Keeping entity {} that already exists with UUID {}", entity1, entity.getUniqueID().toString()); // CraftBukkit // paper - WorldServer.LOGGER.error("Deleting duplicate entity {}", entity); // CraftBukkit // paper -+ + WorldServer.LOGGER.warn("Trying to add entity with duplicated UUID {}. Existing {}#{}, new: {}#{}", uuid, EntityTypes.getName(entity1.getEntityType()), entity1.getId(), EntityTypes.getName(entity.getEntityType()), entity.getId()); // CraftBukkit // Paper + // Paper start + if (DEBUG_ENTITIES && entity.world.paperConfig.duplicateUUIDMode != PaperWorldConfig.DuplicateUUIDMode.NOTHING) { + if (entity1.addedToWorldStack != null) { diff --git a/Spigot-Server-Patches/0360-improve-CraftWorld-isChunkLoaded.patch b/Spigot-Server-Patches/0357-improve-CraftWorld-isChunkLoaded.patch index 8ec42bd442..af9dc8e606 100644 --- a/Spigot-Server-Patches/0360-improve-CraftWorld-isChunkLoaded.patch +++ b/Spigot-Server-Patches/0357-improve-CraftWorld-isChunkLoaded.patch @@ -9,10 +9,10 @@ waiting for the execution queue to get to our request; We can just query the chunk status and get a response now, vs having to wait diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2cf4510e7bc06735915f7368db75dccaac4583f2..48805c32aabe453e0a860168b79ea9026fa848b1 100644 +index 69159ae999af8b48542f69eb60ad0822eca2809d..eb4dd0708930b0c5388a88c193d1c17978e42f48 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -408,13 +408,13 @@ public class CraftWorld implements World { +@@ -413,13 +413,13 @@ public class CraftWorld implements World { @Override public boolean isChunkLoaded(int x, int z) { diff --git a/Spigot-Server-Patches/0361-Configurable-Keep-Spawn-Loaded-range-per-world.patch b/Spigot-Server-Patches/0358-Configurable-Keep-Spawn-Loaded-range-per-world.patch index 388acd8af4..f49c233f2b 100644 --- a/Spigot-Server-Patches/0361-Configurable-Keep-Spawn-Loaded-range-per-world.patch +++ b/Spigot-Server-Patches/0358-Configurable-Keep-Spawn-Loaded-range-per-world.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable Keep Spawn Loaded range per world This lets you disable it for some worlds and lower it for others. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6e29e3294d0661cc35d53b4201d980a2db4f5c93..6e1756eb90b6237100612527f69c995246d53ed1 100644 +index 21910dfd1a533e923a8a73e92fea25685a07b445..44811683cfe47adbdce6c8bd627bdbeb13ce114c 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -444,4 +444,10 @@ public class PaperWorldConfig { +@@ -433,4 +433,10 @@ public class PaperWorldConfig { break; } } @@ -21,10 +21,10 @@ index 6e29e3294d0661cc35d53b4201d980a2db4f5c93..6e1756eb90b6237100612527f69c9952 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b9e047643e1c3f84f26d936fcb067f607018ef34..d6a3c51826ac82fd46b8f6c98be7bf405ffa3f38 100644 +index f4c1804fc956b2415d80e7704c1dd20c4a4b8264..e6e4e8c07b0283bdf45c8dac3cc47336a7430ca3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -607,6 +607,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -605,6 +605,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.forceTicks = true; // CraftBukkit end @@ -39,7 +39,7 @@ index b9e047643e1c3f84f26d936fcb067f607018ef34..d6a3c51826ac82fd46b8f6c98be7bf40 MinecraftServer.LOGGER.info("Preparing start region for dimension {}", worldserver.getDimensionKey().a()); BlockPosition blockposition = worldserver.getSpawn(); -@@ -615,14 +623,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -613,14 +621,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas chunkproviderserver.getLightEngine().a(500); this.nextTick = SystemUtils.getMonotonicMillis(); @@ -102,11 +102,11 @@ index 3868572aed50c8bffd93727a139a3fbb8dc19688..ae77805f71c6c574d92f39c51b1e48f2 @Override public void a(ChunkCoordIntPair chunkcoordintpair) { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 41c68de8119dc53a033ac005d69cd57d38b4f719..7b4182a0dc9aaa76f0a4a3b09cc497bcb9704277 100644 +index 9e3a519b14e4736ffb5b579fcc491003d4d08b83..da6d9495c869150ce83dfb284c5977d7f122e71b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1499,12 +1499,88 @@ public class WorldServer extends World implements GeneratorAccessSeed { - return ((PersistentIdCounts) this.getMinecraftServer().D().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a(); +@@ -1543,12 +1543,88 @@ public class WorldServer extends World implements GeneratorAccessSeed { + return ((PersistentIdCounts) this.getMinecraftServer().E().getWorldPersistentData().a(PersistentIdCounts::new, "idcounts")).a(); } + // Paper start - helper function for configurable spawn radius @@ -180,13 +180,13 @@ index 41c68de8119dc53a033ac005d69cd57d38b4f719..7b4182a0dc9aaa76f0a4a3b09cc497bc + } + // Paper end + - public void a_(BlockPosition blockposition) { + public void a(BlockPosition blockposition, float f) { - ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); + // Paper - configurable spawn radius + BlockPosition prevSpawn = this.getSpawn(); + //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); - this.worldData.setSpawn(blockposition); + this.worldData.setSpawn(blockposition, f); - this.getChunkProvider().removeTicket(TicketType.START, chunkcoordintpair, 11, Unit.INSTANCE); - this.getChunkProvider().addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE); + if (this.keepSpawnInMemory) { @@ -194,14 +194,14 @@ index 41c68de8119dc53a033ac005d69cd57d38b4f719..7b4182a0dc9aaa76f0a4a3b09cc497bc + this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn); + this.addTicketsForSpawn(this.paperConfig.keepLoadedRange, blockposition); + } - this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition)); + this.getMinecraftServer().getPlayerList().sendAll(new PacketPlayOutSpawnPosition(blockposition, f)); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 48805c32aabe453e0a860168b79ea9026fa848b1..b5621b8456fbd3c5e94a9b9ec9b4be0068962674 100644 +index eb4dd0708930b0c5388a88c193d1c17978e42f48..07657d884f45959a69998ec510bf14e940e62056 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1949,15 +1949,21 @@ public class CraftWorld implements World { +@@ -1937,15 +1937,21 @@ public class CraftWorld implements World { @Override public void setKeepSpawnInMemory(boolean keepLoaded) { diff --git a/Spigot-Server-Patches/0362-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch b/Spigot-Server-Patches/0359-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch index 5e910adc7e..70f1397fe3 100644 --- a/Spigot-Server-Patches/0362-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch +++ b/Spigot-Server-Patches/0359-MC-114618-Fix-EntityAreaEffectCloud-from-going-negat.patch @@ -6,7 +6,7 @@ Subject: [PATCH] MC-114618 - Fix EntityAreaEffectCloud from going negative diff --git a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java -index 65ea440e78a5202e432af5ba071e72a5837dc319..a6721a8872a5aae52eb39118bc490b2d2ea0a980 100644 +index f1c9cd01fd6a7866c6e24724259a0ff4ea20aa29..fc648dabbde8ab8fd2a16a6cf94f2e20021d6970 100644 --- a/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java +++ b/src/main/java/net/minecraft/server/EntityAreaEffectCloud.java @@ -175,6 +175,12 @@ public class EntityAreaEffectCloud extends Entity { diff --git a/Spigot-Server-Patches/0363-ChunkMapDistance-CME.patch b/Spigot-Server-Patches/0360-ChunkMapDistance-CME.patch index 7f60c986b3..83cd7c1ed0 100644 --- a/Spigot-Server-Patches/0363-ChunkMapDistance-CME.patch +++ b/Spigot-Server-Patches/0360-ChunkMapDistance-CME.patch @@ -5,7 +5,7 @@ Subject: [PATCH] ChunkMapDistance CME diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index cf68c9105084d1823b5fc76b3f472a0f8ecd9568..d5b50a6a6816421c0443ae36213932b16ed5c797 100644 +index cf68c9105084d1823b5fc76b3f472a0f8ecd9568..d15bf949671c9a533573278d573376282bfed8c8 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -33,7 +33,16 @@ public abstract class ChunkMapDistance { @@ -60,11 +60,20 @@ index cf68c9105084d1823b5fc76b3f472a0f8ecd9568..d5b50a6a6816421c0443ae36213932b1 return true; } else { if (!this.l.isEmpty()) { +@@ -366,7 +363,7 @@ public abstract class ChunkMapDistance { + ObjectIterator objectiterator = this.a.long2ByteEntrySet().iterator(); + + while (objectiterator.hasNext()) { +- it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (it.unimi.dsi.fastutil.longs.Long2ByteMap.Entry) objectiterator.next(); ++ Long2ByteMap.Entry it_unimi_dsi_fastutil_longs_long2bytemap_entry = (Long2ByteMap.Entry) objectiterator.next(); // Paper - decompile fix + byte b0 = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getByteValue(); + long j = it_unimi_dsi_fastutil_longs_long2bytemap_entry.getLongKey(); + diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index ca41e420a1ab22f097dd0b98e156fd51434733d8..5efd611859648ed3c1bcda70728ea6106bd4bf4c 100644 +index 49686f1f39417f8c7d6e0a58fb428fa34335fb0f..3b51e231551306e92cfe8fdf2e4e7777ab45d722 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -18,6 +18,7 @@ public class PlayerChunk { +@@ -20,6 +20,7 @@ public class PlayerChunk { private static final CompletableFuture<Either<Chunk, PlayerChunk.Failure>> UNLOADED_CHUNK_FUTURE = CompletableFuture.completedFuture(PlayerChunk.UNLOADED_CHUNK); private static final List<ChunkStatus> CHUNK_STATUSES = ChunkStatus.a(); private static final PlayerChunk.State[] CHUNK_STATES = PlayerChunk.State.values(); diff --git a/Spigot-Server-Patches/0364-Implement-CraftBlockSoundGroup.patch b/Spigot-Server-Patches/0361-Implement-CraftBlockSoundGroup.patch index ae2bcae166..a9e7193783 100644 --- a/Spigot-Server-Patches/0364-Implement-CraftBlockSoundGroup.patch +++ b/Spigot-Server-Patches/0361-Implement-CraftBlockSoundGroup.patch @@ -84,10 +84,10 @@ index 957799e034ad8bc7201815b849244b7a809fb666..2301b38ac3b488809d2f624055ad3e23 return this.ab; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 12b8d544566888dc77bc2c8748d78f09c4bb3b76..bda3e17ae7a5de98ef94f37307df302fefa3675f 100644 +index af0d1c742e806f5855a08c887c0e0654da2c6f95..1730a33fe7a10960b0d0c5f3905f38b995931213 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -718,4 +718,11 @@ public class CraftBlock implements Block { +@@ -726,4 +726,11 @@ public class CraftBlock implements Block { AxisAlignedBB aabb = shape.getBoundingBox(); return new BoundingBox(getX() + aabb.minX, getY() + aabb.minY, getZ() + aabb.minZ, getX() + aabb.maxX, getY() + aabb.maxY, getZ() + aabb.maxZ); } diff --git a/Spigot-Server-Patches/0365-Chunk-debug-command.patch b/Spigot-Server-Patches/0362-Chunk-debug-command.patch index 34d34a4a51..52686ab0dd 100644 --- a/Spigot-Server-Patches/0365-Chunk-debug-command.patch +++ b/Spigot-Server-Patches/0362-Chunk-debug-command.patch @@ -185,10 +185,10 @@ index f0a836db74ad3e20778d3863223bc9a35ff4ad41..9ead9b1ea1fafaa3d684c17efbae7473 * Ported from MinecraftForge - author: LexManos <[email protected]> - License: LGPLv2.1 */ diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 6921def2dc8dd7f2b8ba9d46ab697a9f9b62cf4e..9f4c79629c981d496b96cf8a7a4c8e058f102b8b 100644 +index 09cfd3ee900d0d1f523e6453163fdb806a0da6de..db6b52850f10d212b3db81dcf86c622e610f02b2 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -23,7 +23,7 @@ import org.apache.logging.log4j.Logger; +@@ -24,7 +24,7 @@ import org.apache.logging.log4j.Logger; public class ChunkProviderServer extends IChunkProvider { @@ -198,12 +198,12 @@ index 6921def2dc8dd7f2b8ba9d46ab697a9f9b62cf4e..9f4c79629c981d496b96cf8a7a4c8e05 public final ChunkGenerator chunkGenerator; private final WorldServer world; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..baa0f67400d9f7d36900010c362fe4ef4186573f 100644 +index 816d55b17ea531bc2f25b92c003b127fe6e04112..2507bdf7bfa65f1bc728a46322d2a570e566e32c 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -5,7 +5,13 @@ import com.destroystokyo.paper.profile.CraftPlayerProfile; - import com.destroystokyo.paper.profile.PlayerProfile; +@@ -6,7 +6,13 @@ import com.destroystokyo.paper.profile.PlayerProfile; import com.google.common.util.concurrent.ThreadFactoryBuilder; + import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; import org.apache.commons.lang.exception.ExceptionUtils; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; @@ -215,7 +215,7 @@ index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..baa0f67400d9f7d36900010c362fe4ef import org.bukkit.Location; import org.bukkit.block.BlockFace; import org.bukkit.craftbukkit.CraftWorld; -@@ -14,8 +20,11 @@ import org.spigotmc.AsyncCatcher; +@@ -15,8 +21,11 @@ import org.spigotmc.AsyncCatcher; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -227,7 +227,7 @@ index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..baa0f67400d9f7d36900010c362fe4ef import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.LinkedBlockingQueue; -@@ -521,4 +530,170 @@ public final class MCUtil { +@@ -522,4 +531,170 @@ public final class MCUtil { return null; } @@ -399,20 +399,20 @@ index 2eacc5de340ca5558d9a0cba9baa26bbebef714d..baa0f67400d9f7d36900010c362fe4ef + } } diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 5efd611859648ed3c1bcda70728ea6106bd4bf4c..d806b6acbcfbf141f4c1436bd5a163fbf11bf4e6 100644 +index 3b51e231551306e92cfe8fdf2e4e7777ab45d722..6538fc2874d6a24fdd69dee7224d69d0f7ca56ee 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -27,7 +27,7 @@ public class PlayerChunk { +@@ -29,7 +29,7 @@ public class PlayerChunk { public int oldTicketLevel; private int ticketLevel; private int n; - private final ChunkCoordIntPair location; + final ChunkCoordIntPair location; // Paper - private -> package - private final short[] dirtyBlocks; - private int dirtyCount; + private boolean p; + private final ShortSet[] dirtyBlocks; private int r; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 936be3fd8954933ac218f62a172df6878d128ec9..ee062b05d0de2c434ca1199e9614824a3a23e73b 100644 +index 2db0f3e060850ae65033f878ed46b678686a03f9..2e41af4f945f942c9a8f4b29464522ae07b12982 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -59,7 +59,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { diff --git a/Spigot-Server-Patches/0366-Catch-exceptions-from-dispenser-entity-spawns.patch b/Spigot-Server-Patches/0363-Catch-exceptions-from-dispenser-entity-spawns.patch index be995a8f41..beaf6dd426 100644 --- a/Spigot-Server-Patches/0366-Catch-exceptions-from-dispenser-entity-spawns.patch +++ b/Spigot-Server-Patches/0363-Catch-exceptions-from-dispenser-entity-spawns.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Catch exceptions from dispenser entity spawns diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java -index aa6af83512e2baea4e3d942b7f7407ad05ea0f24..5432c24919bb5c32ca1eec4c9861ad127f72a60a 100644 +index e41d64a9cdf6e8c58a6909b672df43e6738e3c31..ce7ab95c95eba7f1c49096a88d9a1b2110ae473b 100644 --- a/src/main/java/net/minecraft/server/IDispenseBehavior.java +++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java @@ -163,7 +163,14 @@ public interface IDispenseBehavior { @@ -16,7 +16,7 @@ index aa6af83512e2baea4e3d942b7f7407ad05ea0f24..5432c24919bb5c32ca1eec4c9861ad12 entitytypes.spawnCreature(isourceblock.getWorld(), itemstack, (EntityHuman) null, isourceblock.getBlockPosition().shift(enumdirection), EnumMobSpawn.DISPENSER, enumdirection != EnumDirection.UP, false); + // Paper start + } catch (Exception ex){ -+ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", world.getWorld().getName(), isourceblock.getBlockPosition(), ex); ++ MinecraftServer.LOGGER.warn("An exception occurred dispensing entity at {}[{}]", worldserver.getWorld().getName(), isourceblock.getBlockPosition(), ex); + } + // Paper end + diff --git a/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch b/Spigot-Server-Patches/0364-Fix-World-isChunkGenerated-calls.patch index d854627fb0..37678bf806 100644 --- a/Spigot-Server-Patches/0367-Fix-World-isChunkGenerated-calls.patch +++ b/Spigot-Server-Patches/0364-Fix-World-isChunkGenerated-calls.patch @@ -8,10 +8,10 @@ This patch also adds a chunk status cache on region files (note that its only purpose is to cache the status on DISK) diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 9f4c79629c981d496b96cf8a7a4c8e058f102b8b..726926f19c6725c1d935beec2f0f766d7466835e 100644 +index db6b52850f10d212b3db81dcf86c622e610f02b2..3bfd225db6945cb431238a9a980fb6d10f831f61 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -29,7 +29,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -30,7 +30,7 @@ public class ChunkProviderServer extends IChunkProvider { private final WorldServer world; public final Thread serverThread; // Paper - private -> public private final LightEngineThreaded lightEngine; @@ -20,7 +20,7 @@ index 9f4c79629c981d496b96cf8a7a4c8e058f102b8b..726926f19c6725c1d935beec2f0f766d public final PlayerChunkMap playerChunkMap; private final WorldPersistentData worldPersistentData; private long lastTickTime; -@@ -295,6 +295,21 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -296,6 +296,21 @@ public class ChunkProviderServer extends IChunkProvider { return ret; } @@ -43,7 +43,7 @@ index 9f4c79629c981d496b96cf8a7a4c8e058f102b8b..726926f19c6725c1d935beec2f0f766d @Nullable diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 17b8c4445af2bd2ed907d05ed3c396d4290dc63d..208a8ef3aaa4b33bfe2db2569a3588a332ab5686 100644 +index 1e28061dd83a4bf2daab38aee84ddba3329b28dc..ff859311abb0eeaedb9c9d9cf7a9e858f4e12978 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -407,6 +407,17 @@ public class ChunkRegionLoader { @@ -65,7 +65,7 @@ index 17b8c4445af2bd2ed907d05ed3c396d4290dc63d..208a8ef3aaa4b33bfe2db2569a3588a3 if (nbttagcompound != null) { ChunkStatus chunkstatus = ChunkStatus.a(nbttagcompound.getCompound("Level").getString("Status")); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 772affccd3f56c72e547c973e4548b12ad3a86ec..0939e015aad7d3fcc7908afcabee0100c4deee40 100644 +index ca4b23007bec075412fd5c6f100b9b9fc5019db6..f231bb2f5bca184557182c50d251943932693614 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -182,6 +182,7 @@ public class ChunkStatus { @@ -108,10 +108,10 @@ index 2fde0b6ca8f38a998ac73b68be61fbfea9088cee..fa03834dacacf7ae6a326c88007256a2 @Nullable private PersistentStructureLegacy c; diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index d806b6acbcfbf141f4c1436bd5a163fbf11bf4e6..3b0d13d319fe1d274ab657c7c87e5a2db5c02c4f 100644 +index 6538fc2874d6a24fdd69dee7224d69d0f7ca56ee..3f125a57f43ea1678bd891ab7c1e6b892de55542 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -111,6 +111,19 @@ public class PlayerChunk { +@@ -113,6 +113,19 @@ public class PlayerChunk { Either<IChunkAccess, PlayerChunk.Failure> either = (Either<IChunkAccess, PlayerChunk.Failure>) statusFuture.getNow(null); return either == null ? null : (Chunk) either.left().orElse(null); } @@ -132,7 +132,7 @@ index d806b6acbcfbf141f4c1436bd5a163fbf11bf4e6..3b0d13d319fe1d274ab657c7c87e5a2d public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index ee062b05d0de2c434ca1199e9614824a3a23e73b..dbfd1f4d2156a99ff11bc295d3751eadc87fd40c 100644 +index 2e41af4f945f942c9a8f4b29464522ae07b12982..d8bedba819fa9ee0a4d3bdfbf0b010da7144dd68 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java @@ -938,12 +938,61 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @@ -200,12 +200,12 @@ index ee062b05d0de2c434ca1199e9614824a3a23e73b..dbfd1f4d2156a99ff11bc295d3751ead // Spigot start return isOutsideOfRange(chunkcoordintpair, false); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..4f1a6954ea880857352003982627545dd3483ad2 100644 +index 2fb4131e5972d3b554a763098709470e8a725280..3e299ffaabf2a91336fae28031c8fc0712667bc5 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -36,6 +36,30 @@ public class RegionFile implements AutoCloseable { - private final RegionFileBitSet freeSectors; - public final File file; +@@ -38,6 +38,30 @@ public class RegionFile implements AutoCloseable { + protected final RegionFileBitSet freeSectors; + public final File file; // Paper + // Paper start - Cache chunk status + private final ChunkStatus[] statuses = new ChunkStatus[32 * 32]; @@ -234,7 +234,7 @@ index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..4f1a6954ea880857352003982627545d public RegionFile(File file, File file1, boolean flag) throws IOException { this(file.toPath(), file1.toPath(), RegionFileCompression.b, flag); } -@@ -359,11 +383,13 @@ public class RegionFile implements AutoCloseable { +@@ -374,11 +398,13 @@ public class RegionFile implements AutoCloseable { return this.getOffset(chunkcoordintpair) != 0; } @@ -249,10 +249,10 @@ index f781bb12a1c37d8b3088d0f638eae80d5b80aca4..4f1a6954ea880857352003982627545d this.d(); } finally { diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 02bd568af727633a6e834d5328683a9ff67b9dd7..341689ac996164b7b53e095495b92b6e85ab991a 100644 +index de926992e20da3ec433f9c7b4bc73805fd9d36ab..7a15944926427eb6cad976daabe5e710f4fbf1bb 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -20,7 +20,14 @@ public final class RegionFileCache implements AutoCloseable { +@@ -21,7 +21,14 @@ public final class RegionFileCache implements AutoCloseable { this.c = flag; } @@ -268,18 +268,16 @@ index 02bd568af727633a6e834d5328683a9ff67b9dd7..341689ac996164b7b53e095495b92b6e long i = ChunkCoordIntPair.pair(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); RegionFile regionfile = (RegionFile) this.cache.getAndMoveToFirst(i); -@@ -167,7 +174,8 @@ public final class RegionFileCache implements AutoCloseable { +@@ -168,6 +175,7 @@ public final class RegionFileCache implements AutoCloseable { try { NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) dataoutputstream); -- regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // We don't do this anymore + regionfile.setStatus(chunkcoordintpair.x, chunkcoordintpair.z, ChunkRegionLoader.getStatus(nbttagcompound)); // Paper - cache status on disk -+ regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); + regionfile.setOversized(chunkcoordintpair.x, chunkcoordintpair.z, false); // Paper - We don't do this anymore, mojang stores differently, but clear old meta flag if it exists to get rid of our own meta file once last oversized is gone } catch (Throwable throwable1) { throwable = throwable1; - throw throwable1; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c99932bc38ac2bb0bd82c694a76b844efcdbdd52..2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24 100644 +index 07657d884f45959a69998ec510bf14e940e62056..e741d1f966869b057652a93a1ef1785ad152f303 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -19,6 +19,7 @@ import java.util.Objects; @@ -290,7 +288,7 @@ index c99932bc38ac2bb0bd82c694a76b844efcdbdd52..2f10a1c6f4f7b31c8054f3cd72947b2e import java.util.function.Predicate; import java.util.stream.Collectors; import net.minecraft.server.ArraySetSorted; -@@ -413,8 +414,22 @@ public class CraftWorld implements World { +@@ -418,8 +419,22 @@ public class CraftWorld implements World { @Override public boolean isChunkGenerated(int x, int z) { @@ -314,7 +312,7 @@ index c99932bc38ac2bb0bd82c694a76b844efcdbdd52..2f10a1c6f4f7b31c8054f3cd72947b2e } catch (IOException ex) { throw new RuntimeException(ex); } -@@ -525,20 +540,49 @@ public class CraftWorld implements World { +@@ -530,20 +545,49 @@ public class CraftWorld implements World { @Override public boolean loadChunk(int x, int z, boolean generate) { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot diff --git a/Spigot-Server-Patches/0368-Show-blockstate-location-if-we-failed-to-read-it.patch b/Spigot-Server-Patches/0365-Show-blockstate-location-if-we-failed-to-read-it.patch index bdabcc0cc8..bdabcc0cc8 100644 --- a/Spigot-Server-Patches/0368-Show-blockstate-location-if-we-failed-to-read-it.patch +++ b/Spigot-Server-Patches/0365-Show-blockstate-location-if-we-failed-to-read-it.patch diff --git a/Spigot-Server-Patches/0369-Synchronize-DataPaletteBlock-instead-of-ReentrantLoc.patch b/Spigot-Server-Patches/0366-Synchronize-DataPaletteBlock-instead-of-ReentrantLoc.patch index f0a0d68f9e..0384e927a5 100644 --- a/Spigot-Server-Patches/0369-Synchronize-DataPaletteBlock-instead-of-ReentrantLoc.patch +++ b/Spigot-Server-Patches/0366-Synchronize-DataPaletteBlock-instead-of-ReentrantLoc.patch @@ -13,7 +13,7 @@ contention situations. And this is extremely a low contention situation. diff --git a/src/main/java/net/minecraft/server/DataPaletteBlock.java b/src/main/java/net/minecraft/server/DataPaletteBlock.java -index bcf249aab7d8223f6d9b597fcb20c1aa523ab862..4d397dc5a5127d5e9eb1ba5675239b022a1544c0 100644 +index eabc9d7b934f27c823e012f3f10fffc23b461292..f4c1b8d32b239c44e70d3fa6d094b74955f75339 100644 --- a/src/main/java/net/minecraft/server/DataPaletteBlock.java +++ b/src/main/java/net/minecraft/server/DataPaletteBlock.java @@ -23,7 +23,7 @@ public class DataPaletteBlock<T> implements DataPaletteExpandable<T> { diff --git a/Spigot-Server-Patches/0370-incremental-chunk-saving.patch b/Spigot-Server-Patches/0367-incremental-chunk-saving.patch index 17e14aad2c..19486b4ccf 100644 --- a/Spigot-Server-Patches/0370-incremental-chunk-saving.patch +++ b/Spigot-Server-Patches/0367-incremental-chunk-saving.patch @@ -5,10 +5,10 @@ Subject: [PATCH] incremental chunk saving diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6e1756eb90b6237100612527f69c995246d53ed1..5f3c8f74a60f9446623b863f9297402be1cd2f88 100644 +index 44811683cfe47adbdce6c8bd627bdbeb13ce114c..e7c73a4ddbb42aa52112147a60c8a761bfd3d07b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -450,4 +450,19 @@ public class PaperWorldConfig { +@@ -439,4 +439,19 @@ public class PaperWorldConfig { keepLoadedRange = (short) (getInt("keep-spawn-loaded-range", Math.min(spigotConfig.viewDistance, 10)) * 16); log( "Keep Spawn Loaded Range: " + (keepLoadedRange/16)); } @@ -29,7 +29,7 @@ index 6e1756eb90b6237100612527f69c995246d53ed1..5f3c8f74a60f9446623b863f9297402b + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 141f2e8975b01fc2a5e7743955894f100c3062a2..8a316f732644886c476921c69838e9cb8b93a5b5 100644 +index 8e3244fc5c6e5fff22857637b4ab5944d6b1e165..62758052546fac25fc90a9d26e5081d92eeba8b5 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -43,7 +43,7 @@ public class Chunk implements IChunkAccess { @@ -42,10 +42,10 @@ index 141f2e8975b01fc2a5e7743955894f100c3062a2..8a316f732644886c476921c69838e9cb private long inhabitedTime; @Nullable diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 726926f19c6725c1d935beec2f0f766d7466835e..f2ff1aa915c218bb1fc72467ccbd73ccf135c494 100644 +index 3bfd225db6945cb431238a9a980fb6d10f831f61..b49420bdbdd00148fc5f9a21d3f4953457b2cdc6 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -535,6 +535,15 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -536,6 +536,15 @@ public class ChunkProviderServer extends IChunkProvider { } // Paper - Timings } @@ -62,7 +62,7 @@ index 726926f19c6725c1d935beec2f0f766d7466835e..f2ff1aa915c218bb1fc72467ccbd73cc public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d6a3c51826ac82fd46b8f6c98be7bf405ffa3f38..4ffd9c1d7b4fc2f42fa157b2235365cab41e295f 100644 +index e6e4e8c07b0283bdf45c8dac3cc47336a7430ca3..122485e7351791e54e1d2ac8a71e3623a8d4cb29 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -152,6 +152,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -73,7 +73,7 @@ index d6a3c51826ac82fd46b8f6c98be7bf405ffa3f38..4ffd9c1d7b4fc2f42fa157b2235365ca public CommandDispatcher vanillaCommandDispatcher; private boolean forceTicks; // CraftBukkit end -@@ -1143,14 +1144,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1141,14 +1142,24 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.serverPing.b().a(agameprofile); } @@ -104,10 +104,10 @@ index d6a3c51826ac82fd46b8f6c98be7bf405ffa3f38..4ffd9c1d7b4fc2f42fa157b2235365ca this.methodProfiler.enter("snooper"); if (((DedicatedServer) this).getDedicatedServerProperties().snooperEnabled && !this.snooper.d() && this.ticks > 100) { // Spigot diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 3b0d13d319fe1d274ab657c7c87e5a2db5c02c4f..3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080 100644 +index 3f125a57f43ea1678bd891ab7c1e6b892de55542..f558fa255933cbe9f15a6fa8e2dcd456380e5620 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -40,6 +40,9 @@ public class PlayerChunk { +@@ -42,6 +42,9 @@ public class PlayerChunk { private final PlayerChunkMap chunkMap; // Paper @@ -117,7 +117,7 @@ index 3b0d13d319fe1d274ab657c7c87e5a2db5c02c4f..3e1c1253ad5e2fa68fd8a0bac100c2e7 public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) { this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; -@@ -386,7 +389,19 @@ public class PlayerChunk { +@@ -393,7 +396,19 @@ public class PlayerChunk { boolean flag2 = playerchunk_state.isAtLeast(PlayerChunk.State.BORDER); boolean flag3 = playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER); @@ -137,7 +137,7 @@ index 3b0d13d319fe1d274ab657c7c87e5a2db5c02c4f..3e1c1253ad5e2fa68fd8a0bac100c2e7 if (!flag2 && flag3) { // Paper start - cache ticking ready status int expectCreateCount = ++this.fullChunkCreateCount; -@@ -506,8 +521,32 @@ public class PlayerChunk { +@@ -513,8 +528,32 @@ public class PlayerChunk { } public void m() { @@ -171,15 +171,23 @@ index 3b0d13d319fe1d274ab657c7c87e5a2db5c02c4f..3e1c1253ad5e2fa68fd8a0bac100c2e7 public void a(ProtoChunkExtension protochunkextension) { for (int i = 0; i < this.statusFutures.length(); ++i) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 6dda11ffc022aa9bc7481506811a710a184f5e78..39d89d6209123ae2146ae292009cad44c25f490a 100644 +index d8bedba819fa9ee0a4d3bdfbf0b010da7144dd68..c4ed4d58f7b344626acb13baeb14288970a7bb90 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -333,6 +333,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -47,6 +47,7 @@ import java.util.function.Supplier; + import java.util.stream.Collectors; + import java.util.stream.Stream; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.objects.ObjectRBTreeSet; // Paper + import org.apache.commons.lang3.mutable.MutableBoolean; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -333,6 +334,64 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } + // Paper start - incremental autosave -+ final it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<PlayerChunk> autoSaveQueue = new it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<>((playerchunk1, playerchunk2) -> { ++ final ObjectRBTreeSet<PlayerChunk> autoSaveQueue = new ObjectRBTreeSet<>((playerchunk1, playerchunk2) -> { + int timeCompare = Long.compare(playerchunk1.lastAutoSaveTime, playerchunk2.lastAutoSaveTime); + if (timeCompare != 0) { + return timeCompare; @@ -239,7 +247,7 @@ index 6dda11ffc022aa9bc7481506811a710a184f5e78..39d89d6209123ae2146ae292009cad44 protected void save(boolean flag) { if (flag) { List<PlayerChunk> list = (List) this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).peek(PlayerChunk::m).collect(Collectors.toList()); -@@ -443,6 +501,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -443,6 +502,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.world.unloadChunk(chunk); } @@ -247,7 +255,7 @@ index 6dda11ffc022aa9bc7481506811a710a184f5e78..39d89d6209123ae2146ae292009cad44 this.lightEngine.a(ichunkaccess.getPos()); this.lightEngine.queueUpdate(); -@@ -635,6 +694,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -635,6 +695,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { playerchunk.a(new ProtoChunkExtension(chunk)); } @@ -257,10 +265,10 @@ index 6dda11ffc022aa9bc7481506811a710a184f5e78..39d89d6209123ae2146ae292009cad44 return PlayerChunk.getChunkState(playerchunk.getTicketLevel()); }); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 7b4182a0dc9aaa76f0a4a3b09cc497bcb9704277..0286bc56d49e586dde506071e5e72423f157bd52 100644 +index da6d9495c869150ce83dfb284c5977d7f122e71b..c679a3838a5f4c180fbc258d59cf202a6bd91a16 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -767,11 +767,43 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -768,11 +768,43 @@ public class WorldServer extends World implements GeneratorAccessSeed { return !this.server.a(this, blockposition, entityhuman) && this.getWorldBorder().a(blockposition); } @@ -305,11 +313,11 @@ index 7b4182a0dc9aaa76f0a4a3b09cc497bcb9704277..0286bc56d49e586dde506071e5e72423 try (co.aikar.timings.Timing ignored = timings.worldSave.startTiming()) { // Paper if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel")); -@@ -797,6 +829,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -798,6 +830,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // CraftBukkit end } -+ private void saveData() { this.ag(); } // Paper - OBFHELPER - private void ag() { ++ private void saveData() { this.ai(); } // Paper - OBFHELPER + private void ai() { if (this.dragonBattle != null) { this.worldDataServer.a(this.dragonBattle.a()); // CraftBukkit diff --git a/Spigot-Server-Patches/0371-Anti-Xray.patch b/Spigot-Server-Patches/0368-Anti-Xray.patch index 6b00aae71e..5ac054cb15 100644 --- a/Spigot-Server-Patches/0371-Anti-Xray.patch +++ b/Spigot-Server-Patches/0368-Anti-Xray.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Anti-Xray diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 5f3c8f74a60f9446623b863f9297402be1cd2f88..c2cc7b8ebb1b15cf2c080ef5f78c5215d7c20828 100644 +index e7c73a4ddbb42aa52112147a60c8a761bfd3d07b..fd869c25b83670ded11678988288ab1322b9b001 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -1,7 +1,9 @@ @@ -18,7 +18,7 @@ index 5f3c8f74a60f9446623b863f9297402be1cd2f88..c2cc7b8ebb1b15cf2c080ef5f78c5215 import org.bukkit.Bukkit; import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -465,4 +467,31 @@ public class PaperWorldConfig { +@@ -454,4 +456,31 @@ public class PaperWorldConfig { private void maxAutoSaveChunksPerTick() { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } @@ -98,10 +98,10 @@ index 0000000000000000000000000000000000000000..df7e4183d8842f5be8ae9d0698f8fa90 +} diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java new file mode 100644 -index 0000000000000000000000000000000000000000..c0d7767adb996edf9f645be591e4eee1d1dddf97 +index 0000000000000000000000000000000000000000..f475427af03a0bcd69a215daf3d0c1456ca57be1 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java -@@ -0,0 +1,620 @@ +@@ -0,0 +1,622 @@ +package com.destroystokyo.paper.antixray; + +import java.util.ArrayList; @@ -135,7 +135,8 @@ index 0000000000000000000000000000000000000000..c0d7767adb996edf9f645be591e4eee1 + private final ChunkSection[] emptyNearbyChunkSections = {Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION, Chunk.EMPTY_CHUNK_SECTION}; + private final int maxBlockYUpdatePosition; + -+ public ChunkPacketBlockControllerAntiXray(PaperWorldConfig paperWorldConfig, Executor executor) { ++ public ChunkPacketBlockControllerAntiXray(World world, Executor executor) { ++ PaperWorldConfig paperWorldConfig = world.paperConfig; + engineMode = paperWorldConfig.engineMode; + maxChunkSectionIndex = paperWorldConfig.maxChunkSectionIndex; + updateRadius = paperWorldConfig.updateRadius; @@ -185,12 +186,13 @@ index 0000000000000000000000000000000000000000..c0d7767adb996edf9f645be591e4eee1 + for (String id : toObfuscate) { + Block block = IRegistry.BLOCK.getOptional(new MinecraftKey(id)).orElse(null); + -+ if (block != null) { ++ // Don't obfuscate air because air causes unnecessary block updates and causes block updates to fail in the void ++ if (block != null && !block.getBlockData().isAir()) { + obfuscateGlobal[ChunkSection.GLOBAL_PALETTE.getOrCreateIdFor(block.getBlockData())] = true; + } + } + -+ ChunkEmpty emptyChunk = new ChunkEmpty(null, new ChunkCoordIntPair(0, 0)); ++ ChunkEmpty emptyChunk = new ChunkEmpty(world, new ChunkCoordIntPair(0, 0)); + BlockPosition zeroPos = new BlockPosition(0, 0, 0); + + for (int i = 0; i < solidGlobal.length; i++) { @@ -988,7 +990,7 @@ index 0000000000000000000000000000000000000000..333763936897befda5bb6c077944d266 + } +} diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0073f8abe4001a4ea0fda97a1607d6317cbd3485..67fa80d677eb657ce0c44500f5dacedda8e74588 100644 +index 62758052546fac25fc90a9d26e5081d92eeba8b5..8dea2c50529478cf8473a53b7f760546812aa7ff 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -423,7 +423,7 @@ public class Chunk implements IChunkAccess { @@ -1000,8 +1002,21 @@ index 0073f8abe4001a4ea0fda97a1607d6317cbd3485..67fa80d677eb657ce0c44500f5dacedd this.sections[j >> 4] = chunksection; } +diff --git a/src/main/java/net/minecraft/server/ChunkEmpty.java b/src/main/java/net/minecraft/server/ChunkEmpty.java +index ed22ff28ea6c0978ec0d9d1ecf7baa3f422ed677..d2286f1549de563332c3e4181b9ada30845b3725 100644 +--- a/src/main/java/net/minecraft/server/ChunkEmpty.java ++++ b/src/main/java/net/minecraft/server/ChunkEmpty.java +@@ -12,7 +12,7 @@ public class ChunkEmpty extends Chunk { + }); + + public ChunkEmpty(World world, ChunkCoordIntPair chunkcoordintpair) { +- super(world, chunkcoordintpair, new BiomeStorage(world.r().b(IRegistry.ay), ChunkEmpty.b)); ++ super(world, chunkcoordintpair, new BiomeStorage(MinecraftServer.getServer().getCustomRegistry().b(IRegistry.ay), ChunkEmpty.b)); // Paper - world isnt ready yet for anti xray use here, use server singleton for registry + } + + // Paper start diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 208a8ef3aaa4b33bfe2db2569a3588a332ab5686..be3c7a8697c540d03a143b9306311a184474857f 100644 +index ff859311abb0eeaedb9c9d9cf7a9e858f4e12978..95bc46e8d9c9f75147cfdeaf464ec3ca2e491b1c 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -58,7 +58,7 @@ public class ChunkRegionLoader { @@ -1023,7 +1038,7 @@ index 208a8ef3aaa4b33bfe2db2569a3588a332ab5686..be3c7a8697c540d03a143b9306311a18 protochunk.a(biomestorage); object = protochunk; diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index bd2290a4d4ec314b7afdb1f63d711f80803153cd..cb72be356a2f28cfebc0cb4a822fa21d22ca5064 100644 +index 5c7068cd93806d67c643ed6aabdfcab8888ed94e..90bb2f7ad9f82818d58de9be918f1299c6725070 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -1,6 +1,7 @@ @@ -1036,7 +1051,7 @@ index bd2290a4d4ec314b7afdb1f63d711f80803153cd..cb72be356a2f28cfebc0cb4a822fa21d public class ChunkSection { @@ -12,16 +13,22 @@ public class ChunkSection { private short e; - final DataPaletteBlock<IBlockData> blockIds; + final DataPaletteBlock<IBlockData> blockIds; // Paper - package-private - public ChunkSection(int i) { - this(i, (short) 0, (short) 0, (short) 0); @@ -1200,8 +1215,20 @@ index f4c1b8d32b239c44e70d3fa6d094b74955f75339..ed77117630d54b7ad81f633110c7d2a7 int j = along.length * 64 / 4096; if (this.h == this.b) { +diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java +index 122485e7351791e54e1d2ac8a71e3623a8d4cb29..15714009820659e298a2fff002a64c60b668c79a 100644 +--- a/src/main/java/net/minecraft/server/MinecraftServer.java ++++ b/src/main/java/net/minecraft/server/MinecraftServer.java +@@ -2142,6 +2142,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas + return this.saveData; + } + ++ public final IRegistryCustom getCustomRegistry() { return aX(); } // Paper - OBFHELPER + public IRegistryCustom aX() { + return this.f; + } diff --git a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java -index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9d016455a 100644 +index 5fae0ec8933cef2b87d2f465c8019af0af2e130d..5094a5d6fb3c1a84d6e8f6abe79e894c047d9cfa 100644 --- a/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java +++ b/src/main/java/net/minecraft/server/PacketPlayOutMapChunk.java @@ -1,5 +1,6 @@ @@ -1211,9 +1238,9 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 import com.google.common.collect.Lists; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; -@@ -22,7 +23,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -21,7 +22,13 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { + private List<NBTTagCompound> g; private boolean h; - private boolean i; - public PacketPlayOutMapChunk() {} + // Paper start - Async-Anti-Xray - Set the ready flag to true @@ -1222,32 +1249,33 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 + this.ready = true; + } + // Paper end - ++ // Paper start private final java.util.List<Packet> extraPackets = new java.util.ArrayList<>(); -@@ -34,6 +40,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { + private static final int TE_LIMIT = Integer.getInteger("Paper.excessiveTELimit", 750); +@@ -32,6 +39,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { } // Paper end - public PacketPlayOutMapChunk(Chunk chunk, int i, boolean flag) { + public PacketPlayOutMapChunk(Chunk chunk, int i) { + ChunkPacketInfo<IBlockData> chunkPacketInfo = chunk.world.chunkPacketBlockController.getChunkPacketInfo(this, chunk, i); // Paper - Anti-Xray - Add chunk packet info ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); this.a = chunkcoordintpair.x; -@@ -57,7 +64,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -54,7 +62,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { } this.f = new byte[this.a(chunk, i)]; -- this.c = this.a(new PacketDataSerializer(this.k()), chunk, i); +- this.c = this.a(new PacketDataSerializer(this.j()), chunk, i); + // Paper start - Anti-Xray - Add chunk packet info + if (chunkPacketInfo != null) { + chunkPacketInfo.setData(this.getData()); + } -+ this.c = this.writeChunk(new PacketDataSerializer(this.k()), chunk, i, chunkPacketInfo); ++ this.c = this.writeChunk(new PacketDataSerializer(this.j()), chunk, i, chunkPacketInfo); + // Paper end this.g = Lists.newArrayList(); iterator = chunk.getTileEntities().entrySet().iterator(); int totalTileEntities = 0; // Paper -@@ -84,8 +96,19 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -81,8 +94,19 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { this.g.add(nbttagcompound); } } @@ -1267,7 +1295,7 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 @Override public void a(PacketDataSerializer packetdataserializer) throws IOException { -@@ -153,8 +176,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -148,8 +172,12 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { return bytebuf; } @@ -1282,7 +1310,7 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 int j = 0; ChunkSection[] achunksection = chunk.getSections(); int k = 0; -@@ -164,7 +191,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { +@@ -159,7 +187,7 @@ public class PacketPlayOutMapChunk implements Packet<PacketListenerPlayOut> { if (chunksection != Chunk.a && (!this.f() || !chunksection.c()) && (i & 1 << k) != 0) { j |= 1 << k; @@ -1292,10 +1320,10 @@ index 900f16efde29ace3f073b1cbc01df8bafc360a9a..8335d003369d94cbad17ec6fce76d6f9 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 17c656a6cbbefea211414e8685d0f6b6aacb61c2..a21c9a0c3e25421510461b2e9fcc1ab69f731f61 100644 +index c4ed4d58f7b344626acb13baeb14288970a7bb90..8e79200b23f2dee612b0cbdcd6359a25dc2323cb 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -608,7 +608,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -609,7 +609,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } this.g(chunkcoordintpair); @@ -1318,7 +1346,7 @@ index a32490f0eb754b065ee34c41465176db78b1625d..734855c1db3215d90b2743988f64af68 public void a(BlockPosition blockposition, PacketPlayInBlockDig.EnumPlayerDigType packetplayinblockdig_enumplayerdigtype, String s) { diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index 5114ce15ad1be23ca83b3a3fcaba10a34fcb1a6f..a60b414cdf70096e667e776ab4fd36e411f8ff12 100644 +index 2bcd26ccccf4503241c6b77600ed6ce1d94ccfcc..912c5187a08e972fc9455aed33278387a83f03f2 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -46,16 +46,24 @@ public class ProtoChunk implements IChunkAccess { @@ -1359,7 +1387,7 @@ index 5114ce15ad1be23ca83b3a3fcaba10a34fcb1a6f..a60b414cdf70096e667e776ab4fd36e4 return this.j[i]; diff --git a/src/main/java/net/minecraft/server/ProtoChunkExtension.java b/src/main/java/net/minecraft/server/ProtoChunkExtension.java -index ee8df274d43be753887fb77e4203e2ee30ea02b3..9f91c02b444874e690eacb0cfa0c810168c8bb46 100644 +index 09da0cc8f02c504191dfec8be93e6cf67c6afb78..9ee7e1e93659beb747b8fe2b926522b14734d0cd 100644 --- a/src/main/java/net/minecraft/server/ProtoChunkExtension.java +++ b/src/main/java/net/minecraft/server/ProtoChunkExtension.java @@ -11,7 +11,7 @@ public class ProtoChunkExtension extends ProtoChunk { @@ -1372,7 +1400,7 @@ index ee8df274d43be753887fb77e4203e2ee30ea02b3..9f91c02b444874e690eacb0cfa0c8101 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 9d79dfb0e31302ecb0fe5c43a9a56040861bba84..82faa08d5750dad6045ec3da9a52e90bc0b1bdb6 100644 +index 7c7c038dde32c2acd10cd653c6c85bca466d3a6c..fa134406c7d0132971ad5d75f1e0f46667f94a01 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -2,6 +2,8 @@ package net.minecraft.server; @@ -1392,19 +1420,19 @@ index 9d79dfb0e31302ecb0fe5c43a9a56040861bba84..82faa08d5750dad6045ec3da9a52e90b public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPosition lastPhysicsProblem; // Spigot -@@ -101,9 +104,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return (CraftServer) Bukkit.getServer(); +@@ -105,9 +108,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + return typeKey; } -- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { -+ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { +- protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) { ++ protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, final DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { // Paper this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper -+ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray ++ this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit -@@ -408,6 +412,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -373,6 +377,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { // CraftBukkit end IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag @@ -1413,23 +1441,23 @@ index 9d79dfb0e31302ecb0fe5c43a9a56040861bba84..82faa08d5750dad6045ec3da9a52e90b if (iblockdata1 == null) { // CraftBukkit start - remove blockstate if failed (or the same) diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0286bc56d49e586dde506071e5e72423f157bd52..1f2ac5883b3b977b605077438005c6be66d8b49c 100644 +index c679a3838a5f4c180fbc258d59cf202a6bd91a16..cb1f2360f798f061159c365f0ed72ac3132643e6 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -95,7 +95,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -96,7 +96,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { -- super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env); -+ super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { +- super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env); ++ super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor this.pvpMode = minecraftserver.getPVP(); convertable = convertable_conversionsession; uuid = WorldUUID.getUUID(convertable_conversionsession.folder.toFile()); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 2bd7d7959ce2845dbc09e198122e3574593dca58..cccb8f7b1c13811db7203282a5caad3da5b69a09 100644 +index 3d18a95c9ce9e2fbe142b522d41045992002f715..ddad3440d364ebe98f6fabf00e90766b4ea4a5c2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -40,7 +40,7 @@ public class CraftChunk implements Chunk { +@@ -41,7 +41,7 @@ public class CraftChunk implements Chunk { private final WorldServer worldServer; private final int x; private final int z; @@ -1438,7 +1466,7 @@ index 2bd7d7959ce2845dbc09e198122e3574593dca58..cccb8f7b1c13811db7203282a5caad3d private static final byte[] emptyLight = new byte[2048]; public CraftChunk(net.minecraft.server.Chunk chunk) { -@@ -262,7 +262,7 @@ public class CraftChunk implements Chunk { +@@ -263,7 +263,7 @@ public class CraftChunk implements Chunk { NBTTagCompound data = new NBTTagCompound(); cs[i].getBlocks().a(data, "Palette", "BlockStates"); diff --git a/Spigot-Server-Patches/0372-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch b/Spigot-Server-Patches/0369-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch index 4699925f45..de2bfb3743 100644 --- a/Spigot-Server-Patches/0372-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch +++ b/Spigot-Server-Patches/0369-Only-count-Natural-Spawned-mobs-towards-natural-spaw.patch @@ -17,10 +17,10 @@ This should fully solve all of the issues around it so that only natural influences natural spawns. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c2cc7b8ebb1b15cf2c080ef5f78c5215d7c20828..bccc2cb3e76aa3ffe1c4200f1b7380d136cb2f96 100644 +index fd869c25b83670ded11678988288ab1322b9b001..bdfaaa535a9339a8f6fb51d5fb7892becf617097 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -468,6 +468,16 @@ public class PaperWorldConfig { +@@ -457,6 +457,16 @@ public class PaperWorldConfig { maxAutoSaveChunksPerTick = getInt("max-auto-save-chunks-per-tick", 24); } @@ -38,7 +38,7 @@ index c2cc7b8ebb1b15cf2c080ef5f78c5215d7c20828..bccc2cb3e76aa3ffe1c4200f1b7380d1 public EngineMode engineMode; public int maxChunkSectionIndex; diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 6426f67afb3cc3522ff79b1c8515c1f97cd2f0c1..8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc 100644 +index 2561ba9b9c02ccb59bd7284ddfe62889911d4220..99d4d6b4bdedcba7964ddc99467b8f8e5229b98a 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -48,6 +48,13 @@ public final class SpawnerCreature { diff --git a/Spigot-Server-Patches/0373-Configurable-projectile-relative-velocity.patch b/Spigot-Server-Patches/0370-Configurable-projectile-relative-velocity.patch index bed72ea706..d15c339cc5 100644 --- a/Spigot-Server-Patches/0373-Configurable-projectile-relative-velocity.patch +++ b/Spigot-Server-Patches/0370-Configurable-projectile-relative-velocity.patch @@ -25,10 +25,10 @@ P3) Solutions for 1) and especially 2) might not be future-proof, while this server-internal fix makes this change future-proof. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index bccc2cb3e76aa3ffe1c4200f1b7380d136cb2f96..822b738f48578b39f81bb8e38208dc3d26c2a221 100644 +index bdfaaa535a9339a8f6fb51d5fb7892becf617097..b83abceb55fd6cc6bde3e34da098e9916e3a497b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -504,4 +504,9 @@ public class PaperWorldConfig { +@@ -493,4 +493,9 @@ public class PaperWorldConfig { } log("Anti-Xray: " + (antiXray ? "enabled" : "disabled") + " / Engine Mode: " + engineMode.getDescription() + " / Up to " + ((maxChunkSectionIndex + 1) * 16) + " blocks / Update Radius: " + updateRadius); } @@ -39,7 +39,7 @@ index bccc2cb3e76aa3ffe1c4200f1b7380d136cb2f96..822b738f48578b39f81bb8e38208dc3d + } } diff --git a/src/main/java/net/minecraft/server/IProjectile.java b/src/main/java/net/minecraft/server/IProjectile.java -index ff137b15de7670f8e5fcb9f4dde3dc8251e3075c..6e175e30a6c1fc69bd2f8417d2df38ee1b78545b 100644 +index 8d26521bc414b3d34f496e966f0c918b023f4833..9f5ce64a60fe7c312399ee416b11b84213dd3bee 100644 --- a/src/main/java/net/minecraft/server/IProjectile.java +++ b/src/main/java/net/minecraft/server/IProjectile.java @@ -114,7 +114,7 @@ public abstract class IProjectile extends Entity { diff --git a/Spigot-Server-Patches/0374-Mark-entities-as-being-ticked-when-notifying-navigat.patch b/Spigot-Server-Patches/0371-Mark-entities-as-being-ticked-when-notifying-navigat.patch index 6e78696770..6773d896cd 100644 --- a/Spigot-Server-Patches/0374-Mark-entities-as-being-ticked-when-notifying-navigat.patch +++ b/Spigot-Server-Patches/0371-Mark-entities-as-being-ticked-when-notifying-navigat.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Mark entities as being ticked when notifying navigation diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 1f2ac5883b3b977b605077438005c6be66d8b49c..f1b2ef8836d31ce0dd5502357d6af655eabd9006 100644 +index cb1f2360f798f061159c365f0ed72ac3132643e6..31e433168c61fb39bec846ca4ef73a39893709fe 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1318,6 +1318,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1355,6 +1355,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { VoxelShape voxelshape1 = iblockdata1.getCollisionShape(this, blockposition); if (VoxelShapes.c(voxelshape, voxelshape1, OperatorBoolean.NOT_SAME)) { @@ -16,7 +16,7 @@ index 1f2ac5883b3b977b605077438005c6be66d8b49c..f1b2ef8836d31ce0dd5502357d6af655 Iterator iterator = this.navigators.iterator(); while (iterator.hasNext()) { -@@ -1328,6 +1329,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1365,6 +1366,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } diff --git a/Spigot-Server-Patches/0375-offset-item-frame-ticking.patch b/Spigot-Server-Patches/0372-offset-item-frame-ticking.patch index f3cc8ac572..cb279c67d9 100644 --- a/Spigot-Server-Patches/0375-offset-item-frame-ticking.patch +++ b/Spigot-Server-Patches/0372-offset-item-frame-ticking.patch @@ -5,7 +5,7 @@ Subject: [PATCH] offset item frame ticking diff --git a/src/main/java/net/minecraft/server/EntityHanging.java b/src/main/java/net/minecraft/server/EntityHanging.java -index 3dc1f234a389b1badf0b189ba27708c787ce37af..06cf11af972f7762de43dc1df18a431a62787111 100644 +index 77cee2a41103441e7c7bc5dad621966ab8754ea3..08975848abcbab99888fedadf29eb2b3b9e6c283 100644 --- a/src/main/java/net/minecraft/server/EntityHanging.java +++ b/src/main/java/net/minecraft/server/EntityHanging.java @@ -15,7 +15,7 @@ public abstract class EntityHanging extends Entity { diff --git a/Spigot-Server-Patches/0376-Avoid-hopper-searches-if-there-are-no-items.patch b/Spigot-Server-Patches/0373-Avoid-hopper-searches-if-there-are-no-items.patch index c514cf39dc..8d625255e8 100644 --- a/Spigot-Server-Patches/0376-Avoid-hopper-searches-if-there-are-no-items.patch +++ b/Spigot-Server-Patches/0373-Avoid-hopper-searches-if-there-are-no-items.patch @@ -14,7 +14,7 @@ And since minecart hoppers are used _very_ rarely near we can avoid alot of sear Combined, this adds up a lot. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8fa440b313b414a79118089b7481dee9f7ba69a8..b2713942d8cf5bedd91ac63df18a336743c72da5 100644 +index 8dea2c50529478cf8473a53b7f760546812aa7ff..a6cd89e0850c11ab6dd7f77842583c456c7f93dd 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -85,6 +85,10 @@ public class Chunk implements IChunkAccess { @@ -100,7 +100,7 @@ index 8fa440b313b414a79118089b7481dee9f7ba69a8..b2713942d8cf5bedd91ac63df18a3367 T t0 = (T) iterator.next(); // CraftBukkit - decompile error if (t0.shouldBeRemoved) continue; // Paper diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 28f10ab2e427872c04bc97ebc392cf6d58854cf9..57bc56cffff87d9b1774cec455af8d1651fb882c 100644 +index c13bb708ccd14c3848afbc9afaf6439c1a574f22..3c296c81845c295c66854cb365f2061a7a7bbf23 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -11,6 +11,7 @@ public final class IEntitySelector { diff --git a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch b/Spigot-Server-Patches/0374-Asynchronous-chunk-IO-and-loading.patch index 2416982309..553ef04f20 100644 --- a/Spigot-Server-Patches/0377-Asynchronous-chunk-IO-and-loading.patch +++ b/Spigot-Server-Patches/0374-Asynchronous-chunk-IO-and-loading.patch @@ -2308,10 +2308,10 @@ index 0000000000000000000000000000000000000000..49a594e5f345096cb3b9913b8ee27607 + +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index f2ff1aa915c218bb1fc72467ccbd73ccf135c494..edd901bb53385fa3d189a0057d57f98bf8b7115c 100644 +index b49420bdbdd00148fc5f9a21d3f4953457b2cdc6..032464901e02392df4966c68cce8d06f2bd6b6f8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -310,11 +310,138 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -311,11 +311,138 @@ public class ChunkProviderServer extends IChunkProvider { return playerChunk.getAvailableChunkNow(); } @@ -2450,7 +2450,7 @@ index f2ff1aa915c218bb1fc72467ccbd73ccf135c494..edd901bb53385fa3d189a0057d57f98b if (Thread.currentThread() != this.serverThread) { return (IChunkAccess) CompletableFuture.supplyAsync(() -> { return this.getChunkAt(i, j, chunkstatus, flag); -@@ -337,11 +464,16 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -338,11 +465,16 @@ public class ChunkProviderServer extends IChunkProvider { } gameprofilerfiller.c("getChunkCacheMiss"); @@ -2468,7 +2468,7 @@ index f2ff1aa915c218bb1fc72467ccbd73ccf135c494..edd901bb53385fa3d189a0057d57f98b this.world.timings.syncChunkLoad.stopTiming(); // Paper } // Paper ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { -@@ -407,6 +539,11 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -408,6 +540,11 @@ public class ChunkProviderServer extends IChunkProvider { } private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getChunkFutureMainThread(int i, int j, ChunkStatus chunkstatus, boolean flag) { @@ -2480,7 +2480,7 @@ index f2ff1aa915c218bb1fc72467ccbd73ccf135c494..edd901bb53385fa3d189a0057d57f98b ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j); long k = chunkcoordintpair.pair(); int l = 33 + ChunkStatus.a(chunkstatus); -@@ -806,11 +943,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -807,11 +944,12 @@ public class ChunkProviderServer extends IChunkProvider { protected boolean executeNext() { // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task try { @@ -2495,7 +2495,7 @@ index f2ff1aa915c218bb1fc72467ccbd73ccf135c494..edd901bb53385fa3d189a0057d57f98b } finally { playerChunkMap.callbackExecutor.run(); diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index be3c7a8697c540d03a143b9306311a184474857f..4d6e8f987233ca6c5f53d004031c022bb2d43e1e 100644 +index 95bc46e8d9c9f75147cfdeaf464ec3ca2e491b1c..61aef3c14dff6bda603175883f9cb1b9a2c82428 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.longs.LongOpenHashSet; @@ -2756,7 +2756,7 @@ index be3c7a8697c540d03a143b9306311a184474857f..4d6e8f987233ca6c5f53d004031c022b nbttagcompound1.set("PostProcessing", a(ichunkaccess.l())); diff --git a/src/main/java/net/minecraft/server/ChunkStatus.java b/src/main/java/net/minecraft/server/ChunkStatus.java -index 0939e015aad7d3fcc7908afcabee0100c4deee40..7948b915bf1adaea49fb5c78284ce6d4a8e7f6df 100644 +index f231bb2f5bca184557182c50d251943932693614..f6c9bdbf52d773d7aa601125b887b347163f9328 100644 --- a/src/main/java/net/minecraft/server/ChunkStatus.java +++ b/src/main/java/net/minecraft/server/ChunkStatus.java @@ -159,6 +159,7 @@ public class ChunkStatus { @@ -2801,7 +2801,7 @@ index 0939e015aad7d3fcc7908afcabee0100c4deee40..7948b915bf1adaea49fb5c78284ce6d4 return this.c() >= chunkstatus.c(); } diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index 4c65bf1f692b20d5c876a2840d5d9f76b67c6d2d..c5259673ccddd6326d185370f8123aa936aae755 100644 +index 46959b58bac01b5ff7e3eb4cbac07ddf6bfc4ebc..c475009fe03a1550cb64a716a02a5a8b5204c873 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -91,7 +91,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -2924,10 +2924,10 @@ index fa03834dacacf7ae6a326c88007256a261153c27..c0d2df8ef3b4d0224ede2b7a4ef4e3f9 } } diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index baa0f67400d9f7d36900010c362fe4ef4186573f..8eb93f33da264cd5182d1399e40e1f63d83a3e98 100644 +index 2507bdf7bfa65f1bc728a46322d2a570e566e32c..c470c6527b214026c230feaae0c0875c86dea673 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -696,4 +696,9 @@ public final class MCUtil { +@@ -697,4 +697,9 @@ public final class MCUtil { out.print(fileData); } } @@ -2938,7 +2938,7 @@ index baa0f67400d9f7d36900010c362fe4ef4186573f..8eb93f33da264cd5182d1399e40e1f63 + } } diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 52476513405a28b4125170650ff53a07deba0ec2..79ac93c5f2cad09a5dd0450b55c709415d5fb3e6 100644 +index d80235349ea8cc868b720b69f7f0812184e895c8..95f3abe47a5ef4268bc6b7cdde94cba30303d786 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -172,6 +172,7 @@ public class Main { @@ -2950,11 +2950,11 @@ index 52476513405a28b4125170650ff53a07deba0ec2..79ac93c5f2cad09a5dd0450b55c70941 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, datapackconfiguration1, thread, iregistrycustom_dimension, convertable_conversionsession, resourcepackrepository, datapackresources, null, dedicatedserversettings, DataConverterRegistry.a(), minecraftsessionservice, gameprofilerepository, usercache, WorldLoadListenerLogger::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 7291946fdd283685b5eedf3503fb4c52544acc7b..15c35aacd8a1ef4c9d74df06c1689b1fb0e2bf3f 100644 +index 15714009820659e298a2fff002a64c60b668c79a..4820030bbe1ad2f524011ffe5142abe6c7d28969 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -807,7 +807,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - this.getUserCache().c(false); // Paper +@@ -805,7 +805,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas + this.getUserCache().b(false); // Paper } // Spigot end - @@ -2985,7 +2985,7 @@ index e9c405fb5376c5733b9b0191cd5309173f4021e8..33cfeabdee03195a294f303f28044a31 this.e = t0; this.b = i; diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java -index ed8c4a87b52e6375e354a28316f8f24608082417..996c8326387b5a7fe62db6a76e000144565cb85b 100644 +index 9aeb6ed1b4f452a69de217076aab015b164cc295..6d608dfa52fffd79878f3bdebcda9fab176e413e 100644 --- a/src/main/java/net/minecraft/server/NibbleArray.java +++ b/src/main/java/net/minecraft/server/NibbleArray.java @@ -71,6 +71,7 @@ public class NibbleArray { @@ -3010,10 +3010,10 @@ index 4c52c57c02571353f71772e3650932f314da62ca..71daa0cb08d69c16bded510d1a490534 @Override diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22b8d80bad 100644 +index f558fa255933cbe9f15a6fa8e2dcd456380e5620..12f91b5a5f740d661f8422b0ba870e3454c26467 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -127,6 +127,18 @@ public class PlayerChunk { +@@ -129,6 +129,18 @@ public class PlayerChunk { } return null; } @@ -3032,7 +3032,7 @@ index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22 // Paper end public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { -@@ -340,7 +352,7 @@ public class PlayerChunk { +@@ -347,7 +359,7 @@ public class PlayerChunk { ChunkStatus chunkstatus = getChunkStatus(this.oldTicketLevel); ChunkStatus chunkstatus1 = getChunkStatus(this.ticketLevel); boolean flag = this.oldTicketLevel <= PlayerChunkMap.GOLDEN_TICKET; @@ -3041,7 +3041,7 @@ index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22 PlayerChunk.State playerchunk_state = getChunkState(this.oldTicketLevel); PlayerChunk.State playerchunk_state1 = getChunkState(this.ticketLevel); // CraftBukkit start -@@ -376,6 +388,12 @@ public class PlayerChunk { +@@ -383,6 +395,12 @@ public class PlayerChunk { } }); @@ -3055,10 +3055,10 @@ index 3e1c1253ad5e2fa68fd8a0bac100c2e7536ea080..b6868b6b23a09e8e0dfe7a5e378dca22 completablefuture = (CompletableFuture) this.statusFutures.get(i); if (completablefuture != null) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060b42e7abc 100644 +index 8e79200b23f2dee612b0cbdcd6359a25dc2323cb..e7d9674e25c06090d57bba6c8229bc3b75cb67e6 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -64,7 +64,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -65,7 +65,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private final LightEngineThreaded lightEngine; private final IAsyncTaskHandler<Runnable> executor; public final ChunkGenerator chunkGenerator; @@ -3067,7 +3067,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 private final VillagePlace m; public final LongSet unloadQueue; private boolean updatingChunksModified; -@@ -74,7 +74,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -75,7 +75,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final WorldLoadListener worldLoadListener; public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; @@ -3076,7 +3076,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 private final File w; private final PlayerMap playerMap; public final Int2ObjectMap<PlayerChunkMap.EntityTracker> trackedEntities; -@@ -157,7 +157,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -158,7 +158,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.lightEngine = new LightEngineThreaded(ilightaccess, this, this.world.getDimensionManager().hasSkyLight(), threadedmailbox1, this.p.a(threadedmailbox1, false)); this.chunkDistanceManager = new PlayerChunkMap.a(executor, iasynctaskhandler); this.l = supplier; @@ -3085,7 +3085,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 this.setViewDistance(i); } -@@ -199,12 +199,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -200,12 +200,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @Nullable @@ -3100,7 +3100,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 return (PlayerChunk) this.visibleChunks.get(i); } -@@ -326,6 +326,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -327,6 +327,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public void close() throws IOException { try { this.p.close(); @@ -3108,7 +3108,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 this.m.close(); } finally { super.close(); -@@ -417,7 +418,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -418,7 +419,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.b(() -> { return true; }); @@ -3118,7 +3118,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName()); } else { this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> { -@@ -433,16 +435,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -434,16 +436,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @@ -3140,7 +3140,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 } gameprofilerfiller.exit(); -@@ -463,12 +469,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -464,12 +470,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (playerchunk != null) { this.pendingUnload.put(j, playerchunk); this.updatingChunksModified = true; @@ -3155,7 +3155,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 } } activityAccountant.endActivity(); // Spigot -@@ -482,6 +489,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -483,6 +490,60 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @@ -3216,7 +3216,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 private void a(long i, PlayerChunk playerchunk) { CompletableFuture<IChunkAccess> completablefuture = playerchunk.getChunkSave(); Consumer<IChunkAccess> consumer = (ichunkaccess) -> { // CraftBukkit - decompile error -@@ -495,7 +556,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -496,7 +557,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ((Chunk) ichunkaccess).setLoaded(false); } @@ -3225,7 +3225,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 if (this.loadedChunks.remove(i) && ichunkaccess instanceof Chunk) { Chunk chunk = (Chunk) ichunkaccess; -@@ -503,6 +564,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -504,6 +565,13 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } this.autoSaveQueue.remove(playerchunk); // Paper @@ -3239,7 +3239,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 this.lightEngine.a(ichunkaccess.getPos()); this.lightEngine.queueUpdate(); this.worldLoadListener.a(ichunkaccess.getPos(), (ChunkStatus) null); -@@ -573,19 +641,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -574,19 +642,23 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } private CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> f(ChunkCoordIntPair chunkcoordintpair) { @@ -3272,7 +3272,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 protochunk.setLastSaved(this.world.getTime()); this.a(chunkcoordintpair, protochunk.getChunkStatus().getType()); -@@ -609,7 +681,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -610,7 +682,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.g(chunkcoordintpair); return Either.left(new ProtoChunk(chunkcoordintpair, ChunkConverter.a, this.world)); // Paper - Anti-Xray - Add parameter @@ -3306,7 +3306,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 } private void g(ChunkCoordIntPair chunkcoordintpair) { -@@ -836,6 +933,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -837,6 +934,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } public boolean saveChunk(IChunkAccess ichunkaccess) { @@ -3314,7 +3314,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 this.m.a(ichunkaccess.getPos()); if (!ichunkaccess.isNeedsSaving()) { return false; -@@ -848,6 +946,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -849,6 +947,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkStatus chunkstatus = ichunkaccess.getChunkStatus(); if (chunkstatus.getType() != ChunkStatus.Type.LEVELCHUNK) { @@ -3322,7 +3322,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 if (this.h(chunkcoordintpair)) { return false; } -@@ -855,12 +954,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -856,12 +955,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (chunkstatus == ChunkStatus.EMPTY && ichunkaccess.h().values().stream().noneMatch(StructureStart::e)) { return false; } @@ -3345,7 +3345,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 this.a(chunkcoordintpair, chunkstatus.getType()); return true; } catch (Exception exception) { -@@ -869,6 +976,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -870,6 +977,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return false; } } @@ -3353,7 +3353,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 } private boolean h(ChunkCoordIntPair chunkcoordintpair) { -@@ -998,6 +1106,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -999,6 +1107,35 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } } @@ -3389,7 +3389,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 @Nullable public NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { // Paper - private -> public NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); -@@ -1019,33 +1156,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1020,33 +1157,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - chunk status cache "api" public ChunkStatus getChunkStatusOnDiskIfCached(ChunkCoordIntPair chunkPos) { @@ -3456,7 +3456,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 } public IChunkAccess getUnloadingChunk(int chunkX, int chunkZ) { -@@ -1054,6 +1213,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1055,6 +1214,39 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end @@ -3496,7 +3496,7 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) { // Spigot start return isOutsideOfRange(chunkcoordintpair, false); -@@ -1399,6 +1591,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1400,6 +1592,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @@ -3505,10 +3505,10 @@ index a21c9a0c3e25421510461b2e9fcc1ab69f731f61..33becdbf730151e386f1d9aa727a8060 return this.m; } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index ce9d797b1233efd8f3bdee012a7734f7bfe4b5fe..6dfdbd45e0f533ebca5138c071cc349cf8827cfd 100644 +index 76be1b78e3959e4237708a091ed9198eacfad834..ab45ee434964c770033e56e7aa9480736f45a67b 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -544,6 +544,13 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -538,6 +538,13 @@ public class PlayerConnection implements PacketListenerPlayIn { minecraftServer.scheduleOnMain(() -> this.disconnect(new ChatMessage("disconnect.spam", new Object[0]))); // Paper return; } @@ -3523,19 +3523,19 @@ index ce9d797b1233efd8f3bdee012a7734f7bfe4b5fe..6dfdbd45e0f533ebca5138c071cc349c StringReader stringreader = new StringReader(packetplayintabcomplete.c()); diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java -index 4f1a6954ea880857352003982627545dd3483ad2..939b51826681a7648ad3ea2512c20082193e6a01 100644 +index 3e299ffaabf2a91336fae28031c8fc0712667bc5..1751fb6934d9242e475c1a44b2a4a1ade6987766 100644 --- a/src/main/java/net/minecraft/server/RegionFile.java +++ b/src/main/java/net/minecraft/server/RegionFile.java -@@ -36,6 +36,8 @@ public class RegionFile implements AutoCloseable { - private final RegionFileBitSet freeSectors; - public final File file; +@@ -38,6 +38,8 @@ public class RegionFile implements AutoCloseable { + protected final RegionFileBitSet freeSectors; + public final File file; // Paper + public final java.util.concurrent.locks.ReentrantLock fileLock = new java.util.concurrent.locks.ReentrantLock(true); // Paper + // Paper start - Cache chunk status private final ChunkStatus[] statuses = new ChunkStatus[32 * 32]; -@@ -229,7 +231,7 @@ public class RegionFile implements AutoCloseable { +@@ -244,7 +246,7 @@ public class RegionFile implements AutoCloseable { return (i + 4096 - 1) / 4096; } @@ -3544,7 +3544,7 @@ index 4f1a6954ea880857352003982627545dd3483ad2..939b51826681a7648ad3ea2512c20082 int i = this.getOffset(chunkcoordintpair); if (i == 0) { -@@ -389,6 +391,11 @@ public class RegionFile implements AutoCloseable { +@@ -404,6 +406,11 @@ public class RegionFile implements AutoCloseable { } public void close() throws IOException { @@ -3556,7 +3556,7 @@ index 4f1a6954ea880857352003982627545dd3483ad2..939b51826681a7648ad3ea2512c20082 this.closed = true; // Paper try { this.d(); -@@ -399,6 +406,10 @@ public class RegionFile implements AutoCloseable { +@@ -414,6 +421,10 @@ public class RegionFile implements AutoCloseable { this.dataFile.close(); } } @@ -3568,10 +3568,10 @@ index 4f1a6954ea880857352003982627545dd3483ad2..939b51826681a7648ad3ea2512c20082 } diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5db945b0fc 100644 +index 7a15944926427eb6cad976daabe5e710f4fbf1bb..d64f7ad925e5f40740a58ceee0845ac2db5419f2 100644 --- a/src/main/java/net/minecraft/server/RegionFileCache.java +++ b/src/main/java/net/minecraft/server/RegionFileCache.java -@@ -9,7 +9,7 @@ import java.io.File; +@@ -10,7 +10,7 @@ import java.io.File; import java.io.IOException; import javax.annotation.Nullable; @@ -3580,7 +3580,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d public final Long2ObjectLinkedOpenHashMap<RegionFile> cache = new Long2ObjectLinkedOpenHashMap(); private final File b; -@@ -22,16 +22,27 @@ public final class RegionFileCache implements AutoCloseable { +@@ -23,16 +23,27 @@ public final class RegionFileCache implements AutoCloseable { // Paper start @@ -3610,7 +3610,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d return regionfile; } else { if (this.cache.size() >= com.destroystokyo.paper.PaperConfig.regionFileCacheSize) { // Paper - configurable -@@ -47,6 +58,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -48,6 +59,12 @@ public final class RegionFileCache implements AutoCloseable { RegionFile regionfile1 = new RegionFile(file, this.b, this.c); this.cache.putAndMoveToFirst(i, regionfile1); @@ -3623,7 +3623,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d return regionfile1; } } -@@ -122,11 +139,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -123,11 +140,12 @@ public final class RegionFileCache implements AutoCloseable { @Nullable public NBTTagCompound read(ChunkCoordIntPair chunkcoordintpair) throws IOException { // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing @@ -3637,7 +3637,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d DataInputStream datainputstream = regionfile.a(chunkcoordintpair); // Paper start if (regionfile.isOversized(chunkcoordintpair.x, chunkcoordintpair.z)) { -@@ -164,10 +182,14 @@ public final class RegionFileCache implements AutoCloseable { +@@ -165,10 +183,14 @@ public final class RegionFileCache implements AutoCloseable { } return nbttagcompound; @@ -3653,7 +3653,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper DataOutputStream dataoutputstream = regionfile.c(chunkcoordintpair); Throwable throwable = null; -@@ -206,9 +228,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -207,9 +229,12 @@ public final class RegionFileCache implements AutoCloseable { MinecraftServer.LOGGER.error("Failed to save chunk", laste); } // Paper end @@ -3667,7 +3667,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d ExceptionSuppressor<IOException> exceptionsuppressor = new ExceptionSuppressor<>(); ObjectIterator objectiterator = this.cache.values().iterator(); -@@ -235,4 +260,12 @@ public final class RegionFileCache implements AutoCloseable { +@@ -236,4 +261,12 @@ public final class RegionFileCache implements AutoCloseable { } } @@ -3681,7 +3681,7 @@ index 341689ac996164b7b53e095495b92b6e85ab991a..867dc074bc57b27486de6ce742971d5d + // CraftBukkit end } diff --git a/src/main/java/net/minecraft/server/RegionFileSection.java b/src/main/java/net/minecraft/server/RegionFileSection.java -index a39075c68bb04e7183941c5eb80eb7cdde235045..bd0ff1e43a07a3332f9ade49fec2f76275a25c7f 100644 +index 21e75a3b5f03262a3885b2f9e3b3c175422efc03..04256a95108b8182e8f808e856e0d2b62165e242 100644 --- a/src/main/java/net/minecraft/server/RegionFileSection.java +++ b/src/main/java/net/minecraft/server/RegionFileSection.java @@ -21,28 +21,29 @@ import javax.annotation.Nullable; @@ -3828,7 +3828,7 @@ index 75ab9f185b3231113dfa387c956a707b403bb2db..8055f5998213ab1c6c10d03d88d2b14d public static <T> TicketType<T> a(String s, Comparator<T> comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java -index b8c15047771bd4527b86e514a3b950b2ffc6eef0..303f6b0953ff3c29bd31ec5e02386a92b11d114a 100644 +index d6aca683465c6898536507fab9e6888fef2e77e5..b926cebd053bef829517c9d9bbf1c609c23ca04a 100644 --- a/src/main/java/net/minecraft/server/VillagePlace.java +++ b/src/main/java/net/minecraft/server/VillagePlace.java @@ -25,8 +25,16 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { @@ -3848,7 +3848,7 @@ index b8c15047771bd4527b86e514a3b950b2ffc6eef0..303f6b0953ff3c29bd31ec5e02386a92 } public void a(BlockPosition blockposition, VillagePlaceType villageplacetype) { -@@ -134,7 +142,23 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { +@@ -144,7 +152,23 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { @Override public void a(BooleanSupplier booleansupplier) { @@ -3873,7 +3873,7 @@ index b8c15047771bd4527b86e514a3b950b2ffc6eef0..303f6b0953ff3c29bd31ec5e02386a92 this.a.a(); } -@@ -234,6 +258,35 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { +@@ -244,6 +268,35 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> { } } @@ -3910,10 +3910,10 @@ index b8c15047771bd4527b86e514a3b950b2ffc6eef0..303f6b0953ff3c29bd31ec5e02386a92 HAS_SPACE(VillagePlaceRecord::d), IS_OCCUPIED(VillagePlaceRecord::e), ANY((villageplacerecord) -> { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index f1b2ef8836d31ce0dd5502357d6af655eabd9006..d88e7e24d5fdd8caa075fe2aaf22f11f611e31bd 100644 +index 31e433168c61fb39bec846ca4ef73a39893709fe..45a1a6d64d92f9f191b7fc08fe3e56fd2786d03c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -93,6 +93,79 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -94,6 +94,79 @@ public class WorldServer extends World implements GeneratorAccessSeed { return this.chunkProvider.getChunkAt(x, z, false); } @@ -3991,9 +3991,9 @@ index f1b2ef8836d31ce0dd5502357d6af655eabd9006..d88e7e24d5fdd8caa075fe2aaf22f11f + // Paper end + // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { - super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -140,6 +213,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor +@@ -141,6 +214,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.dragonBattle = null; } this.getServer().addWorld(this.getWorld()); // CraftBukkit @@ -4002,7 +4002,7 @@ index f1b2ef8836d31ce0dd5502357d6af655eabd9006..d88e7e24d5fdd8caa075fe2aaf22f11f } // CraftBukkit start -@@ -1568,7 +1643,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1612,7 +1687,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { } MCUtil.getSpiralOutChunks(spawn, radiusInBlocks >> 4).forEach(pair -> { @@ -4015,18 +4015,18 @@ index f1b2ef8836d31ce0dd5502357d6af655eabd9006..d88e7e24d5fdd8caa075fe2aaf22f11f } public void removeTicketsForSpawn(int radiusInBlocks, BlockPosition spawn) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24..893406dfa074e1551513357a1b820de48076dfe4 100644 +index e741d1f966869b057652a93a1ef1785ad152f303..204ad44454732345be78c5c428dfb178344a96bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -74,6 +74,7 @@ import net.minecraft.server.GroupDataEntity; - import net.minecraft.server.IBlockData; +@@ -75,6 +75,7 @@ import net.minecraft.server.IBlockData; import net.minecraft.server.IChunkAccess; + import net.minecraft.server.IRegistry; import net.minecraft.server.MinecraftKey; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.MovingObjectPosition; import net.minecraft.server.PacketPlayOutCustomSoundEffect; import net.minecraft.server.PacketPlayOutUpdateTime; -@@ -558,22 +559,23 @@ public class CraftWorld implements World { +@@ -563,22 +564,23 @@ public class CraftWorld implements World { return true; } @@ -4058,7 +4058,7 @@ index 2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24..893406dfa074e1551513357a1b820de4 // fall through to load // we do this so we do not re-read the chunk data on disk -@@ -2479,6 +2481,34 @@ public class CraftWorld implements World { +@@ -2467,6 +2469,34 @@ public class CraftWorld implements World { public DragonBattle getEnderDragonBattle() { return (getHandle().getDragonBattle() == null) ? null : new CraftDragonBattle(getHandle().getDragonBattle()); } @@ -4094,10 +4094,10 @@ index 2f10a1c6f4f7b31c8054f3cd72947b2eb3a6ef24..893406dfa074e1551513357a1b820de4 // Spigot start @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 821417610fdb23791bd83e263977026b9d09e31a..a525a9e29f46c889a10d8c9fb70d8389fc204226 100644 +index a479ca88dcf60866650c236e885dd55f47915858..26376c995102753fcd298b1eea6e195bae238d65 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -495,6 +495,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -501,6 +501,28 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { entity.setHeadRotation(yaw); } diff --git a/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch b/Spigot-Server-Patches/0375-Use-getChunkIfLoadedImmediately-in-places.patch index af28573983..23763c3754 100644 --- a/Spigot-Server-Patches/0378-Use-getChunkIfLoadedImmediately-in-places.patch +++ b/Spigot-Server-Patches/0375-Use-getChunkIfLoadedImmediately-in-places.patch @@ -8,10 +8,10 @@ ticket level 33 (yes getChunkIfLoaded will actually perform a chunk load in that case). diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6dfdbd45e0f533ebca5138c071cc349cf8827cfd..c555c5426281980bb8a5b3cf78f4203566a05bfb 100644 +index ab45ee434964c770033e56e7aa9480736f45a67b..fc163511f6bb639c7934785ca34184df05cc019a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1015,7 +1015,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1009,7 +1009,7 @@ public class PlayerConnection implements PacketListenerPlayIn { speed = player.abilities.walkSpeed * 10f; } // Paper start - Prevent moving into unloaded chunks @@ -21,7 +21,7 @@ index 6dfdbd45e0f533ebca5138c071cc349cf8827cfd..c555c5426281980bb8a5b3cf78f42035 return; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 82faa08d5750dad6045ec3da9a52e90bc0b1bdb6..14ca9210e0501aff8e4559ddde9fd7d5db4c63c7 100644 +index fa134406c7d0132971ad5d75f1e0f46667f94a01..48d4b0314eb0934fdaa445800eceed481a662c63 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -104,6 +104,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @@ -35,10 +35,10 @@ index 82faa08d5750dad6045ec3da9a52e90bc0b1bdb6..14ca9210e0501aff8e4559ddde9fd7d5 + } + // Paper end + - protected World(WorldDataMutable worlddatamutable, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, Supplier<GameProfilerFiller> supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env, java.util.concurrent.Executor executor) { - this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((WorldDataServer) worlddatamutable).getName()); // Spigot - this.paperConfig = new com.destroystokyo.paper.PaperWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.spigotConfig); // Paper -@@ -1034,14 +1041,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + public ResourceKey<DimensionManager> getTypeKey() { + return typeKey; + } +@@ -999,14 +1006,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } public boolean p(BlockPosition blockposition) { @@ -55,7 +55,7 @@ index 82faa08d5750dad6045ec3da9a52e90bc0b1bdb6..14ca9210e0501aff8e4559ddde9fd7d5 return ichunkaccess == null ? false : ichunkaccess.getType(blockposition).a((IBlockAccess) this, blockposition, entity, enumdirection); } -@@ -1162,7 +1169,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1127,7 +1134,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -65,10 +65,10 @@ index 82faa08d5750dad6045ec3da9a52e90bc0b1bdb6..14ca9210e0501aff8e4559ddde9fd7d5 if (chunk != null) { chunk.a(oclass, axisalignedbb, list, predicate); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d88e7e24d5fdd8caa075fe2aaf22f11f611e31bd..2c61b97ed1571f2032b29b142a839f012a0c2cac 100644 +index 45a1a6d64d92f9f191b7fc08fe3e56fd2786d03c..4a93341ebd6f6fabc8981b9769837dfe4304823b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -90,7 +90,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -91,7 +91,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } @Override public Chunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI diff --git a/Spigot-Server-Patches/0379-Reduce-sync-loads.patch b/Spigot-Server-Patches/0376-Reduce-sync-loads.patch index 8b961aa577..0362a5868c 100644 --- a/Spigot-Server-Patches/0379-Reduce-sync-loads.patch +++ b/Spigot-Server-Patches/0376-Reduce-sync-loads.patch @@ -286,10 +286,10 @@ index 0000000000000000000000000000000000000000..1a68a8012f83bab9e814159c76b8c371 + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index edd901bb53385fa3d189a0057d57f98bf8b7115c..707db4febac59a4d09d6420ea2add469cf54c2ec 100644 +index 032464901e02392df4966c68cce8d06f2bd6b6f8..55feb186e4f3f7985efdf7c4410ed4232e52733e 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -471,6 +471,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -472,6 +472,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z); // Paper end @@ -298,10 +298,10 @@ index edd901bb53385fa3d189a0057d57f98bf8b7115c..707db4febac59a4d09d6420ea2add469 this.serverThreadQueue.awaitTasks(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 14ca9210e0501aff8e4559ddde9fd7d5db4c63c7..57f544eb6b2e3362b62e8541642bfc88419ab596 100644 +index 48d4b0314eb0934fdaa445800eceed481a662c63..ab5bf1ea0413cd947204794017b02a52cb601507 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1102,7 +1102,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1067,7 +1067,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 <= j; ++i1) { for (int j1 = k; j1 <= l; ++j1) { @@ -310,7 +310,7 @@ index 14ca9210e0501aff8e4559ddde9fd7d5db4c63c7..57f544eb6b2e3362b62e8541642bfc88 if (chunk != null) { chunk.a(entity, axisalignedbb, list, predicate); -@@ -1123,7 +1123,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1088,7 +1088,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -319,7 +319,7 @@ index 14ca9210e0501aff8e4559ddde9fd7d5db4c63c7..57f544eb6b2e3362b62e8541642bfc88 if (chunk != null) { chunk.a(entitytypes, axisalignedbb, list, predicate); -@@ -1146,7 +1146,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1111,7 +1111,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { for (int i1 = i; i1 < j; ++i1) { for (int j1 = k; j1 < l; ++j1) { @@ -329,10 +329,10 @@ index 14ca9210e0501aff8e4559ddde9fd7d5db4c63c7..57f544eb6b2e3362b62e8541642bfc88 if (chunk != null) { chunk.a(oclass, axisalignedbb, list, predicate); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 2c61b97ed1571f2032b29b142a839f012a0c2cac..89dd2695d829024aa3dc48eec5c7dcc114ce3d92 100644 +index 4a93341ebd6f6fabc8981b9769837dfe4304823b..fb81deb88d8a4b4616c5a4fd31977bd8eb78fa66 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -165,6 +165,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -166,6 +166,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { }; public final com.destroystokyo.paper.io.chunk.ChunkTaskManager asyncChunkTaskManager; // Paper end @@ -344,4 +344,4 @@ index 2c61b97ed1571f2032b29b142a839f012a0c2cac..89dd2695d829024aa3dc48eec5c7dcc1 + // Paper end // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { diff --git a/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch b/Spigot-Server-Patches/0377-Implement-alternative-item-despawn-rate.patch index 27424c79ad..b92c7e5fd0 100644 --- a/Spigot-Server-Patches/0380-Implement-alternative-item-despawn-rate.patch +++ b/Spigot-Server-Patches/0377-Implement-alternative-item-despawn-rate.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement alternative item-despawn-rate diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 822b738f48578b39f81bb8e38208dc3d26c2a221..ce0db77ccd24c3543c7894db4044bed03ea776d8 100644 +index b83abceb55fd6cc6bde3e34da098e9916e3a497b..8221a9f5af9207b0a984ba2555df0e7690ff50ad 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -1,10 +1,15 @@ @@ -24,7 +24,7 @@ index 822b738f48578b39f81bb8e38208dc3d26c2a221..ce0db77ccd24c3543c7894db4044bed0 import org.bukkit.configuration.file.YamlConfiguration; import org.spigotmc.SpigotWorldConfig; -@@ -509,4 +514,52 @@ public class PaperWorldConfig { +@@ -498,4 +503,52 @@ public class PaperWorldConfig { private void disableRelativeProjectileVelocity() { disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false); } @@ -78,7 +78,7 @@ index 822b738f48578b39f81bb8e38208dc3d26c2a221..ce0db77ccd24c3543c7894db4044bed0 + } } diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index 465550656356394074ebf4cc8d6188455daded88..f2626358d16e8f3d60633283322009e5afacd145 100644 +index 42f020be9c954e2c58896520c99be546f7b8531e..d8f55884a60df39b099ec71a97cbc69855f96ed7 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java @@ -6,6 +6,7 @@ import java.util.Objects; @@ -89,7 +89,7 @@ index 465550656356394074ebf4cc8d6188455daded88..f2626358d16e8f3d60633283322009e5 import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent; // CraftBukkit end -@@ -129,7 +130,7 @@ public class EntityItem extends Entity { +@@ -134,7 +135,7 @@ public class EntityItem extends Entity { } } @@ -98,7 +98,7 @@ index 465550656356394074ebf4cc8d6188455daded88..f2626358d16e8f3d60633283322009e5 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -153,7 +154,7 @@ public class EntityItem extends Entity { +@@ -158,7 +159,7 @@ public class EntityItem extends Entity { this.lastTick = MinecraftServer.currentTick; // CraftBukkit end @@ -107,7 +107,7 @@ index 465550656356394074ebf4cc8d6188455daded88..f2626358d16e8f3d60633283322009e5 // CraftBukkit start - fire ItemDespawnEvent if (org.bukkit.craftbukkit.event.CraftEventFactory.callItemDespawnEvent(this).isCancelled()) { this.age = 0; -@@ -497,9 +498,16 @@ public class EntityItem extends Entity { +@@ -507,9 +508,16 @@ public class EntityItem extends Entity { public void s() { this.o(); @@ -123,5 +123,5 @@ index 465550656356394074ebf4cc8d6188455daded88..f2626358d16e8f3d60633283322009e5 + // Paper end + @Override - public Packet<?> O() { + public Packet<?> P() { return new PacketPlayOutSpawnEntity(this); diff --git a/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch b/Spigot-Server-Patches/0378-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch index 36ac6d6a22..c8332cf31f 100644 --- a/Spigot-Server-Patches/0381-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch +++ b/Spigot-Server-Patches/0378-Do-less-work-if-we-have-a-custom-Bukkit-generator.patch @@ -7,32 +7,34 @@ If the Bukkit generator already has a spawn, use it immediately instead of spending time generating one that we won't use diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0633944364179ffb9b9fdd0400d82fd5b2ab3892..41c4b2df34faa95afdd2d35b0bac021d77c56884 100644 +index 4820030bbe1ad2f524011ffe5142abe6c7d28969..bdcbc2a05714c37fc034ddbfd0166efbeff1c4ac 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -512,11 +512,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -509,12 +509,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } else if (flag1) { - iworlddataserver.setSpawn(BlockPosition.ZERO.up()); + iworlddataserver.setSpawn(BlockPosition.ZERO.up(), 0.0F); } else { - WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager(); -- List<BiomeBase> list = worldchunkmanager.b(); - Random random = new Random(worldserver.getSeed()); -- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random); +- BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> { +- return biomebase.b().b(); +- }, random); - ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition); + // Paper start - moved down // CraftBukkit start if (worldserver.generator != null) { Random rand = new Random(worldserver.getSeed()); -@@ -532,6 +528,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -530,6 +525,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } } // CraftBukkit end + // Paper start - if the generator created a spawn for us, then there is no need for us to also create a spawn - + // only do it if the generator did not + WorldChunkManager worldchunkmanager = chunkgenerator.getWorldChunkManager(); -+ List<BiomeBase> list = worldchunkmanager.b(); + Random random = new Random(worldserver.getSeed()); -+ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, list, random); ++ BlockPosition blockposition = worldchunkmanager.a(0, worldserver.getSeaLevel(), 0, 256, (biomebase) -> { ++ return biomebase.b().b(); ++ }, random); + ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition); + // Paper end diff --git a/Spigot-Server-Patches/0382-Fix-MC-158900.patch b/Spigot-Server-Patches/0379-Fix-MC-158900.patch index 1f220caabb..174f5ee289 100644 --- a/Spigot-Server-Patches/0382-Fix-MC-158900.patch +++ b/Spigot-Server-Patches/0379-Fix-MC-158900.patch @@ -7,7 +7,7 @@ The problem was we were checking isExpired() on the entry, but if it was expired at that point, then it would be null. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 8a659688ddc608fafe19e452c55e69f132f05fca..0144e3ac2f0c09fe49b6cbc21799caf2352b85d0 100644 +index 531b64e96b30b4f5ae80ecc0b2fb3d656ca4ade9..978cda5490c9348fe02c1b1b90a1bb4988a3045b 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -531,8 +531,10 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0383-implement-optional-per-player-mob-spawns.patch b/Spigot-Server-Patches/0380-implement-optional-per-player-mob-spawns.patch index 61cc8afb20..e0154048cd 100644 --- a/Spigot-Server-Patches/0383-implement-optional-per-player-mob-spawns.patch +++ b/Spigot-Server-Patches/0380-implement-optional-per-player-mob-spawns.patch @@ -25,10 +25,10 @@ index a27dc38d1a29ed1d63d2f44b7984c2b65be487d9..96aaaab5b7685c874463505f9d25e8a0 poiUnload = Timings.ofSafe(name + "Chunk unload - POI"); chunkUnload = Timings.ofSafe(name + "Chunk unload - Chunk"); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index ce0db77ccd24c3543c7894db4044bed03ea776d8..edf4fa474d32ac20ff85cecfa9f03464a7ecf6ec 100644 +index 8221a9f5af9207b0a984ba2555df0e7690ff50ad..aaa7ff2c861005618f3b2ab8f960a5199fd678ce 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -562,4 +562,9 @@ public class PaperWorldConfig { +@@ -551,4 +551,9 @@ public class PaperWorldConfig { } } } @@ -545,14 +545,14 @@ index 0000000000000000000000000000000000000000..4f13d3ff8391793a99f067189f854078 + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 707db4febac59a4d09d6420ea2add469cf54c2ec..1597b7a882769109f467d81ecbadc45ff6779b7e 100644 +index 55feb186e4f3f7985efdf7c4410ed4232e52733e..dce9c62c0cf37a37994537b74dfdc2286c60fae2 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -744,7 +744,22 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -745,7 +745,22 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().enter("naturalSpawnCount"); this.world.timings.countNaturalMobs.startTiming(); // Paper - timings int l = this.chunkMapDistance.b(); -- SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.z(), this::a); +- SpawnerCreature.d spawnercreature_d = SpawnerCreature.a(l, this.world.A(), this::a); + // Paper start - per player mob spawning + SpawnerCreature.d spawnercreature_d; // moved down + if (this.playerChunkMap.playerMobDistanceMap != null) { @@ -564,19 +564,19 @@ index 707db4febac59a4d09d6420ea2add469cf54c2ec..1597b7a882769109f467d81ecbadc45f + for (EntityPlayer player : this.world.players) { + Arrays.fill(player.mobCounts, 0); + } -+ spawnercreature_d = SpawnerCreature.countMobs(l, this.world.z(), this::a, true); ++ spawnercreature_d = SpawnerCreature.countMobs(l, this.world.A(), this::a, true); + } else { -+ spawnercreature_d = SpawnerCreature.countMobs(l, this.world.z(), this::a, false); ++ spawnercreature_d = SpawnerCreature.countMobs(l, this.world.A(), this::a, false); + } + // Paper end this.world.timings.countNaturalMobs.stopTiming(); // Paper - timings this.p = spawnercreature_d; diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 2f0759ebc6f7adb3dc0856e19f856b406a21845e..8965141ab85df736e6adad6a3cf728864f582949 100644 +index 8f9f1bb7f30632edcba4feae414a11d795610e05..80d613e5b241bb27dd7d7d17f2d3570469d3315d 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -85,6 +85,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -87,6 +87,11 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; // Paper end @@ -588,7 +588,7 @@ index 2f0759ebc6f7adb3dc0856e19f856b406a21845e..8965141ab85df736e6adad6a3cf72886 // CraftBukkit start public String displayName; -@@ -120,6 +125,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -122,6 +127,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.displayName = this.getName(); this.canPickUpLoot = true; this.maxHealthCache = this.getMaxHealth(); @@ -596,31 +596,31 @@ index 2f0759ebc6f7adb3dc0856e19f856b406a21845e..8965141ab85df736e6adad6a3cf72886 } // Yes, this doesn't match Vanilla, but it's the best we can do for now. -@@ -1929,6 +1935,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1900,6 +1906,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } -+ public final SectionPosition getPlayerMapSection() { return this.N(); } // Paper - OBFHELPER - public SectionPosition N() { - return this.cq; ++ public final SectionPosition getPlayerMapSection() { return this.O(); } // Paper - OBFHELPER + public SectionPosition O() { + return this.cj; } diff --git a/src/main/java/net/minecraft/server/EntityTypes.java b/src/main/java/net/minecraft/server/EntityTypes.java -index b9fe08301409bc1f0d61a7566c26e720ff720d80..18a806ebbf092b904983691529ce5edf2da4e6db 100644 +index ffb8685e7c457483bcf4b2ed1065fec0fbaa69e2..2767de830bdb9051ae6a6b7c30342175b117e7ed 100644 --- a/src/main/java/net/minecraft/server/EntityTypes.java +++ b/src/main/java/net/minecraft/server/EntityTypes.java -@@ -265,6 +265,7 @@ public class EntityTypes<T extends Entity> { - return this.bk; +@@ -270,6 +270,7 @@ public class EntityTypes<T extends Entity> { + return this.bl; } + public final EnumCreatureType getEnumCreatureType() { return this.e(); } // Paper - OBFHELPER public EnumCreatureType e() { - return this.bf; + return this.bg; } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index cacf60563826da0219754a67500fdc239b13f0cd..f06c41d06f853b625dbd46822126810da3c3264a 100644 +index e7d9674e25c06090d57bba6c8229bc3b75cb67e6..70a291090f022ff7d79a75b94ac54b94ff6db751 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -80,7 +80,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -81,7 +81,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final Int2ObjectMap<PlayerChunkMap.EntityTracker> trackedEntities; private final Long2ByteMap z; private final Queue<Runnable> A; private final Queue<Runnable> getUnloadQueueTasks() { return this.A; } // Paper - OBFHELPER @@ -630,7 +630,7 @@ index cacf60563826da0219754a67500fdc239b13f0cd..f06c41d06f853b625dbd46822126810d // CraftBukkit start - recursion-safe executor for Chunk loadCallback() and unloadCallback() public final CallbackExecutor callbackExecutor = new CallbackExecutor(); -@@ -159,6 +160,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -160,6 +161,24 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.l = supplier; this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper this.setViewDistance(i); @@ -656,7 +656,7 @@ index cacf60563826da0219754a67500fdc239b13f0cd..f06c41d06f853b625dbd46822126810d private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java -index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51a9d2b649 100644 +index 99d4d6b4bdedcba7964ddc99467b8f8e5229b98a..beaea041dc47635411542fe9d06690809e03bf9e 100644 --- a/src/main/java/net/minecraft/server/SpawnerCreature.java +++ b/src/main/java/net/minecraft/server/SpawnerCreature.java @@ -29,6 +29,11 @@ public final class SpawnerCreature { @@ -671,7 +671,7 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 SpawnerCreatureProbabilities spawnercreatureprobabilities = new SpawnerCreatureProbabilities(); Object2IntOpenHashMap<EnumCreatureType> object2intopenhashmap = new Object2IntOpenHashMap(); Iterator iterator = iterable.iterator(); -@@ -67,6 +72,11 @@ public final class SpawnerCreature { +@@ -66,6 +71,11 @@ public final class SpawnerCreature { } object2intopenhashmap.addTo(enumcreaturetype, 1); @@ -683,7 +683,7 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 }); } } -@@ -125,13 +135,33 @@ public final class SpawnerCreature { +@@ -124,13 +134,33 @@ public final class SpawnerCreature { continue; } @@ -719,7 +719,7 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 } } -@@ -140,22 +170,34 @@ public final class SpawnerCreature { +@@ -139,22 +169,34 @@ public final class SpawnerCreature { } public static void a(EnumCreatureType enumcreaturetype, WorldServer worldserver, Chunk chunk, SpawnerCreature.c spawnercreature_c, SpawnerCreature.a spawnercreature_a) { @@ -756,15 +756,17 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 int k = 0; while (k < 3) { -@@ -195,13 +237,13 @@ public final class SpawnerCreature { +@@ -194,7 +236,7 @@ public final class SpawnerCreature { // Paper start - Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomebase_biomemeta, blockposition_mutableblockposition, d2); + Boolean doSpawning = a(worldserver, enumcreaturetype, structuremanager, chunkgenerator, biomesettingsmobs_c, blockposition_mutableblockposition, d2); if (doSpawning == null) { - return; + return j; // Paper } - if (doSpawning.booleanValue() && spawnercreature_c.test(biomebase_biomemeta.c, blockposition_mutableblockposition, ichunkaccess)) { // Paper end - EntityInsentient entityinsentient = a(worldserver, biomebase_biomemeta.c); + if (doSpawning && spawnercreature_c.test(biomesettingsmobs_c.c, blockposition_mutableblockposition, ichunkaccess)) { + // Paper end +@@ -202,7 +244,7 @@ public final class SpawnerCreature { + if (entityinsentient == null) { - return; @@ -772,10 +774,10 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 } entityinsentient.setPositionRotation(d0, (double) i, d1, worldserver.random.nextFloat() * 360.0F, 0.0F); -@@ -209,13 +251,18 @@ public final class SpawnerCreature { +@@ -210,13 +252,18 @@ public final class SpawnerCreature { groupdataentity = entityinsentient.prepare(worldserver, worldserver.getDamageScaler(entityinsentient.getChunkCoordinates()), EnumMobSpawn.NATURAL, groupdataentity, (NBTTagCompound) null); // CraftBukkit start - if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { + if (worldserver.addAllEntities(entityinsentient, SpawnReason.NATURAL)) { - ++j; + ++j; // Paper - force diff on name change - we expect this to be the total amount spawned ++k1; @@ -794,7 +796,7 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 } if (entityinsentient.c(k1)) { -@@ -237,6 +284,7 @@ public final class SpawnerCreature { +@@ -238,6 +285,7 @@ public final class SpawnerCreature { } } @@ -802,7 +804,7 @@ index 8130e14b5d6c3e8b0a1234668d5c855e82f3a5dc..0a25523f3ca5df483b7916364fa9fb51 } private static boolean a(WorldServer worldserver, IChunkAccess ichunkaccess, BlockPosition.MutableBlockPosition blockposition_mutableblockposition, double d0) { -@@ -476,8 +524,8 @@ public final class SpawnerCreature { +@@ -478,8 +526,8 @@ public final class SpawnerCreature { public static class d { diff --git a/Spigot-Server-Patches/0384-Prevent-consuming-the-wrong-itemstack.patch b/Spigot-Server-Patches/0381-Prevent-consuming-the-wrong-itemstack.patch index 7e0d9d79db..d26dbc6684 100644 --- a/Spigot-Server-Patches/0384-Prevent-consuming-the-wrong-itemstack.patch +++ b/Spigot-Server-Patches/0381-Prevent-consuming-the-wrong-itemstack.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Prevent consuming the wrong itemstack diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index a6f38a95b78ac43a2250f575a755e833d1baea33..0515587559a75e4afddbcac90f65d5d60156a527 100644 +index aecb5ca746be20e31f047a68f729d5c5a3699140..1de120fc11cdcd6ea38ab51a7d9c69b71a132507 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -3065,10 +3065,13 @@ public abstract class EntityLiving extends Entity { - this.datawatcher.set(EntityLiving.an, (byte) j); +@@ -3077,10 +3077,13 @@ public abstract class EntityLiving extends Entity { + this.datawatcher.set(EntityLiving.ag, (byte) j); } - public void c(EnumHand enumhand) { @@ -22,9 +22,9 @@ index a6f38a95b78ac43a2250f575a755e833d1baea33..0515587559a75e4afddbcac90f65d5d6 - if (!itemstack.isEmpty() && !this.isHandRaised()) { + if (!itemstack.isEmpty() && !this.isHandRaised() || forceUpdate) { // Paper use override flag this.activeItem = itemstack; - this.bk = itemstack.k(); + this.bd = itemstack.k(); if (!this.world.isClientSide) { -@@ -3144,6 +3147,7 @@ public abstract class EntityLiving extends Entity { +@@ -3158,6 +3161,7 @@ public abstract class EntityLiving extends Entity { this.releaseActiveItem(); } else { if (!this.activeItem.isEmpty() && this.isHandRaised()) { @@ -32,9 +32,9 @@ index a6f38a95b78ac43a2250f575a755e833d1baea33..0515587559a75e4afddbcac90f65d5d6 this.b(this.activeItem, 16); // CraftBukkit start - fire PlayerItemConsumeEvent ItemStack itemstack; -@@ -3174,8 +3178,8 @@ public abstract class EntityLiving extends Entity { - this.a(this.getRaisedHand(), itemstack); - // CraftBukkit end +@@ -3192,8 +3196,8 @@ public abstract class EntityLiving extends Entity { + } + this.clearActiveItem(); - // Paper start - if the replacement is anything but the default, update the client inventory - if (this instanceof EntityPlayer && !com.google.common.base.Objects.equal(defaultReplacement, itemstack)) { diff --git a/Spigot-Server-Patches/0386-Fix-nether-portal-creation.patch b/Spigot-Server-Patches/0382-Fix-nether-portal-creation.patch index fa2903fd89..fa2903fd89 100644 --- a/Spigot-Server-Patches/0386-Fix-nether-portal-creation.patch +++ b/Spigot-Server-Patches/0382-Fix-nether-portal-creation.patch diff --git a/Spigot-Server-Patches/0387-Generator-Settings.patch b/Spigot-Server-Patches/0383-Generator-Settings.patch index c60e196ea9..2d17b689bf 100644 --- a/Spigot-Server-Patches/0387-Generator-Settings.patch +++ b/Spigot-Server-Patches/0383-Generator-Settings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Generator Settings diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index edf4fa474d32ac20ff85cecfa9f03464a7ecf6ec..fde31f324b3578c65a7d064c466b80ee46b65e03 100644 +index aaa7ff2c861005618f3b2ab8f960a5199fd678ce..6a102f56316b50c1993890d225b0eb4d619452c1 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -567,4 +567,9 @@ public class PaperWorldConfig { +@@ -556,4 +556,9 @@ public class PaperWorldConfig { private void perPlayerMobSpawns() { perPlayerMobSpawns = getBoolean("per-player-mob-spawns", false); } @@ -19,21 +19,21 @@ index edf4fa474d32ac20ff85cecfa9f03464a7ecf6ec..fde31f324b3578c65a7d064c466b80ee + } } diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index bbd955160802fdb231cd8090d95f4e49f10d8495..733c6244e08f6b7277006c1ed801f2cfc8fc36e5 100644 +index 24befd3222e73cdd5853aac502a22387b1fdf81a..4741d28aec73ffa1d5a9f60a4086eac3375c83b1 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -@@ -370,8 +370,8 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { - BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); +@@ -374,8 +374,8 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { int i = ichunkaccess.getPos().d(); int j = ichunkaccess.getPos().e(); -- int k = this.h.f(); -- int l = this.x - 1 - this.h.e(); -+ int k = this.h.f(); final int floorHeight = k; // Paper -+ int l = this.x - 1 - this.h.e(); final int roofHeight = l; // Paper + GeneratorSettingBase generatorsettingbase = (GeneratorSettingBase) this.h.get(); +- int k = generatorsettingbase.f(); +- int l = this.x - 1 - generatorsettingbase.e(); ++ int k = generatorsettingbase.f(); final int floorHeight = k; // Paper ++ int l = this.x - 1 - generatorsettingbase.e(); final int roofHeight = l; // Paper boolean flag = true; boolean flag1 = l + 4 >= 0 && l < this.x; boolean flag2 = k + 4 >= 0 && k < this.x; -@@ -385,7 +385,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -389,7 +389,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { if (flag1) { for (i1 = 0; i1 < 5; ++i1) { @@ -42,7 +42,7 @@ index bbd955160802fdb231cd8090d95f4e49f10d8495..733c6244e08f6b7277006c1ed801f2cf ichunkaccess.setType(blockposition_mutableblockposition.d(blockposition.getX(), l - i1, blockposition.getZ()), Blocks.BEDROCK.getBlockData(), false); } } -@@ -393,7 +393,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -397,7 +397,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { if (flag2) { for (i1 = 4; i1 >= 0; --i1) { @@ -52,7 +52,7 @@ index bbd955160802fdb231cd8090d95f4e49f10d8495..733c6244e08f6b7277006c1ed801f2cf } } diff --git a/src/main/java/net/minecraft/server/IChunkAccess.java b/src/main/java/net/minecraft/server/IChunkAccess.java -index 3adb35b6abd0df9617e27e10fa3e0d365958ba42..930cd8106412b362650c77a69ea5f945043c92c7 100644 +index 887366f4c2ab608974113e75760b58c47f2afa00..180b6b58dc5663158db84b6f1257591439b48c31 100644 --- a/src/main/java/net/minecraft/server/IChunkAccess.java +++ b/src/main/java/net/minecraft/server/IChunkAccess.java @@ -12,6 +12,18 @@ import org.apache.logging.log4j.LogManager; @@ -75,7 +75,7 @@ index 3adb35b6abd0df9617e27e10fa3e0d365958ba42..930cd8106412b362650c77a69ea5f945 @Nullable IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag); diff --git a/src/main/java/net/minecraft/server/ProtoChunk.java b/src/main/java/net/minecraft/server/ProtoChunk.java -index a60b414cdf70096e667e776ab4fd36e411f8ff12..3b03c28ee5de1481e1f8088c0e4d388778155fad 100644 +index 912c5187a08e972fc9455aed33278387a83f03f2..5b0cd414ca1949ab53b289f7159f18da07d21f14 100644 --- a/src/main/java/net/minecraft/server/ProtoChunk.java +++ b/src/main/java/net/minecraft/server/ProtoChunk.java @@ -46,7 +46,7 @@ public class ProtoChunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/0388-Fix-MC-161754.patch b/Spigot-Server-Patches/0384-Fix-MC-161754.patch index bab48dada7..bdf800ee63 100644 --- a/Spigot-Server-Patches/0388-Fix-MC-161754.patch +++ b/Spigot-Server-Patches/0384-Fix-MC-161754.patch @@ -9,7 +9,7 @@ We can use an entity valid check since this method is invoked for each inventory iteraction (thanks to CB) and on player tick (vanilla). diff --git a/src/main/java/net/minecraft/server/ContainerHorse.java b/src/main/java/net/minecraft/server/ContainerHorse.java -index 82109f50778a3ac4bea43ef83b5442105a45664a..ebaf45be997d121e1974dc1f920dccbf11744cb3 100644 +index 62a9f7802f3800a24a886cb7f592c803d65d1b9d..0c85658ec6f8314eb0fb30b55bdbc20dc03aa981 100644 --- a/src/main/java/net/minecraft/server/ContainerHorse.java +++ b/src/main/java/net/minecraft/server/ContainerHorse.java @@ -76,7 +76,7 @@ public class ContainerHorse extends Container { diff --git a/Spigot-Server-Patches/0389-Performance-improvement-for-Chunk.getEntities.patch b/Spigot-Server-Patches/0385-Performance-improvement-for-Chunk.getEntities.patch index d166242db6..1a29e821a7 100644 --- a/Spigot-Server-Patches/0389-Performance-improvement-for-Chunk.getEntities.patch +++ b/Spigot-Server-Patches/0385-Performance-improvement-for-Chunk.getEntities.patch @@ -10,10 +10,10 @@ operation. This patch will reduce the load of plugins which for example implement custom moblimits and depend on Chunk.getEntities(). diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index cccb8f7b1c13811db7203282a5caad3da5b69a09..01bf7320b5cbc38e278ca907aa324ee3e945805e 100644 +index ddad3440d364ebe98f6fabf00e90766b4ea4a5c2..2a08a3170fcef666cb3096511d8a592e575c9734 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -113,14 +113,14 @@ public class CraftChunk implements Chunk { +@@ -114,14 +114,14 @@ public class CraftChunk implements Chunk { Entity[] entities = new Entity[count]; for (int i = 0; i < 16; i++) { diff --git a/Spigot-Server-Patches/0385-only-add-passanger-entities-once-from-spawners.patch b/Spigot-Server-Patches/0385-only-add-passanger-entities-once-from-spawners.patch deleted file mode 100644 index 223cc92211..0000000000 --- a/Spigot-Server-Patches/0385-only-add-passanger-entities-once-from-spawners.patch +++ /dev/null @@ -1,19 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: kickash32 <[email protected]> -Date: Wed, 21 Aug 2019 23:57:32 +0500 -Subject: [PATCH] only add passanger entities once from spawners - - -diff --git a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -index 1ceee84d724142c8a9e969ac1ceb567b2a334a41..17e5e1f191efd91b0797826cb96e5f230d622a0d 100644 ---- a/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -+++ b/src/main/java/net/minecraft/server/MobSpawnerAbstract.java -@@ -197,7 +197,7 @@ public abstract class MobSpawnerAbstract { - } - - private void a(Entity entity) { -- if (this.a().addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) { // CraftBukkit -+ if (entity.valid || this.a().addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER)) { // CraftBukkit // Paper - Iterator iterator = entity.getPassengers().iterator(); - - while (iterator.hasNext()) { diff --git a/Spigot-Server-Patches/0390-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch b/Spigot-Server-Patches/0386-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch index 95f57aab3e..fd97f9274a 100644 --- a/Spigot-Server-Patches/0390-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch +++ b/Spigot-Server-Patches/0386-Fix-spawning-of-hanging-entities-that-are-not-ItemFr.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix spawning of hanging entities that are not ItemFrames and diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 45999be11cbbd08155ea882b98380178efe514fb..97176c02e31540315d256b7e0636e7285092c59e 100644 +index 204ad44454732345be78c5c428dfb178344a96bb..20aeec95138a08accc4cb7b1f2d80d63bb9bf920 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -1870,7 +1870,12 @@ public class CraftWorld implements World { +@@ -1858,7 +1858,12 @@ public class CraftWorld implements World { height = 9; } diff --git a/Spigot-Server-Patches/0391-Expose-the-internal-current-tick.patch b/Spigot-Server-Patches/0387-Expose-the-internal-current-tick.patch index bbcce68227..017339393f 100644 --- a/Spigot-Server-Patches/0391-Expose-the-internal-current-tick.patch +++ b/Spigot-Server-Patches/0387-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 80ed8abb4e5b1d13a17ba7d87b628c23944bea92..4f9917af2ebb11266afe925daac154c8e2e9479b 100644 +index 0a67b6d56f7eb3ba488ae77dba624a56e9939caa..39e2246569f4c89ed0b5e8de1d738521732972ce 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2289,5 +2289,10 @@ public final class CraftServer implements Server { +@@ -2283,5 +2283,10 @@ public final class CraftServer implements Server { } return new com.destroystokyo.paper.profile.CraftPlayerProfile(uuid, name); } diff --git a/Spigot-Server-Patches/0392-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch b/Spigot-Server-Patches/0388-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch index f02237ae14..5a65daa3ac 100644 --- a/Spigot-Server-Patches/0392-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch +++ b/Spigot-Server-Patches/0388-Fix-stuck-in-sneak-when-changing-worlds-MC-10657.patch @@ -5,23 +5,23 @@ Subject: [PATCH] Fix stuck in sneak when changing worlds (MC-10657) diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 8965141ab85df736e6adad6a3cf728864f582949..4cdd2612b41f7fe16f307dfdc05350009df2cbca 100644 +index 80d613e5b241bb27dd7d7d17f2d3570469d3315d..e82d4b4ef55f981ea653e53424a5a8c746fa70d3 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -1016,6 +1016,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - this.lastHealthSent = -1.0F; - this.lastFoodSent = -1; +@@ -942,6 +942,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + this.lastHealthSent = -1.0F; + this.lastFoodSent = -1; + setSneaking(false); // Paper - fix MC-10657 + - // CraftBukkit start - PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); - this.world.getServer().getPluginManager().callEvent(changeEvent); + // CraftBukkit start + PlayerChangedWorldEvent changeEvent = new PlayerChangedWorldEvent(this.getBukkitEntity(), worldserver1.getWorld()); + this.world.getServer().getPluginManager().callEvent(changeEvent); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 0144e3ac2f0c09fe49b6cbc21799caf2352b85d0..15a12ebc266c54d2b29f368fc31df76b994b28ae 100644 +index 978cda5490c9348fe02c1b1b90a1bb4988a3045b..f9eee8a5a06b300e1fece26e6a001da6b169b965 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -759,6 +759,8 @@ public abstract class PlayerList { +@@ -771,6 +771,8 @@ public abstract class PlayerList { entityplayer.playerConnection.sendPacket(new PacketPlayOutEntityEffect(entityplayer.getId(), mobEffect)); } diff --git a/Spigot-Server-Patches/0393-Add-option-to-disable-pillager-patrols.patch b/Spigot-Server-Patches/0389-Add-option-to-disable-pillager-patrols.patch index a159a6c4e3..cfa2184bd4 100644 --- a/Spigot-Server-Patches/0393-Add-option-to-disable-pillager-patrols.patch +++ b/Spigot-Server-Patches/0389-Add-option-to-disable-pillager-patrols.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option to disable pillager patrols diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index fde31f324b3578c65a7d064c466b80ee46b65e03..c51a149fd9cd7f2d250f07a4ca0e7ce8c9b91383 100644 +index 6a102f56316b50c1993890d225b0eb4d619452c1..06ed45f35025a0ce16ff80fa4316d8da98ed3c6a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -572,4 +572,9 @@ public class PaperWorldConfig { +@@ -561,4 +561,9 @@ public class PaperWorldConfig { private void generatorSettings() { generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false); } @@ -19,7 +19,7 @@ index fde31f324b3578c65a7d064c466b80ee46b65e03..c51a149fd9cd7f2d250f07a4ca0e7ce8 + } } diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java -index e108f14b36b5459503e02146f8c11e5223d6bd61..b1fea06d29a0c98136496d6eff81e6959cb73672 100644 +index ec5c96112cedf418a9e7f7d245a4b007b56db953..7ed89bbe465402582c9d28f0a3935758a6b0f7af 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java @@ -10,6 +10,7 @@ public class MobSpawnerPatrol implements MobSpawner { diff --git a/Spigot-Server-Patches/0394-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch b/Spigot-Server-Patches/0390-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch index b6b217a2a1..578d629915 100644 --- a/Spigot-Server-Patches/0394-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch +++ b/Spigot-Server-Patches/0390-Fix-AssertionError-when-player-hand-set-to-empty-typ.patch @@ -7,10 +7,10 @@ Fixes an AssertionError when setting the player's item in hand to null or a new Fixes GH-2718 diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 0515587559a75e4afddbcac90f65d5d60156a527..f71ca4ee57d86c30d78c8292ced0531b963beabb 100644 +index 1de120fc11cdcd6ea38ab51a7d9c69b71a132507..56fe1bfd2a1eabc531087b9bd34848f5e960f19b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2037,6 +2037,7 @@ public abstract class EntityLiving extends Entity { +@@ -2038,6 +2038,7 @@ public abstract class EntityLiving extends Entity { return predicate.test(this.getItemInMainHand().getItem()) || predicate.test(this.getItemInOffHand().getItem()); } @@ -19,10 +19,10 @@ index 0515587559a75e4afddbcac90f65d5d60156a527..f71ca4ee57d86c30d78c8292ced0531b if (enumhand == EnumHand.MAIN_HAND) { return this.getEquipment(EnumItemSlot.MAINHAND); diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 092e49ae11ff735cf0179de8e0aaa73f7842e372..eb5231571884d1c828935b007d8fba3499bb68d2 100644 +index fc163511f6bb639c7934785ca34184df05cc019a..7c5c7e67dd8f1fdc726b2f2923f8d2e2bf864e6c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1478,6 +1478,10 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1472,6 +1472,10 @@ public class PlayerConnection implements PacketListenerPlayIn { this.player.getBukkitEntity().updateInventory(); // SPIGOT-2524 return; } diff --git a/Spigot-Server-Patches/0395-PlayerLaunchProjectileEvent.patch b/Spigot-Server-Patches/0391-PlayerLaunchProjectileEvent.patch index cf650d9db4..cf650d9db4 100644 --- a/Spigot-Server-Patches/0395-PlayerLaunchProjectileEvent.patch +++ b/Spigot-Server-Patches/0391-PlayerLaunchProjectileEvent.patch diff --git a/Spigot-Server-Patches/0396-Add-CraftMagicNumbers.isSupportedApiVersion.patch b/Spigot-Server-Patches/0392-Add-CraftMagicNumbers.isSupportedApiVersion.patch index 89e7e9fe82..c0221a9bb3 100644 --- a/Spigot-Server-Patches/0396-Add-CraftMagicNumbers.isSupportedApiVersion.patch +++ b/Spigot-Server-Patches/0392-Add-CraftMagicNumbers.isSupportedApiVersion.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add CraftMagicNumbers.isSupportedApiVersion() diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index 8b45f510bf24bb1f9503cb4dcef0e21b3634400c..d288d5fadbdb7cd4e5a42f94cdba6f825b2ed877 100644 +index 66925d9c3be206bb4fc4e88b247b099a2432b200..1f1766f9396ad8c5be9725c2145e0ce29d110a55 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -328,6 +328,11 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/Spigot-Server-Patches/0397-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch b/Spigot-Server-Patches/0393-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch index 74c0749370..bbb6cb4aa8 100644 --- a/Spigot-Server-Patches/0397-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch +++ b/Spigot-Server-Patches/0393-Prevent-sync-chunk-loads-when-villagers-try-to-find-.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent sync chunk loads when villagers try to find beds diff --git a/src/main/java/net/minecraft/server/BehaviorSleep.java b/src/main/java/net/minecraft/server/BehaviorSleep.java -index 77bbe246b225aab41fa193cf63286739118c05f4..615a06497588e07fa2b71194a5836ef6360bf0ca 100644 +index 98ea2478898643a5744760b2d2adfacfa0bd5956..aadc27ddebbcc00d19d3d87593f130cf309e10ef 100644 --- a/src/main/java/net/minecraft/server/BehaviorSleep.java +++ b/src/main/java/net/minecraft/server/BehaviorSleep.java -@@ -34,7 +34,8 @@ public class BehaviorSleep extends Behavior<EntityLiving> { +@@ -32,7 +32,8 @@ public class BehaviorSleep extends Behavior<EntityLiving> { } } diff --git a/Spigot-Server-Patches/0398-MC-145656-Fix-Follow-Range-Initial-Target.patch b/Spigot-Server-Patches/0394-MC-145656-Fix-Follow-Range-Initial-Target.patch index 524934062e..996e9fd991 100644 --- a/Spigot-Server-Patches/0398-MC-145656-Fix-Follow-Range-Initial-Target.patch +++ b/Spigot-Server-Patches/0394-MC-145656-Fix-Follow-Range-Initial-Target.patch @@ -5,10 +5,10 @@ Subject: [PATCH] MC-145656 Fix Follow Range Initial Target diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index c51a149fd9cd7f2d250f07a4ca0e7ce8c9b91383..f0a28d787e06ceae71034f757637b4c90b6f3c04 100644 +index 06ed45f35025a0ce16ff80fa4316d8da98ed3c6a..b94c8e33780e10e458951384ffc49bd7fb015a6b 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -577,4 +577,9 @@ public class PaperWorldConfig { +@@ -566,4 +566,9 @@ public class PaperWorldConfig { private void pillagerSettings() { disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols); } @@ -31,16 +31,16 @@ index 25a67f91e487d80d3996cc8b2544fece55059590..c0721c7fe479c8f753b8f48197a70dcd @Override diff --git a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java -index 42859f323ad5a300e0026e86371f5753ab3feab5..af09e1926fb6f3b780a5063b2e2e00da4cdc8ce6 100644 +index 174464273d1069ea07f12aaea116206366bad89f..253377c6238594de1f76cafcbf8223592e4d3f6b 100644 --- a/src/main/java/net/minecraft/server/PathfinderTargetCondition.java +++ b/src/main/java/net/minecraft/server/PathfinderTargetCondition.java @@ -80,7 +80,7 @@ public class PathfinderTargetCondition { if (this.b > 0.0D) { double d0 = this.g ? entityliving1.A(entityliving) : 1.0D; -- double d1 = this.b * d0; -+ double d1 = (useFollowRange ? getFollowRange(entityliving) : this.b) * d0; // Paper - double d2 = entityliving.g(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ()); +- double d1 = Math.max(this.b * d0, 2.0D); ++ double d1 = Math.max((useFollowRange ? getFollowRange(entityliving) : this.b) * d0, 2.0D); // Paper + double d2 = entityliving.h(entityliving1.locX(), entityliving1.locY(), entityliving1.locZ()); if (d2 > d1 * d1) { @@ -96,4 +96,18 @@ public class PathfinderTargetCondition { diff --git a/Spigot-Server-Patches/0399-Optimize-Hoppers.patch b/Spigot-Server-Patches/0395-Optimize-Hoppers.patch index b7851eecda..643fabeaf1 100644 --- a/Spigot-Server-Patches/0399-Optimize-Hoppers.patch +++ b/Spigot-Server-Patches/0395-Optimize-Hoppers.patch @@ -13,10 +13,10 @@ Subject: [PATCH] Optimize Hoppers * Remove Streams from Item Suck In and restore restore 1.12 AABB checks which is simpler and no voxel allocations (was doing TWO Item Suck ins) diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f0a28d787e06ceae71034f757637b4c90b6f3c04..9bd64034587217743157a81c04fc20751474e21d 100644 +index b94c8e33780e10e458951384ffc49bd7fb015a6b..d846c55de176879e94f6c0e5bf8f58910657fc75 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -582,4 +582,13 @@ public class PaperWorldConfig { +@@ -571,4 +571,13 @@ public class PaperWorldConfig { private void entitiesTargetWithFollowRange() { entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange); } @@ -31,7 +31,7 @@ index f0a28d787e06ceae71034f757637b4c90b6f3c04..9bd64034587217743157a81c04fc2075 + } } diff --git a/src/main/java/net/minecraft/server/IHopper.java b/src/main/java/net/minecraft/server/IHopper.java -index d891be4115f35c7b9685faa34ce90380e989fb18..54552d181912133577cd2c16c0d54e47d90f59d3 100644 +index b548ab8b7eb7e3c8a455f4653c30ea1610f268e8..187000f1e49f6609267b00f69fe2d266ea6b9255 100644 --- a/src/main/java/net/minecraft/server/IHopper.java +++ b/src/main/java/net/minecraft/server/IHopper.java @@ -12,12 +12,13 @@ public interface IHopper extends IInventory { @@ -53,7 +53,7 @@ index d891be4115f35c7b9685faa34ce90380e989fb18..54552d181912133577cd2c16c0d54e47 + double A(); default double getZ() { return this.A(); } // Paper - OBFHELPER } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index dea478d4790be0c0d6e14cd7673d161abfc46e08..d1e4ee64aa395b38cad22f316308c4687ea56b9f 100644 +index 63aa474c73f506737cb5de31977bffcd17d4dc11..b6703378e21a6cd7e140fd35756a20d47f49ed31 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -486,11 +486,12 @@ public final class ItemStack { @@ -73,10 +73,10 @@ index dea478d4790be0c0d6e14cd7673d161abfc46e08..d1e4ee64aa395b38cad22f316308c468 itemstack.d(this.D()); if (this.tag != null) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6e67b4e1afd1425a99de8b27a9072cde0bbedf69..529721fb2f7da134957e2fee437dc159d40d1747 100644 +index bdcbc2a05714c37fc034ddbfd0166efbeff1c4ac..9290d6c84e764bf691d9222723d73209a3d9ae2e 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1247,6 +1247,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1245,6 +1245,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas while (iterator.hasNext()) { WorldServer worldserver = (WorldServer) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper @@ -85,7 +85,7 @@ index 6e67b4e1afd1425a99de8b27a9072cde0bbedf69..529721fb2f7da134957e2fee437dc159 this.methodProfiler.a(() -> { return worldserver + " " + worldserver.getDimensionKey().a(); diff --git a/src/main/java/net/minecraft/server/TileEntity.java b/src/main/java/net/minecraft/server/TileEntity.java -index 2b06c95b4fac97513e706ef073fdd7418e1f092c..67fda8bd5a0ad6fea2df0066c61e006c8a49980c 100644 +index 6ccca984daa803ddf446a8f69aca0d86ee27fabc..e48fbf6280e107ab3a288f9099373df0fd6fccbd 100644 --- a/src/main/java/net/minecraft/server/TileEntity.java +++ b/src/main/java/net/minecraft/server/TileEntity.java @@ -62,6 +62,7 @@ public abstract class TileEntity implements KeyedObject { // Paper @@ -105,7 +105,7 @@ index 2b06c95b4fac97513e706ef073fdd7418e1f092c..67fda8bd5a0ad6fea2df0066c61e006c this.world.b(this.position, this); if (!this.c.isAir()) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java -index a0a3adac3e2bc939b1809c5587929f674f4318a5..20df9bd21d0e4d2579d05d79672da2eb26478044 100644 +index 4398f452c52182694c5e2c0945fe70ca32cb0dfd..d432de40eba2767f4ced4d9c642c9d2033acd0ea 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -168,6 +168,160 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi @@ -423,7 +423,7 @@ index a0a3adac3e2bc939b1809c5587929f674f4318a5..20df9bd21d0e4d2579d05d79672da2eb } public static List<EntityItem> c(IHopper ihopper) { -- return (List) ihopper.ac_().d().stream().flatMap((axisalignedbb) -> { +- return (List) ihopper.aa_().d().stream().flatMap((axisalignedbb) -> { - return ihopper.getWorld().a(EntityItem.class, axisalignedbb.d(ihopper.x() - 0.5D, ihopper.z() - 0.5D, ihopper.A() - 0.5D), IEntitySelector.a).stream(); - }).collect(Collectors.toList()); + // Paper start - Optimize item suck in. remove streams, restore 1.12 checks. Seriously checking the bowl?! @@ -459,7 +459,7 @@ index a0a3adac3e2bc939b1809c5587929f674f4318a5..20df9bd21d0e4d2579d05d79672da2eb if (!list.isEmpty()) { diff --git a/src/main/java/net/minecraft/server/TileEntityLootable.java b/src/main/java/net/minecraft/server/TileEntityLootable.java -index 006f8bace83ba1e540399b3f05952fa5edb0681f..badf8e136ec3e45870c29e154cd4a855546c7530 100644 +index c6e6c54a3eb5d725b71f2ec2bb27dd8e2aceabde..c79ebe2343cc14f113c0cc6496c20e7d7bf6fd32 100644 --- a/src/main/java/net/minecraft/server/TileEntityLootable.java +++ b/src/main/java/net/minecraft/server/TileEntityLootable.java @@ -77,12 +77,19 @@ public abstract class TileEntityLootable extends TileEntityContainer { @@ -485,10 +485,10 @@ index 006f8bace83ba1e540399b3f05952fa5edb0681f..badf8e136ec3e45870c29e154cd4a855 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 57f544eb6b2e3362b62e8541642bfc88419ab596..325d7a313cfab72978f5c8fada1af6f19cdab239 100644 +index ab5bf1ea0413cd947204794017b02a52cb601507..3db488d602dde2ba5dcd324ad38b19edd24e9285 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1134,8 +1134,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -1099,8 +1099,8 @@ public abstract class World implements GeneratorAccess, AutoCloseable { return list; } diff --git a/Spigot-Server-Patches/0400-PlayerDeathEvent-shouldDropExperience.patch b/Spigot-Server-Patches/0396-PlayerDeathEvent-shouldDropExperience.patch index 86c2ddce64..e98fc8e6ce 100644 --- a/Spigot-Server-Patches/0400-PlayerDeathEvent-shouldDropExperience.patch +++ b/Spigot-Server-Patches/0396-PlayerDeathEvent-shouldDropExperience.patch @@ -5,11 +5,11 @@ Subject: [PATCH] PlayerDeathEvent#shouldDropExperience diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 4cdd2612b41f7fe16f307dfdc05350009df2cbca..b74a31904f0fedbff0534dd90e189c05282258b8 100644 +index e82d4b4ef55f981ea653e53424a5a8c746fa70d3..04e402275de6797dcd25d2497faf6a258dc26112 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -688,7 +688,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { - this.eW(); +@@ -692,7 +692,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + this.eV(); } // SPIGOT-5478 must be called manually now - this.dropExperience(); diff --git a/Spigot-Server-Patches/0401-Prevent-bees-loading-chunks-checking-hive-position.patch b/Spigot-Server-Patches/0397-Prevent-bees-loading-chunks-checking-hive-position.patch index 8ff6e16636..888eb61195 100644 --- a/Spigot-Server-Patches/0401-Prevent-bees-loading-chunks-checking-hive-position.patch +++ b/Spigot-Server-Patches/0397-Prevent-bees-loading-chunks-checking-hive-position.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Prevent bees loading chunks checking hive position diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index 5cc0a9284ef635aa6cb6f4803c0776cdbbf515a8..dcfd2ea5024be6d4a001fa7437092a7831b36fa7 100644 +index 20cd37c1d5a069a35b586ec57c8d8e6e3859fbf2..5ccb537a7560b585a4f6e1c513b8b173ac521032 100644 --- a/src/main/java/net/minecraft/server/EntityBee.java +++ b/src/main/java/net/minecraft/server/EntityBee.java @@ -368,6 +368,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB diff --git a/Spigot-Server-Patches/0402-Don-t-load-Chunks-from-Hoppers-and-other-things.patch b/Spigot-Server-Patches/0398-Don-t-load-Chunks-from-Hoppers-and-other-things.patch index 83a4f9a58f..83a4f9a58f 100644 --- a/Spigot-Server-Patches/0402-Don-t-load-Chunks-from-Hoppers-and-other-things.patch +++ b/Spigot-Server-Patches/0398-Don-t-load-Chunks-from-Hoppers-and-other-things.patch diff --git a/Spigot-Server-Patches/0403-Guard-against-serializing-mismatching-chunk-coordina.patch b/Spigot-Server-Patches/0399-Guard-against-serializing-mismatching-chunk-coordina.patch index bcb1842884..0d1282ca12 100644 --- a/Spigot-Server-Patches/0403-Guard-against-serializing-mismatching-chunk-coordina.patch +++ b/Spigot-Server-Patches/0399-Guard-against-serializing-mismatching-chunk-coordina.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Guard against serializing mismatching chunk coordinate Should help if something dumb happens diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 4d6e8f987233ca6c5f53d004031c022bb2d43e1e..5b196201c0e35895a04e2a542ef7c753d0c469e1 100644 +index 61aef3c14dff6bda603175883f9cb1b9a2c82428..937bd0daf84f6b5f382dea73e20f2fd6ad903000 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -24,6 +24,13 @@ public class ChunkRegionLoader { diff --git a/Spigot-Server-Patches/0404-Optimise-IEntityAccess-getPlayerByUUID.patch b/Spigot-Server-Patches/0400-Optimise-IEntityAccess-getPlayerByUUID.patch index 17be8ce539..ee63a0f5ae 100644 --- a/Spigot-Server-Patches/0404-Optimise-IEntityAccess-getPlayerByUUID.patch +++ b/Spigot-Server-Patches/0400-Optimise-IEntityAccess-getPlayerByUUID.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise IEntityAccess#getPlayerByUUID Use the world entity map instead of iterating over all players diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 48e8b005bd9589135eff03a110ecce8776ab208a..74d4c28246e7db850e6d993e07a84b2a6ca24ce2 100644 +index b6cf294e785b36b8bc800f26dbb8cfcb2119eae1..1cb8ba7cd28cdb8a660c2d78d35e86cd5cf08a8f 100644 --- a/src/main/java/net/minecraft/server/IEntityAccess.java +++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -235,6 +235,12 @@ public interface IEntityAccess { +@@ -243,6 +243,12 @@ public interface IEntityAccess { @Nullable default EntityHuman b(UUID uuid) { @@ -23,10 +23,10 @@ index 48e8b005bd9589135eff03a110ecce8776ab208a..74d4c28246e7db850e6d993e07a84b2a EntityHuman entityhuman = (EntityHuman) this.getPlayers().get(i); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 89dd2695d829024aa3dc48eec5c7dcc114ce3d92..54423fd1133b313d3d2e7550f03e660b9ab6db99 100644 +index fb81deb88d8a4b4616c5a4fd31977bd8eb78fa66..026818ce2c69ffe0399cb1aa5391fa896720c36b 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -172,6 +172,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -173,6 +173,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end @@ -40,5 +40,5 @@ index 89dd2695d829024aa3dc48eec5c7dcc114ce3d92..54423fd1133b313d3d2e7550f03e660b + // Paper end + // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { - super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor diff --git a/Spigot-Server-Patches/0405-Fix-items-not-falling-correctly.patch b/Spigot-Server-Patches/0401-Fix-items-not-falling-correctly.patch index e8f474c064..87fbda3115 100644 --- a/Spigot-Server-Patches/0405-Fix-items-not-falling-correctly.patch +++ b/Spigot-Server-Patches/0401-Fix-items-not-falling-correctly.patch @@ -15,15 +15,15 @@ This patch resolves the conflict by offsetting checking an item's move method from Spigot's entity activation range check. diff --git a/src/main/java/net/minecraft/server/EntityItem.java b/src/main/java/net/minecraft/server/EntityItem.java -index f2626358d16e8f3d60633283322009e5afacd145..a7860cb4ded3e9f949e6e1a7a2afacd738da756e 100644 +index d8f55884a60df39b099ec71a97cbc69855f96ed7..cfb31c412cc6507c31e4de11592e95ea54bbc4d6 100644 --- a/src/main/java/net/minecraft/server/EntityItem.java +++ b/src/main/java/net/minecraft/server/EntityItem.java -@@ -88,7 +88,7 @@ public class EntityItem extends Entity { +@@ -89,7 +89,7 @@ public class EntityItem extends Entity { } } -- if (!this.onGround || b(this.getMot()) > 9.999999747378752E-6D || (this.ticksLived + this.getId()) % 4 == 0) { -+ if (!this.onGround || b(this.getMot()) > 9.999999747378752E-6D || this.ticksLived % 4 == 3) { // Paper - Ensure checking item movement is always offset from Spigot's entity activation range check +- if (!this.onGround || c(this.getMot()) > 9.999999747378752E-6D || (this.ticksLived + this.getId()) % 4 == 0) { ++ if (!this.onGround || c(this.getMot()) > 9.999999747378752E-6D || this.ticksLived % 4 == 0) { // Paper - Ensure checking item movement is always offset from Spigot's entity activation range check this.move(EnumMoveType.SELF, this.getMot()); - float f = 0.98F; + float f1 = 0.98F; diff --git a/Spigot-Server-Patches/0406-Lag-compensate-eating.patch b/Spigot-Server-Patches/0402-Lag-compensate-eating.patch index 61bc5556dd..170408738a 100644 --- a/Spigot-Server-Patches/0406-Lag-compensate-eating.patch +++ b/Spigot-Server-Patches/0402-Lag-compensate-eating.patch @@ -7,20 +7,20 @@ When the server is lagging, players will wait longer when eating. Change to also use a time check instead if it passes. diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index f71ca4ee57d86c30d78c8292ced0531b963beabb..fd8b3d05238329adf3f638b1e04fd95c08e0a74a 100644 +index 56fe1bfd2a1eabc531087b9bd34848f5e960f19b..228edf1beb04649ddca0726d90f41ce5506c253b 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -119,7 +119,7 @@ public abstract class EntityLiving extends Entity { private int jumpTicks; - private float bD; + private float bw; public ItemStack activeItem; // Paper - public -- protected int bk; -+ protected int bk; protected final int getEatTimeTicks() { return this.bk; } protected final void setEatTimeTicks(int value) { this.bk = value; } // Paper - OBFHELPER - protected int bl; - private BlockPosition bE; - private Optional<BlockPosition> bF; -@@ -3015,6 +3015,11 @@ public abstract class EntityLiving extends Entity { - return ((Byte) this.datawatcher.get(EntityLiving.an) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND; +- protected int bd; ++ protected int bd; protected final int getEatTimeTicks() { return this.bd; } protected final void setEatTimeTicks(int value) { this.bd = value; } // Paper - OBFHELPER + protected int be; + private BlockPosition bx; + private Optional<BlockPosition> by; +@@ -3027,6 +3027,11 @@ public abstract class EntityLiving extends Entity { + return ((Byte) this.datawatcher.get(EntityLiving.ag) & 2) > 0 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND; } + // Paper start - lag compensate eating @@ -28,55 +28,54 @@ index f71ca4ee57d86c30d78c8292ced0531b963beabb..fd8b3d05238329adf3f638b1e04fd95c + protected int totalEatTimeTicks; + // Paper end + - private void u() { + private void t() { if (this.isHandRaised()) { if (ItemStack.d(this.b(this.getRaisedHand()), this.activeItem)) { -@@ -3024,7 +3029,13 @@ public abstract class EntityLiving extends Entity { +@@ -3036,7 +3041,12 @@ public abstract class EntityLiving extends Entity { this.b(this.activeItem, 5); } -- if (--this.bk == 0 && !this.world.isClientSide && !this.activeItem.m()) { +- if (--this.bd == 0 && !this.world.isClientSide && !this.activeItem.m()) { + // Paper start - lag compensate eating + // we add 1 to the expected time to avoid lag compensating when we should not -+ boolean shouldLagCompensate -+ = this.activeItem.getItem().isFood() && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1 + this.totalEatTimeTicks) * 50 * (1000 * 1000)); -+ if ((--this.bk == 0 || shouldLagCompensate) && !this.world.isClientSide && !this.activeItem.m()) { ++ boolean shouldLagCompensate = this.activeItem.getItem().isFood() && this.eatStartTime != -1 && (System.nanoTime() - this.eatStartTime) > ((1 + this.totalEatTimeTicks) * 50 * (1000 * 1000)); ++ if ((--this.bd == 0 || shouldLagCompensate) && !this.world.isClientSide && !this.activeItem.m()) { + this.setEatTimeTicks(0); + // Paper end this.s(); } } else { -@@ -3074,7 +3085,10 @@ public abstract class EntityLiving extends Entity { +@@ -3086,7 +3096,10 @@ public abstract class EntityLiving extends Entity { if (!itemstack.isEmpty() && !this.isHandRaised() || forceUpdate) { // Paper use override flag this.activeItem = itemstack; -- this.bk = itemstack.k(); +- this.bd = itemstack.k(); + // Paper start - lag compensate eating -+ this.bk = this.totalEatTimeTicks = itemstack.k(); ++ this.bd = this.totalEatTimeTicks = itemstack.k(); + this.eatStartTime = System.nanoTime(); + // Paper end if (!this.world.isClientSide) { this.c(1, true); this.c(2, enumhand == EnumHand.OFF_HAND); -@@ -3098,7 +3112,10 @@ public abstract class EntityLiving extends Entity { +@@ -3110,7 +3123,10 @@ public abstract class EntityLiving extends Entity { } } else if (!this.isHandRaised() && !this.activeItem.isEmpty()) { this.activeItem = ItemStack.b; -- this.bk = 0; +- this.bd = 0; + // Paper start - lag compensate eating -+ this.bk = this.totalEatTimeTicks = 0; ++ this.bd = this.totalEatTimeTicks = 0; + this.eatStartTime = -1L; + // Paper end } } -@@ -3220,7 +3237,10 @@ public abstract class EntityLiving extends Entity { +@@ -3238,7 +3254,10 @@ public abstract class EntityLiving extends Entity { } this.activeItem = ItemStack.b; -- this.bk = 0; +- this.bd = 0; + // Paper start - lag compensate eating -+ this.bk = this.totalEatTimeTicks = 0; ++ this.bd = this.totalEatTimeTicks = 0; + this.eatStartTime = -1L; + // Paper end } diff --git a/Spigot-Server-Patches/0407-Optimize-call-to-getFluid-for-explosions.patch b/Spigot-Server-Patches/0403-Optimize-call-to-getFluid-for-explosions.patch index 46956819e7..7b75139061 100644 --- a/Spigot-Server-Patches/0407-Optimize-call-to-getFluid-for-explosions.patch +++ b/Spigot-Server-Patches/0403-Optimize-call-to-getFluid-for-explosions.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Optimize call to getFluid for explosions diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 1b738260fb06446713ceab159eb7fa3df70fb611..22a19e761fdec68cc9405988b977021a8b6398eb 100644 +index 7b6c3a667ea67b25f9f12d4049dfc51b1c9fb69d..005ab6dd65b9c50cb07048a69613e425a369b69f 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -124,7 +124,7 @@ public class Explosion { +@@ -125,7 +125,7 @@ public class Explosion { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { BlockPosition blockposition = new BlockPosition(d4, d5, d6); IBlockData iblockdata = this.world.getType(blockposition); - Fluid fluid = this.world.getFluid(blockposition); + Fluid fluid = iblockdata.getFluid(); // Paper - Optional<Float> optional = this.k.a(this, this.world, blockposition, iblockdata, fluid); + Optional<Float> optional = this.l.a(this, this.world, blockposition, iblockdata, fluid); if (optional.isPresent()) { diff --git a/Spigot-Server-Patches/0408-Fix-last-firework-in-stack-not-having-effects-when-d.patch b/Spigot-Server-Patches/0404-Fix-last-firework-in-stack-not-having-effects-when-d.patch index 9c065ec6c5..83028d184d 100644 --- a/Spigot-Server-Patches/0408-Fix-last-firework-in-stack-not-having-effects-when-d.patch +++ b/Spigot-Server-Patches/0404-Fix-last-firework-in-stack-not-having-effects-when-d.patch @@ -9,7 +9,7 @@ dispensed. The resulting item would have size == 0 and therefore be convertered to air, hence why the effects disappeared. diff --git a/src/main/java/net/minecraft/server/IDispenseBehavior.java b/src/main/java/net/minecraft/server/IDispenseBehavior.java -index 5432c24919bb5c32ca1eec4c9861ad127f72a60a..660f44975a003ea68ddad59899618485fdaf5487 100644 +index ce7ab95c95eba7f1c49096a88d9a1b2110ae473b..7b8a470d97ccf0fdcdb8eef9368195486e09913b 100644 --- a/src/main/java/net/minecraft/server/IDispenseBehavior.java +++ b/src/main/java/net/minecraft/server/IDispenseBehavior.java @@ -352,7 +352,7 @@ public interface IDispenseBehavior { diff --git a/Spigot-Server-Patches/0410-Add-effect-to-block-break-naturally.patch b/Spigot-Server-Patches/0405-Add-effect-to-block-break-naturally.patch index 712d4676d1..0a9e0954cc 100644 --- a/Spigot-Server-Patches/0410-Add-effect-to-block-break-naturally.patch +++ b/Spigot-Server-Patches/0405-Add-effect-to-block-break-naturally.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add effect to block break naturally diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index bda3e17ae7a5de98ef94f37307df302fefa3675f..9b0e868f006a34b47ef9a48c7ea844be8122c291 100644 +index 1730a33fe7a10960b0d0c5f3905f38b995931213..733f2430d461c66735a529a6b1a1a2e58ab1dd85 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -@@ -620,6 +620,13 @@ public class CraftBlock implements Block { +@@ -628,6 +628,13 @@ public class CraftBlock implements Block { @Override public boolean breakNaturally(ItemStack item) { @@ -22,9 +22,9 @@ index bda3e17ae7a5de98ef94f37307df302fefa3675f..9b0e868f006a34b47ef9a48c7ea844be // Order matters here, need to drop before setting to air so skulls can get their data net.minecraft.server.IBlockData iblockdata = this.getNMS(); net.minecraft.server.Block block = iblockdata.getBlock(); -@@ -629,6 +636,7 @@ public class CraftBlock implements Block { +@@ -637,6 +644,7 @@ public class CraftBlock implements Block { // Modelled off EntityHuman#hasBlock - if (block != Blocks.AIR && (item == null || !iblockdata.isAlwaysDestroyable() || nmsItem.canDestroySpecialBlock(iblockdata))) { + if (block != Blocks.AIR && (item == null || !iblockdata.isRequiresSpecialTool() || nmsItem.canDestroySpecialBlock(iblockdata))) { net.minecraft.server.Block.dropItems(iblockdata, world.getMinecraftWorld(), position, world.getTileEntity(position), null, nmsItem); + if (triggerEffect) world.triggerEffect(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.server.Block.getCombinedId(block.getBlockData())); // Paper result = true; diff --git a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch b/Spigot-Server-Patches/0406-Tracking-Range-Improvements.patch index fcb91a24ba..f78514e775 100644 --- a/Spigot-Server-Patches/0411-Tracking-Range-Improvements.patch +++ b/Spigot-Server-Patches/0406-Tracking-Range-Improvements.patch @@ -8,10 +8,10 @@ Sets tracking range of watermobs to animals instead of misc and simplifies code Also ignores Enderdragon, defaulting it to Mojang's setting diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 16c501d5bb5bcf045ded81f61c738ce7a504c591..2542b24b0e1919fdc28417df718acd766deefd03 100644 +index 70a291090f022ff7d79a75b94ac54b94ff6db751..512940ef8608d28c83a4a8d0777a99ebf25b4e8b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1738,6 +1738,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1739,6 +1739,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); int j = entity.getEntityType().getChunkRange() * 16; diff --git a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch b/Spigot-Server-Patches/0407-Entity-Activation-Range-2.0.patch index de9d60cbcf..db2f0a1e5d 100644 --- a/Spigot-Server-Patches/0409-Entity-Activation-Range-2.0.patch +++ b/Spigot-Server-Patches/0407-Entity-Activation-Range-2.0.patch @@ -14,19 +14,19 @@ Adds flying monsters to control ghast and phantoms Adds villagers as separate config diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 668b720f17760de7d893bcdd95661f13601fcbd3..2f224c29b25a480608a4da558706a285a223c667 100644 +index 7d679c8651bca6041e330abc8b17102175ff5f7b..c844ee21d09eedee8c7e202afe4add0c84b8e11c 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -166,7 +166,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - public boolean ac; +@@ -165,7 +165,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + public boolean Y; public boolean impulse; public int portalCooldown; -- protected boolean inPortal; public final boolean inPortal() { return this.inPortal; } // Paper - OBFHELPER +- protected boolean inPortal; + public boolean inPortal; // Paper - public protected int portalTicks; - protected BlockPosition ah; - protected Vec3D ai; -@@ -192,6 +192,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + protected BlockPosition ac; + private boolean invulnerable; +@@ -189,6 +189,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; public long activatedTick = Integer.MIN_VALUE; @@ -34,15 +34,15 @@ index 668b720f17760de7d893bcdd95661f13601fcbd3..2f224c29b25a480608a4da558706a285 public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one protected int numCollisions = 0; // Paper public void inactiveTick() { } -@@ -575,6 +576,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -578,6 +579,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.recalcPosition(); } else { if (enummovetype == EnumMoveType.PISTON) { + this.activatedTick = MinecraftServer.currentTick + 20; // Paper - vec3d = this.a(vec3d); + vec3d = this.b(vec3d); if (vec3d.equals(Vec3D.a)) { return; -@@ -587,6 +589,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -590,6 +592,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke this.x = Vec3D.a; this.setMot(Vec3D.a); } @@ -55,9 +55,9 @@ index 668b720f17760de7d893bcdd95661f13601fcbd3..2f224c29b25a480608a4da558706a285 + // Paper end vec3d = this.a(vec3d, enummovetype); - Vec3D vec3d1 = this.f(vec3d); -@@ -2700,6 +2709,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return this.al; + Vec3D vec3d1 = this.g(vec3d); +@@ -2708,6 +2717,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return this.ae; } + public final boolean isPushedByWater() { return this.bU(); } // Paper - OBFHELPER - the below is not an obfhelper, don't use it! @@ -65,7 +65,7 @@ index 668b720f17760de7d893bcdd95661f13601fcbd3..2f224c29b25a480608a4da558706a285 // Paper start return this.pushedByWater(); diff --git a/src/main/java/net/minecraft/server/EntityCreature.java b/src/main/java/net/minecraft/server/EntityCreature.java -index c94197a50269622e8995685119bac984c45e6833..11d384729326af693a9a679195acbd594227466a 100644 +index 68f1a101174f4a2f7ab5556a5b733f75f3a7802f..4757e5a92c9cf04fa52d62bac6dae782e08ddab1 100644 --- a/src/main/java/net/minecraft/server/EntityCreature.java +++ b/src/main/java/net/minecraft/server/EntityCreature.java @@ -7,6 +7,7 @@ import org.bukkit.event.entity.EntityUnleashEvent; @@ -77,7 +77,7 @@ index c94197a50269622e8995685119bac984c45e6833..11d384729326af693a9a679195acbd59 protected EntityCreature(EntityTypes<? extends EntityCreature> entitytypes, World world) { super(entitytypes, world); diff --git a/src/main/java/net/minecraft/server/EntityInsentient.java b/src/main/java/net/minecraft/server/EntityInsentient.java -index e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34..a5c9526499c64dd8e4c760c322c0ab6a14a19087 100644 +index 6279f00bc8ca0334d34305590b8eed0637ccdf46..36df27024c0486a1c3c9d72f366d689a94b89749 100644 --- a/src/main/java/net/minecraft/server/EntityInsentient.java +++ b/src/main/java/net/minecraft/server/EntityInsentient.java @@ -47,7 +47,7 @@ public abstract class EntityInsentient extends EntityLiving { @@ -86,9 +86,9 @@ index e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34..a5c9526499c64dd8e4c760c322c0ab6a @Nullable - private Entity leashHolder; + public Entity leashHolder; // Paper - private -> public - private int bE; + private int bx; @Nullable - private NBTTagCompound bF; + private NBTTagCompound by; @@ -128,6 +128,17 @@ public abstract class EntityInsentient extends EntityLiving { return this.lookController; } @@ -108,35 +108,35 @@ index e0ecdb8f87ec82b97a056c8f6d91d6a86f37bd34..a5c9526499c64dd8e4c760c322c0ab6a if (this.isPassenger() && this.getVehicle() instanceof EntityInsentient) { EntityInsentient entityinsentient = (EntityInsentient) this.getVehicle(); diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index fd8b3d05238329adf3f638b1e04fd95c08e0a74a..9746346d6b9c432710f229f5355e4540c308ffb4 100644 +index 228edf1beb04649ddca0726d90f41ce5506c253b..fede5e527a6f19243a25567e378ceebf79e118d6 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -97,7 +97,7 @@ public abstract class EntityLiving extends Entity { - protected float aU; - protected int aV; protected int getKillCount() { return this.aV; } // Paper - OBFHELPER + protected float aN; + protected int aO;protected int getKillCount() { return this.aO; } // Paper - OBFHELPER public float lastDamage; - protected boolean jumping; + public boolean jumping; // Paper protected -> public - public float aY; - public float aZ; - public float ba; + public float aR; + public float aS; + public float aT; diff --git a/src/main/java/net/minecraft/server/EntityLlama.java b/src/main/java/net/minecraft/server/EntityLlama.java -index 7ce3421696fbfc5a445f879dfd55a3055502a933..4fe769c761949c40bbb923cde5dfe1709843921f 100644 +index 4248fbf021c8c99060a7cb3ca2ea1588c124e937..d4175f2dad57b19a2420ee4c2d1343aaf2d2740e 100644 --- a/src/main/java/net/minecraft/server/EntityLlama.java +++ b/src/main/java/net/minecraft/server/EntityLlama.java @@ -404,6 +404,7 @@ public class EntityLlama extends EntityHorseChestedAbstract implements IRangedEn - return this.bJ != null; + return this.bC != null; } -+ public final boolean inCaravan() { return this.fD(); } // Paper - OBFHELPER - public boolean fD() { - return this.bI != null; ++ public final boolean inCaravan() { return this.fC(); } // Paper - OBFHELPER + public boolean fC() { + return this.bB != null; } diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index a23c8d54a30a1ed1a3ed4d158da08229f59ca4c5..8d3811ead268635c4b728f5c9b8dd6c9b8ec6124 100644 +index ea7fff8ff9922e038f71e887072c567cded10973..3db74ab8d722b38bcae008ea2e02778fbac31471 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -144,18 +144,29 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -144,17 +144,29 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation @Override public void inactiveTick() { // SPIGOT-3874, SPIGOT-3894, SPIGOT-3846, SPIGOT-5286 :( @@ -166,55 +166,54 @@ index a23c8d54a30a1ed1a3ed4d158da08229f59ca4c5..8d3811ead268635c4b728f5c9b8dd6c9 + protected void mobTick(boolean inactive) { this.world.getMethodProfiler().enter("villagerBrain"); - this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error -- this.world.getMethodProfiler().exit(); + if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper - if (this.bM) { - this.bM = false; - } -@@ -178,7 +189,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - this.bC = null; + this.world.getMethodProfiler().exit(); + if (this.bF) { + this.bF = false; +@@ -178,7 +190,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + this.bv = null; } - if (!this.isNoAI() && this.random.nextInt(100) == 0) { + if (!inactive && !this.isNoAI() && this.random.nextInt(100) == 0) { // Paper - Raid raid = ((WorldServer) this.world).c_(this.getChunkCoordinates()); + Raid raid = ((WorldServer) this.world).b_(this.getChunkCoordinates()); if (raid != null && raid.v() && !raid.a()) { -@@ -189,6 +200,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.eO()) { +@@ -189,6 +201,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + if (this.getVillagerData().getProfession() == VillagerProfession.NONE && this.eN()) { this.eT(); } + if (inactive) return; // Paper super.mobTick(); } -@@ -820,6 +832,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation +@@ -825,6 +838,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation } } -+ private void doReputationTick() { fv(); } // Paper - OBFHELPER - private void fv() { ++ private void doReputationTick() { fw(); } // Paper - OBFHELPER + private void fw() { long i = this.world.getTime(); diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java -index b2ea467f26f78d3239062c6c3b9741b87489713e..81823b5d5ef17479583fda0121c95091175fdf1e 100644 +index 8b6b5d921443d07bfb3bbccb2a549d5386006edb..68fd780bc76ecf3c463f38c137fd8d4f036cdcbd 100644 --- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java +++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java -@@ -45,10 +45,12 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP - return super.prepare(generatoraccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); +@@ -44,10 +44,12 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP + return super.prepare(worldaccess, difficultydamagescaler, enummobspawn, (GroupDataEntity) groupdataentity, nbttagcompound); } -+ public final int getUnhappy() { return eL(); } // Paper - OBFHELPER - public int eL() { - return (Integer) this.datawatcher.get(EntityVillagerAbstract.bw); ++ public final int getUnhappy() { return eK(); } // Paper - OBFHELPER + public int eK() { + return (Integer) this.datawatcher.get(EntityVillagerAbstract.bp); } + public final void setUnhappy(int i) { s(i); } // Paper - OBFHELPER public void s(int i) { - this.datawatcher.set(EntityVillagerAbstract.bw, i); + this.datawatcher.set(EntityVillagerAbstract.bp, i); } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index d9454448119a3c1590b7f9ef141dccf10d4742cc..384300894d19ff70556c23b130c01b2e49aa3f20 100644 +index ffc750d0f800d76854388506c5bc4bcdb99fc674..b132cb42da9a733e46fe9059258db7b77f811b3b 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -20,7 +20,10 @@ public abstract class PathfinderGoal { @@ -230,7 +229,7 @@ index d9454448119a3c1590b7f9ef141dccf10d4742cc..384300894d19ff70556c23b130c01b2e public void e() {} diff --git a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java -index b0e17a5764ae4668ef45c4b5e8fe7280b3f5bfdf..3e26c32d0c886c6bd70aa4823d8738cdde7a6b24 100644 +index 9b0511e996a5e3952c6f975e7c93299c532a8ea1..8bd75b8243590fcddd0e330a7276c03a71a38b93 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalGotoTarget.java @@ -4,12 +4,12 @@ import java.util.EnumSet; @@ -243,8 +242,8 @@ index b0e17a5764ae4668ef45c4b5e8fe7280b3f5bfdf..3e26c32d0c886c6bd70aa4823d8738cd protected int c; protected int d; private int g; -- protected BlockPosition e; -+ protected BlockPosition e; public BlockPosition getTarget() { return e; } public void setTarget(BlockPosition pos) { this.e = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER +- protected BlockPosition e;public final BlockPosition getTargetPosition() { return this.e; } // Paper - OBFHELPER ++ protected BlockPosition e; public final BlockPosition getTargetPosition() { return this.e; } public void setTargetPosition(BlockPosition pos) { this.e = pos; getEntity().movingTarget = pos != BlockPosition.ZERO ? pos : null; } // Paper - OBFHELPER private boolean h; private final int i; private final int j; @@ -256,17 +255,17 @@ index b0e17a5764ae4668ef45c4b5e8fe7280b3f5bfdf..3e26c32d0c886c6bd70aa4823d8738cd + @Override + public void onTaskReset() { + super.onTaskReset(); -+ setTarget(BlockPosition.ZERO); ++ setTargetPosition(BlockPosition.ZERO); + } + // Paper end public PathfinderGoalGotoTarget(EntityCreature entitycreature, double d0, int i, int j) { this.e = BlockPosition.ZERO; -@@ -100,6 +107,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { +@@ -106,6 +113,7 @@ public abstract class PathfinderGoalGotoTarget extends PathfinderGoal { blockposition_mutableblockposition.a((BaseBlockPosition) blockposition, i1, k - 1, j1); if (this.a.a((BlockPosition) blockposition_mutableblockposition) && this.a(this.a.world, blockposition_mutableblockposition)) { this.e = blockposition_mutableblockposition; -+ setTarget(blockposition_mutableblockposition.immutableCopy()); // Paper ++ setTargetPosition(blockposition_mutableblockposition.immutableCopy()); // Paper return true; } } @@ -315,7 +314,7 @@ index 482ce2cd8123252110508e8e03aa65afdd533e0a..b18e53220d8dbd50723c4201231091cb this.d.stream().filter((pathfindergoalwrapped) -> { return pathfindergoalwrapped.j() == pathfindergoal; diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java -index 50487dbf0ac162d7608b67b4fb50fa7f8bfba69d..04b28555b1bb68536e40bb652613678775337b31 100644 +index 182cd7e9110408fff9909ef362d368d055a2b167..f3df10587e652d3a26d15deb09304b97a727cd88 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java @@ -64,6 +64,7 @@ public class PathfinderGoalWrapped extends PathfinderGoal { @@ -327,7 +326,7 @@ index 50487dbf0ac162d7608b67b4fb50fa7f8bfba69d..04b28555b1bb68536e40bb6526136787 return this.c; } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 325d7a313cfab72978f5c8fada1af6f19cdab239..1d8f091cf55c2296b87d74fb9948142952ebdce2 100644 +index 3db488d602dde2ba5dcd324ad38b19edd24e9285..08ad1e6034fe484a65faacd6b8e63d664720f395 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -82,6 +82,12 @@ public abstract class World implements GeneratorAccess, AutoCloseable { diff --git a/Spigot-Server-Patches/0412-Fix-items-vanishing-through-end-portal.patch b/Spigot-Server-Patches/0408-Fix-items-vanishing-through-end-portal.patch index c186d986f7..1912664049 100644 --- a/Spigot-Server-Patches/0412-Fix-items-vanishing-through-end-portal.patch +++ b/Spigot-Server-Patches/0408-Fix-items-vanishing-through-end-portal.patch @@ -13,16 +13,16 @@ Quickly loading the exact world spawn chunk before searching the heightmap resolves the issue without having to load all spawn chunks. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 067765981afda04959313fc5371e6da9d7564f1a..39a7b8743a0612f818cda3796b5f6ae1137a7eee 100644 +index c844ee21d09eedee8c7e202afe4add0c84b8e11c..0d62e517bb756b80758827a7ba171de3ae306a82 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -2537,6 +2537,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2619,6 +2619,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + BlockPosition blockposition1; - if (blockposition == null) { // CraftBukkit - if (this.world.getTypeKey() == DimensionManager.THE_END && worldserver.getTypeKey() == DimensionManager.OVERWORLD) { // CraftBukkit + if (flag1) { + // Paper start - Ensure spawn chunk is always loaded before calculating Y coordinate + this.world.getChunkAtWorldCoords(this.world.getSpawn()); + // Paper end - // CraftBukkit start - EntityPortalEvent event = CraftEventFactory.callEntityPortalEvent(this, worldserver, worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn()), 0); - if (event == null) { + blockposition1 = WorldServer.a; + } else { + blockposition1 = worldserver.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver.getSpawn()); diff --git a/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch b/Spigot-Server-Patches/0409-Bees-get-gravity-in-void.-Fixes-MC-167279.patch index c5fd5518e0..11ca5d9e1e 100644 --- a/Spigot-Server-Patches/0413-Bees-get-gravity-in-void.-Fixes-MC-167279.patch +++ b/Spigot-Server-Patches/0409-Bees-get-gravity-in-void.-Fixes-MC-167279.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Bees get gravity in void. Fixes MC-167279 diff --git a/src/main/java/net/minecraft/server/ControllerMove.java b/src/main/java/net/minecraft/server/ControllerMove.java -index f2d2d04fe16bc091a971c8c90db56e6cd2799555..6393ff765f12db2911e2eaba800104b7539c290a 100644 +index 558523817e98711cca6d1671af98df6f8c5f0b07..8f9fb058c11ba5c2e887df048025284cd834ffe9 100644 --- a/src/main/java/net/minecraft/server/ControllerMove.java +++ b/src/main/java/net/minecraft/server/ControllerMove.java @@ -2,7 +2,7 @@ package net.minecraft.server; @@ -18,7 +18,7 @@ index f2d2d04fe16bc091a971c8c90db56e6cd2799555..6393ff765f12db2911e2eaba800104b7 protected double c; protected double d; diff --git a/src/main/java/net/minecraft/server/ControllerMoveFlying.java b/src/main/java/net/minecraft/server/ControllerMoveFlying.java -index d3507b3852f02bf35bda35a13db66d5375325000..bafcb780f520db562e4a834400b789f60b563597 100644 +index 2778cb9069ef3ba4049a9a3dc7c788cd50f98c28..2b1db4bf21f7341dbdf27673e123936d9eaa7f95 100644 --- a/src/main/java/net/minecraft/server/ControllerMoveFlying.java +++ b/src/main/java/net/minecraft/server/ControllerMoveFlying.java @@ -12,7 +12,7 @@ public class ControllerMoveFlying extends ControllerMove { @@ -31,7 +31,7 @@ index d3507b3852f02bf35bda35a13db66d5375325000..bafcb780f520db562e4a834400b789f6 this.h = ControllerMove.Operation.WAIT; this.a.setNoGravity(true); diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index dcfd2ea5024be6d4a001fa7437092a7831b36fa7..b9e01e4d9e64fdec4c4f04f1808eb8832bd00c8e 100644 +index 5ccb537a7560b585a4f6e1c513b8b173ac521032..0f44cbd3ce6e57f9693cd23b10d487e06aa62eeb 100644 --- a/src/main/java/net/minecraft/server/EntityBee.java +++ b/src/main/java/net/minecraft/server/EntityBee.java @@ -37,7 +37,17 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB diff --git a/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch b/Spigot-Server-Patches/0410-Optimise-getChunkAt-calls-for-loaded-chunks.patch index 145508828a..21be124c86 100644 --- a/Spigot-Server-Patches/0414-Optimise-getChunkAt-calls-for-loaded-chunks.patch +++ b/Spigot-Server-Patches/0410-Optimise-getChunkAt-calls-for-loaded-chunks.patch @@ -7,10 +7,10 @@ bypass the need to get a player chunk, then get the either, then unwrap it... diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b1977150d73f 100644 +index dce9c62c0cf37a37994537b74dfdc2286c60fae2..f7055ee0f2d497502f6a8b03544a55956f49e647 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -447,6 +447,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -448,6 +448,12 @@ public class ChunkProviderServer extends IChunkProvider { return this.getChunkAt(i, j, chunkstatus, flag); }, this.serverThreadQueue).join(); } else { @@ -23,7 +23,7 @@ index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b197 GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); gameprofilerfiller.c("getChunk"); -@@ -497,39 +503,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -498,39 +504,7 @@ public class ChunkProviderServer extends IChunkProvider { if (Thread.currentThread() != this.serverThread) { return null; } else { @@ -65,10 +65,10 @@ index 1597b7a882769109f467d81ecbadc45ff6779b7e..67d6facd37462beef49dac311019b197 } diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 822cd9b5a4695d5d17320a16d70eb4c977211759..7c6b7955c454c585eed7457d6680ce67e6219162 100644 +index 08ad1e6034fe484a65faacd6b8e63d664720f395..31f27db84e15664bb5aa81da73916e65bbffb62f 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -321,6 +321,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -286,6 +286,14 @@ public abstract class World implements GeneratorAccess, AutoCloseable { @Override public Chunk getChunkAt(int i, int j) { diff --git a/Spigot-Server-Patches/0415-Allow-overriding-the-java-version-check.patch b/Spigot-Server-Patches/0411-Allow-overriding-the-java-version-check.patch index 0d23692701..f9518aee43 100644 --- a/Spigot-Server-Patches/0415-Allow-overriding-the-java-version-check.patch +++ b/Spigot-Server-Patches/0411-Allow-overriding-the-java-version-check.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Allow overriding the java version check -DPaper.IgnoreJavaVersion=true diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index d94d25481000c3cf98affdc2fbdf9fcedbc93d94..2049f9783bf93c56d8c4dcb395293c03f09b5b40 100644 +index 7f9aec88ff40c63fc204e7790fb5e5a719a18cf2..62ebe09f955e42ad75bde9f3de690c512473c87e 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -175,7 +175,7 @@ public class Main { diff --git a/Spigot-Server-Patches/0416-Add-ThrownEggHatchEvent.patch b/Spigot-Server-Patches/0412-Add-ThrownEggHatchEvent.patch index 5edd2e992d..5edd2e992d 100644 --- a/Spigot-Server-Patches/0416-Add-ThrownEggHatchEvent.patch +++ b/Spigot-Server-Patches/0412-Add-ThrownEggHatchEvent.patch diff --git a/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch b/Spigot-Server-Patches/0413-Optimise-random-block-ticking.patch index defc46a6c7..096a8ed42b 100644 --- a/Spigot-Server-Patches/0417-Optimise-random-block-ticking.patch +++ b/Spigot-Server-Patches/0413-Optimise-random-block-ticking.patch @@ -71,10 +71,10 @@ index 0000000000000000000000000000000000000000..3edc8e52e06a62ce9f8cc734fd7458b3 + } +} diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 4f0bcc096a7b1d51e4f7a3936d1dec7198002704..fc7dda277a0f80141e4de6f7efdbef0f19e19fc2 100644 +index f068436960c96b0df427bcdf337a4dcc6a9f66f5..253423acc3c3697a5e47136f34da92617e719753 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -400,6 +400,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -462,6 +462,7 @@ public class BlockPosition extends BaseBlockPosition { return this.d(MathHelper.floor(d0), MathHelper.floor(d1), MathHelper.floor(d2)); } @@ -83,7 +83,7 @@ index 4f0bcc096a7b1d51e4f7a3936d1dec7198002704..fc7dda277a0f80141e4de6f7efdbef0f return this.d(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 74093f7757714a85f02492dddff23cbc91c28ae0..db5f22c3df9c7302e854f1f6d66067b0afeded28 100644 +index a6cd89e0850c11ab6dd7f77842583c456c7f93dd..20c3e425f4299318c49128f3d330b889a0c1c52a 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -593,8 +593,8 @@ public class Chunk implements IChunkAccess { @@ -98,7 +98,7 @@ index 74093f7757714a85f02492dddff23cbc91c28ae0..db5f22c3df9c7302e854f1f6d66067b0 } diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index cb72be356a2f28cfebc0cb4a822fa21d22ca5064..fbd2f6a068ee3037fc6fdc4a2f527f8b5b680afa 100644 +index 90bb2f7ad9f82818d58de9be918f1299c6725070..668942c629732b8d46b7f2646df8e7827baae240 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -7,12 +7,14 @@ import javax.annotation.Nullable; @@ -111,7 +111,7 @@ index cb72be356a2f28cfebc0cb4a822fa21d22ca5064..fbd2f6a068ee3037fc6fdc4a2f527f8b - private short tickingBlockCount; + short tickingBlockCount; // Paper - private -> package-private private short e; - final DataPaletteBlock<IBlockData> blockIds; + final DataPaletteBlock<IBlockData> blockIds; // Paper - package-private + final com.destroystokyo.paper.util.maplist.IBlockDataList tickingList = new com.destroystokyo.paper.util.maplist.IBlockDataList(); // Paper + @@ -174,7 +174,7 @@ index cb72be356a2f28cfebc0cb4a822fa21d22ca5064..fbd2f6a068ee3037fc6fdc4a2f527f8b } diff --git a/src/main/java/net/minecraft/server/DataBits.java b/src/main/java/net/minecraft/server/DataBits.java -index 0e030347710df7c4bbf1ba695209ea66cec7c46d..e65fe633f5dc7df58fdc52955c23a9b9fbcdc4f6 100644 +index 2901700dc0ff5dce4fb6f6df9f6686c786293d28..26b48b5ffa4ce3fbe50810dc1a8070d333a2684f 100644 --- a/src/main/java/net/minecraft/server/DataBits.java +++ b/src/main/java/net/minecraft/server/DataBits.java @@ -111,4 +111,32 @@ public class DataBits { @@ -230,24 +230,24 @@ index ed77117630d54b7ad81f633110c7d2a7c59288e9..95ef96286855624590b72d69514b0fc0 public interface a<T> { diff --git a/src/main/java/net/minecraft/server/EntityTurtle.java b/src/main/java/net/minecraft/server/EntityTurtle.java -index cf90ebf0614422879f5f5da05c925728f94ef8be..06333b69539a86b14b6b1efa5fee19b5bdfacfdf 100644 +index 1fd2a41050de39b47a0fe6e52f7a6727a8475757..430f9d23a24f6d28af91719f8ca81ad1f83d00d0 100644 --- a/src/main/java/net/minecraft/server/EntityTurtle.java +++ b/src/main/java/net/minecraft/server/EntityTurtle.java @@ -28,7 +28,7 @@ public class EntityTurtle extends EntityAnimal { } public void setHomePos(BlockPosition blockposition) { -- this.datawatcher.set(EntityTurtle.bw, blockposition); -+ this.datawatcher.set(EntityTurtle.bw, blockposition.immutableCopy()); // Paper - called with mutablepos... +- this.datawatcher.set(EntityTurtle.bp, blockposition); ++ this.datawatcher.set(EntityTurtle.bp, blockposition.immutableCopy()); // Paper - called with mutablepos... } + public BlockPosition getHomePos() { // Paper - public - return (BlockPosition) this.datawatcher.get(EntityTurtle.bw); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index e7dafb74d104ecd3fa05efc7189c8298abee8ca2..cad4cd2af375d80c6ceb82541ee248c742ba68e4 100644 +index 31f27db84e15664bb5aa81da73916e65bbffb62f..c3f524a3b1ce20d61e3f6b5a0897cf6bb9b2460c 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -1461,10 +1461,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - public abstract TagRegistry p(); +@@ -1417,10 +1417,18 @@ public abstract class World implements GeneratorAccess, AutoCloseable { + public abstract ITagRegistry p(); public BlockPosition a(int i, int j, int k, int l) { + // Paper start - allow use of mutable pos @@ -267,10 +267,10 @@ index e7dafb74d104ecd3fa05efc7189c8298abee8ca2..cad4cd2af375d80c6ceb82541ee248c7 public boolean isSavingDisabled() { diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 54423fd1133b313d3d2e7550f03e660b9ab6db99..d41981a5dc4beb9d63f52abea5653067144be932 100644 +index 026818ce2c69ffe0399cb1aa5391fa896720c36b..65e47279dcaba633bfbad324be04285422f809e9 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -556,7 +556,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -557,7 +557,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { }); } @@ -284,20 +284,20 @@ index 54423fd1133b313d3d2e7550f03e660b9ab6db99..d41981a5dc4beb9d63f52abea5653067 ChunkCoordIntPair chunkcoordintpair = chunk.getPos(); boolean flag = this.isRaining(); int j = chunkcoordintpair.d(); -@@ -564,10 +569,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -565,10 +570,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { GameProfilerFiller gameprofilerfiller = this.getMethodProfiler(); gameprofilerfiller.enter("thunder"); - BlockPosition blockposition; + final BlockPosition.MutableBlockPosition blockposition = this.chunkTickMutablePosition; // Paper - use mutable to reduce allocation rate, final to force compile fail on change - if (!this.paperConfig.disableThunder && flag && this.T() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder + if (!this.paperConfig.disableThunder && flag && this.V() && this.random.nextInt(100000) == 0) { // Paper - Disable thunder - blockposition = this.a(this.a(j, 0, k, 15)); + blockposition.setValues(this.a(this.a(j, 0, k, 15))); // Paper if (this.isRainingAt(blockposition)) { DifficultyDamageScaler difficultydamagescaler = this.getDamageScaler(blockposition); boolean flag1 = this.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && this.random.nextDouble() < (double) difficultydamagescaler.b() * paperConfig.skeleHorseSpawnChance; // Paper -@@ -590,59 +595,77 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -591,59 +596,77 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exitEnter("iceandsnow"); @@ -313,11 +313,11 @@ index 54423fd1133b313d3d2e7550f03e660b9ab6db99..d41981a5dc4beb9d63f52abea5653067 + // Paper end BiomeBase biomebase = this.getBiome(blockposition); -- if (biomebase.a((IWorldReader) this, blockposition1)) { +- if (biomebase.a(this, blockposition1)) { - org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition1, Blocks.ICE.getBlockData(), null); // CraftBukkit + // Paper start - optimise chunk ticking + blockposition.setY(downY); -+ if (biomebase.a((IWorldReader) this, blockposition)) { ++ if (biomebase.a(this, blockposition)) { + org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.ICE.getBlockData(), null); // CraftBukkit + // Paper end } @@ -327,11 +327,11 @@ index 54423fd1133b313d3d2e7550f03e660b9ab6db99..d41981a5dc4beb9d63f52abea5653067 org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(this, blockposition, Blocks.SNOW.getBlockData(), null); // CraftBukkit } -- if (flag && this.getBiome(blockposition1).d() == BiomeBase.Precipitation.RAIN) { +- if (flag && this.getBiome(blockposition1).c() == BiomeBase.Precipitation.RAIN) { - this.getType(blockposition1).getBlock().c((World) this, blockposition1); + // Paper start - optimise chunk ticking + blockposition.setY(downY); -+ if (flag && this.getBiome(blockposition).d() == BiomeBase.Precipitation.RAIN) { ++ if (flag && this.getBiome(blockposition).c() == BiomeBase.Precipitation.RAIN) { + chunk.getType(blockposition).getBlock().c((World) this, blockposition); + // Paper end } diff --git a/Spigot-Server-Patches/0418-Entity-Jump-API.patch b/Spigot-Server-Patches/0414-Entity-Jump-API.patch index e5134f0541..0b9836e1c6 100644 --- a/Spigot-Server-Patches/0418-Entity-Jump-API.patch +++ b/Spigot-Server-Patches/0414-Entity-Jump-API.patch @@ -5,11 +5,11 @@ Subject: [PATCH] Entity Jump API diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 9746346d6b9c432710f229f5355e4540c308ffb4..172b9de45f0f1b550acddc0c53b762c9e93f0d18 100644 +index fede5e527a6f19243a25567e378ceebf79e118d6..0cce4dabcfc6bd2ad99d59597d4cddd98276bb8d 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2751,8 +2751,10 @@ public abstract class EntityLiving extends Entity { - } else if (this.aN() && (!this.onGround || d7 > d8)) { +@@ -2752,8 +2752,10 @@ public abstract class EntityLiving extends Entity { + } else if (this.aP() && (!this.onGround || d7 > d8)) { this.c((Tag) TagsFluid.LAVA); } else if ((this.onGround || flag && d7 <= d8) && this.jumpTicks == 0) { + if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper @@ -20,13 +20,13 @@ index 9746346d6b9c432710f229f5355e4540c308ffb4..172b9de45f0f1b550acddc0c53b762c9 } else { this.jumpTicks = 0; diff --git a/src/main/java/net/minecraft/server/EntityPanda.java b/src/main/java/net/minecraft/server/EntityPanda.java -index 50fe69143a6b91f957414ff556a0e60d220ab04f..42df0d74ee24ef9ac15ee19cfd298c5721df0d7d 100644 +index ed8c0073f0c938c2ee8ed0dad2afda21a115b67d..01cc3d94d3fe1f82c94abdfcc92b0d3bc26f2fea 100644 --- a/src/main/java/net/minecraft/server/EntityPanda.java +++ b/src/main/java/net/minecraft/server/EntityPanda.java @@ -435,7 +435,9 @@ public class EntityPanda extends EntityAnimal { EntityPanda entitypanda = (EntityPanda) iterator.next(); - if (!entitypanda.isBaby() && entitypanda.onGround && !entitypanda.isInWater() && entitypanda.fi()) { + if (!entitypanda.isBaby() && entitypanda.onGround && !entitypanda.isInWater() && entitypanda.fh()) { + if (new com.destroystokyo.paper.event.entity.EntityJumpEvent(getBukkitLivingEntity()).callEvent()) { // Paper entitypanda.jump(); + } else { this.setJumping(false); } // Paper - setJumping(false) stops a potential loop diff --git a/Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch b/Spigot-Server-Patches/0415-Add-option-to-nerf-pigmen-from-nether-portals.patch index 8f719cd097..4767187598 100644 --- a/Spigot-Server-Patches/0419-Add-option-to-nerf-pigmen-from-nether-portals.patch +++ b/Spigot-Server-Patches/0415-Add-option-to-nerf-pigmen-from-nether-portals.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 9bd64034587217743157a81c04fc20751474e21d..796c5a0b110009b479f5c9eef17e2605b564ce09 100644 +index d846c55de176879e94f6c0e5bf8f58910657fc75..5517caf85740c7d8ac29dba74f5da1c026629f63 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -591,4 +591,9 @@ public class PaperWorldConfig { +@@ -580,4 +580,9 @@ public class PaperWorldConfig { disableHopperMoveEvents = getBoolean("hopper.disable-move-event", disableHopperMoveEvents); log("Hopper Move Item Events: " + (disableHopperMoveEvents ? "disabled" : "enabled")); } @@ -19,23 +19,23 @@ index 9bd64034587217743157a81c04fc20751474e21d..796c5a0b110009b479f5c9eef17e2605 + } } diff --git a/src/main/java/net/minecraft/server/BlockPortal.java b/src/main/java/net/minecraft/server/BlockPortal.java -index e5b8d45ed9f62c28b0429859593d881546ccead2..77f8d5e6662fa75e622f07b3e6efae04c38735fe 100644 +index a224a04ee1bb9705166913ef1c66aa031d87c270..4132cd4c6f13cfa1c0cda43daaa908ff3c07f32b 100644 --- a/src/main/java/net/minecraft/server/BlockPortal.java +++ b/src/main/java/net/minecraft/server/BlockPortal.java -@@ -46,6 +46,8 @@ public class BlockPortal extends Block { +@@ -44,6 +44,8 @@ public class BlockPortal extends Block { if (entity != null) { - entity.portalCooldown = entity.getDefaultPortalCooldown(); + entity.resetPortalCooldown(); + entity.fromNetherPortal = true; // Paper + if (worldserver.paperConfig.nerfNetherPortalPigmen) ((EntityInsentient) entity).aware = false; // Paper } } } diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 39a7b8743a0612f818cda3796b5f6ae1137a7eee..c49d157b8ca25f9811bf64396c207b1c1d6e085d 100644 +index 0d62e517bb756b80758827a7ba171de3ae306a82..6b525e813034cb43403f9b116b5d661eb3be49aa 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -194,6 +194,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -191,6 +191,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke public long activatedTick = Integer.MIN_VALUE; public boolean isTemporarilyActive = false; // Paper public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one @@ -43,7 +43,7 @@ index 39a7b8743a0612f818cda3796b5f6ae1137a7eee..c49d157b8ca25f9811bf64396c207b1c protected int numCollisions = 0; // Paper public void inactiveTick() { } // Spigot end -@@ -1606,6 +1607,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1599,6 +1600,9 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke if (spawnedViaMobSpawner) { nbttagcompound.setBoolean("Paper.FromMobSpawner", true); } @@ -53,7 +53,7 @@ index 39a7b8743a0612f818cda3796b5f6ae1137a7eee..c49d157b8ca25f9811bf64396c207b1c // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -1730,6 +1734,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1723,6 +1727,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } spawnedViaMobSpawner = nbttagcompound.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch b/Spigot-Server-Patches/0416-Make-the-GUI-graph-fancier.patch index 7b332f58cd..15c868c6a9 100644 --- a/Spigot-Server-Patches/0420-Make-the-GUI-graph-fancier.patch +++ b/Spigot-Server-Patches/0416-Make-the-GUI-graph-fancier.patch @@ -398,7 +398,7 @@ index d4d5bc19e167a5271f8eb8d010f8a52b23b942df..859e31c63f94bdc7729c6d475990750b }); private final int[] b = new int[256]; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 67ab908879146c83bf591ae9956d0c038fb5c5d9..99b6a4d277816699a5abd9ec889535c064758e97 100644 +index 9290d6c84e764bf691d9222723d73209a3d9ae2e..c5dc14ee9b1721780ed83851c15c7bd3df83390d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -106,7 +106,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas diff --git a/Spigot-Server-Patches/0421-add-hand-to-BlockMultiPlaceEvent.patch b/Spigot-Server-Patches/0417-add-hand-to-BlockMultiPlaceEvent.patch index a0abfd9cec..60300eb740 100644 --- a/Spigot-Server-Patches/0421-add-hand-to-BlockMultiPlaceEvent.patch +++ b/Spigot-Server-Patches/0417-add-hand-to-BlockMultiPlaceEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add hand to BlockMultiPlaceEvent diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 59205a848524f281edcab388a9ca40b3e08a9556..3bea7e9ccdfd225f1c6aa391b55e6d190f963534 100644 +index be7e98dc6f8faf4ebfd24df035ade809a3e4c918..6bd2b47151a3abfd0b96641272ecc9fe2d2421b2 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -331,13 +331,18 @@ public class CraftEventFactory { +@@ -335,13 +335,18 @@ public class CraftEventFactory { } org.bukkit.inventory.ItemStack item; diff --git a/Spigot-Server-Patches/0422-Prevent-teleporting-dead-entities.patch b/Spigot-Server-Patches/0418-Prevent-teleporting-dead-entities.patch index 53bdb45a3a..2e52422713 100644 --- a/Spigot-Server-Patches/0422-Prevent-teleporting-dead-entities.patch +++ b/Spigot-Server-Patches/0418-Prevent-teleporting-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent teleporting dead entities diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index eb5231571884d1c828935b007d8fba3499bb68d2..6faa8764d19f3e58808de9dc84145f765c8958a8 100644 +index 7c5c7e67dd8f1fdc726b2f2923f8d2e2bf864e6c..ff436b2424ebab9bc1e673b8f484e63d52d4940c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1240,6 +1240,10 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1234,6 +1234,10 @@ public class PlayerConnection implements PacketListenerPlayIn { } private void internalTeleport(double d0, double d1, double d2, float f, float f1, Set<PacketPlayOutPosition.EnumPlayerTeleportFlags> set) { diff --git a/Spigot-Server-Patches/0423-Validate-tripwire-hook-placement-before-update.patch b/Spigot-Server-Patches/0419-Validate-tripwire-hook-placement-before-update.patch index 6ea67bd8e8..6ea67bd8e8 100644 --- a/Spigot-Server-Patches/0423-Validate-tripwire-hook-placement-before-update.patch +++ b/Spigot-Server-Patches/0419-Validate-tripwire-hook-placement-before-update.patch diff --git a/Spigot-Server-Patches/0424-Add-option-to-allow-iron-golems-to-spawn-in-air.patch b/Spigot-Server-Patches/0420-Add-option-to-allow-iron-golems-to-spawn-in-air.patch index ca49b9a59c..ad6486667a 100644 --- a/Spigot-Server-Patches/0424-Add-option-to-allow-iron-golems-to-spawn-in-air.patch +++ b/Spigot-Server-Patches/0420-Add-option-to-allow-iron-golems-to-spawn-in-air.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add option to allow iron golems to spawn in air diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 796c5a0b110009b479f5c9eef17e2605b564ce09..1b2256144f7f968667570e5a9838a77173d515c5 100644 +index 5517caf85740c7d8ac29dba74f5da1c026629f63..8ef1c03cde1cc882ae96d684b26cbba0f8f75f83 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -380,6 +380,11 @@ public class PaperWorldConfig { @@ -17,11 +17,11 @@ index 796c5a0b110009b479f5c9eef17e2605b564ce09..1b2256144f7f968667570e5a9838a771 + ironGolemsCanSpawnInAir = getBoolean("iron-golems-can-spawn-in-air", ironGolemsCanSpawnInAir); + } + - public int bedSearchRadius = 1; - private void bedSearchRadius() { - bedSearchRadius = getInt("bed-search-radius", 1); + public boolean armorStandEntityLookups = true; + private void armorStandEntityLookups() { + armorStandEntityLookups = getBoolean("armor-stands-do-collision-entity-lookups", true); diff --git a/src/main/java/net/minecraft/server/EntityIronGolem.java b/src/main/java/net/minecraft/server/EntityIronGolem.java -index 86de45327653c09dcb6764754b10b8ad1b3450fd..e38a675be7e6a4cbb1f2f7606bf84ac570bb5985 100644 +index 09c88c1079d1169b76b19eea235d5ee7805c6b83..0a5c27e732540e03c87e6da0fbdc6e3c2e382810 100644 --- a/src/main/java/net/minecraft/server/EntityIronGolem.java +++ b/src/main/java/net/minecraft/server/EntityIronGolem.java @@ -251,7 +251,7 @@ public class EntityIronGolem extends EntityGolem implements IEntityAngerable { diff --git a/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch b/Spigot-Server-Patches/0421-Configurable-chance-of-villager-zombie-infection.patch index 5c9d9586bc..8a0a5721a8 100644 --- a/Spigot-Server-Patches/0425-Configurable-chance-of-villager-zombie-infection.patch +++ b/Spigot-Server-Patches/0421-Configurable-chance-of-villager-zombie-infection.patch @@ -8,10 +8,10 @@ This allows you to solve an issue in vanilla behavior where: * On normal difficulty they will have a 50% of getting infected or dying. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 1b2256144f7f968667570e5a9838a77173d515c5..f888fc1c5ef4212f81ed936da6485abadc336407 100644 +index 8ef1c03cde1cc882ae96d684b26cbba0f8f75f83..b633d74450c40bcc8831836f79a7a2daa43e3d35 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -601,4 +601,9 @@ public class PaperWorldConfig { +@@ -590,4 +590,9 @@ public class PaperWorldConfig { private void nerfNetherPortalPigmen() { nerfNetherPortalPigmen = getBoolean("game-mechanics.nerf-pigmen-from-nether-portals", nerfNetherPortalPigmen); } @@ -22,18 +22,18 @@ index 1b2256144f7f968667570e5a9838a77173d515c5..f888fc1c5ef4212f81ed936da6485aba + } } diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java -index e436b0f4691154e200b9a5c28566074ff8bc0df9..8784da7ca664b93c4ce1d3e63bb841229f4616df 100644 +index 45c470ebeca1552e0a849b607fde95de437e8bb4..039c5f4387b5383b15bd8b954eb464089612a303 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java -@@ -389,10 +389,14 @@ public class EntityZombie extends EntityMonster { +@@ -386,10 +386,14 @@ public class EntityZombie extends EntityMonster { @Override - public void a_(EntityLiving entityliving) { - super.a_(entityliving); -- if ((this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) { -- if (this.world.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) { + public void a(WorldServer worldserver, EntityLiving entityliving) { + super.a(worldserver, entityliving); +- if ((worldserver.getDifficulty() == EnumDifficulty.NORMAL || worldserver.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) { +- if (worldserver.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) { + // Paper start -+ if (world.paperConfig.zombieVillagerInfectionChance != 0.0 && (world.paperConfig.zombieVillagerInfectionChance != -1.0 || this.world.getDifficulty() == EnumDifficulty.NORMAL || this.world.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) { -+ if (world.paperConfig.zombieVillagerInfectionChance == -1.0 && this.world.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) { ++ if (world.paperConfig.zombieVillagerInfectionChance != 0.0 && (world.paperConfig.zombieVillagerInfectionChance != -1.0 || worldserver.getDifficulty() == EnumDifficulty.NORMAL || worldserver.getDifficulty() == EnumDifficulty.HARD) && entityliving instanceof EntityVillager) { ++ if (world.paperConfig.zombieVillagerInfectionChance == -1.0 && worldserver.getDifficulty() != EnumDifficulty.HARD && this.random.nextBoolean()) { return; } + if (world.paperConfig.zombieVillagerInfectionChance != -1.0 && (this.random.nextDouble() * 100.0) > world.paperConfig.zombieVillagerInfectionChance) { @@ -41,4 +41,4 @@ index e436b0f4691154e200b9a5c28566074ff8bc0df9..8784da7ca664b93c4ce1d3e63bb84122 + } // Paper end EntityVillager entityvillager = (EntityVillager) entityliving; - EntityZombieVillager entityzombievillager = (EntityZombieVillager) EntityTypes.ZOMBIE_VILLAGER.a(this.world); + // CraftBukkit start diff --git a/Spigot-Server-Patches/0426-Optimise-Chunk-getFluid.patch b/Spigot-Server-Patches/0422-Optimise-Chunk-getFluid.patch index ed9f3cdb2c..d1429a76d8 100644 --- a/Spigot-Server-Patches/0426-Optimise-Chunk-getFluid.patch +++ b/Spigot-Server-Patches/0422-Optimise-Chunk-getFluid.patch @@ -8,7 +8,7 @@ faster on its own, however removing the try catch makes it easier to inline due to code size diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index a76b1d2fd81aaedb37190bcb8510020d5df2513e..cb24f27bc443880b18ffc36236f6ec7174c9d493 100644 +index 20c3e425f4299318c49128f3d330b889a0c1c52a..eebd014f9c0f4285f16d9ffac79e604854a6926c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -386,17 +386,20 @@ public class Chunk implements IChunkAccess { @@ -48,7 +48,7 @@ index a76b1d2fd81aaedb37190bcb8510020d5df2513e..cb24f27bc443880b18ffc36236f6ec71 // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index cf444fa1cc96e881a1f9ed0c78d45935fe1c90ab..860dc98ab4f84c470b27726314943936d23fcb79 100644 +index 668942c629732b8d46b7f2646df8e7827baae240..39572cdce691a459cb9df0cc064fbf7bde83a99e 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -38,7 +38,7 @@ public class ChunkSection { diff --git a/Spigot-Server-Patches/0427-Optimise-TickListServer-by-rewriting-it.patch b/Spigot-Server-Patches/0423-Optimise-TickListServer-by-rewriting-it.patch index 44aa3f8cb1..574afcc909 100644 --- a/Spigot-Server-Patches/0427-Optimise-TickListServer-by-rewriting-it.patch +++ b/Spigot-Server-Patches/0423-Optimise-TickListServer-by-rewriting-it.patch @@ -889,10 +889,10 @@ index 0000000000000000000000000000000000000000..118988c39e58f28e8a2851792b9c014f + } +} diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 2d3e73ef92c7b88d49f8eb27233cb823b425ea4a..163a6c83a2e494e28981974ef9accd3255e562c2 100644 +index 253423acc3c3697a5e47136f34da92617e719753..52ae74571b0d671a294900caedaa400b62d4ea34 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -104,6 +104,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -105,6 +105,7 @@ public class BlockPosition extends BaseBlockPosition { return i == 0 && j == 0 && k == 0 ? this : new BlockPosition(this.getX() + i, this.getY() + j, this.getZ() + k); } @@ -901,10 +901,10 @@ index 2d3e73ef92c7b88d49f8eb27233cb823b425ea4a..163a6c83a2e494e28981974ef9accd32 return this.b(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 67d6facd37462beef49dac311019b1977150d73f..ba9f75bd8f6fe1990d485548f4481bd1762d93af 100644 +index f7055ee0f2d497502f6a8b03544a55956f49e647..fc8f3539f143d5fb3fcfb8b7813a2384497ccc1d 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -202,6 +202,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -203,6 +203,13 @@ public class ChunkProviderServer extends IChunkProvider { } // Paper end @@ -990,10 +990,10 @@ index 33cfeabdee03195a294f303f28044a313cb1c4ed..2287e47d1b891135a5f2579ec324c705 public String toString() { return this.e + ": " + this.a + ", " + this.b + ", " + this.c + ", " + this.f; diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index b6868b6b23a09e8e0dfe7a5e378dca22b8d80bad..9cb2ff09da0b8832e58eed4d70741853a25c9011 100644 +index 12f91b5a5f740d661f8422b0ba870e3454c26467..844f5b204b0f8c4474b4b9ffdc9cb7f3564b1336 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -460,7 +460,9 @@ public class PlayerChunk { +@@ -467,7 +467,9 @@ public class PlayerChunk { PlayerChunk.this.isTickingReady = true; @@ -1191,10 +1191,10 @@ index 3b8f56c0f0507ebdd9ac20be70688b4c0cfe4cf8..3e148b7e99554a1abe257dd3c9acafb9 } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d41981a5dc4beb9d63f52abea5653067144be932..eebd453bfaeb99b8fdf0d11ee8888f27ad2afff2 100644 +index 65e47279dcaba633bfbad324be04285422f809e9..4e9bfa66f2ed110c71c865c05d4573d2df84489c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -181,6 +181,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -182,6 +182,15 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Paper end @@ -1208,9 +1208,9 @@ index d41981a5dc4beb9d63f52abea5653067144be932..eebd453bfaeb99b8fdf0d11ee8888f27 + // Paper end - rewrite ticklistserver + // Add env and gen to constructor, WorldData -> WorldDataServer - public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, ResourceKey<DimensionManager> resourcekey1, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { - super(iworlddataserver, resourcekey, resourcekey1, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor -@@ -188,12 +197,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { + public WorldServer(MinecraftServer minecraftserver, Executor executor, Convertable.ConversionSession convertable_conversionsession, IWorldDataServer iworlddataserver, ResourceKey<World> resourcekey, DimensionManager dimensionmanager, WorldLoadListener worldloadlistener, ChunkGenerator chunkgenerator, boolean flag, long i, List<MobSpawner> list, boolean flag1, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen) { + super(iworlddataserver, resourcekey, dimensionmanager, minecraftserver::getMethodProfiler, false, flag, i, gen, env, executor); // Paper pass executor +@@ -189,12 +198,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { convertable = convertable_conversionsession; uuid = WorldUUID.getUUID(convertable_conversionsession.folder.toFile()); // CraftBukkit end @@ -1238,7 +1238,7 @@ index d41981a5dc4beb9d63f52abea5653067144be932..eebd453bfaeb99b8fdf0d11ee8888f27 this.navigators = Sets.newHashSet(); this.L = new ObjectLinkedOpenHashSet(); this.Q = flag1; -@@ -526,7 +544,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -527,7 +545,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { if (this.Q) { long i = this.worldData.getTime() + 1L; @@ -1246,6 +1246,6 @@ index d41981a5dc4beb9d63f52abea5653067144be932..eebd453bfaeb99b8fdf0d11ee8888f27 + this.worldDataServer.setTime(i); // Paper - diff on change, we want the below to be ran right after this + this.nextTickListBlock.nextTick(); // Paper + this.nextTickListFluid.nextTick(); // Paper - this.worldDataServer.t().a(this.server, i); - if (this.worldData.p().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) { + this.worldDataServer.u().a(this.server, i); + if (this.worldData.q().getBoolean(GameRules.DO_DAYLIGHT_CYCLE)) { this.setDayTime(this.worldData.getDayTime() + 1L); diff --git a/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch b/Spigot-Server-Patches/0424-Pillager-patrol-spawn-settings-and-per-player-option.patch index 4678c272c9..57789c3048 100644 --- a/Spigot-Server-Patches/0428-Pillager-patrol-spawn-settings-and-per-player-option.patch +++ b/Spigot-Server-Patches/0424-Pillager-patrol-spawn-settings-and-per-player-option.patch @@ -10,10 +10,10 @@ When not per player it will use the Vanilla mechanic of one delay per world and the world age for the start day. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index f888fc1c5ef4212f81ed936da6485abadc336407..b987399ca3786a30f87c98658e8bf04d4aa2e2da 100644 +index b633d74450c40bcc8831836f79a7a2daa43e3d35..6c80906d0cf3594a30aa201793a16a29ffeb1fcb 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -579,10 +579,21 @@ public class PaperWorldConfig { +@@ -568,10 +568,21 @@ public class PaperWorldConfig { } public boolean disablePillagerPatrols = false; @@ -36,10 +36,10 @@ index f888fc1c5ef4212f81ed936da6485abadc336407..b987399ca3786a30f87c98658e8bf04d private void entitiesTargetWithFollowRange() { entitiesTargetWithFollowRange = getBoolean("entities-target-with-follow-range", entitiesTargetWithFollowRange); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b74a31904f0fedbff0534dd90e189c05282258b8..415049bb5fdcc5c3edaf71bc8ddc330fe6bbcdb2 100644 +index 04e402275de6797dcd25d2497faf6a258dc26112..4fd7be1029bb69abfce3ad8d939031c574e19e9c 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -81,6 +81,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -83,6 +83,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean viewingCredits; private int containerUpdateDelay; // Paper public long loginTime; // Paper @@ -48,7 +48,7 @@ index b74a31904f0fedbff0534dd90e189c05282258b8..415049bb5fdcc5c3edaf71bc8ddc330f public boolean queueHealthUpdatePacket = false; public net.minecraft.server.PacketPlayOutUpdateHealth queuedHealthUpdatePacket; diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java -index b1fea06d29a0c98136496d6eff81e6959cb73672..776e54ff472a67f535dfb409e753325a1105bcce 100644 +index 7ed89bbe465402582c9d28f0a3935758a6b0f7af..13fccedb948ce5ced1678ff338f7eea5d53ee022 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java @@ -4,13 +4,13 @@ import java.util.Random; diff --git a/Spigot-Server-Patches/0429-Ensure-Entity-is-never-double-registered.patch b/Spigot-Server-Patches/0425-Ensure-Entity-is-never-double-registered.patch index 0211cd80bc..57c5535952 100644 --- a/Spigot-Server-Patches/0429-Ensure-Entity-is-never-double-registered.patch +++ b/Spigot-Server-Patches/0425-Ensure-Entity-is-never-double-registered.patch @@ -11,10 +11,10 @@ Vs behavior of non ticking of just overwriting state. We will now simply log a warning when this happens instead of crashing the server. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index c49d157b8ca25f9811bf64396c207b1c1d6e085d..e895bf811ce5d441541725ade48e3f07ca86fc2b 100644 +index 6b525e813034cb43403f9b116b5d661eb3be49aa..78d2b48385bcb2090058d617599ef2b639fecbcf 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -59,6 +59,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -61,6 +61,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } // Paper start @@ -23,10 +23,10 @@ index c49d157b8ca25f9811bf64396c207b1c1d6e085d..e895bf811ce5d441541725ade48e3f07 private boolean locked = false; @Override diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index eebd453bfaeb99b8fdf0d11ee8888f27ad2afff2..0e28e829474bea693550b3b2f0e72f97ff9bb10e 100644 +index 4e9bfa66f2ed110c71c865c05d4573d2df84489c..62b2a4d38102b1ffbda4d2fc031350a51fcf180c 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -530,6 +530,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -531,6 +531,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { Entity entity2; while ((entity2 = (Entity) this.entitiesToAdd.poll()) != null) { @@ -34,7 +34,7 @@ index eebd453bfaeb99b8fdf0d11ee8888f27ad2afff2..0e28e829474bea693550b3b2f0e72f97 this.registerEntity(entity2); } -@@ -1228,6 +1229,19 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1265,6 +1266,19 @@ public class WorldServer extends World implements GeneratorAccessSeed { public void unregisterEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity unregister"); // Spigot @@ -54,7 +54,7 @@ index eebd453bfaeb99b8fdf0d11ee8888f27ad2afff2..0e28e829474bea693550b3b2f0e72f97 // Spigot start if ( entity instanceof EntityHuman ) { -@@ -1294,9 +1308,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1331,9 +1345,21 @@ public class WorldServer extends World implements GeneratorAccessSeed { private void registerEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity register"); // Spigot @@ -76,4 +76,4 @@ index eebd453bfaeb99b8fdf0d11ee8888f27ad2afff2..0e28e829474bea693550b3b2f0e72f97 + entity.isQueuedForRegister = false; // Paper this.entitiesById.put(entity.getId(), entity); if (entity instanceof EntityEnderDragon) { - EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eK(); + EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity).eJ(); diff --git a/Spigot-Server-Patches/0430-Fix-unregistering-entities-from-unloading-chunks.patch b/Spigot-Server-Patches/0426-Fix-unregistering-entities-from-unloading-chunks.patch index 53a29f344c..7cd3329b3c 100644 --- a/Spigot-Server-Patches/0430-Fix-unregistering-entities-from-unloading-chunks.patch +++ b/Spigot-Server-Patches/0426-Fix-unregistering-entities-from-unloading-chunks.patch @@ -15,10 +15,10 @@ Combine that with a buggy detail of the previous implementation of the Dupe UUID patch, then this was the likely source of the "Ghost entities" diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0e28e829474bea693550b3b2f0e72f97ff9bb10e..0038ba4153ce3bb894968ce848f844800361c44a 100644 +index 62b2a4d38102b1ffbda4d2fc031350a51fcf180c..ab955f3eaada8017116b99840e2519fd3429cf23 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1387,9 +1387,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1424,9 +1424,9 @@ public class WorldServer extends World implements GeneratorAccessSeed { } private void removeEntityFromChunk(Entity entity) { diff --git a/Spigot-Server-Patches/0431-Remote-Connections-shouldn-t-hold-up-shutdown.patch b/Spigot-Server-Patches/0427-Remote-Connections-shouldn-t-hold-up-shutdown.patch index ee69aaee70..e182432ca5 100644 --- a/Spigot-Server-Patches/0431-Remote-Connections-shouldn-t-hold-up-shutdown.patch +++ b/Spigot-Server-Patches/0427-Remote-Connections-shouldn-t-hold-up-shutdown.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Remote Connections shouldn't hold up shutdown Bugs in the connection logic appears to leave stale connections even, preventing shutdown diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index e923835634f7440e5b88a9d5c62a70fcec8b688a..87753a94792af94454f76a2beb1ab9f1027f514f 100644 +index b197aa44307aca7f0385ae9d2f5622e72bbffc0f..dd83bb7951d2765cfb728e5d9b9b839435c92646 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -361,11 +361,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -359,11 +359,11 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer } if (this.remoteControlListener != null) { diff --git a/Spigot-Server-Patches/0432-Do-not-allow-bees-to-load-chunks-for-beehives.patch b/Spigot-Server-Patches/0428-Do-not-allow-bees-to-load-chunks-for-beehives.patch index f39f9165ee..e73a3a2e4b 100644 --- a/Spigot-Server-Patches/0432-Do-not-allow-bees-to-load-chunks-for-beehives.patch +++ b/Spigot-Server-Patches/0428-Do-not-allow-bees-to-load-chunks-for-beehives.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Do not allow bees to load chunks for beehives diff --git a/src/main/java/net/minecraft/server/EntityBee.java b/src/main/java/net/minecraft/server/EntityBee.java -index b9e01e4d9e64fdec4c4f04f1808eb8832bd00c8e..e6868e2b65e3c2bde7696272b242a47e7394e27f 100644 +index 0f44cbd3ce6e57f9693cd23b10d487e06aa62eeb..b1ff30fb1569ddf59f46240266ce32f0aa96da1a 100644 --- a/src/main/java/net/minecraft/server/EntityBee.java +++ b/src/main/java/net/minecraft/server/EntityBee.java @@ -284,6 +284,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB @@ -27,7 +27,7 @@ index b9e01e4d9e64fdec4c4f04f1808eb8832bd00c8e..e6868e2b65e3c2bde7696272b242a47e @@ -558,6 +560,7 @@ public class EntityBee extends EntityAnimal implements IEntityAngerable, EntityB @Override public boolean g() { - if (EntityBee.this.hasHivePos() && EntityBee.this.fe() && EntityBee.this.hivePos.a((IPosition) EntityBee.this.getPositionVector(), 2.0D)) { + if (EntityBee.this.hasHivePos() && EntityBee.this.fd() && EntityBee.this.hivePos.a((IPosition) EntityBee.this.getPositionVector(), 2.0D)) { + if (!EntityBee.this.world.isLoadedAndInBounds(EntityBee.this.hivePos)) return false; // Paper TileEntity tileentity = EntityBee.this.world.getTileEntity(EntityBee.this.hivePos); diff --git a/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch b/Spigot-Server-Patches/0429-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch index 9d5b458f62..a9fd70d33f 100644 --- a/Spigot-Server-Patches/0433-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch +++ b/Spigot-Server-Patches/0429-Prevent-Double-PlayerChunkMap-adds-crashing-server.patch @@ -7,10 +7,10 @@ Suspected case would be around the technique used in .stopRiding Stack will identify any causer of this and warn instead of crashing. diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 2542b24b0e1919fdc28417df718acd766deefd03..d4207cb622bf17314f77831c604c8ba9e6cf848f 100644 +index 512940ef8608d28c83a4a8d0777a99ebf25b4e8b..f839091ae4385e763a19d680585a9363fad6b744 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1445,6 +1445,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1446,6 +1446,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { protected void addEntity(Entity entity) { org.spigotmc.AsyncCatcher.catchOp("entity track"); // Spigot @@ -26,10 +26,10 @@ index 2542b24b0e1919fdc28417df718acd766deefd03..d4207cb622bf17314f77831c604c8ba9 EntityTypes<?> entitytypes = entity.getEntityType(); int i = entitytypes.getChunkRange() * 16; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 0038ba4153ce3bb894968ce848f844800361c44a..1fabe0a99e796f423adf4a6c51811b462745c537 100644 +index ab955f3eaada8017116b99840e2519fd3429cf23..c479d9ebeb6e98d091b4e68d59bc5fa6980947ca 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1353,7 +1353,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1390,7 +1390,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } } @@ -38,7 +38,7 @@ index 0038ba4153ce3bb894968ce848f844800361c44a..1fabe0a99e796f423adf4a6c51811b46 // CraftBukkit start - SPIGOT-5278 if (entity instanceof EntityDrowned) { this.navigators.add(((EntityDrowned) entity).navigationWater); -@@ -1364,6 +1364,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1401,6 +1401,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.navigators.add(((EntityInsentient) entity).getNavigation()); } entity.valid = true; // CraftBukkit diff --git a/Spigot-Server-Patches/0434-Optimize-Collision-to-not-load-chunks.patch b/Spigot-Server-Patches/0430-Optimize-Collision-to-not-load-chunks.patch index 2ca7e66b4a..7197c44105 100644 --- a/Spigot-Server-Patches/0434-Optimize-Collision-to-not-load-chunks.patch +++ b/Spigot-Server-Patches/0430-Optimize-Collision-to-not-load-chunks.patch @@ -14,10 +14,10 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index e895bf811ce5d441541725ade48e3f07ca86fc2b..152f613159ef88977de867c0deec94bfa4353f7a 100644 +index 78d2b48385bcb2090058d617599ef2b639fecbcf..d3e4b26798661b99686941e813aca50774db8ff6 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -80,6 +80,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -82,6 +82,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke private CraftEntity bukkitEntity; PlayerChunkMap.EntityTracker tracker; // Paper @@ -26,7 +26,7 @@ index e895bf811ce5d441541725ade48e3f07ca86fc2b..152f613159ef88977de867c0deec94bf public CraftEntity getBukkitEntity() { if (bukkitEntity == null) { diff --git a/src/main/java/net/minecraft/server/ICollisionAccess.java b/src/main/java/net/minecraft/server/ICollisionAccess.java -index b27260270de80de371a5a71fa0516aa43c44c83e..1cc40b1f0af9e617b2a71bcc442543e10b2dc61a 100644 +index 7bb0843d76864fc10575532745eb63f9ca478354..25e54a1fadc5d31fb250a3f47524b4f345fc8cc6 100644 --- a/src/main/java/net/minecraft/server/ICollisionAccess.java +++ b/src/main/java/net/minecraft/server/ICollisionAccess.java @@ -46,7 +46,9 @@ public interface ICollisionAccess extends IBlockAccess { @@ -40,10 +40,10 @@ index b27260270de80de371a5a71fa0516aa43c44c83e..1cc40b1f0af9e617b2a71bcc442543e1 Stream<VoxelShape> c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 15a12ebc266c54d2b29f368fc31df76b994b28ae..f0caadb6117d761e6ce0ee573e2c351b894a00c2 100644 +index f9eee8a5a06b300e1fece26e6a001da6b169b965..c0625090f7c36d42112c2e50785d860aeaecb60e 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -722,6 +722,7 @@ public abstract class PlayerList { +@@ -734,6 +734,7 @@ public abstract class PlayerList { entityplayer1.forceSetPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); // CraftBukkit end @@ -120,7 +120,7 @@ index 4967d1ebd109c462a322e4829d01ff519d1b5366..ed0f3ddbcb7d6ce8a59ae3829f4cb11a if (!this.i.test(iblockdata, this.e) || l == 1 && !iblockdata.d() || l == 2 && !iblockdata.a(Blocks.MOVING_PISTON)) { continue; diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index b6e2a3d8d0cf510f497c6f974356fafaf2adc13b..4acde367542247627574fdeb586fb8c9087eef1a 100644 +index 881cea7c466f29ff4a89db28d104e8500a548b1f..dd91a57f994f1c23464f5e33ca332529d7d9ea19 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -239,7 +239,8 @@ public final class VoxelShapes { diff --git a/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch b/Spigot-Server-Patches/0431-Don-t-tick-dead-players.patch index 7f83b49e23..65e5951a74 100644 --- a/Spigot-Server-Patches/0435-Don-t-tick-dead-players.patch +++ b/Spigot-Server-Patches/0431-Don-t-tick-dead-players.patch @@ -7,10 +7,10 @@ Causes sync chunk loads and who knows what all else. This is safe because Spectators are skipped in unloaded chunks too in vanilla. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 415049bb5fdcc5c3edaf71bc8ddc330fe6bbcdb2..a03340ae87bf967895d39bed1767f9753c7f0c60 100644 +index 4fd7be1029bb69abfce3ad8d939031c574e19e9c..32fb4938bd73ad2be24bd7bd856275f6a1b7cafd 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -469,7 +469,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -473,7 +473,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public void playerTick() { try { diff --git a/Spigot-Server-Patches/0436-Dead-Player-s-shouldn-t-be-able-to-move.patch b/Spigot-Server-Patches/0432-Dead-Player-s-shouldn-t-be-able-to-move.patch index eb02670fdd..3fed64bdc3 100644 --- a/Spigot-Server-Patches/0436-Dead-Player-s-shouldn-t-be-able-to-move.patch +++ b/Spigot-Server-Patches/0432-Dead-Player-s-shouldn-t-be-able-to-move.patch @@ -7,7 +7,7 @@ This fixes a lot of game state issues where packets were delayed for processing due to 1.15's new queue but processed while dead. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 7916421fe1dd8eadfd1c9bd15c4bbbb7331faca6..22acfe1350eb122b7eaa7209f519e4f4f1469b6c 100644 +index 272f4ff0a59350a088d6699a9fcb6bb9f8e95551..eae7bfa171e648b8ec51465a8d9f7d9b7c59a2c9 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -952,7 +952,7 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch b/Spigot-Server-Patches/0433-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch index 18c159e4eb..aacf413372 100644 --- a/Spigot-Server-Patches/0437-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch +++ b/Spigot-Server-Patches/0433-Optimize-PlayerChunkMap-memory-use-for-visibleChunks.patch @@ -57,10 +57,10 @@ index 0000000000000000000000000000000000000000..f6ff4d8132a95895680f5bc81f8f873e + } +} diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364ee784c93 100644 +index fc8f3539f143d5fb3fcfb8b7813a2384497ccc1d..359ac0845468e0bcccf7ed4d5596cad5f72dafa8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -756,7 +756,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -757,7 +757,7 @@ public class ChunkProviderServer extends IChunkProvider { entityPlayer.playerNaturallySpawnedEvent.callEvent(); }; // Paper end @@ -70,10 +70,10 @@ index ba9f75bd8f6fe1990d485548f4481bd1762d93af..e14e8bcf235339c1537a1e0a7702a364 if (optional.isPresent()) { diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 8eb93f33da264cd5182d1399e40e1f63d83a3e98..73e5a1a11c90aeb31e29d79fca2fedcd52e7439a 100644 +index c470c6527b214026c230feaae0c0875c86dea673..df3150072fd36dac28d83309e50342c9cfa326b3 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -598,7 +598,7 @@ public final class MCUtil { +@@ -599,7 +599,7 @@ public final class MCUtil { WorldServer world = ((org.bukkit.craftbukkit.CraftWorld)bukkitWorld).getHandle(); PlayerChunkMap chunkMap = world.getChunkProvider().playerChunkMap; @@ -83,10 +83,10 @@ index 8eb93f33da264cd5182d1399e40e1f63d83a3e98..73e5a1a11c90aeb31e29d79fca2fedcd List<PlayerChunk> allChunks = new ArrayList<>(visibleChunks.values()); List<EntityPlayer> players = world.players; diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c87d9511c8 100644 +index f839091ae4385e763a19d680585a9363fad6b744..d3a597d878de4cb625484cbf3a9838961d38ada0 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -56,8 +56,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -57,8 +57,33 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private static final Logger LOGGER = LogManager.getLogger(); public static final int GOLDEN_TICKET = 33 + ChunkStatus.b(); @@ -122,7 +122,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 private final Long2ObjectLinkedOpenHashMap<PlayerChunk> pendingUnload; final LongSet loadedChunks; // Paper - private -> package public final WorldServer world; -@@ -130,7 +155,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -131,7 +156,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) { super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag); @@ -131,7 +131,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 this.pendingUnload = new Long2ObjectLinkedOpenHashMap(); this.loadedChunks = new LongOpenHashSet(); this.unloadQueue = new LongOpenHashSet(); -@@ -222,9 +247,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -223,9 +248,52 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return (PlayerChunk) this.updatingChunks.get(i); } @@ -185,7 +185,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 } protected IntSupplier c(long i) { -@@ -412,8 +480,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -413,8 +481,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end protected void save(boolean flag) { @@ -196,7 +196,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 MutableBoolean mutableboolean = new MutableBoolean(); do { -@@ -441,7 +510,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -442,7 +511,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // this.i(); // Paper - nuke IOWorker PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.w.getName()); } else { @@ -205,7 +205,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { -@@ -612,7 +681,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -613,7 +682,20 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { if (!this.updatingChunksModified) { return false; } else { @@ -227,7 +227,7 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 this.updatingChunksModified = false; return true; } -@@ -1083,12 +1165,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1084,12 +1166,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } protected Iterable<PlayerChunk> f() { @@ -243,13 +243,13 @@ index 19be0735fead18cbea75e02a6135f189eaf29aa7..2fc063add21b89ee5a456536088fe0c8 while (objectbidirectionaliterator.hasNext()) { Entry<PlayerChunk> entry = (Entry) objectbidirectionaliterator.next(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 045d874bffc25279247edfc413686d5b89cb301e..c57ccc003cf055c9e5dc704eaa07544881f32727 100644 +index 20aeec95138a08accc4cb7b1f2d80d63bb9bf920..5ef12e85d7374c137e2d7ff3e0571995070cc222 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -73,6 +73,7 @@ import net.minecraft.server.GameRules; - import net.minecraft.server.GroupDataEntity; +@@ -74,6 +74,7 @@ import net.minecraft.server.GroupDataEntity; import net.minecraft.server.IBlockData; import net.minecraft.server.IChunkAccess; + import net.minecraft.server.IRegistry; +import net.minecraft.server.MCUtil; import net.minecraft.server.MinecraftKey; import net.minecraft.server.MinecraftServer; @@ -285,7 +285,7 @@ index 045d874bffc25279247edfc413686d5b89cb301e..c57ccc003cf055c9e5dc704eaa075448 } public int getPlayerCount() { return world.players.size(); -@@ -438,6 +442,14 @@ public class CraftWorld implements World { +@@ -443,6 +447,14 @@ public class CraftWorld implements World { @Override public Chunk[] getLoadedChunks() { diff --git a/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch b/Spigot-Server-Patches/0434-Increase-Light-Queue-Size.patch index 2890f58e7c..ccded33fc0 100644 --- a/Spigot-Server-Patches/0438-Increase-Light-Queue-Size.patch +++ b/Spigot-Server-Patches/0434-Increase-Light-Queue-Size.patch @@ -14,10 +14,10 @@ light engine on shutdown... The queue size only puts a cap on max loss, doesn't solve that problem. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index b987399ca3786a30f87c98658e8bf04d4aa2e2da..08949526752e4d66e4c0df11f76f6500846e1fe4 100644 +index 6c80906d0cf3594a30aa201793a16a29ffeb1fcb..82ff9cc4ae84ca120f7b0c4bd14c55d1a4280358 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -617,4 +617,9 @@ public class PaperWorldConfig { +@@ -606,4 +606,9 @@ public class PaperWorldConfig { private void zombieVillagerInfectionChance() { zombieVillagerInfectionChance = getDouble("zombie-villager-infection-chance", zombieVillagerInfectionChance); } @@ -28,15 +28,15 @@ index b987399ca3786a30f87c98658e8bf04d4aa2e2da..08949526752e4d66e4c0df11f76f6500 + } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 99b6a4d277816699a5abd9ec889535c064758e97..0d91765cb6386c9483a6b5494e37bd7806638928 100644 +index c5dc14ee9b1721780ed83851c15c7bd3df83390d..3c87b0c5a55caf589aabd508255e704368797d65 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -662,7 +662,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -660,7 +660,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.executeModerately(); // CraftBukkit end worldloadlistener.b(); - chunkproviderserver.getLightEngine().a(5); + chunkproviderserver.getLightEngine().a(worldserver.paperConfig.lightQueueSize); // Paper - increase light queue size - this.ba(); + this.bb(); // CraftBukkit start diff --git a/Spigot-Server-Patches/0439-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch b/Spigot-Server-Patches/0435-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch index bcc5be24a3..179ac69ad3 100644 --- a/Spigot-Server-Patches/0439-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch +++ b/Spigot-Server-Patches/0435-Mid-Tick-Chunk-Tasks-Speed-up-processing-of-chunk-lo.patch @@ -42,7 +42,7 @@ index a58ef60d9976b3afc50e94364cf474bd2e5fdfd6..dd07223978c9aa648673d96ba7b3db11 public static final Timing commandFunctionsTimer = Timings.ofSafe("Command Functions"); public static final Timing connectionTimer = Timings.ofSafe("Connection Handler"); diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java -index 8508b3e10e60a4ce36d471b1d3f7ffc836a6ddf7..aad1420dc63c16b558ad1ca34accf8a7a9af6363 100644 +index ee1a690c1b12f28a5282a61917d28deb3ca08f61..7b37f46b29699603629e5e635be89f725f163f00 100644 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -405,4 +405,9 @@ public class PaperConfig { @@ -56,10 +56,10 @@ index 8508b3e10e60a4ce36d471b1d3f7ffc836a6ddf7..aad1420dc63c16b558ad1ca34accf8a7 + } } diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78718d298f 100644 +index 359ac0845468e0bcccf7ed4d5596cad5f72dafa8..fb061dc0d6be52c959e8360e25a2c7c0468f40e2 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -694,6 +694,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -695,6 +695,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().enter("purge"); this.world.timings.doChunkMap.startTiming(); // Spigot this.chunkMapDistance.purgeTickets(); @@ -67,7 +67,7 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 this.tickDistanceManager(); this.world.timings.doChunkMap.stopTiming(); // Spigot this.world.getMethodProfiler().exitEnter("chunks"); -@@ -703,6 +704,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -704,6 +705,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.timings.doChunkUnload.startTiming(); // Spigot this.world.getMethodProfiler().exitEnter("unload"); this.playerChunkMap.unloadChunks(booleansupplier); @@ -75,7 +75,7 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 this.world.timings.doChunkUnload.stopTiming(); // Spigot this.world.getMethodProfiler().exit(); this.clearCache(); -@@ -756,7 +758,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -757,7 +759,7 @@ public class ChunkProviderServer extends IChunkProvider { entityPlayer.playerNaturallySpawnedEvent.callEvent(); }; // Paper end @@ -84,7 +84,7 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); if (optional.isPresent()) { -@@ -780,6 +782,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -781,6 +783,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.timings.chunkTicks.startTiming(); // Spigot // Paper this.world.a(chunk, k); this.world.timings.chunkTicks.stopTiming(); // Spigot // Paper @@ -92,7 +92,7 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 } } } -@@ -936,6 +939,41 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -937,6 +940,41 @@ public class ChunkProviderServer extends IChunkProvider { super.executeTask(runnable); } @@ -135,10 +135,10 @@ index e14e8bcf235339c1537a1e0a7702a364ee784c93..d1f832db33f21f8ba910d2c0c163af78 protected boolean executeNext() { // CraftBukkit start - process pending Chunk loadCallback() and unloadCallback() after each run task diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef878baff782 100644 +index 3c87b0c5a55caf589aabd508255e704368797d65..9ee7e5a1fd499dfdb804a78e41ddaf3e43dc1920 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -941,6 +941,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -939,6 +939,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // Paper end tickSection = curTime; } @@ -146,7 +146,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 // Spigot end //MinecraftServer.currentTick = (int) (System.currentTimeMillis() / 50); // CraftBukkit // Paper - don't overwrite current tick time -@@ -1010,7 +1011,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1008,7 +1009,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } @@ -155,7 +155,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 // CraftBukkit start if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken return this.forceTicks || this.isEntered() || SystemUtils.getMonotonicMillis() < (this.X ? this.W : this.nextTick); -@@ -1040,6 +1041,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1038,6 +1039,23 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas }); } @@ -179,7 +179,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 @Override protected TickTask postToMainThread(Runnable runnable) { return new TickTask(this.ticks, runnable); -@@ -1126,6 +1144,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1124,6 +1142,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // Paper start - move oversleep into full server tick isOversleep = true;MinecraftTimings.serverOversleep.startTiming(); this.awaitTasks(() -> { @@ -187,7 +187,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 return !this.canOversleep(); }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); -@@ -1204,13 +1223,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1202,13 +1221,16 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } protected void b(BooleanSupplier booleansupplier) { @@ -204,7 +204,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 this.methodProfiler.exitEnter("levels"); Iterator iterator = this.getWorlds().iterator(); -@@ -1221,7 +1243,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1219,7 +1241,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas processQueue.remove().run(); } MinecraftTimings.processQueueTimer.stopTiming(); // Spigot @@ -213,7 +213,7 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Send time updates to everyone, it will get the right time from the world the player is in. // Paper start - optimize time updates -@@ -1263,9 +1285,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1261,9 +1283,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.methodProfiler.enter("tick"); try { @@ -226,10 +226,10 @@ index 0d91765cb6386c9483a6b5494e37bd7806638928..5b6f3d811ff55d0c6d55bddc7707ef87 // Spigot Start CrashReport crashreport; diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 3ebb6140b248925c53bc8912d4eeaced00d30fe2..8f1a47fcb317fc79f8827e93d9bfe8e9023cca20 100644 +index c479d9ebeb6e98d091b4e68d59bc5fa6980947ca..860101012d81f62092fed402100f00e162d6dc9e 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -452,6 +452,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -453,6 +453,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } timings.scheduledBlocks.stopTiming(); // Paper @@ -237,15 +237,15 @@ index 3ebb6140b248925c53bc8912d4eeaced00d30fe2..8f1a47fcb317fc79f8827e93d9bfe8e9 gameprofilerfiller.exitEnter("raid"); this.timings.raids.startTiming(); // Paper - timings this.persistentRaid.a(); -@@ -460,6 +461,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -461,6 +462,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { timings.doSounds.startTiming(); // Spigot - this.ah(); + this.aj(); timings.doSounds.stopTiming(); // Spigot + this.getMinecraftServer().midTickLoadChunks(); // Paper this.ticking = false; gameprofilerfiller.exitEnter("entities"); boolean flag3 = true || !this.players.isEmpty() || !this.getForceLoadedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players -@@ -526,6 +528,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -527,6 +529,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { timings.entityTick.stopTiming(); // Spigot this.tickingEntities = false; @@ -253,7 +253,7 @@ index 3ebb6140b248925c53bc8912d4eeaced00d30fe2..8f1a47fcb317fc79f8827e93d9bfe8e9 Entity entity2; -@@ -535,6 +538,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -536,6 +539,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } timings.tickEntities.stopTiming(); // Spigot diff --git a/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch b/Spigot-Server-Patches/0436-Don-t-move-existing-players-to-world-spawn.patch index 989b94baf8..36da13e503 100644 --- a/Spigot-Server-Patches/0440-Don-t-move-existing-players-to-world-spawn.patch +++ b/Spigot-Server-Patches/0436-Don-t-move-existing-players-to-world-spawn.patch @@ -10,27 +10,27 @@ larger than the keep loaded range. By skipping this, we avoid potential for a large spike on server start. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index a03340ae87bf967895d39bed1767f9753c7f0c60..48ee5d7beaf336f7eb440a4a8a6e3bba2321b0b9 100644 +index 32fb4938bd73ad2be24bd7bd856275f6a1b7cafd..2f1f57dc347e37c2b2be0cc7930174aa66bf9d67 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -118,7 +118,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -120,7 +120,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.serverStatisticManager = minecraftserver.getPlayerList().getStatisticManager(this); this.advancementDataPlayer = minecraftserver.getPlayerList().f(this); this.G = 1.0F; -- this.b(worldserver); -+ //this.b(worldserver); // Paper - don't move to spawn on login, only first join +- this.c(worldserver); ++ //this.c(worldserver); // Paper - don't move to spawn on login, only first join this.cachedSingleHashSet = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper -@@ -168,6 +168,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -170,6 +170,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } // CraftBukkit end -+ public final void moveToSpawn(WorldServer worldserver) { b(worldserver); } // Paper - OBFHELPER - private void b(WorldServer worldserver) { ++ public final void moveToSpawn(WorldServer worldserver) { c(worldserver); } // Paper - OBFHELPER + private void c(WorldServer worldserver) { BlockPosition blockposition = worldserver.getSpawn(); -@@ -343,7 +344,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -347,7 +348,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { position = Vec3D.a(((WorldServer) world).getSpawn()); } this.world = world; @@ -40,7 +40,7 @@ index a03340ae87bf967895d39bed1767f9753c7f0c60..48ee5d7beaf336f7eb440a4a8a6e3bba this.playerInteractManager.a((WorldServer) world); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f0caadb6117d761e6ce0ee573e2c351b894a00c2..4676b4dc4b22c838c946a342af9e88b56436de70 100644 +index c0625090f7c36d42112c2e50785d860aeaecb60e..6cbbb4817a921dc7c811259e34f19e538c107226 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -134,6 +134,8 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch b/Spigot-Server-Patches/0437-Add-tick-times-API-and-mspt-command.patch index f844f52cfa..c02a33090d 100644 --- a/Spigot-Server-Patches/0441-Add-tick-times-API-and-mspt-command.patch +++ b/Spigot-Server-Patches/0437-Add-tick-times-API-and-mspt-command.patch @@ -87,7 +87,7 @@ index 7b37f46b29699603629e5e635be89f725f163f00..093605fe8e079d9ec973702c55ea6cad version = getInt("config-version", 20); set("config-version", 20); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 0573b03a2213661e9d9595af735e4a769586f0b8..251e07ca1955533be4e6075af4200a53d2bb4bdb 100644 +index 9ee7e5a1fd499dfdb804a78e41ddaf3e43dc1920..2a269f51a6797ec9350e5bf010076412283a8db5 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -107,6 +107,11 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -102,7 +102,7 @@ index 0573b03a2213661e9d9595af735e4a769586f0b8..251e07ca1955533be4e6075af4200a53 @Nullable private KeyPair H; @Nullable -@@ -1215,6 +1220,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1213,6 +1218,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.ag = this.ag * 0.8F + (float) l / 1000000.0F * 0.19999999F; long i1 = SystemUtils.getMonotonicNanos(); @@ -115,9 +115,9 @@ index 0573b03a2213661e9d9595af735e4a769586f0b8..251e07ca1955533be4e6075af4200a53 this.circularTimer.a(i1 - i); this.methodProfiler.exit(); org.spigotmc.WatchdogThread.tick(); // Spigot -@@ -2170,4 +2181,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - public SaveData getSaveData() { - return this.saveData; +@@ -2175,4 +2186,30 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas + public IRegistryCustom aX() { + return this.f; } + + // Paper start @@ -147,10 +147,10 @@ index 0573b03a2213661e9d9595af735e4a769586f0b8..251e07ca1955533be4e6075af4200a53 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4f9917af2ebb11266afe925daac154c8e2e9479b..ff7456a744bb0e42ba96fcb699690de82582a06d 100644 +index 39e2246569f4c89ed0b5e8de1d738521732972ce..854cfac4b511bb3c6ee221493e479e97fa95b4dc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2139,6 +2139,16 @@ public final class CraftServer implements Server { +@@ -2133,6 +2133,16 @@ public final class CraftServer implements Server { net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() }; } diff --git a/Spigot-Server-Patches/0442-Expose-MinecraftServer-isRunning.patch b/Spigot-Server-Patches/0438-Expose-MinecraftServer-isRunning.patch index b095a0a86f..fef5c5f724 100644 --- a/Spigot-Server-Patches/0442-Expose-MinecraftServer-isRunning.patch +++ b/Spigot-Server-Patches/0438-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index ff7456a744bb0e42ba96fcb699690de82582a06d..9111bc559353bc09eaf9a05a35b2d921f54b9f10 100644 +index 854cfac4b511bb3c6ee221493e479e97fa95b4dc..a860b850f7833bd2462c117cd58879424be3792c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2304,5 +2304,10 @@ public final class CraftServer implements Server { +@@ -2298,5 +2298,10 @@ public final class CraftServer implements Server { public int getCurrentTick() { return net.minecraft.server.MinecraftServer.currentTick; } diff --git a/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch b/Spigot-Server-Patches/0439-Add-Raw-Byte-ItemStack-Serialization.patch index e51ef893d3..6192963d60 100644 --- a/Spigot-Server-Patches/0443-Add-Raw-Byte-ItemStack-Serialization.patch +++ b/Spigot-Server-Patches/0439-Add-Raw-Byte-ItemStack-Serialization.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Add Raw Byte ItemStack Serialization Serializes using NBT which is safer for server data migrations than bukkits format. diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java -index d7ebbce930fc65437697d25637346b9c99e6a8fa..5d807082281527c78a08d01430e42b3ecee6d2cf 100644 +index 08c11270c0409f3af9ba9b3a64488a2381b2a423..48e31e9142ffeb2725af6b1f483de67410e25694 100644 --- a/src/main/java/net/minecraft/server/DataConverterRegistry.java +++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java @@ -24,6 +24,7 @@ public class DataConverterRegistry { @@ -18,7 +18,7 @@ index d7ebbce930fc65437697d25637346b9c99e6a8fa..5d807082281527c78a08d01430e42b3e return DataConverterRegistry.c; } diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index d1e4ee64aa395b38cad22f316308c4687ea56b9f..9a9678ed76b95131df0c12af5bba3440789699aa 100644 +index b6703378e21a6cd7e140fd35756a20d47f49ed31..8c82f80bb21611b54a35e61c04f5ba3ee9efbd7d 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -144,6 +144,7 @@ public final class ItemStack { @@ -30,19 +30,19 @@ index d1e4ee64aa395b38cad22f316308c4687ea56b9f..9a9678ed76b95131df0c12af5bba3440 try { return new ItemStack(nbttagcompound); diff --git a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -index f48b62af436de47484eb1cf496e97a29168586b0..c948e590eeff0aea53573532f8c507d638cc0bdf 100644 +index 6e6cabc03bc3822ee973bdafef8f4adb61b6c263..0282dcb68fa185b342f59c5aaafe8f42c632cac3 100644 --- a/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java +++ b/src/main/java/net/minecraft/server/NBTCompressedStreamTools.java -@@ -15,6 +15,7 @@ import io.netty.buffer.ByteBufInputStream; // Paper - - public class NBTCompressedStreamTools { +@@ -47,6 +47,7 @@ public class NBTCompressedStreamTools { + return nbttagcompound; + } + public static NBTTagCompound readNBT(InputStream inputstream) throws IOException { return a(inputstream); } // Paper - OBFHELPER public static NBTTagCompound a(InputStream inputstream) throws IOException { DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new GZIPInputStream(inputstream))); Throwable throwable = null; -@@ -44,6 +45,7 @@ public class NBTCompressedStreamTools { - return nbttagcompound; +@@ -102,6 +103,7 @@ public class NBTCompressedStreamTools { + } + public static void writeNBT(NBTTagCompound nbttagcompound, OutputStream outputstream) throws IOException { a(nbttagcompound, outputstream); } // Paper - OBFHELPER @@ -50,7 +50,7 @@ index f48b62af436de47484eb1cf496e97a29168586b0..c948e590eeff0aea53573532f8c507d6 DataOutputStream dataoutputstream = new DataOutputStream(new BufferedOutputStream(new GZIPOutputStream(outputstream))); Throwable throwable = null; diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java -index d288d5fadbdb7cd4e5a42f94cdba6f825b2ed877..90c1067ca23e566a96d71e06c273d44397928b64 100644 +index 1f1766f9396ad8c5be9725c2145e0ce29d110a55..c1efe830dd0807d5f7bda10cb582556af6d23383 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -333,6 +333,46 @@ public final class CraftMagicNumbers implements UnsafeValues { diff --git a/Spigot-Server-Patches/0444-Remove-streams-from-Mob-AI-System.patch b/Spigot-Server-Patches/0440-Remove-streams-from-Mob-AI-System.patch index 9187f6cb2a..a2076fc9bf 100644 --- a/Spigot-Server-Patches/0444-Remove-streams-from-Mob-AI-System.patch +++ b/Spigot-Server-Patches/0440-Remove-streams-from-Mob-AI-System.patch @@ -10,7 +10,7 @@ Also optimise the stream.anyMatch statement to move to a bitset where we can replace the call with a single bitwise operation. diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index 384300894d19ff70556c23b130c01b2e49aa3f20..a85d81186ae92dec72f2cc3a1dcd8c4b7e7ede62 100644 +index b132cb42da9a733e46fe9059258db7b77f811b3b..42b690b9215d82346990d93a5cead727b1fa10ab 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -1,10 +1,12 @@ @@ -234,7 +234,7 @@ index b18e53220d8dbd50723c4201231091cbe4f4119a..22f4fec58fbaab24673dd418700c5167 public void a(PathfinderGoal.Type pathfindergoal_type, boolean flag) { diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java -index 04b28555b1bb68536e40bb652613678775337b31..96f4401044cacf88e8e00b5b18821c105e634fba 100644 +index f3df10587e652d3a26d15deb09304b97a727cd88..22773eca7561d39cd838338efe6d40ab9421feba 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java @@ -59,9 +59,10 @@ public class PathfinderGoalWrapped extends PathfinderGoal { diff --git a/Spigot-Server-Patches/0445-Delay-unsafe-actions-until-after-entity-ticking-is-d.patch b/Spigot-Server-Patches/0441-Delay-unsafe-actions-until-after-entity-ticking-is-d.patch index e5c08756d6..19666db293 100644 --- a/Spigot-Server-Patches/0445-Delay-unsafe-actions-until-after-entity-ticking-is-d.patch +++ b/Spigot-Server-Patches/0441-Delay-unsafe-actions-until-after-entity-ticking-is-d.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Delay unsafe actions until after entity ticking is done This will help prevent many cases of unregistering entities during entity ticking diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 8f1a47fcb317fc79f8827e93d9bfe8e9023cca20..8f87e5121631dfa50f6cb95d036a700135d21b2c 100644 +index 860101012d81f62092fed402100f00e162d6dc9e..9d13745382d34693a0ebdcfe1c3392fb0b4f15b5 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -61,6 +61,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -62,6 +62,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { public final List<EntityPlayer> players = Lists.newArrayList(); // Paper - private -> public public final ChunkProviderServer chunkProvider; // Paper - public boolean tickingEntities; @@ -26,7 +26,7 @@ index 8f1a47fcb317fc79f8827e93d9bfe8e9023cca20..8f87e5121631dfa50f6cb95d036a7001 private final MinecraftServer server; public final WorldDataServer worldDataServer; // CraftBukkit - type public boolean savingDisabled; -@@ -528,6 +538,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -529,6 +539,16 @@ public class WorldServer extends World implements GeneratorAccessSeed { timings.entityTick.stopTiming(); // Spigot this.tickingEntities = false; diff --git a/Spigot-Server-Patches/0446-Async-command-map-building.patch b/Spigot-Server-Patches/0442-Async-command-map-building.patch index 953f418632..fea0b75504 100644 --- a/Spigot-Server-Patches/0446-Async-command-map-building.patch +++ b/Spigot-Server-Patches/0442-Async-command-map-building.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Async command map building diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index e6030512dbbfac3c2ab29e20562ad666f7608295..1229aaf19de60f1e3ce161b5c3b7ef659d14c018 100644 +index 3a91513951f635b82d3d612c29e78f9f1db4860d..4b1ea9bc39191e01f83577c7bad128cf1ab9612f 100644 --- a/src/main/java/net/minecraft/server/CommandDispatcher.java +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -242,6 +242,14 @@ public class CommandDispatcher { +@@ -244,6 +244,14 @@ public class CommandDispatcher { if ( org.spigotmc.SpigotConfig.tabComplete < 0 ) return; // Spigot // CraftBukkit start // Register Vanilla commands into builtRoot as before @@ -23,7 +23,7 @@ index e6030512dbbfac3c2ab29e20562ad666f7608295..1229aaf19de60f1e3ce161b5c3b7ef65 Map<CommandNode<CommandListenerWrapper>, CommandNode<ICompletionProvider>> map = Maps.newIdentityHashMap(); // Use identity to prevent aliasing issues RootCommandNode vanillaRoot = new RootCommandNode(); -@@ -259,7 +267,14 @@ public class CommandDispatcher { +@@ -261,7 +269,14 @@ public class CommandDispatcher { for (CommandNode node : rootcommandnode.getChildren()) { bukkit.add(node.getName()); } diff --git a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch b/Spigot-Server-Patches/0443-Improved-Watchdog-Support.patch index 04b712a32e..fa5dfb579e 100644 --- a/Spigot-Server-Patches/0447-Improved-Watchdog-Support.patch +++ b/Spigot-Server-Patches/0443-Improved-Watchdog-Support.patch @@ -67,7 +67,7 @@ index 95e6a6de7ccfc4445d0ac19c5f874c0d533b1712..cc6e6f245ee5e73bd570cf42381bf55e throwable = throwable.getCause(); } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6a54dcacc 100644 +index dd83bb7951d2765cfb728e5d9b9b839435c92646..a16495f69626356e5312f8804c66d40a29894b7e 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -242,7 +242,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @@ -79,7 +79,7 @@ index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6 if (dedicatedserverproperties.announcePlayerAchievements != null) { ((GameRules.GameRuleBoolean) this.getGameRules().get(GameRules.ANNOUNCE_ADVANCEMENTS)).a(dedicatedserverproperties.announcePlayerAchievements, (MinecraftServer) this); } -@@ -368,6 +368,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -366,6 +366,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer //this.remoteStatusListener.b(); // Paper - don't wait for remote connections } @@ -87,7 +87,7 @@ index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6 System.exit(0); // CraftBukkit } -@@ -696,7 +697,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -699,7 +700,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @Override public void stop() { super.stop(); @@ -97,7 +97,7 @@ index 87753a94792af94454f76a2beb1ab9f1027f514f..4c561181a977fd0244325880bb6a8cd6 @Override diff --git a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java -index c5259673ccddd6326d185370f8123aa936aae755..fb4c5ae4011e104848bab9e9141d9e90a5cb45ca 100644 +index c475009fe03a1550cb64a716a02a5a8b5204c873..5df6be7e8d9b1295ed0700b3be90c3778fc7d77c 100644 --- a/src/main/java/net/minecraft/server/IAsyncTaskHandler.java +++ b/src/main/java/net/minecraft/server/IAsyncTaskHandler.java @@ -135,6 +135,7 @@ public abstract class IAsyncTaskHandler<R extends Runnable> implements Mailbox<R @@ -105,11 +105,11 @@ index c5259673ccddd6326d185370f8123aa936aae755..fb4c5ae4011e104848bab9e9141d9e90 r0.run(); } catch (Exception exception) { + if (exception.getCause() instanceof ThreadDeath) throw exception; // Paper - IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bh(), exception); + IAsyncTaskHandler.LOGGER.fatal("Error executing task on {}", this.bi(), exception); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9f7a64d35 100644 +index 2a269f51a6797ec9350e5bf010076412283a8db5..2f83f308596e97f82833d639fe2a2ce1017c0574 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -159,7 +159,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @@ -130,7 +130,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 public static <S extends MinecraftServer> S a(Function<Thread, S> function) { AtomicReference<S> atomicreference = new AtomicReference(); Thread thread = new Thread(() -> { -@@ -737,6 +739,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -735,6 +737,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // CraftBukkit start private boolean hasStopped = false; @@ -138,7 +138,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 private final Object stopLock = new Object(); public final boolean hasStopped() { synchronized (stopLock) { -@@ -751,6 +754,19 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -749,6 +752,19 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas if (hasStopped) return; hasStopped = true; } @@ -158,8 +158,8 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 // CraftBukkit end MinecraftServer.LOGGER.info("Stopping server"); MinecraftTimings.stopServer(); // Paper -@@ -816,7 +832,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - this.getUserCache().c(false); // Paper +@@ -814,7 +830,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas + this.getUserCache().b(false); // Paper } // Spigot end + // Paper start - move final shutdown items here @@ -177,15 +177,15 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 } public String getServerIp() { -@@ -909,6 +936,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -907,6 +934,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas - protected void v() { + protected void w() { try { + long serverStartTime = SystemUtils.getMonotonicNanos(); // Paper if (this.init()) { this.nextTick = SystemUtils.getMonotonicMillis(); this.serverPing.setMOTD(new ChatComponentText(this.motd)); -@@ -916,6 +944,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -914,6 +942,18 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.a(this.serverPing); // Spigot start @@ -204,7 +204,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 org.spigotmc.WatchdogThread.hasStarted = true; // Paper Arrays.fill( recentTps, 20 ); long start = System.nanoTime(), curTime, tickSection = start; // Paper - Further improve server tick loop -@@ -971,6 +1011,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -969,6 +1009,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.a((CrashReport) null); } } catch (Throwable throwable) { @@ -217,7 +217,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); // Spigot Start if ( throwable.getCause() != null ) -@@ -1002,14 +1048,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1000,14 +1046,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } catch (Throwable throwable1) { MinecraftServer.LOGGER.error("Exception stopping the server", throwable1); } finally { @@ -235,7 +235,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 } } -@@ -1065,6 +1111,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1063,6 +1109,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas @Override protected TickTask postToMainThread(Runnable runnable) { @@ -248,7 +248,7 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 return new TickTask(this.ticks, runnable); } -@@ -1307,6 +1359,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1305,6 +1357,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas try { crashreport = CrashReport.a(throwable, "Exception ticking world"); } catch (Throwable t) { @@ -267,10 +267,10 @@ index 251e07ca1955533be4e6075af4200a53d2bb4bdb..8b7c64c0d2315ba3ad70d0104511bfa9 this.customFunctionData.a(this.dataPackResources.a()); this.ak.a(this.dataPackResources.h()); diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 2fc063add21b89ee5a456536088fe0c87d9511c8..8e60f1e24d4adc3580864ef51188dffa46c17830 100644 +index d3a597d878de4cb625484cbf3a9838961d38ada0..16e4acdb0f834883a480829a864ef7570035bc26 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -486,6 +486,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -487,6 +487,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { MutableBoolean mutableboolean = new MutableBoolean(); do { @@ -279,7 +279,7 @@ index 2fc063add21b89ee5a456536088fe0c87d9511c8..8e60f1e24d4adc3580864ef51188dffa list.stream().map((playerchunk) -> { CompletableFuture completablefuture; diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 4676b4dc4b22c838c946a342af9e88b56436de70..db049d529c4ed9157a1136695e5cd14429fd442f 100644 +index 6cbbb4817a921dc7c811259e34f19e538c107226..7baad991689d9f9fd55176028569095a8daa94af 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -429,7 +429,7 @@ public abstract class PlayerList { @@ -292,10 +292,10 @@ index 4676b4dc4b22c838c946a342af9e88b56436de70..db049d529c4ed9157a1136695e5cd144 // Paper start - Remove from collideRule team if needed diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java -index 5579044782f155f587de1e2ea5115bde6053f722..e8075ad6b5395c7dce12741fe85dafd13f72cf41 100644 +index 391eca025b69ea96f16403459c7908378cf48eff..e3f6e17fb1f670fcb1096314b801c018ef0966a7 100644 --- a/src/main/java/net/minecraft/server/SystemUtils.java +++ b/src/main/java/net/minecraft/server/SystemUtils.java -@@ -119,6 +119,7 @@ public class SystemUtils { +@@ -123,6 +123,7 @@ public class SystemUtils { return SystemUtils.f; } @@ -304,10 +304,10 @@ index 5579044782f155f587de1e2ea5115bde6053f722..e8075ad6b5395c7dce12741fe85dafd1 a(SystemUtils.e); a(SystemUtils.f); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index cad4cd2af375d80c6ceb82541ee248c742ba68e4..ada3364150e55273cc699889e3a98cf0b9680219 100644 +index c3f524a3b1ce20d61e3f6b5a0897cf6bb9b2460c..34e425854541333b3042f9ec4abb80f186fb67d6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -841,6 +841,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -806,6 +806,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { gameprofilerfiller.exit(); } catch (Throwable throwable) { @@ -315,7 +315,7 @@ index cad4cd2af375d80c6ceb82541ee248c742ba68e4..ada3364150e55273cc699889e3a98cf0 // Paper start - Prevent tile entity and entity crashes String msg = "TileEntity threw exception at " + tileentity.world.getWorld().getName() + ":" + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ(); System.err.println(msg); -@@ -916,6 +917,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -881,6 +882,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { try { consumer.accept(entity); } catch (Throwable throwable) { @@ -324,10 +324,10 @@ index cad4cd2af375d80c6ceb82541ee248c742ba68e4..ada3364150e55273cc699889e3a98cf0 String msg = "Entity threw exception at " + entity.world.getWorld().getName() + ":" + entity.locX() + "," + entity.locY() + "," + entity.locZ(); System.err.println(msg); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9111bc559353bc09eaf9a05a35b2d921f54b9f10..c80fd400cd6eb2c31890ebce55844da36a84c7d0 100644 +index a860b850f7833bd2462c117cd58879424be3792c..9941e5294f16d5353174dc584380140a5aa4a37a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1792,7 +1792,7 @@ public final class CraftServer implements Server { +@@ -1786,7 +1786,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -337,7 +337,7 @@ index 9111bc559353bc09eaf9a05a35b2d921f54b9f10..c80fd400cd6eb2c31890ebce55844da3 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index 2049f9783bf93c56d8c4dcb395293c03f09b5b40..ac8f1681d91251ff84938f94fc59db97560000d6 100644 +index 62ebe09f955e42ad75bde9f3de690c512473c87e..c8cbb853c7cbcc251da422e99c6c76ba72d6b733 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -150,6 +150,37 @@ public class Main { diff --git a/Spigot-Server-Patches/0448-Optimize-Pathfinding.patch b/Spigot-Server-Patches/0444-Optimize-Pathfinding.patch index 6329d78de1..bbe8d56762 100644 --- a/Spigot-Server-Patches/0448-Optimize-Pathfinding.patch +++ b/Spigot-Server-Patches/0444-Optimize-Pathfinding.patch @@ -7,7 +7,7 @@ Prevents pathfinding from spamming failures for things such as arrow attacks. diff --git a/src/main/java/net/minecraft/server/NavigationAbstract.java b/src/main/java/net/minecraft/server/NavigationAbstract.java -index cca6242e38fc286eea810eb8f2e4d1ab5429b9df..e6dc5b9ce1b2f844d84a7cdf9bce030bc8eb568d 100644 +index 7645fc16c3393364389562899d460ea6670a070d..a85154aa216c19b1629097c76158922292fa4afc 100644 --- a/src/main/java/net/minecraft/server/NavigationAbstract.java +++ b/src/main/java/net/minecraft/server/NavigationAbstract.java @@ -11,7 +11,7 @@ public abstract class NavigationAbstract { diff --git a/Spigot-Server-Patches/0449-Reduce-Either-Optional-allocation.patch b/Spigot-Server-Patches/0445-Reduce-Either-Optional-allocation.patch index 0f4641263b..0f4641263b 100644 --- a/Spigot-Server-Patches/0449-Reduce-Either-Optional-allocation.patch +++ b/Spigot-Server-Patches/0445-Reduce-Either-Optional-allocation.patch diff --git a/Spigot-Server-Patches/0450-Remove-streams-from-PairedQueue.patch b/Spigot-Server-Patches/0446-Remove-streams-from-PairedQueue.patch index a0ba9fe4c5..a0ba9fe4c5 100644 --- a/Spigot-Server-Patches/0450-Remove-streams-from-PairedQueue.patch +++ b/Spigot-Server-Patches/0446-Remove-streams-from-PairedQueue.patch diff --git a/Spigot-Server-Patches/0451-Reduce-memory-footprint-of-NBTTagCompound.patch b/Spigot-Server-Patches/0447-Reduce-memory-footprint-of-NBTTagCompound.patch index 1ef08f95cc..07e5f32b13 100644 --- a/Spigot-Server-Patches/0451-Reduce-memory-footprint-of-NBTTagCompound.patch +++ b/Spigot-Server-Patches/0447-Reduce-memory-footprint-of-NBTTagCompound.patch @@ -8,37 +8,45 @@ is important because we clone chunk data after reading it for safety. So, reduce the impact of the clone on GC. diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index 9c445902e6adc05773497bc4444203ca364e4f5c..f608b35502890650adfc1df35e0794471f57ecbc 100644 +index 9c445902e6adc05773497bc4444203ca364e4f5c..8dd91ddf9e1489ec035452c590cbd59afa44c18f 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -41,7 +41,7 @@ public class NBTTagCompound implements NBTBase { +@@ -20,6 +20,7 @@ import java.util.Set; + import java.util.UUID; + import java.util.regex.Pattern; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; // Paper + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; + +@@ -41,7 +42,7 @@ public class NBTTagCompound implements NBTBase { if (i > 512) { throw new RuntimeException("Tried to read NBT tag with too high complexity, depth > 512"); } else { - HashMap hashmap = Maps.newHashMap(); -+ it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<String, NBTBase> hashmap = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(8, 0.8f); // Paper - reduce memory footprint of NBTTagCompound ++ Object2ObjectOpenHashMap<String, NBTBase> hashmap = new Object2ObjectOpenHashMap<>(8, 0.8f); // Paper - reduce memory footprint of NBTTagCompound byte b0; -@@ -77,7 +77,7 @@ public class NBTTagCompound implements NBTBase { +@@ -77,7 +78,7 @@ public class NBTTagCompound implements NBTBase { } public NBTTagCompound() { - this(Maps.newHashMap()); -+ this(new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(8, 0.8f)); // Paper - reduce memory footprint of NBTTagCompound ++ this(new Object2ObjectOpenHashMap<>(8, 0.8f)); // Paper - reduce memory footprint of NBTTagCompound } @Override -@@ -409,9 +409,17 @@ public class NBTTagCompound implements NBTBase { +@@ -409,9 +410,17 @@ public class NBTTagCompound implements NBTBase { @Override public NBTTagCompound clone() { - Map<String, NBTBase> map = Maps.newHashMap(Maps.transformValues(this.map, NBTBase::clone)); + // Paper start - reduce memory footprint of NBTTagCompound -+ it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<String, NBTBase> ret = new it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap<>(this.map.size(), 0.8f); ++ Object2ObjectOpenHashMap<String, NBTBase> ret = new Object2ObjectOpenHashMap<>(this.map.size(), 0.8f); - return new NBTTagCompound(map); -+ Iterator<Map.Entry<String, NBTBase>> iterator = (this.map instanceof it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap) ? ((it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap)this.map).object2ObjectEntrySet().fastIterator() : this.map.entrySet().iterator(); ++ Iterator<Map.Entry<String, NBTBase>> iterator = (this.map instanceof Object2ObjectOpenHashMap) ? ((Object2ObjectOpenHashMap)this.map).object2ObjectEntrySet().fastIterator() : this.map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry<String, NBTBase> entry = iterator.next(); + ret.put(entry.getKey(), entry.getValue().clone()); diff --git a/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch b/Spigot-Server-Patches/0448-Prevent-opening-inventories-when-frozen.patch index 6668a7ee17..37d1162dcd 100644 --- a/Spigot-Server-Patches/0452-Prevent-opening-inventories-when-frozen.patch +++ b/Spigot-Server-Patches/0448-Prevent-opening-inventories-when-frozen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent opening inventories when frozen diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 48ee5d7beaf336f7eb440a4a8a6e3bba2321b0b9..99513a682c0b1bbe141098427883ee561a4d5e9d 100644 +index 2f1f57dc347e37c2b2be0cc7930174aa66bf9d67..52fa2cb225754125f8f28e9a2dca3fa2887ffed8 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -420,7 +420,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -424,7 +424,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { containerUpdateDelay = world.paperConfig.containerUpdateTickRate; } // Paper end @@ -17,7 +17,7 @@ index 48ee5d7beaf336f7eb440a4a8a6e3bba2321b0b9..99513a682c0b1bbe141098427883ee56 this.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.CANT_USE); // Paper this.activeContainer = this.defaultContainer; } -@@ -1276,7 +1276,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1251,7 +1251,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } else { // CraftBukkit start this.activeContainer = container; @@ -26,7 +26,7 @@ index 48ee5d7beaf336f7eb440a4a8a6e3bba2321b0b9..99513a682c0b1bbe141098427883ee56 // CraftBukkit end container.addSlotListener(this); return OptionalInt.of(this.containerCounter); -@@ -2071,7 +2071,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -2042,7 +2042,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { } @Override @@ -36,7 +36,7 @@ index 48ee5d7beaf336f7eb440a4a8a6e3bba2321b0b9..99513a682c0b1bbe141098427883ee56 } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 00d67c9911c52ddcdf48fda7998bcd2a8a35f0eb..75aa141e86e301254b25ede3da67513aae76fa5c 100644 +index af95aff8b0252917dd324faadf0dbc773cb38ba6..867443784d685d8f200d00b50e4b11474cee5ebe 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -319,7 +319,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/0453-Optimise-ArraySetSorted-removeIf.patch b/Spigot-Server-Patches/0449-Optimise-ArraySetSorted-removeIf.patch index 529f78279c..529f78279c 100644 --- a/Spigot-Server-Patches/0453-Optimise-ArraySetSorted-removeIf.patch +++ b/Spigot-Server-Patches/0449-Optimise-ArraySetSorted-removeIf.patch diff --git a/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch b/Spigot-Server-Patches/0450-Don-t-run-entity-collision-code-if-not-needed.patch index 99cda91e08..d42bee442f 100644 --- a/Spigot-Server-Patches/0454-Don-t-run-entity-collision-code-if-not-needed.patch +++ b/Spigot-Server-Patches/0450-Don-t-run-entity-collision-code-if-not-needed.patch @@ -7,10 +7,10 @@ Will not run if max entity craming is disabled and the max collisions per entity is less than or equal to 0 diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 172b9de45f0f1b550acddc0c53b762c9e93f0d18..574d9ef4f4f0e95a66252b0428ff84c72d5bc32c 100644 +index 0cce4dabcfc6bd2ad99d59597d4cddd98276bb8d..ab03bca06ebd6474ef41266b366b7f0176e477c3 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2817,10 +2817,16 @@ public abstract class EntityLiving extends Entity { +@@ -2820,10 +2820,16 @@ public abstract class EntityLiving extends Entity { protected void doTick() {} protected void collideNearby() { diff --git a/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch b/Spigot-Server-Patches/0451-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch index 368e1ea8c2..5df87b9c02 100644 --- a/Spigot-Server-Patches/0456-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch +++ b/Spigot-Server-Patches/0451-Optimize-ChunkProviderServer-s-chunk-level-checking-.patch @@ -9,10 +9,10 @@ so inline where possible, and avoid the abstraction of the Either class. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index d1f832db33f21f8ba910d2c0c163af78718d298f..91755cd7313d87bae85584dff140acbc6467428f 100644 +index fb061dc0d6be52c959e8360e25a2c7c0468f40e2..64190f8d80b22146796f71a14e166969ba175d0f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -618,21 +618,29 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -619,21 +619,29 @@ public class ChunkProviderServer extends IChunkProvider { public final boolean isInEntityTickingChunk(Entity entity) { return this.a(entity); } // Paper - OBFHELPER @Override public boolean a(Entity entity) { diff --git a/Spigot-Server-Patches/0457-Restrict-vanilla-teleport-command-to-valid-locations.patch b/Spigot-Server-Patches/0452-Restrict-vanilla-teleport-command-to-valid-locations.patch index 12eb7b480e..ddfde9966c 100644 --- a/Spigot-Server-Patches/0457-Restrict-vanilla-teleport-command-to-valid-locations.patch +++ b/Spigot-Server-Patches/0452-Restrict-vanilla-teleport-command-to-valid-locations.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Restrict vanilla teleport command to valid locations Fixes GH-3165, GH-3575 diff --git a/src/main/java/net/minecraft/server/CommandTeleport.java b/src/main/java/net/minecraft/server/CommandTeleport.java -index 75c2c7f191f0a9704017ff08766cc920fa8a7270..203373c3bb97d331ff6c6b9e21ae4cbc8b173fe6 100644 +index db9c28b51ff46729f8d7ac5c05905b16f61fcc59..ddc978279f9436617bec222cef8e552c5cdad77b 100644 --- a/src/main/java/net/minecraft/server/CommandTeleport.java +++ b/src/main/java/net/minecraft/server/CommandTeleport.java @@ -119,6 +119,12 @@ public class CommandTeleport { @@ -20,5 +20,5 @@ index 75c2c7f191f0a9704017ff08766cc920fa8a7270..203373c3bb97d331ff6c6b9e21ae4cbc + } + // Paper end - if (!World.k(blockposition)) { + if (!World.l(blockposition)) { throw CommandTeleport.a.create(); diff --git a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch b/Spigot-Server-Patches/0453-Implement-Player-Client-Options-API.patch index 9f70e8ca14..452d78b6b9 100644 --- a/Spigot-Server-Patches/0458-Implement-Player-Client-Options-API.patch +++ b/Spigot-Server-Patches/0453-Implement-Player-Client-Options-API.patch @@ -85,20 +85,20 @@ index 0000000000000000000000000000000000000000..b6f4400df3d8ec7e06a996de54f8cabb + } +} diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 9fe3a6e16e2a5c6b83ac559c440dfce60cb5ef6b..e411f6280d07e3f6a953e1fcaffaaa49f85dc7cc 100644 +index eae7bfa171e648b8ec51465a8d9f7d9b7c59a2c9..ce4ebc96c01f3dacf4e4d0569d86f52140440d43 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -36,7 +36,7 @@ public abstract class EntityHuman extends EntityLiving { - private static final Map<EntityPose, EntitySize> b = ImmutableMap.<EntityPose, EntitySize>builder().put(EntityPose.STANDING, EntityHuman.bo).put(EntityPose.SLEEPING, EntityHuman.ao).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build(); + private static final Map<EntityPose, EntitySize> b = ImmutableMap.<EntityPose, EntitySize>builder().put(EntityPose.STANDING, EntityHuman.bh).put(EntityPose.SLEEPING, EntityHuman.ah).put(EntityPose.FALL_FLYING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SWIMMING, EntitySize.b(0.6F, 0.6F)).put(EntityPose.SPIN_ATTACK, EntitySize.b(0.6F, 0.6F)).put(EntityPose.CROUCHING, EntitySize.b(0.6F, 1.5F)).put(EntityPose.DYING, EntitySize.c(0.2F, 0.2F)).build(); private static final DataWatcherObject<Float> c = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.c); private static final DataWatcherObject<Integer> d = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.b); -- protected static final DataWatcherObject<Byte> bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); -+ protected static final DataWatcherObject<Byte> bp = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject<Byte> getSkinPartsWatcher() { return bp; } // Paper - OBFHELPER - protected static final DataWatcherObject<Byte> bq = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); - protected static final DataWatcherObject<NBTTagCompound> br = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); - protected static final DataWatcherObject<NBTTagCompound> bs = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); +- protected static final DataWatcherObject<Byte> bi = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); ++ protected static final DataWatcherObject<Byte> bi = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); public static DataWatcherObject<Byte> getSkinPartsWatcher() { return bi; } // Paper - OBFHELPER + protected static final DataWatcherObject<Byte> bj = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.a); + protected static final DataWatcherObject<NBTTagCompound> bk = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); + protected static final DataWatcherObject<NBTTagCompound> bl = DataWatcher.a(EntityHuman.class, DataWatcherRegistry.p); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 99513a682c0b1bbe141098427883ee561a4d5e9d..15696359ac65f00bbff82c54d445562fccab86ba 100644 +index 52fa2cb225754125f8f28e9a2dca3fa2887ffed8..b22eb32199de78730bc6db5d803fadde5fd3b7c1 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -2,6 +2,7 @@ package net.minecraft.server; @@ -109,16 +109,16 @@ index 99513a682c0b1bbe141098427883ee561a4d5e9d..15696359ac65f00bbff82c54d445562f import com.mojang.authlib.GameProfile; import com.mojang.datafixers.util.Either; import com.mojang.serialization.DataResult; -@@ -59,7 +60,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -60,7 +61,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public int lastSentExp = -99999999; public int invulnerableTicks = 60; - private EnumChatVisibility cf; -- private boolean cg = true; -+ private boolean cg = true; public boolean hasChatColorsEnabled() { return this.cg; } // Paper - OBFHELPER - private long ch = SystemUtils.getMonotonicMillis(); + private EnumChatVisibility bY; +- private boolean bZ = true; ++ private boolean bZ = true; public boolean hasChatColorsEnabled() { return this.bZ; } // Paper - OBFHELPER + private long ca = SystemUtils.getMonotonicMillis(); private Entity spectatedEntity; public boolean worldChangeInvuln; -@@ -1680,6 +1681,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -1652,6 +1653,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public String locale = null; // CraftBukkit - lowercase // Paper - default to null public void a(PacketPlayInSettings packetplayinsettings) { @@ -149,7 +149,7 @@ index dbc3552d50c4129e1844c8a379ab5ba396645f52..87ec3987d4b6de836016e91ef90383e3 return this.e; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 0a265324877bb20d2d0aa3ceed076d7d0e772da2..f2d61a03c540ff10a6949e637b40a8057be2f1dc 100644 +index 747dd3c06d24b395d9d940413fe47a63b66e65d0..ff18c2d8c4752149ace290495d130e12baa52756 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1,5 +1,8 @@ @@ -159,9 +159,9 @@ index 0a265324877bb20d2d0aa3ceed076d7d0e772da2..f2d61a03c540ff10a6949e637b40a805 +import com.destroystokyo.paper.PaperSkinParts; +import com.destroystokyo.paper.ClientOption; import com.destroystokyo.paper.Title; - import com.destroystokyo.paper.profile.CraftPlayerProfile; - import com.destroystokyo.paper.profile.PlayerProfile; -@@ -2041,6 +2044,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + import com.google.common.base.Preconditions; + import com.google.common.collect.ImmutableSet; +@@ -2034,6 +2037,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player { public void setViewDistance(int viewDistance) { throw new NotImplementedException("Per-Player View Distance APIs need further understanding to properly implement (There are per world view distances though!)"); // TODO } diff --git a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch b/Spigot-Server-Patches/0454-Fix-Chunk-Post-Processing-deadlock-risk.patch index 2aaf29124e..f204382674 100644 --- a/Spigot-Server-Patches/0459-Fix-Chunk-Post-Processing-deadlock-risk.patch +++ b/Spigot-Server-Patches/0454-Fix-Chunk-Post-Processing-deadlock-risk.patch @@ -25,10 +25,10 @@ This successfully fixed a reoccurring and highly reproduceable crash for heightmaps. diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8bf1ec290 100644 +index 64190f8d80b22146796f71a14e166969ba175d0f..4c4e6e154e0db23662484d6aa03f1d762a48badb 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -994,6 +994,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -995,6 +995,7 @@ public class ChunkProviderServer extends IChunkProvider { return super.executeNext() || execChunkTask; // Paper } } finally { @@ -37,10 +37,10 @@ index 91755cd7313d87bae85584dff140acbc6467428f..0080a0cbe58d1a81c434ef97659428c8 } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 1fcf75b2ed3c8c1ca2e31f679fc7d507f963caf2..fbe7129280f371ab9658fba2965c003b455aaa7a 100644 +index 16e4acdb0f834883a480829a864ef7570035bc26..842f5ebad2a4d040b9912ec4841de426667cd91d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -133,6 +133,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -134,6 +134,8 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }; // CraftBukkit end @@ -49,7 +49,7 @@ index 1fcf75b2ed3c8c1ca2e31f679fc7d507f963caf2..fbe7129280f371ab9658fba2965c003b // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); -@@ -998,7 +1000,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -999,7 +1001,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return Either.left(chunk); }); }, (runnable) -> { diff --git a/Spigot-Server-Patches/0460-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch b/Spigot-Server-Patches/0455-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch index fd6daa9573..e52d3ea2bf 100644 --- a/Spigot-Server-Patches/0460-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch +++ b/Spigot-Server-Patches/0455-Don-t-crash-if-player-is-attempted-to-be-removed-fro.patch @@ -7,7 +7,7 @@ Subject: [PATCH] Don't crash if player is attempted to be removed from I suspect it deals with teleporting as it uses players current x/y/z diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index d5b50a6a6816421c0443ae36213932b16ed5c797..32d3887e2542c4ebba4a7498167fbe4b497a71ce 100644 +index d15bf949671c9a533573278d573376282bfed8c8..275c2b23b4d1ff09ee2b1823d0780700f773659e 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -238,8 +238,8 @@ public abstract class ChunkMapDistance { diff --git a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch b/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch deleted file mode 100644 index 163f97fb60..0000000000 --- a/Spigot-Server-Patches/0455-Optimise-entity-hard-collision-checking.patch +++ /dev/null @@ -1,228 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Spottedleaf <[email protected]> -Date: Wed, 15 Apr 2020 18:08:53 -0700 -Subject: [PATCH] Optimise entity hard collision checking - -Very few entities actually hard collide, so store them in their own -entity slices and provide a special getEntites type call just for them. -This reduces entity collision checking impact (in my testing) by 25% -for crammed entities (shove 130 cows into an 8x6 area in one chunk). -Less crammed entities are likely to show significantly less benefit. -Effectively, this patch optimises crammed entity situations. - -diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 0d7a2812ec739dbde52b551834a88a7c516cea13..8346592e75e0d719cbec0e03bff0864990c0a47c 100644 ---- a/src/main/java/net/minecraft/server/Chunk.java -+++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -91,6 +91,54 @@ public class Chunk implements IChunkAccess { - private final int[] inventoryEntityCounts = new int[16]; - // Paper end - -+ // Paper start - optimise hard collision handling -+ final com.destroystokyo.paper.util.maplist.EntityList[] hardCollidingEntities = new com.destroystokyo.paper.util.maplist.EntityList[16]; -+ -+ { -+ for (int i = 0, len = this.hardCollidingEntities.length; i < len; ++i) { -+ this.hardCollidingEntities[i] = new com.destroystokyo.paper.util.maplist.EntityList(); -+ } -+ } -+ -+ public final void getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, List<Entity> into, Predicate<Entity> predicate) { -+ // copied from getEntities -+ int min = MathHelper.floor((axisalignedbb.minY - 2.0D) / 16.0D); -+ int max = MathHelper.floor((axisalignedbb.maxY + 2.0D) / 16.0D); -+ -+ min = MathHelper.clamp(min, 0, this.hardCollidingEntities.length - 1); -+ max = MathHelper.clamp(max, 0, this.hardCollidingEntities.length - 1); -+ -+ for (int k = min; k <= max; ++k) { -+ com.destroystokyo.paper.util.maplist.EntityList entityList = this.hardCollidingEntities[k]; -+ Entity[] entities = entityList.getRawData(); -+ -+ for (int i = 0, len = entityList.size(); i < len; ++i) { -+ Entity entity1 = entities[i]; -+ if (entity1.shouldBeRemoved) continue; // Paper -+ -+ if (entity1 != entity && entity1.getBoundingBox().intersects(axisalignedbb) && (predicate == null || predicate.test(entity1))) { -+ into.add(entity1); -+ -+ if (!(entity1 instanceof EntityEnderDragon)) { -+ continue; -+ } -+ -+ EntityComplexPart[] aentitycomplexpart = ((EntityEnderDragon) entity1).getComplexParts(); -+ int l = aentitycomplexpart.length; -+ -+ for (int i1 = 0; i1 < l; ++i1) { -+ EntityComplexPart entitycomplexpart = aentitycomplexpart[i1]; -+ -+ if (entitycomplexpart != entity && entitycomplexpart.getBoundingBox().intersects(axisalignedbb) && (predicate == null || predicate.test(entitycomplexpart))) { -+ into.add(entitycomplexpart); -+ } -+ } -+ } -+ } -+ } -+ } -+ // Paper end - optimise hard collision handling -+ - public Chunk(World world, ChunkCoordIntPair chunkcoordintpair, BiomeStorage biomestorage, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long i, @Nullable ChunkSection[] achunksection, @Nullable Consumer<Chunk> consumer) { - this.sections = new ChunkSection[16]; - this.e = Maps.newHashMap(); -@@ -546,7 +594,7 @@ public class Chunk implements IChunkAccess { - entity.chunkY = k; - entity.chunkZ = this.loc.z; - this.entities.add(entity); // Paper - per chunk entity list -- this.entitySlices[k].add(entity); -+ this.entitySlices[k].add(entity); if (entity.hardCollides()) this.hardCollidingEntities[k].add(entity); // Paper - optimise hard colliding entities - // Paper start - if (entity instanceof EntityItem) { - itemCounts[k]++; -@@ -583,7 +631,7 @@ public class Chunk implements IChunkAccess { - entity.entitySlice = null; - entity.inChunk = false; - } -- if (!this.entitySlices[i].remove(entity)) { -+ if (entity.hardCollides()) this.hardCollidingEntities[i].remove(entity); if (!this.entitySlices[i].remove(entity)) { // Paper - optimise hard colliding entities - return; - } - if (entity instanceof EntityItem) { -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 82042830979c5d7e39dc03f5ac4fe1c3199fdebb..f8a7ddeb70a1708805f22a1fd23e44f8906ea507 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -211,6 +211,40 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - // CraftBukkit end - -+ // Paper start -+ /** -+ * Overriding this field will cause memory leaks. -+ */ -+ private final boolean hardCollides; -+ -+ private static final java.util.Map<Class<? extends Entity>, Boolean> cachedOverrides = java.util.Collections.synchronizedMap(new java.util.WeakHashMap<>()); -+ { -+ Boolean hardCollides = cachedOverrides.get(this.getClass()); -+ if (hardCollides == null) { -+ try { -+ Object getHardCollisionBoxMethod = Entity.class.getMethod("ay"); -+ Object getHardCollisionBoxEntityMethod = Entity.class.getMethod("j", Entity.class); -+ if (!this.getClass().getMethod("ay").equals(getHardCollisionBoxMethod)) { -+ hardCollides = Boolean.TRUE; -+ } else if (!this.getClass().getMethod("j", Entity.class).equals(getHardCollisionBoxEntityMethod)) { -+ hardCollides = Boolean.TRUE; -+ } else { -+ hardCollides = Boolean.FALSE; -+ } -+ cachedOverrides.put(this.getClass(), hardCollides); -+ } catch (Throwable thr) { -+ // shouldn't happen, just explode -+ throw new RuntimeException(thr); -+ } -+ } -+ this.hardCollides = hardCollides.booleanValue(); -+ } -+ -+ public final boolean hardCollides() { -+ return this.hardCollides; -+ } -+ // Paper end -+ - public Entity(EntityTypes<?> entitytypes, World world) { - this.id = Entity.entityCount.incrementAndGet(); - this.passengers = Lists.newArrayList(); -diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 96f898acdeae1917a4aaf99ec4a48bccf3904488..73e9859e675902d9fc5942547966b52426a496a2 100644 ---- a/src/main/java/net/minecraft/server/EntityEnderDragon.java -+++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java -@@ -844,6 +844,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { - @Override - public void checkDespawn() {} - -+ public final EntityComplexPart[] getComplexParts() { return this.eK(); } // Paper - OBFHELPER - public EntityComplexPart[] eK() { - return this.children; - } -diff --git a/src/main/java/net/minecraft/server/IEntityAccess.java b/src/main/java/net/minecraft/server/IEntityAccess.java -index 74d4c28246e7db850e6d993e07a84b2a6ca24ce2..267a6baae89c181eed545e6758fac7115eb3882f 100644 ---- a/src/main/java/net/minecraft/server/IEntityAccess.java -+++ b/src/main/java/net/minecraft/server/IEntityAccess.java -@@ -53,24 +53,36 @@ public interface IEntityAccess { - return this.b(oclass, axisalignedbb, IEntitySelector.g); - } - -+ // Paper start - optimise hard collision -+ /** -+ * Not guaranteed to only return hard colliding entites -+ */ -+ default List<Entity> getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate) { -+ return this.getEntities(entity, axisalignedbb, predicate); -+ } -+ // Paper end - optimise hard collision -+ - default Stream<VoxelShape> c(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate) { - if (axisalignedbb.a() < 1.0E-7D) { - return Stream.empty(); - } else { - AxisAlignedBB axisalignedbb1 = axisalignedbb.g(1.0E-7D); - -- return this.getEntities(entity, axisalignedbb1, predicate.and((entity1) -> { -+ // Paper start -+ Predicate<Entity> effectivePredicate = predicate.and((entity1) -> { - return entity == null || !entity.isSameVehicle(entity1); -- })).stream().flatMap((entity1) -> { -+ }); -+ -+ return ((entity != null && entity.hardCollides()) ? this.getEntities(entity, axisalignedbb, effectivePredicate) : this.getHardCollidingEntities(entity, axisalignedbb1, effectivePredicate)).stream().flatMap((entity1) -> { - if (entity != null) { -- AxisAlignedBB axisalignedbb2 = entity.j(entity1); -+ AxisAlignedBB axisalignedbb2 = entity.j(entity1); // Paper - diff on change, hard collision box method - - if (axisalignedbb2 != null && axisalignedbb2.c(axisalignedbb1)) { - return Stream.of(entity1.ay(), axisalignedbb2); - } - } - -- return Stream.of(entity1.ay()); -+ return Stream.of(entity1.ay()); // Paper - diff on change, hard collision box method - }).filter(Objects::nonNull).map(VoxelShapes::a); - } - } -diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index ada3364150e55273cc699889e3a98cf0b9680219..7342bdaa5f1cc0ae6a889149d45a97b6597a1e5b 100644 ---- a/src/main/java/net/minecraft/server/World.java -+++ b/src/main/java/net/minecraft/server/World.java -@@ -1106,6 +1106,32 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - return this.getChunkAt(i, j, ChunkStatus.FULL, false); - } - -+ // Paper start - optimise hard collision handling -+ @Override -+ public List<Entity> getHardCollidingEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, Predicate<Entity> predicate) { -+ // copied from below -+ List<Entity> list = Lists.newArrayList(); -+ int i = MathHelper.floor((axisalignedbb.minX - 2.0D) / 16.0D); -+ int j = MathHelper.floor((axisalignedbb.maxX + 2.0D) / 16.0D); -+ int k = MathHelper.floor((axisalignedbb.minZ - 2.0D) / 16.0D); -+ int l = MathHelper.floor((axisalignedbb.maxZ + 2.0D) / 16.0D); -+ -+ ChunkProviderServer chunkProvider = ((WorldServer)this).getChunkProvider(); -+ -+ for (int i1 = i; i1 <= j; ++i1) { -+ for (int j1 = k; j1 <= l; ++j1) { -+ Chunk chunk = chunkProvider.getChunkAtIfLoadedMainThread(i1, j1); -+ -+ if (chunk != null) { -+ chunk.getHardCollidingEntities(entity, axisalignedbb, list, predicate); -+ } -+ } -+ } -+ -+ return list; -+ } -+ // Paper end - optimise hard collision handling -+ - @Override - public List<Entity> getEntities(@Nullable Entity entity, AxisAlignedBB axisalignedbb, @Nullable Predicate<? super Entity> predicate) { - this.getMethodProfiler().c("getEntities"); diff --git a/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch b/Spigot-Server-Patches/0456-Broadcast-join-message-to-console.patch index 7eebec3846..bdfe3cbbaf 100644 --- a/Spigot-Server-Patches/0461-Broadcast-join-message-to-console.patch +++ b/Spigot-Server-Patches/0456-Broadcast-join-message-to-console.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Broadcast join message to console diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index db049d529c4ed9157a1136695e5cd14429fd442f..3e63eeca4f22fa4e607adf0e5845df1498ffcef5 100644 +index 7baad991689d9f9fd55176028569095a8daa94af..2b8ee11bee76671875b9ca2316181ccd2c0088e6 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -211,9 +211,9 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch b/Spigot-Server-Patches/0457-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch index f7669ccdf4..1934ffa37d 100644 --- a/Spigot-Server-Patches/0462-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch +++ b/Spigot-Server-Patches/0457-Fix-Longstanding-Broken-behavior-of-PlayerJoinEvent.patch @@ -28,10 +28,10 @@ receives a deterministic result, and should no longer require 1 tick delays anymore. diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index d4d789e84a2b6a3ba108532630a89f51b3a23f54..bc78b08d3f235de5d98107403c41451034f97976 100644 +index b22eb32199de78730bc6db5d803fadde5fd3b7c1..5d7be3c9841949a11a3207d0ff355b78e2e28e81 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -104,6 +104,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -106,6 +106,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public double maxHealthCache; public boolean joining = true; public boolean sentListPacket = false; @@ -40,10 +40,10 @@ index d4d789e84a2b6a3ba108532630a89f51b3a23f54..bc78b08d3f235de5d98107403c414510 // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index fbe7129280f371ab9658fba2965c003b455aaa7a..537d7889ff3eaacfb74f499c1adb6cac10b0feef 100644 +index 842f5ebad2a4d040b9912ec4841de426667cd91d..c2abf8dca89f3a4f3671e21b2cbfe9c7ad130725 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1537,6 +1537,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1538,6 +1538,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { .printStackTrace(); return; } @@ -52,7 +52,7 @@ index fbe7129280f371ab9658fba2965c003b455aaa7a..537d7889ff3eaacfb74f499c1adb6cac if (!(entity instanceof EntityComplexPart)) { EntityTypes<?> entitytypes = entity.getEntityType(); diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 3e63eeca4f22fa4e607adf0e5845df1498ffcef5..521b972377d21a6dd8781e604bf220e0652e5b74 100644 +index 2b8ee11bee76671875b9ca2316181ccd2c0088e6..a38b0f5dbc76214853034b0a4663d985e62111bf 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -200,6 +200,12 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch b/Spigot-Server-Patches/0458-Load-Chunks-for-Login-Asynchronously.patch index 040072c8a7..8935a0cf3b 100644 --- a/Spigot-Server-Patches/0463-Load-Chunks-for-Login-Asynchronously.patch +++ b/Spigot-Server-Patches/0458-Load-Chunks-for-Login-Asynchronously.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Load Chunks for Login Asynchronously diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 0080a0cbe58d1a81c434ef97659428c8bf1ec290..eebd4c50a7324250d3ebe7060739a71af4243f72 100644 +index 4c4e6e154e0db23662484d6aa03f1d762a48badb..893a835593af2ea95a50607c8c2f2cdb9af6c944 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -604,7 +604,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -605,7 +605,7 @@ public class ChunkProviderServer extends IChunkProvider { return this.serverThreadQueue.executeNext(); } @@ -18,23 +18,23 @@ index 0080a0cbe58d1a81c434ef97659428c8bf1ec290..eebd4c50a7324250d3ebe7060739a71a boolean flag1 = this.playerChunkMap.b(); diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index a0249d7a60c1381ebd7131d735a73fa2e9250543..561610ee1a99c781ccabd600812a0d10cd4ba785 100644 +index d3e4b26798661b99686941e813aca50774db8ff6..810793ee13d0531dbbc233adc3d274cbcf3186b7 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1326,7 +1326,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.pitch = MathHelper.a(f1, -90.0F, 90.0F) % 360.0F; - this.lastYaw = this.yaw; - this.lastPitch = this.pitch; +@@ -1284,7 +1284,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + this.lastY = d1; + this.lastZ = d4; + this.setPosition(d3, d1, d4); - world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit + if (valid) world.getChunkAt((int) Math.floor(this.locX()) >> 4, (int) Math.floor(this.locZ()) >> 4); // CraftBukkit // Paper } - public void c(Vec3D vec3d) { + public void d(Vec3D vec3d) { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index bc78b08d3f235de5d98107403c41451034f97976..ab38ad863d112be39ee676d0ff14fdefe2679048 100644 +index 5d7be3c9841949a11a3207d0ff355b78e2e28e81..4860f84999b22aca6267efd42d920ff8bb868ca5 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -43,6 +43,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -44,6 +44,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private static final Logger LOGGER = LogManager.getLogger(); public PlayerConnection playerConnection; @@ -42,7 +42,7 @@ index bc78b08d3f235de5d98107403c41451034f97976..ab38ad863d112be39ee676d0ff14fdef public final MinecraftServer server; public final PlayerInteractManager playerInteractManager; public final Deque<Integer> removeQueue = new ArrayDeque<>(); // Paper -@@ -105,6 +106,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -107,6 +108,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public boolean joining = true; public boolean sentListPacket = false; public boolean supressTrackerForLogin = false; // Paper @@ -51,7 +51,7 @@ index bc78b08d3f235de5d98107403c41451034f97976..ab38ad863d112be39ee676d0ff14fdef // CraftBukkit end public PlayerNaturallySpawnCreaturesEvent playerNaturallySpawnedEvent; // Paper diff --git a/src/main/java/net/minecraft/server/LoginListener.java b/src/main/java/net/minecraft/server/LoginListener.java -index 50163f7291474062bde81631c9220e8a9f5bb718..ebab6961b752ca0b1c1b28f85abb33c7b4d70e3c 100644 +index c053c40a940bbfebbae48464d5f9e263f54af523..a6684a4d7410e5b7fceb93838787ebe5343967d2 100644 --- a/src/main/java/net/minecraft/server/LoginListener.java +++ b/src/main/java/net/minecraft/server/LoginListener.java @@ -66,7 +66,7 @@ public class LoginListener implements PacketLoginInListener { @@ -73,7 +73,7 @@ index 50163f7291474062bde81631c9220e8a9f5bb718..ebab6961b752ca0b1c1b28f85abb33c7 if (entityplayer != null) { this.g = LoginListener.EnumProtocolState.DELAY_ACCEPT; diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6faa8764d19f3e58808de9dc84145f765c8958a8..22ded747e9e8683faa17924149f9b279752e47ea 100644 +index ff436b2424ebab9bc1e673b8f484e63d52d4940c..23002a66f3189d31c1b4382cdbd684e85320539a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -69,6 +69,7 @@ public class PlayerConnection implements PacketListenerPlayIn { @@ -110,7 +110,7 @@ index 6faa8764d19f3e58808de9dc84145f765c8958a8..22ded747e9e8683faa17924149f9b279 this.minecraftServer.getMethodProfiler().enter("keepAlive"); // Paper Start - give clients a longer time to respond to pings as per pre 1.12.2 timings diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 521b972377d21a6dd8781e604bf220e0652e5b74..2c0d9c52fa90639c6b3b542b626a8b55b82a0df1 100644 +index a38b0f5dbc76214853034b0a4663d985e62111bf..2236c839acca60aef6364e6266fa047a331a01e5 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -54,11 +54,12 @@ public abstract class PlayerList { @@ -149,7 +149,7 @@ index 521b972377d21a6dd8781e604bf220e0652e5b74..2c0d9c52fa90639c6b3b542b626a8b55 if (nbttagcompound != null) { @@ -183,6 +189,51 @@ public abstract class PlayerList { - entityplayer.B().a(entityplayer); + entityplayer.getRecipeBook().a(entityplayer); this.sendScoreboard(worldserver1.getScoreboard(), entityplayer); this.server.invalidatePingSample(); + // Paper start - async load spawn in chunk diff --git a/Spigot-Server-Patches/0464-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/Spigot-Server-Patches/0459-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch index 44d9b275ba..9adc6434ca 100644 --- a/Spigot-Server-Patches/0464-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch +++ b/Spigot-Server-Patches/0459-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -7,10 +7,10 @@ The code following this has better support for null worlds to move them back to the world spawn. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 561610ee1a99c781ccabd600812a0d10cd4ba785..f31f4fdecc824b27afefc79d1791a293227cbc9c 100644 +index 810793ee13d0531dbbc233adc3d274cbcf3186b7..ccee2aa760ce38f7a48cb6a3360d1ec8d1a02450 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1754,9 +1754,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1713,9 +1713,11 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke bworld = server.getWorld(worldName); } diff --git a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch b/Spigot-Server-Patches/0460-Add-PlayerAttackEntityCooldownResetEvent.patch index df5b38adac..256734fb73 100644 --- a/Spigot-Server-Patches/0465-Add-PlayerAttackEntityCooldownResetEvent.patch +++ b/Spigot-Server-Patches/0460-Add-PlayerAttackEntityCooldownResetEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add PlayerAttackEntityCooldownResetEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 574d9ef4f4f0e95a66252b0428ff84c72d5bc32c..ce823833a0b308aeb11902652157575eabf09e3b 100644 +index ab03bca06ebd6474ef41266b366b7f0176e477c3..01de9a9c965ce156f53577d19f1ca9a138657720 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -1822,7 +1822,16 @@ public abstract class EntityLiving extends Entity { +@@ -1823,7 +1823,16 @@ public abstract class EntityLiving extends Entity { EntityDamageEvent event = CraftEventFactory.handleLivingEntityDamageEvent(this, damagesource, originalDamage, hardHatModifier, blockingModifier, armorModifier, resistanceModifier, magicModifier, absorptionModifier, hardHat, blocking, armor, resistance, magic, absorption); if (damagesource.getEntity() instanceof EntityHuman) { diff --git a/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch b/Spigot-Server-Patches/0461-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch index d339b0cec6..42a51f1e26 100644 --- a/Spigot-Server-Patches/0466-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch +++ b/Spigot-Server-Patches/0461-Allow-multiple-callbacks-to-schedule-for-Callback-Ex.patch @@ -14,10 +14,10 @@ Use an ArrayDeque to store this Queue We make sure to also implement a pattern that is recursion safe too. diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 987d4129d7ec9c8be4f6a20376923702e895f231..f2bbb61c7f54fabd9ee087eb4f7ec56aa3df6e99 100644 +index c2abf8dca89f3a4f3671e21b2cbfe9c7ad130725..b6f7fd501432560d4ed557371bc770724ce032ce 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -112,24 +112,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -113,24 +113,32 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final CallbackExecutor callbackExecutor = new CallbackExecutor(); public static final class CallbackExecutor implements java.util.concurrent.Executor, Runnable { diff --git a/Spigot-Server-Patches/0467-Don-t-fire-BlockFade-on-worldgen-threads.patch b/Spigot-Server-Patches/0462-Don-t-fire-BlockFade-on-worldgen-threads.patch index 31efcfdd5a..d427580b79 100644 --- a/Spigot-Server-Patches/0467-Don-t-fire-BlockFade-on-worldgen-threads.patch +++ b/Spigot-Server-Patches/0462-Don-t-fire-BlockFade-on-worldgen-threads.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Don't fire BlockFade on worldgen threads Caused a deadlock diff --git a/src/main/java/net/minecraft/server/BlockFire.java b/src/main/java/net/minecraft/server/BlockFire.java -index a11a775a929c5f868f1b84c56d7e1715a91db236..a8875a9a5fa6b285b41f3de1bc81c44f35ea5cce 100644 +index acd0ec4bf30c5d559d99ec449fef166ce59076e6..5ef90510b8bdac2dcf58cabfa78ba48a30a22a97 100644 --- a/src/main/java/net/minecraft/server/BlockFire.java +++ b/src/main/java/net/minecraft/server/BlockFire.java -@@ -35,6 +35,7 @@ public class BlockFire extends BlockFireAbstract { +@@ -73,6 +73,7 @@ public class BlockFire extends BlockFireAbstract { @Override public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) { // CraftBukkit start @@ -17,7 +17,7 @@ index a11a775a929c5f868f1b84c56d7e1715a91db236..a8875a9a5fa6b285b41f3de1bc81c44f if (!this.canPlace(iblockdata, generatoraccess, blockposition)) { // Suppress during worldgen if (!(generatoraccess instanceof World)) { -@@ -50,7 +51,7 @@ public class BlockFire extends BlockFireAbstract { +@@ -88,7 +89,7 @@ public class BlockFire extends BlockFireAbstract { return blockState.getHandle(); } } diff --git a/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch b/Spigot-Server-Patches/0463-Add-phantom-creative-and-insomniac-controls.patch index 1b5e3e7a31..f5b2704bcb 100644 --- a/Spigot-Server-Patches/0468-Add-phantom-creative-and-insomniac-controls.patch +++ b/Spigot-Server-Patches/0463-Add-phantom-creative-and-insomniac-controls.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add phantom creative and insomniac controls diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 08949526752e4d66e4c0df11f76f6500846e1fe4..13b89276feb76fcecaeefc166a1bc161d5931d9d 100644 +index 82ff9cc4ae84ca120f7b0c4bd14c55d1a4280358..c6843f37f89f0df8a021f6f4b3ed048e6d36549a 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -622,4 +622,11 @@ public class PaperWorldConfig { +@@ -611,4 +611,11 @@ public class PaperWorldConfig { private void lightQueueSize() { lightQueueSize = getInt("light-queue-size", lightQueueSize); } @@ -21,7 +21,7 @@ index 08949526752e4d66e4c0df11f76f6500846e1fe4..13b89276feb76fcecaeefc166a1bc161 + } } diff --git a/src/main/java/net/minecraft/server/EntityPhantom.java b/src/main/java/net/minecraft/server/EntityPhantom.java -index 47d82722e15c5b91a86af1a09807ccc37a1b37be..3cb78924daa48c3a0a3e5c9c64ef6e726d79a798 100644 +index 0605cb3e9873f92835e9f121b18c35e8eca5ccbb..550f80bfdbc8048c23789a2a89ecc946163f0cdd 100644 --- a/src/main/java/net/minecraft/server/EntityPhantom.java +++ b/src/main/java/net/minecraft/server/EntityPhantom.java @@ -225,6 +225,7 @@ public class EntityPhantom extends EntityFlying implements IMonster { @@ -33,7 +33,7 @@ index 47d82722e15c5b91a86af1a09807ccc37a1b37be..3cb78924daa48c3a0a3e5c9c64ef6e72 return true; } diff --git a/src/main/java/net/minecraft/server/IEntitySelector.java b/src/main/java/net/minecraft/server/IEntitySelector.java -index 57bc56cffff87d9b1774cec455af8d1651fb882c..a52dd0c021e264a57a62bde27ea9d2a6a97e2335 100644 +index 3c296c81845c295c66854cb365f2061a7a7bbf23..06ce390b6492f23343e57e648bff241d96fdb7b6 100644 --- a/src/main/java/net/minecraft/server/IEntitySelector.java +++ b/src/main/java/net/minecraft/server/IEntitySelector.java @@ -26,6 +26,7 @@ public final class IEntitySelector { @@ -45,7 +45,7 @@ index 57bc56cffff87d9b1774cec455af8d1651fb882c..a52dd0c021e264a57a62bde27ea9d2a6 // Paper start public static final Predicate<Entity> affectsSpawning = (entity) -> { diff --git a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java -index 39c5350373f6a5ad30f41e8886573d6b315924c6..bf4fa17101cb8710d8b8ba8ad43f98b6fe154ae1 100644 +index 2e3d8d78c7a2b6c9a76c3446f8532137c537c79c..4e3f01bc79b6ed2a322155f29f1d0dcf298c8b82 100644 --- a/src/main/java/net/minecraft/server/MobSpawnerPhantom.java +++ b/src/main/java/net/minecraft/server/MobSpawnerPhantom.java @@ -32,7 +32,7 @@ public class MobSpawnerPhantom implements MobSpawner { @@ -56,4 +56,4 @@ index 39c5350373f6a5ad30f41e8886573d6b315924c6..bf4fa17101cb8710d8b8ba8ad43f98b6 + if (!entityhuman.isSpectator() && (!worldserver.paperConfig.phantomIgnoreCreative || !entityhuman.isCreative())) { // Paper BlockPosition blockposition = entityhuman.getChunkCoordinates(); - if (!worldserver.getDimensionManager().hasSkyLight() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.f(blockposition)) { + if (!worldserver.getDimensionManager().hasSkyLight() || blockposition.getY() >= worldserver.getSeaLevel() && worldserver.e(blockposition)) { diff --git a/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/Spigot-Server-Patches/0464-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 962f9d6fb1..5f7d88cbba 100644 --- a/Spigot-Server-Patches/0469-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/Spigot-Server-Patches/0464-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index f31f4fdecc824b27afefc79d1791a293227cbc9c..449a687399f38d3ef79685ff80531cf1212f054a 100644 +index ccee2aa760ce38f7a48cb6a3360d1ec8d1a02450..63fddf52b5736ee88f47e7f987c52114a3d7df97 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1910,11 +1910,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1869,11 +1869,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } else { // CraftBukkit start - Capture drops for death event if (this instanceof EntityLiving && !((EntityLiving) this).forceDrops) { @@ -34,7 +34,7 @@ index f31f4fdecc824b27afefc79d1791a293227cbc9c..449a687399f38d3ef79685ff80531cf1 entityitem.defaultPickupDelay(); // CraftBukkit start -@@ -2565,6 +2566,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2516,6 +2517,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke @Nullable public Entity teleportTo(WorldServer worldserver, BlockPosition location) { // CraftBukkit end @@ -47,16 +47,16 @@ index f31f4fdecc824b27afefc79d1791a293227cbc9c..449a687399f38d3ef79685ff80531cf1 if (this.world instanceof WorldServer && !this.dead) { this.world.getMethodProfiler().enter("changeDimension"); // CraftBukkit start -@@ -2668,7 +2675,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - entity.bukkitEntity = this.getBukkitEntity(); +@@ -2551,7 +2558,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + entity.bukkitEntity = this.getBukkitEntity(); - if (this instanceof EntityInsentient) { -- ((EntityInsentient)this).unleash(true, false); // Unleash to prevent duping of leads. -+ ((EntityInsentient)this).unleash(true, true); // Paper drop lead + if (this instanceof EntityInsentient) { +- ((EntityInsentient) this).unleash(true, false); // Unleash to prevent duping of leads. ++ ((EntityInsentient) this).unleash(true, true); // Paper drop lead + } + // CraftBukkit end } - // CraftBukkit end - } -@@ -2689,7 +2696,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -2671,7 +2678,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } public boolean canPortal() { @@ -66,10 +66,10 @@ index f31f4fdecc824b27afefc79d1791a293227cbc9c..449a687399f38d3ef79685ff80531cf1 public float a(Explosion explosion, IBlockAccess iblockaccess, BlockPosition blockposition, IBlockData iblockdata, Fluid fluid, float f) { diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java -index 51e9f4a6e09474a7489d2872a800308ee3f02e46..250bccee4a27801b41c50d59e93396c696ab6974 100644 +index 587e8e582dfe9c3127ca2b298c4e1db79c2d6c8e..81df71b7e165b8702575176550a587cdb8744beb 100644 --- a/src/main/java/net/minecraft/server/EntityArmorStand.java +++ b/src/main/java/net/minecraft/server/EntityArmorStand.java -@@ -557,7 +557,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -559,7 +559,7 @@ public class EntityArmorStand extends EntityLiving { for (i = 0; i < this.handItems.size(); ++i) { itemstack = (ItemStack) this.handItems.get(i); if (!itemstack.isEmpty()) { @@ -78,7 +78,7 @@ index 51e9f4a6e09474a7489d2872a800308ee3f02e46..250bccee4a27801b41c50d59e93396c6 this.handItems.set(i, ItemStack.b); } } -@@ -565,7 +565,7 @@ public class EntityArmorStand extends EntityLiving { +@@ -567,7 +567,7 @@ public class EntityArmorStand extends EntityLiving { for (i = 0; i < this.armorItems.size(); ++i) { itemstack = (ItemStack) this.armorItems.get(i); if (!itemstack.isEmpty()) { @@ -88,10 +88,10 @@ index 51e9f4a6e09474a7489d2872a800308ee3f02e46..250bccee4a27801b41c50d59e93396c6 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 3bea7e9ccdfd225f1c6aa391b55e6d190f963534..f84d045fe951e482c10a6ad16c41076bf8808168 100644 +index 6bd2b47151a3abfd0b96641272ecc9fe2d2421b2..32202eb92207995b621d151481aa44bd3817e808 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -804,7 +804,8 @@ public class CraftEventFactory { +@@ -808,7 +808,8 @@ public class CraftEventFactory { for (org.bukkit.inventory.ItemStack stack : event.getDrops()) { if (stack == null || stack.getType() == Material.AIR || stack.getAmount() == 0) continue; diff --git a/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch b/Spigot-Server-Patches/0465-Implement-Brigadier-Mojang-API.patch index 249dbea43f..fc8e2944f9 100644 --- a/Spigot-Server-Patches/0470-Implement-Brigadier-Mojang-API.patch +++ b/Spigot-Server-Patches/0465-Implement-Brigadier-Mojang-API.patch @@ -10,10 +10,10 @@ Adds CommandRegisteredEvent - Allows manipulating the CommandNode to add more children/metadata for the client diff --git a/src/main/java/net/minecraft/server/CommandDispatcher.java b/src/main/java/net/minecraft/server/CommandDispatcher.java -index 1229aaf19de60f1e3ce161b5c3b7ef659d14c018..e59151d01b4710b750366a395e1e5d18caa4726f 100644 +index 4b1ea9bc39191e01f83577c7bad128cf1ab9612f..22d748008d24fd6ed7cd8c4914e2ceb378f32c95 100644 --- a/src/main/java/net/minecraft/server/CommandDispatcher.java +++ b/src/main/java/net/minecraft/server/CommandDispatcher.java -@@ -268,6 +268,7 @@ public class CommandDispatcher { +@@ -270,6 +270,7 @@ public class CommandDispatcher { bukkit.add(node.getName()); } // Paper start - Async command map building @@ -21,7 +21,7 @@ index 1229aaf19de60f1e3ce161b5c3b7ef659d14c018..e59151d01b4710b750366a395e1e5d18 MinecraftServer.getServer().execute(() -> { runSync(entityplayer, bukkit, rootcommandnode); }); -@@ -275,6 +276,7 @@ public class CommandDispatcher { +@@ -277,6 +278,7 @@ public class CommandDispatcher { private void runSync(EntityPlayer entityplayer, Collection<String> bukkit, RootCommandNode<ICompletionProvider> rootcommandnode) { // Paper end - Async command map building @@ -30,7 +30,7 @@ index 1229aaf19de60f1e3ce161b5c3b7ef659d14c018..e59151d01b4710b750366a395e1e5d18 event.getPlayer().getServer().getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java -index 4b6f45501106f49f118a93e5027734cdb7ff2727..fa0f247e51c20ea0e3cbaccbc8dbb2a153d6121f 100644 +index 27c16946b589a36a47b612c8b10b2955ba2715b1..7608b5021d66c39b8121f33829cd09d77c847277 100644 --- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java +++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java @@ -16,7 +16,7 @@ import java.util.function.BinaryOperator; @@ -42,7 +42,7 @@ index 4b6f45501106f49f118a93e5027734cdb7ff2727..fa0f247e51c20ea0e3cbaccbc8dbb2a1 public static final SimpleCommandExceptionType a = new SimpleCommandExceptionType(new ChatMessage("permissions.requires.player")); public static final SimpleCommandExceptionType b = new SimpleCommandExceptionType(new ChatMessage("permissions.requires.entity")); -@@ -121,6 +121,25 @@ public class CommandListenerWrapper implements ICompletionProvider { +@@ -128,6 +128,25 @@ public class CommandListenerWrapper implements ICompletionProvider { return this.g; } @@ -69,10 +69,10 @@ index 4b6f45501106f49f118a93e5027734cdb7ff2727..fa0f247e51c20ea0e3cbaccbc8dbb2a1 public boolean hasPermission(int i) { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 22ded747e9e8683faa17924149f9b279752e47ea..daa066cbec8097b86f8b3c564e8134607e57b3cd 100644 +index 23002a66f3189d31c1b4382cdbd684e85320539a..5f1e7e4bc3ae80f4ed61f2d65da1cf9935a3882a 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -584,8 +584,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -578,8 +578,12 @@ public class PlayerConnection implements PacketListenerPlayIn { ParseResults<CommandListenerWrapper> parseresults = this.minecraftServer.getCommandDispatcher().a().parse(stringreader, this.player.getCommandListener()); this.minecraftServer.getCommandDispatcher().a().getCompletionSuggestions(parseresults).thenAccept((suggestions) -> { @@ -87,7 +87,7 @@ index 22ded747e9e8683faa17924149f9b279752e47ea..daa066cbec8097b86f8b3c564e813460 }); }); } -@@ -594,7 +598,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -588,7 +592,11 @@ public class PlayerConnection implements PacketListenerPlayIn { builder = builder.createOffset(builder.getInput().lastIndexOf(' ') + 1); completions.forEach(builder::suggest); diff --git a/Spigot-Server-Patches/0471-Villager-Restocks-API.patch b/Spigot-Server-Patches/0466-Villager-Restocks-API.patch index 6353e61e2a..e5dc14dfc6 100644 --- a/Spigot-Server-Patches/0471-Villager-Restocks-API.patch +++ b/Spigot-Server-Patches/0466-Villager-Restocks-API.patch @@ -5,18 +5,18 @@ Subject: [PATCH] Villager Restocks API diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 8d3811ead268635c4b728f5c9b8dd6c9b8ec6124..9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12 100644 +index 3db74ab8d722b38bcae008ea2e02778fbac31471..70f15bc9de4d66da7991a18b438737db18e1e76e 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -44,7 +44,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - private long bH; - private int bI; - private long bJ; -- private int bK; -+ private int bK; public int getRestocksToday(){ return this.bK; } public void setRestocksToday(int restocksToday){ this.bK = restocksToday; } // Paper OBFHELPER - private long bL; - private boolean bM; - private static final ImmutableList<MemoryModuleType<?>> bN = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, new MemoryModuleType[]{MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_LAST_SEEN_TIME}); + private long bA; + private int bB; + private long bC; +- private int bD; ++ private int bD; public int getRestocksToday(){ return this.bD; } public void setRestocksToday(int restocksToday){ this.bD = restocksToday; } // Paper OBFHELPER + private long bE; + private boolean bF; + private static final ImmutableList<MemoryModuleType<?>> bG = ImmutableList.of(MemoryModuleType.HOME, MemoryModuleType.JOB_SITE, MemoryModuleType.POTENTIAL_JOB_SITE, MemoryModuleType.MEETING_POINT, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.VISIBLE_VILLAGER_BABIES, MemoryModuleType.NEAREST_PLAYERS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.WALK_TARGET, new MemoryModuleType[]{MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.BREED_TARGET, MemoryModuleType.PATH, MemoryModuleType.DOORS_TO_CLOSE, MemoryModuleType.NEAREST_BED, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.NEAREST_HOSTILE, MemoryModuleType.SECONDARY_JOB_SITE, MemoryModuleType.HIDING_PLACE, MemoryModuleType.HEARD_BELL_TIME, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.LAST_SLEPT, MemoryModuleType.LAST_WOKEN, MemoryModuleType.LAST_WORKED_AT_POI, MemoryModuleType.GOLEM_DETECTED_RECENTLY}); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index fe726e7884c9f091d73c8f5d2cb58a87a16649f8..a8384081c03884c86578dca677914d77441c1863 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java diff --git a/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch b/Spigot-Server-Patches/0467-Validate-PickItem-Packet-and-kick-for-invalid.patch index 744a212e97..4019e7f450 100644 --- a/Spigot-Server-Patches/0472-Validate-PickItem-Packet-and-kick-for-invalid.patch +++ b/Spigot-Server-Patches/0467-Validate-PickItem-Packet-and-kick-for-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Validate PickItem Packet and kick for invalid diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index daa066cbec8097b86f8b3c564e8134607e57b3cd..0ece15a8457debc7d8343c894b060e81be845488 100644 +index 5f1e7e4bc3ae80f4ed61f2d65da1cf9935a3882a..7b079f0e594e24a7d8706c4ed5228c37c5fbe26d 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -697,7 +697,14 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -691,7 +691,14 @@ public class PlayerConnection implements PacketListenerPlayIn { @Override public void a(PacketPlayInPickItem packetplayinpickitem) { PlayerConnectionUtils.ensureMainThread(packetplayinpickitem, this, this.player.getWorldServer()); diff --git a/Spigot-Server-Patches/0473-Expose-game-version.patch b/Spigot-Server-Patches/0468-Expose-game-version.patch index 50dbdd7b1f..92cc02eaca 100644 --- a/Spigot-Server-Patches/0473-Expose-game-version.patch +++ b/Spigot-Server-Patches/0468-Expose-game-version.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose game version diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index c80fd400cd6eb2c31890ebce55844da36a84c7d0..38700faee15b901a0240401d50ed0dc7de211c37 100644 +index 9941e5294f16d5353174dc584380140a5aa4a37a..2a437e27a8add0228b30fd9ba09de01df6f5c5e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -518,6 +518,13 @@ public final class CraftServer implements Server { +@@ -517,6 +517,13 @@ public final class CraftServer implements Server { return bukkitVersion; } diff --git a/Spigot-Server-Patches/0474-Optimize-Voxel-Shape-Merging.patch b/Spigot-Server-Patches/0469-Optimize-Voxel-Shape-Merging.patch index 94143e356b..45a5ea1a45 100644 --- a/Spigot-Server-Patches/0474-Optimize-Voxel-Shape-Merging.patch +++ b/Spigot-Server-Patches/0469-Optimize-Voxel-Shape-Merging.patch @@ -75,7 +75,7 @@ index 71d2ae2a9c5a05351241b5a313e66ca15b0624ef..232b0023773008c19f19ad4658eb40fc this.b = new IntArrayList(i1); this.c = new IntArrayList(i1); diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index 4acde367542247627574fdeb586fb8c9087eef1a..aeee4f11828e54ff9e873e452e19299822b1ec86 100644 +index dd91a57f994f1c23464f5e33ca332529d7d9ea19..450957c41e144ef2b238051c4d5a242ca2b9ae83 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -319,9 +319,21 @@ public final class VoxelShapes { diff --git a/Spigot-Server-Patches/0475-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch b/Spigot-Server-Patches/0470-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch index 5f8b1c974c..31d5fe311c 100644 --- a/Spigot-Server-Patches/0475-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch +++ b/Spigot-Server-Patches/0470-Set-cap-on-JDK-per-thread-native-byte-buffer-cache.patch @@ -17,7 +17,7 @@ keeping long lived large direct buffers in cache. Set system properly at server startup if not set already to help protect from this. diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java -index ac8f1681d91251ff84938f94fc59db97560000d6..9dd994f8b111cec2dfa30a962db8654a68c344b1 100644 +index c8cbb853c7cbcc251da422e99c6c76ba72d6b733..bac292e6d8e6cdb239d8accd21eaa25022f5640f 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -20,6 +20,7 @@ public class Main { diff --git a/Spigot-Server-Patches/0476-Implement-Mob-Goal-API.patch b/Spigot-Server-Patches/0471-Implement-Mob-Goal-API.patch index eb050137a8..cee50a8952 100644 --- a/Spigot-Server-Patches/0476-Implement-Mob-Goal-API.patch +++ b/Spigot-Server-Patches/0471-Implement-Mob-Goal-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/pom.xml b/pom.xml -index 6cde6f7dcbb3ff2fda0189a06573640777548d27..ef8ee637a8a0e5e703922b2991c58f4f116b23fb 100644 +index 2c80b0933b09854228e1bfc19a0ae6278f8c662e..594ab9afbd6249df8817eeb4eb50bffc986bfce1 100644 --- a/pom.xml +++ b/pom.xml @@ -133,6 +133,13 @@ @@ -24,10 +24,10 @@ index 6cde6f7dcbb3ff2fda0189a06573640777548d27..ef8ee637a8a0e5e703922b2991c58f4f <repositories> diff --git a/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java new file mode 100644 -index 0000000000000000000000000000000000000000..7b12014db0abd9c4b89f58ceaaa7d9dd032b027a +index 0000000000000000000000000000000000000000..89b56de7567ae54be75e0735b712e4dd713f1bf4 --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/entity/ai/MobGoalHelper.java -@@ -0,0 +1,353 @@ +@@ -0,0 +1,356 @@ +package com.destroystokyo.paper.entity.ai; + +import com.google.common.collect.BiMap; @@ -142,6 +142,7 @@ index 0000000000000000000000000000000000000000..7b12014db0abd9c4b89f58ceaaa7d9dd + deobfuscationMap.put("shulker_e", "shulker_peek"); + deobfuscationMap.put("squid_a", "squid_flee"); + deobfuscationMap.put("skeleton_abstract_1", "skeleton_melee"); ++ deobfuscationMap.put("strider_a", "strider_go_to_lava"); + deobfuscationMap.put("turtle_a", "turtle_breed"); + deobfuscationMap.put("turtle_b", "turtle_go_home"); + deobfuscationMap.put("turtle_c", "turtle_goto_water"); @@ -253,6 +254,8 @@ index 0000000000000000000000000000000000000000..7b12014db0abd9c4b89f58ceaaa7d9dd + bukkitMap.put(EntityZombieVillager.class, ZombieVillager.class); + bukkitMap.put(EntityHoglin.class, Hoglin.class); + bukkitMap.put(EntityPiglin.class, Piglin.class); ++ bukkitMap.put(EntityPiglinAbstract.class, PiglinAbstract.class); ++ bukkitMap.put(EntityPiglinBrute.class, PiglinBrute.class); + bukkitMap.put(EntityStrider.class, Strider.class); + bukkitMap.put(EntityZoglin.class, Zoglin.class); + } @@ -755,7 +758,7 @@ index 9df0006c1a283f77c4d01d9fce9062fc1c9bbb1f..b3329c6fcd6758a781a51f5ba8f5052a + } } diff --git a/src/main/java/net/minecraft/server/PathfinderGoal.java b/src/main/java/net/minecraft/server/PathfinderGoal.java -index a85d81186ae92dec72f2cc3a1dcd8c4b7e7ede62..8f26cb20b8c63f2809838c97528cef62ec39bcdb 100644 +index 42b690b9215d82346990d93a5cead727b1fa10ab..f103b6630e3d00a4e1a514495c2724111e06f752 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoal.java +++ b/src/main/java/net/minecraft/server/PathfinderGoal.java @@ -8,11 +8,17 @@ public abstract class PathfinderGoal { @@ -855,7 +858,7 @@ index 22f4fec58fbaab24673dd418700c51671248c510..d3f0327a2a7cdedf3fe8d10df981a9f1 return this.d.stream().filter(PathfinderGoalWrapped::g); } diff --git a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java -index 96f4401044cacf88e8e00b5b18821c105e634fba..112d8bab65bf41263a477c5faa717687fe8a2bc9 100644 +index 22773eca7561d39cd838338efe6d40ab9421feba..2e56fcc32f914d2b5f4bb9d368f504f4d3e8795c 100644 --- a/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java +++ b/src/main/java/net/minecraft/server/PathfinderGoalWrapped.java @@ -5,8 +5,8 @@ import javax.annotation.Nullable; @@ -870,10 +873,10 @@ index 96f4401044cacf88e8e00b5b18821c105e634fba..112d8bab65bf41263a477c5faa717687 public PathfinderGoalWrapped(int i, PathfinderGoal pathfindergoal) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 38700faee15b901a0240401d50ed0dc7de211c37..810c0236da937ecbd12a10c5beffe0859842e056 100644 +index 2a437e27a8add0228b30fd9ba09de01df6f5c5e1..82a4166032e234645059d03ee265418045e3935a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2316,5 +2316,11 @@ public final class CraftServer implements Server { +@@ -2310,5 +2310,11 @@ public final class CraftServer implements Server { public boolean isStopping() { return net.minecraft.server.MinecraftServer.getServer().hasStopped(); } diff --git a/Spigot-Server-Patches/0477-Use-distance-map-to-optimise-entity-tracker.patch b/Spigot-Server-Patches/0472-Use-distance-map-to-optimise-entity-tracker.patch index f414762158..61dea11c6f 100644 --- a/Spigot-Server-Patches/0477-Use-distance-map-to-optimise-entity-tracker.patch +++ b/Spigot-Server-Patches/0472-Use-distance-map-to-optimise-entity-tracker.patch @@ -6,12 +6,12 @@ Subject: [PATCH] Use distance map to optimise entity tracker Use the distance map to find candidate players for tracking. diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 22ebf74762f543316800016dcca67ebad84d2ec9..af9f906b4eb806c73f8ec98ea562393c2b48419e 100644 +index 63fddf52b5736ee88f47e7f987c52114a3d7df97..f41c91c0f27e6df8181fafe4c4332ce57b952ea9 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -245,6 +245,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -208,6 +208,21 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke } - // Paper end + // CraftBukkit end + // Paper start - optimise entity tracking + final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); @@ -32,7 +32,7 @@ index 22ebf74762f543316800016dcca67ebad84d2ec9..af9f906b4eb806c73f8ec98ea562393c this.id = Entity.entityCount.incrementAndGet(); this.passengers = Lists.newArrayList(); diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 9b89c0c8a3f1dada4e9b2aaeed0b92e56229b7ca..0c46297e6ff229538d77b2f481e4ab13ea14c48e 100644 +index b8fa8a582c4e440990f7e9c426c40bb576a3af66..8fecf1172c50669604ac097c8e5d81f83087a063 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -72,6 +72,7 @@ public class EntityTrackerEntry { @@ -44,10 +44,10 @@ index 9b89c0c8a3f1dada4e9b2aaeed0b92e56229b7ca..0c46297e6ff229538d77b2f481e4ab13 List<Entity> list = this.tracker.getPassengers(); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8b7c64c0d2315ba3ad70d0104511bfa9f7a64d35..31ce31936a5100f0512103c70c09d097dac64863 100644 +index 2f83f308596e97f82833d639fe2a2ce1017c0574..1241d0253508f79867c5393751c0e6eb62f8b6fe 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1527,6 +1527,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1525,6 +1525,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas } } @@ -56,10 +56,10 @@ index 8b7c64c0d2315ba3ad70d0104511bfa9f7a64d35..31ce31936a5100f0512103c70c09d097 return i; } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae1645287af79ec2 100644 +index b6f7fd501432560d4ed557371bc770724ce032ce..33f5ec0552641e5e979f9a1f3e0d97b23798799b 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -145,21 +145,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -146,21 +146,55 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - distance maps private final com.destroystokyo.paper.util.misc.PooledLinkedHashSets<EntityPlayer> pooledLinkedPlayerHashSets = new com.destroystokyo.paper.util.misc.PooledLinkedHashSets<>(); @@ -116,7 +116,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 } // Paper end -@@ -196,6 +230,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -197,6 +231,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper this.setViewDistance(i); this.playerMobDistanceMap = this.world.paperConfig.perPlayerMobSpawns ? new com.destroystokyo.paper.util.PlayerMobDistanceMap() : null; // Paper @@ -162,7 +162,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 } public void updatePlayerMobTypeMap(Entity entity) { -@@ -1434,17 +1507,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1435,17 +1508,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } public void movePlayer(EntityPlayer entityplayer) { @@ -181,7 +181,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 int i = MathHelper.floor(entityplayer.locX()) >> 4; int j = MathHelper.floor(entityplayer.locZ()) >> 4; -@@ -1560,7 +1623,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1561,7 +1624,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { entity.tracker = playerchunkmap_entitytracker; // Paper - Fast access to tracker this.trackedEntities.put(entity.getId(), playerchunkmap_entitytracker); @@ -190,7 +190,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 if (entity instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer) entity; -@@ -1603,7 +1666,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1604,7 +1667,37 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { entity.tracker = null; // Paper - We're no longer tracked } @@ -228,7 +228,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 List<EntityPlayer> list = Lists.newArrayList(); List<EntityPlayer> list1 = this.world.getPlayers(); -@@ -1671,23 +1764,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1672,23 +1765,31 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { PacketDebug.a(this.world, chunk.getPos()); List<Entity> list = Lists.newArrayList(); List<Entity> list1 = Lists.newArrayList(); @@ -272,7 +272,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 Iterator iterator; Entity entity1; -@@ -1725,7 +1826,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1726,7 +1827,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public class EntityTracker { @@ -281,7 +281,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 private final Entity tracker; private final int trackingDistance; private SectionPosition e; -@@ -1742,6 +1843,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1743,6 +1844,42 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.e = SectionPosition.a(entity); } @@ -324,7 +324,7 @@ index ef42536bca76beb2c5002605563854fdf1498c31..d751c3ec9d799a0c2bfe835cae164528 public boolean equals(Object object) { return object instanceof PlayerChunkMap.EntityTracker ? ((PlayerChunkMap.EntityTracker) object).tracker.getId() == this.tracker.getId() : false; } -@@ -1842,7 +1979,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1843,7 +1980,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { int j = entity.getEntityType().getChunkRange() * 16; j = org.spigotmc.TrackingRange.getEntityTrackingRange(entity, j); // Paper diff --git a/Spigot-Server-Patches/0478-Optimize-isOutsideRange-to-use-distance-maps.patch b/Spigot-Server-Patches/0473-Optimize-isOutsideRange-to-use-distance-maps.patch index 5dd3b946ea..d27e32cdcb 100644 --- a/Spigot-Server-Patches/0478-Optimize-isOutsideRange-to-use-distance-maps.patch +++ b/Spigot-Server-Patches/0473-Optimize-isOutsideRange-to-use-distance-maps.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Optimize isOutsideRange to use distance maps Use a distance map to find the players in range quickly diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 32d3887e2542c4ebba4a7498167fbe4b497a71ce..7e57a53ec614a2f7d2672edff9d7c0e0dca42377 100644 +index 275c2b23b4d1ff09ee2b1823d0780700f773659e..ef61f8e784b7ebd26293d627e8b8e1aef1be6e21 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -31,7 +31,7 @@ public abstract class ChunkMapDistance { @@ -77,10 +77,10 @@ index 32d3887e2542c4ebba4a7498167fbe4b497a71ce..7e57a53ec614a2f7d2672edff9d7c0e0 public String c() { diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index eebd4c50a7324250d3ebe7060739a71af4243f72..319059ba31f3614cc59cd4c4e4fa9242f6e4fe99 100644 +index 893a835593af2ea95a50607c8c2f2cdb9af6c944..c54175eaad6230a1098e9b912e0b4788afe4b9c8 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -728,6 +728,37 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -729,6 +729,37 @@ public class ChunkProviderServer extends IChunkProvider { boolean flag1 = this.world.getGameRules().getBoolean(GameRules.DO_MOB_SPAWNING) && !world.getPlayers().isEmpty(); // CraftBukkit if (!flag) { @@ -118,7 +118,7 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..319059ba31f3614cc59cd4c4e4fa9242 this.world.getMethodProfiler().enter("pollingChunks"); int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit -@@ -757,15 +788,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -758,15 +789,7 @@ public class ChunkProviderServer extends IChunkProvider { this.world.getMethodProfiler().exit(); //List<PlayerChunk> list = Lists.newArrayList(this.playerChunkMap.f()); // Paper //Collections.shuffle(list); // Paper @@ -135,7 +135,7 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..319059ba31f3614cc59cd4c4e4fa9242 final int[] chunksTicked = {0}; this.playerChunkMap.forEachVisibleChunk((playerchunk) -> { // Paper - safe iterator incase chunk loads, also no wrapping Optional<Chunk> optional = ((Either) playerchunk.a().getNow(PlayerChunk.UNLOADED_CHUNK)).left(); -@@ -781,9 +804,9 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -782,9 +805,9 @@ public class ChunkProviderServer extends IChunkProvider { Chunk chunk = (Chunk) optional1.get(); ChunkCoordIntPair chunkcoordintpair = playerchunk.i(); @@ -148,23 +148,23 @@ index eebd4c50a7324250d3ebe7060739a71af4243f72..319059ba31f3614cc59cd4c4e4fa9242 } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index b615199b2f44b6e5169113cca7cd48d37ead997a..ca93c9f3ab6ae50eb7dbc825a70620325033ccad 100644 +index 4860f84999b22aca6267efd42d920ff8bb868ca5..6d72bdfc4be2fefa465a29f6333390173209bcd2 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -113,6 +113,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -115,6 +115,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { public final com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> cachedSingleHashSet; // Paper + double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks + public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { - super(worldserver, worldserver.getSpawn(), gameprofile); + super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile); this.spawnDimension = World.OVERWORLD; diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b29913436f125b06 100644 +index 844f5b204b0f8c4474b4b9ffdc9cb7f3564b1336..4074c1f8f8b71544df9aa6e8d59c5703f2036fd9 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -43,6 +43,18 @@ public class PlayerChunk { +@@ -45,6 +45,18 @@ public class PlayerChunk { long lastAutoSaveTime; // Paper - incremental autosave long inactiveTimeStart; // Paper - incremental autosave @@ -183,7 +183,7 @@ index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b2991343 public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) { this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; -@@ -59,6 +71,7 @@ public class PlayerChunk { +@@ -61,6 +73,7 @@ public class PlayerChunk { this.n = this.oldTicketLevel; this.a(i); this.chunkMap = (PlayerChunkMap)playerchunk_d; // Paper @@ -192,10 +192,10 @@ index 9cb2ff09da0b8832e58eed4d70741853a25c9011..7f660d3c528f5fb4150e4ee8b2991343 // Paper start diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a4100de3912 100644 +index 33f5ec0552641e5e979f9a1f3e0d97b23798799b..6abbea108ef4d5b6fac9449336dc2b0c6d4bfd6e 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -159,6 +159,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -160,6 +160,17 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return MinecraftServer.getServer().applyTrackingRangeScale(vanilla); } // Paper end - use distance map to optimise tracker @@ -213,7 +213,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 void addPlayerToDistanceMaps(EntityPlayer player) { int chunkX = MCUtil.getChunkCoordinate(player.locX()); -@@ -172,6 +183,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -173,6 +184,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { trackMap.add(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance())); } // Paper end - use distance map to optimise entity tracker @@ -223,7 +223,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 } void removePlayerFromDistanceMaps(EntityPlayer player) { -@@ -180,6 +194,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -181,6 +195,10 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerEntityTrackerTrackMaps[i].remove(player); } // Paper end - use distance map to optimise tracker @@ -234,7 +234,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 } void updateMaps(EntityPlayer player) { -@@ -194,6 +212,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -195,6 +213,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { trackMap.update(player, chunkX, chunkZ, Math.min(trackRange, this.getEffectiveViewDistance())); } // Paper end - use distance map to optimise entity tracker @@ -244,7 +244,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 } // Paper end -@@ -225,7 +246,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -226,7 +247,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.mailboxWorldGen = this.p.a(threadedmailbox, false); this.mailboxMain = this.p.a(mailbox, false); this.lightEngine = new LightEngineThreaded(ilightaccess, this, this.world.getDimensionManager().hasSkyLight(), threadedmailbox1, this.p.a(threadedmailbox1, false)); @@ -253,7 +253,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 this.l = supplier; this.m = new VillagePlace(new File(this.w, "poi"), datafixer, flag, this.world); // Paper this.setViewDistance(i); -@@ -269,6 +290,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -270,6 +291,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerEntityTrackerTrackMaps[ordinal] = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); } // Paper end - use distance map to optimise entity tracker @@ -292,7 +292,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 } public void updatePlayerMobTypeMap(Entity entity) { -@@ -288,6 +341,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -289,6 +342,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return entityPlayer.mobCounts[enumCreatureType.ordinal()]; } @@ -300,7 +300,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 private static double a(ChunkCoordIntPair chunkcoordintpair, Entity entity) { double d0 = (double) (chunkcoordintpair.x * 16 + 8); double d1 = (double) (chunkcoordintpair.z * 16 + 8); -@@ -466,6 +520,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -467,6 +521,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } else { if (playerchunk != null) { playerchunk.a(j); @@ -308,7 +308,7 @@ index d751c3ec9d799a0c2bfe835cae1645287af79ec2..8b36a14b2896d32f99e788a5db928a41 } if (playerchunk != null) { -@@ -1436,30 +1491,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1437,30 +1492,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return isOutsideOfRange(chunkcoordintpair, false); } diff --git a/Spigot-Server-Patches/0479-Stop-copy-on-write-operations-for-updating-light-dat.patch b/Spigot-Server-Patches/0474-Stop-copy-on-write-operations-for-updating-light-dat.patch index 99aea0ca9c..99aea0ca9c 100644 --- a/Spigot-Server-Patches/0479-Stop-copy-on-write-operations-for-updating-light-dat.patch +++ b/Spigot-Server-Patches/0474-Stop-copy-on-write-operations-for-updating-light-dat.patch diff --git a/Spigot-Server-Patches/0480-No-Tick-view-distance-implementation.patch b/Spigot-Server-Patches/0475-No-Tick-view-distance-implementation.patch index 6a81e9378b..7ec1d4fe27 100644 --- a/Spigot-Server-Patches/0480-No-Tick-view-distance-implementation.patch +++ b/Spigot-Server-Patches/0475-No-Tick-view-distance-implementation.patch @@ -23,10 +23,10 @@ index c9164dfdb27ddf3709129c8aec54903a1df121ff..e33e889c291d37a821a4fbd40d9aac7b })); diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 13b89276feb76fcecaeefc166a1bc161d5931d9d..5af7e5c815752f2fd2b13c02a905796971401813 100644 +index c6843f37f89f0df8a021f6f4b3ed048e6d36549a..6a62f2000a58312773a8cb57c546d65df980b844 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -629,4 +629,9 @@ public class PaperWorldConfig { +@@ -618,4 +618,9 @@ public class PaperWorldConfig { phantomIgnoreCreative = getBoolean("phantoms-do-not-spawn-on-creative-players", phantomIgnoreCreative); phantomOnlyAttackInsomniacs = getBoolean("phantoms-only-attack-insomniacs", phantomOnlyAttackInsomniacs); } @@ -37,10 +37,10 @@ index 13b89276feb76fcecaeefc166a1bc161d5931d9d..5af7e5c815752f2fd2b13c02a9057969 + } } diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 8346592e75e0d719cbec0e03bff0864990c0a47c..fb3b626a3dbeca14a2b89e2480f81e7b45a432d3 100644 +index eebd014f9c0f4285f16d9ffac79e604854a6926c..6ac8670c76eaf0c1292c6e88c63eaf6b18c9fbb8 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -246,7 +246,51 @@ public class Chunk implements IChunkAccess { +@@ -198,7 +198,51 @@ public class Chunk implements IChunkAccess { } protected void onNeighbourChange(final long bitsetBefore, final long bitsetAfter) { @@ -93,7 +93,7 @@ index 8346592e75e0d719cbec0e03bff0864990c0a47c..fb3b626a3dbeca14a2b89e2480f81e7b public final boolean isAnyNeighborsLoaded() { diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 7e57a53ec614a2f7d2672edff9d7c0e0dca42377..c072f61e8c88eac8335acd660d8ff0e2f9db819e 100644 +index ef61f8e784b7ebd26293d627e8b8e1aef1be6e21..03b1a67aaf3ed75b7669a3157847affd678f8df4 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -262,7 +262,7 @@ public abstract class ChunkMapDistance { @@ -115,23 +115,23 @@ index 7e57a53ec614a2f7d2672edff9d7c0e0dca42377..c072f61e8c88eac8335acd660d8ff0e2 if (flag1) { ChunkMapDistance.this.j.a(ChunkTaskQueueSorter.a(() -> { diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index ca93c9f3ab6ae50eb7dbc825a70620325033ccad..e80133932c5fad52c7b42c45c2b84aff7d11f296 100644 +index 6d72bdfc4be2fefa465a29f6333390173209bcd2..c0656a9fa5e9ebb4199231fdc20c6a50859a80dd 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -115,6 +115,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -117,6 +117,8 @@ public class EntityPlayer extends EntityHuman implements ICrafting { double lastEntitySpawnRadiusSquared; // Paper - optimise isOutsideRange, this field is in blocks + boolean needsChunkCenterUpdate; // Paper - no-tick view distance + public EntityPlayer(MinecraftServer minecraftserver, WorldServer worldserver, GameProfile gameprofile, PlayerInteractManager playerinteractmanager) { - super(worldserver, worldserver.getSpawn(), gameprofile); + super(worldserver, worldserver.getSpawn(), worldserver.v(), gameprofile); this.spawnDimension = World.OVERWORLD; diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index 73e5a1a11c90aeb31e29d79fca2fedcd52e7439a..b419f0e938b8406874ff7b3d0ee7a532e5990557 100644 +index df3150072fd36dac28d83309e50342c9cfa326b3..0b5ddff008d151ad03a1f382a8f24494356e8701 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -620,7 +620,8 @@ public final class MCUtil { +@@ -621,7 +621,8 @@ public final class MCUtil { }); worldData.addProperty("name", world.getWorld().getName()); @@ -142,10 +142,10 @@ index 73e5a1a11c90aeb31e29d79fca2fedcd52e7439a..b419f0e938b8406874ff7b3d0ee7a532 worldData.addProperty("keep-spawn-loaded-range", world.paperConfig.keepLoadedRange); worldData.addProperty("visible-chunk-count", visibleChunks.size()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698e2568201 100644 +index 4074c1f8f8b71544df9aa6e8d59c5703f2036fd9..2784ea71b9f5ee93f6de8e5a3a135457f1be17a3 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -55,6 +55,18 @@ public class PlayerChunk { +@@ -57,6 +57,18 @@ public class PlayerChunk { } // Paper end - optimise isOutsideOfRange @@ -164,16 +164,16 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698 public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) { this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; -@@ -210,7 +222,7 @@ public class PlayerChunk { +@@ -212,7 +224,7 @@ public class PlayerChunk { } - public void a(int i, int j, int k) { + public void a(BlockPosition blockposition) { - Chunk chunk = this.getChunk(); + Chunk chunk = this.getSendingChunk(); // Paper - no-tick view distance if (chunk != null) { - this.r |= 1 << (j >> 4); -@@ -230,7 +242,7 @@ public class PlayerChunk { + byte b0 = (byte) SectionPosition.a(blockposition.getY()); +@@ -228,7 +240,7 @@ public class PlayerChunk { } public void a(EnumSkyBlock enumskyblock, int i) { @@ -182,7 +182,7 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698 if (chunk != null) { chunk.setNeedsSaving(true); -@@ -303,9 +315,48 @@ public class PlayerChunk { +@@ -310,9 +322,48 @@ public class PlayerChunk { } private void a(Packet<?> packet, boolean flag) { @@ -235,10 +235,10 @@ index 7f660d3c528f5fb4150e4ee8b29913436f125b06..40347212ad1bcf857d5b8ddb0ee6a698 public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> a(ChunkStatus chunkstatus, PlayerChunkMap playerchunkmap) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f148ca9edcc 100644 +index 6abbea108ef4d5b6fac9449336dc2b0c6d4bfd6e..65ff262e99d2270c332d63f1bef85d40c6e557e1 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -95,7 +95,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -96,7 +96,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private boolean updatingChunksModified; private final ChunkTaskQueueSorter p; private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen; @@ -247,7 +247,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 public final WorldLoadListener worldLoadListener; public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; -@@ -170,6 +170,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -171,6 +171,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerMobSpawnMap; // this map is absent from updateMaps since it's controlled at the start of the chunkproviderserver tick public final com.destroystokyo.paper.util.misc.PlayerAreaMap playerChunkTickRangeMap; // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -270,7 +270,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 void addPlayerToDistanceMaps(EntityPlayer player) { int chunkX = MCUtil.getChunkCoordinate(player.locX()); -@@ -186,6 +202,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -187,6 +203,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap.add(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -290,7 +290,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } void removePlayerFromDistanceMaps(EntityPlayer player) { -@@ -198,6 +227,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -199,6 +228,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerMobSpawnMap.remove(player); this.playerChunkTickRangeMap.remove(player); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -302,7 +302,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } void updateMaps(EntityPlayer player) { -@@ -215,6 +249,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -216,6 +250,19 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper start - optimise PlayerChunkMap#isOutsideRange this.playerChunkTickRangeMap.update(player, chunkX, chunkZ, ChunkMapDistance.MOB_SPAWN_RANGE); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -322,7 +322,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } // Paper end -@@ -322,6 +369,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -323,6 +370,45 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } }); // Paper end - optimise PlayerChunkMap#isOutsideRange @@ -368,7 +368,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } public void updatePlayerMobTypeMap(Entity entity) { -@@ -1142,15 +1228,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1143,15 +1229,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { completablefuture1.thenAcceptAsync((either) -> { either.mapLeft((chunk) -> { this.u.getAndIncrement(); @@ -386,7 +386,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 }); return completablefuture1; } -@@ -1245,32 +1327,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1246,32 +1328,38 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } } @@ -440,7 +440,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 protected void sendChunk(EntityPlayer entityplayer, ChunkCoordIntPair chunkcoordintpair, Packet<?>[] apacket, boolean flag, boolean flag1) { if (entityplayer.world == this.world) { -@@ -1278,7 +1366,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1279,7 +1367,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { PlayerChunk playerchunk = this.getVisibleChunk(chunkcoordintpair.pair()); if (playerchunk != null) { @@ -449,7 +449,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 if (chunk != null) { this.a(entityplayer, apacket, chunk); -@@ -1539,6 +1627,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1540,6 +1628,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end - optimise isOutsideOfRange @@ -457,7 +457,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 private boolean b(EntityPlayer entityplayer) { return entityplayer.isSpectator() && !this.world.getGameRules().getBoolean(GameRules.SPECTATORS_GENERATE_CHUNKS); } -@@ -1566,13 +1655,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1567,13 +1656,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.removePlayerFromDistanceMaps(entityplayer); // Paper - distance maps } @@ -472,7 +472,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } -@@ -1580,7 +1663,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1581,7 +1664,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { SectionPosition sectionposition = SectionPosition.a((Entity) entityplayer); entityplayer.a(sectionposition); @@ -481,7 +481,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 return sectionposition; } -@@ -1625,6 +1708,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1626,6 +1709,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { int k1; int l1; @@ -489,7 +489,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 if (Math.abs(i1 - i) <= this.viewDistance * 2 && Math.abs(j1 - j) <= this.viewDistance * 2) { k1 = Math.min(i, i1) - this.viewDistance; l1 = Math.min(j, j1) - this.viewDistance; -@@ -1662,7 +1746,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1663,7 +1747,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.sendChunk(entityplayer, chunkcoordintpair1, new Packet[2], false, true); } } @@ -498,7 +498,7 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 this.updateMaps(entityplayer); // Paper - distance maps -@@ -1670,11 +1754,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1671,11 +1755,46 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public Stream<EntityPlayer> a(ChunkCoordIntPair chunkcoordintpair, boolean flag) { @@ -549,15 +549,15 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } protected void addEntity(Entity entity) { -@@ -1832,6 +1951,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1833,6 +1952,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } + final void sendChunk(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { this.a(entityplayer, apacket, chunk); } // Paper - OBFHELPER private void a(EntityPlayer entityplayer, Packet<?>[] apacket, Chunk chunk) { if (apacket[0] == null) { - apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true); -@@ -2017,7 +2137,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { + apacket[0] = new PacketPlayOutMapChunk(chunk, 65535); +@@ -2018,7 +2138,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ); PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); @@ -567,28 +567,28 @@ index 8b36a14b2896d32f99e788a5db928a4100de3912..f67a8b655d0d0a9397650f771bc68f14 } } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 2c0d9c52fa90639c6b3b542b626a8b55b82a0df1..382f334f82efefcfbd1781ac09e191cd27a0fb0c 100644 +index 2236c839acca60aef6364e6266fa047a331a01e5..cd75556eee435f90b042c4c57ec3c65497f0de9e 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -175,7 +175,7 @@ public abstract class PlayerList { boolean flag1 = gamerules.getBoolean(GameRules.REDUCED_DEBUG_INFO); // Spigot - view distance -- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); -+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.E(), this.s, worldserver1.getTypeKey(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver1.getChunkProvider().playerChunkMap.getLoadViewDistance(), flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); // Paper - no-tick view distance +- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.s, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver1.spigotConfig.viewDistance, flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); ++ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), entityplayer.playerInteractManager.c(), BiomeManager.a(worldserver1.getSeed()), worlddata.isHardcore(), this.server.F(), this.s, worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), this.getMaxPlayers(), worldserver1.getChunkProvider().playerChunkMap.getLoadViewDistance(), flag1, !flag, worldserver1.isDebugWorld(), worldserver1.isFlatWorld())); // Paper - no-tick view distance entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); -@@ -814,7 +814,7 @@ public abstract class PlayerList { +@@ -826,7 +826,7 @@ public abstract class PlayerList { // CraftBukkit start WorldData worlddata = worldserver1.getWorldData(); - entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver1.getTypeKey(), worldserver1.getDimensionKey(), BiomeManager.a(worldserver1.getSeed()), entityplayer1.playerInteractManager.getGameMode(), entityplayer1.playerInteractManager.c(), worldserver1.isDebugWorld(), worldserver1.isFlatWorld(), flag)); + entityplayer1.playerConnection.sendPacket(new PacketPlayOutRespawn(worldserver1.getDimensionManager(), worldserver1.getDimensionKey(), BiomeManager.a(worldserver1.getSeed()), entityplayer1.playerInteractManager.getGameMode(), entityplayer1.playerInteractManager.c(), worldserver1.isDebugWorld(), worldserver1.isFlatWorld(), flag)); - entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver1.spigotConfig.viewDistance)); // Spigot + entityplayer1.playerConnection.sendPacket(new PacketPlayOutViewDistance(worldserver1.getChunkProvider().playerChunkMap.getLoadViewDistance())); // Spigot // Paper - no-tick view distance entityplayer1.spawnIn(worldserver1); entityplayer1.dead = false; entityplayer1.playerConnection.teleport(new Location(worldserver1.getWorld(), entityplayer1.locX(), entityplayer1.locY(), entityplayer1.locZ(), entityplayer1.yaw, entityplayer1.pitch)); -@@ -1281,7 +1281,7 @@ public abstract class PlayerList { +@@ -1293,7 +1293,7 @@ public abstract class PlayerList { public void a(int i) { this.viewDistance = i; @@ -598,10 +598,10 @@ index 2c0d9c52fa90639c6b3b542b626a8b55b82a0df1..382f334f82efefcfbd1781ac09e191cd while (iterator.hasNext()) { diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index 7342bdaa5f1cc0ae6a889149d45a97b6597a1e5b..d0e0fb0780e97102d0010f05902cd3218d4b7d3d 100644 +index 34e425854541333b3042f9ec4abb80f186fb67d6..b4bb84088d5932f92715776d9a62aa26a90122ba 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -508,8 +508,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -473,8 +473,13 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.b(blockposition, iblockdata1, iblockdata2); } @@ -617,10 +617,10 @@ index 7342bdaa5f1cc0ae6a889149d45a97b6597a1e5b..d0e0fb0780e97102d0010f05902cd321 if ((i & 1) != 0) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c57ccc003cf055c9e5dc704eaa07544881f32727..f9a5ec5cb34425e346e9a7cc24986ece9a4c44e8 100644 +index 5ef12e85d7374c137e2d7ff3e0571995070cc222..f35dda50fd9015a793708d214c648d75f9f87e2b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2530,10 +2530,39 @@ public class CraftWorld implements World { +@@ -2518,10 +2518,39 @@ public class CraftWorld implements World { // Spigot start @Override public int getViewDistance() { diff --git a/Spigot-Server-Patches/0481-Add-villager-reputation-API.patch b/Spigot-Server-Patches/0476-Add-villager-reputation-API.patch index a4b89e4b69..2ce6b0003d 100644 --- a/Spigot-Server-Patches/0481-Add-villager-reputation-API.patch +++ b/Spigot-Server-Patches/0476-Add-villager-reputation-API.patch @@ -20,16 +20,16 @@ index 0000000000000000000000000000000000000000..0f10c333d88f2e1c56a6c7f22d421084 + } +} diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java -index 9f28c7e4bd70abc280a8cf3cbf5ccc84246aff12..bf019043a9338aca8d91da809f1d5520531386e7 100644 +index 70f15bc9de4d66da7991a18b438737db18e1e76e..c10ff09dd005c0c8b3cd374d9de82e77efcd9097 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java -@@ -959,6 +959,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - this.bK = 0; +@@ -947,6 +947,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation + this.bD = 0; } + public Reputation getReputation() { return this.fj(); } // Paper - OBFHELPER public Reputation fj() { - return this.bF; + return this.by; } diff --git a/src/main/java/net/minecraft/server/Reputation.java b/src/main/java/net/minecraft/server/Reputation.java index 3c6d6be4485cad4f2e9a395425b5837590853eee..09d2fc5769089f6d29971d10de5b8209829baae8 100644 diff --git a/Spigot-Server-Patches/0482-Fix-Light-Command.patch b/Spigot-Server-Patches/0477-Fix-Light-Command.patch index d4d8453264..d5d273ae0b 100644 --- a/Spigot-Server-Patches/0482-Fix-Light-Command.patch +++ b/Spigot-Server-Patches/0477-Fix-Light-Command.patch @@ -124,10 +124,10 @@ index f7d98a5ba54d041eef10b04f821e0958ad898b0a..a12bc81933c15606b7cde46937f504ea if (!SyncLoadFinder.ENABLED) { sender.sendMessage(ChatColor.RED + "This command requires the server startup flag '-Dpaper.debug-sync-loads=true' to be set."); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 40347212ad1bcf857d5b8ddb0ee6a698e2568201..e5751adde516544722b95016f64b2a46c16e77ce 100644 +index 2784ea71b9f5ee93f6de8e5a3a135457f1be17a3..874bf7d3ddd22ddc4ea08dac1f548d246d85e991 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -314,6 +314,7 @@ public class PlayerChunk { +@@ -321,6 +321,7 @@ public class PlayerChunk { } @@ -136,10 +136,10 @@ index 40347212ad1bcf857d5b8ddb0ee6a698e2568201..e5751adde516544722b95016f64b2a46 // Paper start - per player view distance // there can be potential desync with player's last mapped section and the view distance map, so use the diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index f67a8b655d0d0a9397650f771bc68f148ca9edcc..3711914d59c61b652c6c675812ca5ecc29f95130 100644 +index 65ff262e99d2270c332d63f1bef85d40c6e557e1..18cde447a983da69ed6deb079ff372004619c903 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -96,6 +96,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -97,6 +97,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { private final ChunkTaskQueueSorter p; private final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxWorldGen; final Mailbox<ChunkTaskQueueSorter.a<Runnable>> mailboxMain; // Paper - private -> package private @@ -152,7 +152,7 @@ index f67a8b655d0d0a9397650f771bc68f148ca9edcc..3711914d59c61b652c6c675812ca5ecc public final WorldLoadListener worldLoadListener; public final PlayerChunkMap.a chunkDistanceManager; private final AtomicInteger u; -@@ -287,11 +293,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -288,11 +294,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox<Runnable> mailbox = Mailbox.a("main", iasynctaskhandler::a); this.worldLoadListener = worldloadlistener; diff --git a/Spigot-Server-Patches/0483-Fix-PotionEffect-ignores-icon-flag.patch b/Spigot-Server-Patches/0478-Fix-PotionEffect-ignores-icon-flag.patch index 43fcc1a798..43fcc1a798 100644 --- a/Spigot-Server-Patches/0483-Fix-PotionEffect-ignores-icon-flag.patch +++ b/Spigot-Server-Patches/0478-Fix-PotionEffect-ignores-icon-flag.patch diff --git a/Spigot-Server-Patches/0484-Optimize-brigadier-child-sorting-performance.patch b/Spigot-Server-Patches/0479-Optimize-brigadier-child-sorting-performance.patch index a9d88ce863..c5cacac8cc 100644 --- a/Spigot-Server-Patches/0484-Optimize-brigadier-child-sorting-performance.patch +++ b/Spigot-Server-Patches/0479-Optimize-brigadier-child-sorting-performance.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Optimize brigadier child sorting performance diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index 5b305320937eafdabbdc3d41475eb8d1c4b3b324..5e3fc338b0fe69a74465567e69721bc28c64dd17 100644 +index 1685522b494894169b4184b0b94199aedb75b5df..6976da79b20280fcd72dcfb8b48e2eb73257faf2 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -27,7 +27,7 @@ import java.util.stream.Collectors; diff --git a/Spigot-Server-Patches/0485-Don-t-toString-block-unless-actually-showing-the-mes.patch b/Spigot-Server-Patches/0480-Don-t-toString-block-unless-actually-showing-the-mes.patch index 11c031b70c..11c031b70c 100644 --- a/Spigot-Server-Patches/0485-Don-t-toString-block-unless-actually-showing-the-mes.patch +++ b/Spigot-Server-Patches/0480-Don-t-toString-block-unless-actually-showing-the-mes.patch diff --git a/Spigot-Server-Patches/0486-Potential-bed-API.patch b/Spigot-Server-Patches/0481-Potential-bed-API.patch index 75be78853a..1ba42230f4 100644 --- a/Spigot-Server-Patches/0486-Potential-bed-API.patch +++ b/Spigot-Server-Patches/0481-Potential-bed-API.patch @@ -8,7 +8,7 @@ Adds a new method to fetch the location of a player's bed without generating any getPotentialBedLocation - Gets the last known location of a player's bed. This does not preform any check if the bed is still valid and does not load any chunks. diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 75aa141e86e301254b25ede3da67513aae76fa5c..fef2035fe5564645d786d042dceedb10ca8b59ce 100644 +index 867443784d685d8f200d00b50e4b11474cee5ebe..98768b5df93fd1bf94858149e15a8c9a16439695 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -127,6 +127,22 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { diff --git a/Spigot-Server-Patches/0487-Wait-for-Async-Tasks-during-shutdown.patch b/Spigot-Server-Patches/0482-Wait-for-Async-Tasks-during-shutdown.patch index a19892b34a..b016051393 100644 --- a/Spigot-Server-Patches/0487-Wait-for-Async-Tasks-during-shutdown.patch +++ b/Spigot-Server-Patches/0482-Wait-for-Async-Tasks-during-shutdown.patch @@ -10,10 +10,10 @@ Adds a 5 second grace period for any async tasks to finish and warns if any are still running after that delay just as reload does. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 31ce31936a5100f0512103c70c09d097dac64863..84cd55ae46bd09ba2470998155ba64877b2d4cda 100644 +index 1241d0253508f79867c5393751c0e6eb62f8b6fe..4f0b79be16dbc8b528095f8ebfe80d70ef6074ce 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -773,6 +773,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -771,6 +771,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); @@ -22,10 +22,10 @@ index 31ce31936a5100f0512103c70c09d097dac64863..84cd55ae46bd09ba2470998155ba6487 // CraftBukkit end if (this.getServerConnection() != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 810c0236da937ecbd12a10c5beffe0859842e056..11c9b740b6b1ff30bd33c188c03f2b77b12faf7b 100644 +index 82a4166032e234645059d03ee265418045e3935a..e73753c0a4158e3088964ff75a26953ae1b3fc43 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -934,6 +934,35 @@ public final class CraftServer implements Server { +@@ -933,6 +933,35 @@ public final class CraftServer implements Server { org.spigotmc.WatchdogThread.hasStarted = true; // Paper - Disable watchdog early timeout on reload } diff --git a/Spigot-Server-Patches/0488-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch b/Spigot-Server-Patches/0483-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch index 7bdfe0e2d8..fc479ce2c2 100644 --- a/Spigot-Server-Patches/0488-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch +++ b/Spigot-Server-Patches/0483-Ensure-EntityRaider-respects-game-and-entity-rules-f.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Ensure EntityRaider respects game and entity rules for diff --git a/src/main/java/net/minecraft/server/EntityRaider.java b/src/main/java/net/minecraft/server/EntityRaider.java -index a1f89a5c0a8b7bd13ce12fd8e27fc352e877d26f..751873c20ef74daa1e1f7278e8364a22be18504c 100644 +index e235451901a82a078d5cecc8426fd8d23557ad7d..68eaaf86b515a52720c481d77e651c1bde1e8c6c 100644 --- a/src/main/java/net/minecraft/server/EntityRaider.java +++ b/src/main/java/net/minecraft/server/EntityRaider.java @@ -487,7 +487,7 @@ public abstract class EntityRaider extends EntityMonsterPatrolling { @@ -23,6 +23,6 @@ index a1f89a5c0a8b7bd13ce12fd8e27fc352e877d26f..751873c20ef74daa1e1f7278e8364a22 @Override public boolean a() { + if (!getRaider().world.getGameRules().getBoolean(GameRules.MOB_GRIEFING) || !getRaider().canPickupLoot()) return false; // Paper - respect game and entity rules for picking up items - Raid raid = this.b.fb(); + Raid raid = this.b.fa(); - if (this.b.fc() && !this.b.fb().a() && this.b.eO() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) { + if (this.b.fb() && !this.b.fa().a() && this.b.eN() && !ItemStack.matches(this.b.getEquipment(EnumItemSlot.HEAD), Raid.s())) { diff --git a/Spigot-Server-Patches/0489-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch b/Spigot-Server-Patches/0484-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch index c3c3e5ce98..e2a77f8b3a 100644 --- a/Spigot-Server-Patches/0489-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch +++ b/Spigot-Server-Patches/0484-Protect-Bedrock-and-End-Portal-Frames-from-being-des.patch @@ -35,10 +35,10 @@ index 093605fe8e079d9ec973702c55ea6caddf0369f1..3d63215a855c71d257b18a247eb7f0b2 + } diff --git a/src/main/java/net/minecraft/server/Block.java b/src/main/java/net/minecraft/server/Block.java -index 4f9c6b25f152b348a00dadf4b8f58ec3adc3476e..81725611d5b8c10c05d561984f92dc67349900ec 100644 +index b364ceafb4c3412b0d11b3b2e8b4321ed96769bb..a45ceff9ff970b996b2767379a2ecd4693f52d3a 100644 --- a/src/main/java/net/minecraft/server/Block.java +++ b/src/main/java/net/minecraft/server/Block.java -@@ -25,6 +25,14 @@ public class Block extends BlockBase implements IMaterial { +@@ -23,6 +23,19 @@ public class Block extends BlockBase implements IMaterial { protected final BlockStateList<Block, IBlockData> blockStateList; private IBlockData blockData; // Paper start @@ -48,13 +48,18 @@ index 4f9c6b25f152b348a00dadf4b8f58ec3adc3476e..81725611d5b8c10c05d561984f92dc67 + this != Blocks.END_PORTAL_FRAME && + this != Blocks.END_PORTAL && + this != Blocks.END_GATEWAY && -+ this != Blocks.MOVING_PISTON; // try to prevent creation of headless pistons ++ this != Blocks.COMMAND_BLOCK && ++ this != Blocks.REPEATING_COMMAND_BLOCK && ++ this != Blocks.CHAIN_COMMAND_BLOCK && ++ this != Blocks.BARRIER && ++ this != Blocks.STRUCTURE_BLOCK && ++ this != Blocks.JIGSAW; + } public co.aikar.timings.Timing timing; public co.aikar.timings.Timing getTiming() { if (timing == null) { diff --git a/src/main/java/net/minecraft/server/BlockBase.java b/src/main/java/net/minecraft/server/BlockBase.java -index 4c7343a1192dd1a8dc7594b57329e6bb6fefb6b2..7b0cc7833448a9e77e85be10f4e02ce43fdead58 100644 +index 4b1f8ceee358ed7dc17ff09c230ad7ec65e8f194..440c959b1cbff2f406bb7e576b81860cf56f8858 100644 --- a/src/main/java/net/minecraft/server/BlockBase.java +++ b/src/main/java/net/minecraft/server/BlockBase.java @@ -138,7 +138,7 @@ public abstract class BlockBase { @@ -89,7 +94,7 @@ index 4c7343a1192dd1a8dc7594b57329e6bb6fefb6b2..7b0cc7833448a9e77e85be10f4e02ce4 public boolean i(IBlockAccess iblockaccess, BlockPosition blockposition) { diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index c068a4115e3b82f4886d822d2472e8b522946674..6b1253fe7e8d4bb71d4d19c063d3e84c167c4d7b 100644 +index 417d1a6c3dbd23905672a847939d92a953bbc91c..0bab7dfb053c1aa92f5417c25fed5484e09bbec3 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java @@ -165,6 +165,12 @@ public class BlockPiston extends BlockDirectional { @@ -131,18 +136,18 @@ index c068a4115e3b82f4886d822d2472e8b522946674..6b1253fe7e8d4bb71d4d19c063d3e84c world.playSound((EntityHuman) null, blockposition, SoundEffects.BLOCK_PISTON_CONTRACT, SoundCategory.BLOCKS, 0.5F, world.random.nextFloat() * 0.15F + 0.6F); diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java -index 22a19e761fdec68cc9405988b977021a8b6398eb..e408ec8c645e9ceb278a13a5b0de8ecf57f3929e 100644 +index 005ab6dd65b9c50cb07048a69613e425a369b69f..766ec660fa8c59f02a5299c4770cc658fdf4b075 100644 --- a/src/main/java/net/minecraft/server/Explosion.java +++ b/src/main/java/net/minecraft/server/Explosion.java -@@ -124,6 +124,7 @@ public class Explosion { +@@ -125,6 +125,7 @@ public class Explosion { for (float f1 = 0.3F; f > 0.0F; f -= 0.22500001F) { BlockPosition blockposition = new BlockPosition(d4, d5, d6); IBlockData iblockdata = this.world.getType(blockposition); + if (!iblockdata.isDestroyable()) continue; // Paper Fluid fluid = iblockdata.getFluid(); // Paper - Optional<Float> optional = this.k.a(this, this.world, blockposition, iblockdata, fluid); + Optional<Float> optional = this.l.a(this, this.world, blockposition, iblockdata, fluid); -@@ -277,7 +278,7 @@ public class Explosion { +@@ -278,7 +279,7 @@ public class Explosion { IBlockData iblockdata = this.world.getType(blockposition); Block block = iblockdata.getBlock(); @@ -152,10 +157,10 @@ index 22a19e761fdec68cc9405988b977021a8b6398eb..e408ec8c645e9ceb278a13a5b0de8ecf this.world.getMethodProfiler().enter("explosion_blocks"); diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java -index d0e0fb0780e97102d0010f05902cd3218d4b7d3d..a173d2562e0c549184f5e82f112843a9893cb502 100644 +index b4bb84088d5932f92715776d9a62aa26a90122ba..287db5203f3a4995c2b09bfd9fe17734538e7466 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java -@@ -406,6 +406,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { +@@ -371,6 +371,10 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) { // CraftBukkit start - tree generation if (this.captureTreeGeneration) { diff --git a/Spigot-Server-Patches/0490-Optimize-NibbleArray-to-use-pooled-buffers.patch b/Spigot-Server-Patches/0485-Optimize-NibbleArray-to-use-pooled-buffers.patch index b6213c209b..10babb4196 100644 --- a/Spigot-Server-Patches/0490-Optimize-NibbleArray-to-use-pooled-buffers.patch +++ b/Spigot-Server-Patches/0485-Optimize-NibbleArray-to-use-pooled-buffers.patch @@ -9,7 +9,7 @@ an object pool for these. Uses lots of advanced new capabilities of the Paper codebase :) diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 5b196201c0e35895a04e2a542ef7c753d0c469e1..4b7c4643f04448aaccc66f26a9dea2323bea420d 100644 +index 937bd0daf84f6b5f382dea73e20f2fd6ad903000..3d06c87b64c209526bee2ea11b58d30fe9b1d062 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -386,11 +386,11 @@ public class ChunkRegionLoader { @@ -95,7 +95,7 @@ index 7cec18fcfc311d20beca244c0affe5d6c1849e46..a35e7b392c74fadf2760d1fc2021e98d l = SectionPosition.c(SectionPosition.c(i)); int i1 = SectionPosition.c(SectionPosition.d(i)); diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java -index 996c8326387b5a7fe62db6a76e000144565cb85b..8cedfdd820cc02a76607b53e0b054fc74654f907 100644 +index 6d608dfa52fffd79878f3bdebcda9fab176e413e..ff00830b95a17f66d0c913087492dbf4b066df8a 100644 --- a/src/main/java/net/minecraft/server/NibbleArray.java +++ b/src/main/java/net/minecraft/server/NibbleArray.java @@ -1,16 +1,75 @@ @@ -174,7 +174,7 @@ index 996c8326387b5a7fe62db6a76e000144565cb85b..8cedfdd820cc02a76607b53e0b054fc7 + registerCleaner(); + // Paper end if (abyte.length != 2048) { - throw (IllegalArgumentException) SystemUtils.c(new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + abyte.length)); + throw (IllegalArgumentException) SystemUtils.c((Throwable) (new IllegalArgumentException("ChunkNibbleArrays should be 2048 bytes not: " + abyte.length))); } @@ -44,7 +103,8 @@ public class NibbleArray { @@ -353,10 +353,10 @@ index 6b70df646c6a690ab9437ead96c5ff097e4e12d2..a22f0cccecc85b4e4fe4603bcfa213f1 this.d &= ~(1 << k); if (nibblearray != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -index 01bf7320b5cbc38e278ca907aa324ee3e945805e..06e42b7db5385f9a357183552259e7b4491d9fd0 100644 +index 2a08a3170fcef666cb3096511d8a592e575c9734..d2c45157a27c24651c72fd8ab9a0950dec097b84 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java -@@ -273,14 +273,14 @@ public class CraftChunk implements Chunk { +@@ -274,14 +274,14 @@ public class CraftChunk implements Chunk { sectionSkyLights[i] = emptyLight; } else { sectionSkyLights[i] = new byte[2048]; diff --git a/Spigot-Server-Patches/0491-Reduce-MutableInt-allocations-from-light-engine.patch b/Spigot-Server-Patches/0486-Reduce-MutableInt-allocations-from-light-engine.patch index 2524f18f3d..15504c4c63 100644 --- a/Spigot-Server-Patches/0491-Reduce-MutableInt-allocations-from-light-engine.patch +++ b/Spigot-Server-Patches/0486-Reduce-MutableInt-allocations-from-light-engine.patch @@ -7,7 +7,7 @@ We can abuse the fact light is single threaded and share an instance per light engine instance diff --git a/src/main/java/net/minecraft/server/LightEngineBlock.java b/src/main/java/net/minecraft/server/LightEngineBlock.java -index 93a972605c26aa757b9c915876f847da04fcb496..07fadc21ee12138b52cc77c50da536fec5b032f5 100644 +index 29e12f76a3e424d36506144e09e083cc5ce3bedc..4db28b9a9b8a1e91911126172c6670c252dd49cb 100644 --- a/src/main/java/net/minecraft/server/LightEngineBlock.java +++ b/src/main/java/net/minecraft/server/LightEngineBlock.java @@ -6,6 +6,7 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB diff --git a/Spigot-Server-Patches/0492-Reduce-allocation-of-Vec3D-by-entity-tracker.patch b/Spigot-Server-Patches/0487-Reduce-allocation-of-Vec3D-by-entity-tracker.patch index 399c2f2b28..ff87448a7f 100644 --- a/Spigot-Server-Patches/0492-Reduce-allocation-of-Vec3D-by-entity-tracker.patch +++ b/Spigot-Server-Patches/0487-Reduce-allocation-of-Vec3D-by-entity-tracker.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Reduce allocation of Vec3D by entity tracker diff --git a/src/main/java/net/minecraft/server/EntityTrackerEntry.java b/src/main/java/net/minecraft/server/EntityTrackerEntry.java -index 0c46297e6ff229538d77b2f481e4ab13ea14c48e..f75c09d44a19f84588f21a55ea8f0dd8ccb539b9 100644 +index 8fecf1172c50669604ac097c8e5d81f83087a063..831298e3bb0de4ef1bec933cf378889ca4cbcde8 100644 --- a/src/main/java/net/minecraft/server/EntityTrackerEntry.java +++ b/src/main/java/net/minecraft/server/EntityTrackerEntry.java @@ -127,8 +127,12 @@ public class EntityTrackerEntry { @@ -39,10 +39,10 @@ index 0c46297e6ff229538d77b2f481e4ab13ea14c48e..f75c09d44a19f84588f21a55ea8f0dd8 if (!flag4 && this.o <= 400 && !this.q && this.r == this.tracker.isOnGround()) { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 3711914d59c61b652c6c675812ca5ecc29f95130..31bde9518d8fcda2b0f776db22f7fdbbb2953a64 100644 +index 18cde447a983da69ed6deb079ff372004619c903..8de089ebf56d25c7799f822cdd26511a4651223d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -2133,9 +2133,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -2134,9 +2134,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public void updatePlayer(EntityPlayer entityplayer) { org.spigotmc.AsyncCatcher.catchOp("player tracker update"); // Spigot if (entityplayer != this.tracker) { diff --git a/Spigot-Server-Patches/0493-Ensure-safe-gateway-teleport.patch b/Spigot-Server-Patches/0488-Ensure-safe-gateway-teleport.patch index dd6019dd4b..f64384aa2d 100644 --- a/Spigot-Server-Patches/0493-Ensure-safe-gateway-teleport.patch +++ b/Spigot-Server-Patches/0488-Ensure-safe-gateway-teleport.patch @@ -5,20 +5,19 @@ Subject: [PATCH] Ensure safe gateway teleport diff --git a/src/main/java/net/minecraft/server/TileEntityEndGateway.java b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -index 50bb2ca7235781cd80ecde2bb378f37d67514658..89537dec8ed278e79e078cb2fd3d3e839cdbab59 100644 +index 8eb1520d603aa59650418ee12cb1031168271fea..5d158e72378c02032fe6043696b9e3dd82e71e5c 100644 --- a/src/main/java/net/minecraft/server/TileEntityEndGateway.java +++ b/src/main/java/net/minecraft/server/TileEntityEndGateway.java -@@ -62,10 +62,14 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick - --this.c; +@@ -63,9 +63,14 @@ public class TileEntityEndGateway extends TileEntityEnderPortal implements ITick } else if (!this.world.isClientSide) { - List<Entity> list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition())); -- + List<Entity> list = this.world.a(Entity.class, new AxisAlignedBB(this.getPosition()), TileEntityEndGateway::a); + - if (!list.isEmpty()) { -- this.a((Entity) list.get(this.world.random.nextInt(list.size()))); +- this.b((Entity) list.get(this.world.random.nextInt(list.size()))); + // Paper start + for (Entity entity : list) { + if (entity.canPortal()) { -+ this.a(entity); ++ this.b(entity); + break; + } } diff --git a/Spigot-Server-Patches/0494-Add-option-for-console-having-all-permissions.patch b/Spigot-Server-Patches/0489-Add-option-for-console-having-all-permissions.patch index 5b79a61f25..5b79a61f25 100644 --- a/Spigot-Server-Patches/0494-Add-option-for-console-having-all-permissions.patch +++ b/Spigot-Server-Patches/0489-Add-option-for-console-having-all-permissions.patch diff --git a/Spigot-Server-Patches/0495-Workaround-for-Client-Lag-Spikes-MC-162253.patch b/Spigot-Server-Patches/0490-Workaround-for-Client-Lag-Spikes-MC-162253.patch index b8f7801a05..cb38ad4829 100644 --- a/Spigot-Server-Patches/0495-Workaround-for-Client-Lag-Spikes-MC-162253.patch +++ b/Spigot-Server-Patches/0490-Workaround-for-Client-Lag-Spikes-MC-162253.patch @@ -12,10 +12,10 @@ to the client, so that it doesn't attempt to calculate them. This mitigates the frametime impact to a minimum (but it's still there). diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index fb3b626a3dbeca14a2b89e2480f81e7b45a432d3..7e8e1547337c7da451129a1529d372f27b07e6e5 100644 +index 6ac8670c76eaf0c1292c6e88c63eaf6b18c9fbb8..299d7d7a55532930e2d4340a6cfe77a5fd8a0a0c 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java -@@ -278,7 +278,7 @@ public class Chunk implements IChunkAccess { +@@ -230,7 +230,7 @@ public class Chunk implements IChunkAccess { // broadcast Object[] backingSet = inRange.getBackingSet(); @@ -25,7 +25,7 @@ index fb3b626a3dbeca14a2b89e2480f81e7b45a432d3..7e8e1547337c7da451129a1529d372f2 Object temp = backingSet[index]; if (!(temp instanceof EntityPlayer)) { diff --git a/src/main/java/net/minecraft/server/ChunkSection.java b/src/main/java/net/minecraft/server/ChunkSection.java -index f451c69ce705fcaf564cd3916fca01391dc2fe60..3588fe10017cf2341b9121bbb0438ef3fdf8cda6 100644 +index 39572cdce691a459cb9df0cc064fbf7bde83a99e..e52df8096e399c84ff8a2637fdd65ea57d9001d0 100644 --- a/src/main/java/net/minecraft/server/ChunkSection.java +++ b/src/main/java/net/minecraft/server/ChunkSection.java @@ -100,6 +100,7 @@ public class ChunkSection { @@ -37,10 +37,10 @@ index f451c69ce705fcaf564cd3916fca01391dc2fe60..3588fe10017cf2341b9121bbb0438ef3 return chunksection == Chunk.a || chunksection.c(); } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 31bde9518d8fcda2b0f776db22f7fdbbb2953a64..f0dc6efce2e0ff053f134993cce94afb9b5cd6f3 100644 +index 8de089ebf56d25c7799f822cdd26511a4651223d..12c4868b3d7643330ee5b3b2232dd58e0369839f 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -1958,12 +1958,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1959,12 +1959,112 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } @@ -93,7 +93,7 @@ index 31bde9518d8fcda2b0f776db22f7fdbbb2953a64..f0dc6efce2e0ff053f134993cce94afb + apacket = new Packet[10]; + } + // Paper end - apacket[0] = new PacketPlayOutMapChunk(chunk, 65535, true); + apacket[0] = new PacketPlayOutMapChunk(chunk, 65535); apacket[1] = new PacketPlayOutLightUpdate(chunk.getPos(), this.lightEngine, true); + + // Paper start - Fix MC-162253 diff --git a/Spigot-Server-Patches/0496-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch b/Spigot-Server-Patches/0491-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch index 520dbebab7..4ec28f0c92 100644 --- a/Spigot-Server-Patches/0496-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch +++ b/Spigot-Server-Patches/0491-Implement-Chunk-Priority-Urgency-System-for-Chunks.patch @@ -78,10 +78,10 @@ index 49a594e5f345096cb3b9913b8ee2760795c5f012..bcb7ce2692c5bc1a6214c3a384949666 } diff --git a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -index f0e28f03074bc5e24e5fa64dca94c7573f952357..b7093f1682d152988a54ffc5e5579d2f0ce10ad4 100644 +index b12e43ed13a1a9d7d418831b8988c30a242cb5c4..dcaf9f8574a9c913b64ba3a1d8b02220db720225 100644 --- a/src/main/java/net/minecraft/server/ChunkCoordIntPair.java +++ b/src/main/java/net/minecraft/server/ChunkCoordIntPair.java -@@ -107,6 +107,7 @@ public class ChunkCoordIntPair { +@@ -103,6 +103,7 @@ public class ChunkCoordIntPair { return "[" + this.x + ", " + this.z + "]"; } @@ -90,7 +90,7 @@ index f0e28f03074bc5e24e5fa64dca94c7573f952357..b7093f1682d152988a54ffc5e5579d2f return new BlockPosition(this.d(), 0, this.e()); } diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index c072f61e8c88eac8335acd660d8ff0e2f9db819e..705c6e3a47a76509268075078f95871d313f6b76 100644 +index 03b1a67aaf3ed75b7669a3157847affd678f8df4..09fec533d7feebb90e989007dd19c952823550ba 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -23,6 +23,7 @@ import java.util.concurrent.Executor; @@ -483,10 +483,10 @@ index c072f61e8c88eac8335acd660d8ff0e2f9db819e..705c6e3a47a76509268075078f95871d protected int c(long i) { return this.a.get(i); diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027be5d15a0e 100644 +index c54175eaad6230a1098e9b912e0b4788afe4b9c8..afcbdd8e54ad936a4a3ac03341e1c52524624474 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -443,6 +443,26 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -444,6 +444,26 @@ public class ChunkProviderServer extends IChunkProvider { public <T> void removeTicketAtLevel(TicketType<T> ticketType, ChunkCoordIntPair chunkPos, int ticketLevel, T identifier) { this.chunkMapDistance.removeTicketAtLevel(ticketType, chunkPos, ticketLevel, identifier); } @@ -513,7 +513,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b // Paper end @Nullable -@@ -481,6 +501,8 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -482,6 +502,8 @@ public class ChunkProviderServer extends IChunkProvider { if (!completablefuture.isDone()) { // Paper // Paper start - async chunk io/loading @@ -522,7 +522,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b this.world.asyncChunkTaskManager.raisePriority(x, z, com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGHEST_PRIORITY); com.destroystokyo.paper.io.chunk.ChunkTaskManager.pushChunkWait(this.world, x, z); // Paper end -@@ -489,6 +511,8 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -490,6 +512,8 @@ public class ChunkProviderServer extends IChunkProvider { this.serverThreadQueue.awaitTasks(completablefuture::isDone); com.destroystokyo.paper.io.chunk.ChunkTaskManager.popChunkWait(); // Paper - async chunk debug this.world.timings.syncChunkLoad.stopTiming(); // Paper @@ -531,7 +531,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b } // Paper ichunkaccess = (IChunkAccess) ((Either) completablefuture.join()).map((ichunkaccess1) -> { return ichunkaccess1; -@@ -541,10 +565,12 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -542,10 +566,12 @@ public class ChunkProviderServer extends IChunkProvider { if (flag && !currentlyUnloading) { // CraftBukkit end this.chunkMapDistance.a(TicketType.UNKNOWN, chunkcoordintpair, l, chunkcoordintpair); @@ -544,7 +544,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b this.tickDistanceManager(); playerchunk = this.getChunk(k); gameprofilerfiller.exit(); -@@ -553,8 +579,13 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -554,8 +580,13 @@ public class ChunkProviderServer extends IChunkProvider { } } } @@ -560,7 +560,7 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b } private boolean a(@Nullable PlayerChunk playerchunk, int i) { -@@ -605,6 +636,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -606,6 +637,7 @@ public class ChunkProviderServer extends IChunkProvider { } public boolean tickDistanceManager() { // Paper - private -> public @@ -569,10 +569,10 @@ index 319059ba31f3614cc59cd4c4e4fa9242f6e4fe99..7c87ef638d538093e944341525a1027b boolean flag1 = this.playerChunkMap.b(); diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e80133932c5fad52c7b42c45c2b84aff7d11f296..e5a81f831813209d224ffedbc03f6d8243721a25 100644 +index c0656a9fa5e9ebb4199231fdc20c6a50859a80dd..918426385325e5157423cf10fcb2e0ab02d5853a 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -55,6 +55,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -56,6 +56,12 @@ public class EntityPlayer extends EntityHuman implements ICrafting { private int lastArmorScored = Integer.MIN_VALUE; private int lastExpLevelScored = Integer.MIN_VALUE; private int lastExpTotalScored = Integer.MIN_VALUE; @@ -585,7 +585,7 @@ index e80133932c5fad52c7b42c45c2b84aff7d11f296..e5a81f831813209d224ffedbc03f6d82 private float lastHealthSent = -1.0E8F; private int lastFoodSent = -99999999; private boolean lastSentSaturationZero = true; -@@ -136,6 +142,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -138,6 +144,21 @@ public class EntityPlayer extends EntityHuman implements ICrafting { this.maxHealthCache = this.getMaxHealth(); this.cachedSingleMobDistanceMap = new com.destroystokyo.paper.util.PooledHashSets.PooledObjectLinkedOpenHashSet<>(this); // Paper } @@ -607,7 +607,7 @@ index e80133932c5fad52c7b42c45c2b84aff7d11f296..e5a81f831813209d224ffedbc03f6d82 // Yes, this doesn't match Vanilla, but it's the best we can do for now. // If this is an issue, PRs are welcome -@@ -481,6 +502,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { +@@ -485,6 +506,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { if (valid && !this.isSpectator() || this.world.isLoaded(this.getChunkCoordinates())) { // Paper - don't tick dead players that are not in the world currently (pending respawn) super.tick(); } @@ -616,10 +616,10 @@ index e80133932c5fad52c7b42c45c2b84aff7d11f296..e5a81f831813209d224ffedbc03f6d82 for (int i = 0; i < this.inventory.getSize(); ++i) { ItemStack itemstack = this.inventory.getItem(i); diff --git a/src/main/java/net/minecraft/server/MCUtil.java b/src/main/java/net/minecraft/server/MCUtil.java -index b419f0e938b8406874ff7b3d0ee7a532e5990557..87810f007ad258935aa54c0f6a2e2d4325281623 100644 +index 0b5ddff008d151ad03a1f382a8f24494356e8701..ff74be14512a947e81b62d53e616131ca7d7f609 100644 --- a/src/main/java/net/minecraft/server/MCUtil.java +++ b/src/main/java/net/minecraft/server/MCUtil.java -@@ -655,6 +655,7 @@ public final class MCUtil { +@@ -656,6 +656,7 @@ public final class MCUtil { chunkData.addProperty("x", playerChunk.location.x); chunkData.addProperty("z", playerChunk.location.z); chunkData.addProperty("ticket-level", playerChunk.getTicketLevel()); @@ -628,10 +628,18 @@ index b419f0e938b8406874ff7b3d0ee7a532e5990557..87810f007ad258935aa54c0f6a2e2d43 chunkData.addProperty("queued-for-unload", chunkMap.unloadQueue.contains(playerChunk.location.pair())); chunkData.addProperty("status", status == null ? "unloaded" : status.toString()); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e166d6bc1e 100644 +index 874bf7d3ddd22ddc4ea08dac1f548d246d85e991..b629afa7e6f046f1a09237f3355ec193c24e02d8 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -26,8 +26,8 @@ public class PlayerChunk { +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.mojang.datafixers.util.Either; ++import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap; // Paper + import it.unimi.dsi.fastutil.shorts.ShortArraySet; + import it.unimi.dsi.fastutil.shorts.ShortSet; + import java.util.List; +@@ -28,8 +29,8 @@ public class PlayerChunk { private CompletableFuture<IChunkAccess> chunkSave; public int oldTicketLevel; private int ticketLevel; @@ -639,18 +647,18 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 - final ChunkCoordIntPair location; // Paper - private -> package + volatile int n; public final int getCurrentPriority() { return n; } // Paper - OBFHELPER - make volatile since this is concurrently accessed + public final ChunkCoordIntPair location; // Paper - private -> public - private final short[] dirtyBlocks; - private int dirtyCount; + private boolean p; + private final ShortSet[] dirtyBlocks; private int r; -@@ -39,6 +39,7 @@ public class PlayerChunk { - private boolean hasBeenLoaded; +@@ -41,6 +42,7 @@ public class PlayerChunk { + private boolean x; private final PlayerChunkMap chunkMap; // Paper + public WorldServer getWorld() { return chunkMap.world; } // Paper long lastAutoSaveTime; // Paper - incremental autosave long inactiveTimeStart; // Paper - incremental autosave -@@ -66,6 +67,120 @@ public class PlayerChunk { +@@ -68,6 +70,120 @@ public class PlayerChunk { return null; } // Paper end - no-tick view distance @@ -658,7 +666,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 + volatile int neighborPriority = -1; + volatile int priorityBoost = 0; + public final java.util.concurrent.ConcurrentHashMap<PlayerChunk, ChunkStatus> neighbors = new java.util.concurrent.ConcurrentHashMap<>(); -+ public final it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<Integer> neighborPriorities = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(); ++ public final Long2ObjectOpenHashMap<Integer> neighborPriorities = new Long2ObjectOpenHashMap<>(); + + private int getDemandedPriority() { + int priority = neighborPriority; // if we have a neighbor priority, use it @@ -771,7 +779,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 public PlayerChunk(ChunkCoordIntPair chunkcoordintpair, int i, LightEngine lightengine, PlayerChunk.c playerchunk_c, PlayerChunk.d playerchunk_d) { this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); -@@ -164,6 +279,18 @@ public class PlayerChunk { +@@ -166,6 +282,18 @@ public class PlayerChunk { } return null; } @@ -790,7 +798,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 // Paper end public CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> getStatusFutureUnchecked(ChunkStatus chunkstatus) { -@@ -405,6 +532,7 @@ public class PlayerChunk { +@@ -412,6 +540,7 @@ public class PlayerChunk { return this.n; } @@ -798,7 +806,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 private void d(int i) { this.n = i; } -@@ -423,7 +551,7 @@ public class PlayerChunk { +@@ -430,7 +559,7 @@ public class PlayerChunk { // CraftBukkit start // ChunkUnloadEvent: Called before the chunk is unloaded: isChunkLoaded is still true and chunk can still be modified by plugins. if (playerchunk_state.isAtLeast(PlayerChunk.State.BORDER) && !playerchunk_state1.isAtLeast(PlayerChunk.State.BORDER)) { @@ -807,7 +815,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 Chunk chunk = (Chunk)either.left().orElse(null); if (chunk != null) { playerchunkmap.callbackExecutor.execute(() -> { -@@ -488,12 +616,13 @@ public class PlayerChunk { +@@ -495,12 +624,13 @@ public class PlayerChunk { if (!flag2 && flag3) { // Paper start - cache ticking ready status int expectCreateCount = ++this.fullChunkCreateCount; @@ -822,7 +830,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 } -@@ -518,7 +647,7 @@ public class PlayerChunk { +@@ -525,7 +655,7 @@ public class PlayerChunk { if (!flag4 && flag5) { // Paper start - cache ticking ready status @@ -831,7 +839,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 if (either.left().isPresent()) { // note: Here is a very good place to add callbacks to logic waiting on this. Chunk tickingChunk = either.left().get(); -@@ -549,7 +678,7 @@ public class PlayerChunk { +@@ -556,7 +686,7 @@ public class PlayerChunk { } // Paper start - cache ticking ready status @@ -840,11 +848,11 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 if (either.left().isPresent()) { // note: Here is a very good place to add callbacks to logic waiting on this. Chunk entityTickingChunk = either.left().get(); -@@ -569,12 +698,29 @@ public class PlayerChunk { +@@ -576,12 +706,29 @@ public class PlayerChunk { this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; } -- this.v.a(this.location, this::k, this.ticketLevel, this::d); +- this.u.a(this.location, this::k, this.ticketLevel, this::d); + // Paper start - raise IO/load priority if priority changes, use our preferred priority + priorityBoost = chunkMap.chunkDistanceManager.getChunkPriority(location); + int priority = getDemandedPriority(); @@ -858,7 +866,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 + chunkMap.world.asyncChunkTaskManager.raisePriority(location.x, location.z, ioPriority); + } + if (getCurrentPriority() != priority) { -+ this.v.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority ++ this.u.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority + int neighborsPriority = getNeighborsPriority(); + this.neighbors.forEach((neighbor, neighborDesired) -> neighbor.setNeighborPriority(this, neighborsPriority)); + } @@ -872,7 +880,7 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 Chunk chunk = (Chunk)either.left().orElse(null); if (chunk != null) { playerchunkmap.callbackExecutor.execute(() -> { -@@ -656,6 +802,7 @@ public class PlayerChunk { +@@ -663,6 +810,7 @@ public class PlayerChunk { public interface c { @@ -881,10 +889,18 @@ index e5751adde516544722b95016f64b2a46c16e77ce..04dea2c9fd9337631a6289c7242338e1 } diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af203ecd60ca 100644 +index 12c4868b3d7643330ee5b3b2232dd58e0369839f..ddc2d2eff1ba05bd4174c5137f7750db6749306a 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -51,6 +51,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean; +@@ -14,6 +14,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap; + import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; + import it.unimi.dsi.fastutil.longs.Long2ByteMap; + import it.unimi.dsi.fastutil.longs.Long2ByteOpenHashMap; ++import it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap; // Paper + import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; + import it.unimi.dsi.fastutil.longs.Long2ObjectMap.Entry; + import it.unimi.dsi.fastutil.longs.LongIterator; +@@ -52,6 +53,7 @@ import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bukkit.entity.Player; // CraftBukkit @@ -892,7 +908,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { -@@ -88,6 +89,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -89,6 +91,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { public final WorldServer world; private final LightEngineThreaded lightEngine; private final IAsyncTaskHandler<Runnable> executor; @@ -900,7 +916,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 public final ChunkGenerator chunkGenerator; private final Supplier<WorldPersistentData> l; public final Supplier<WorldPersistentData> getWorldPersistentDataSupplier() { return this.l; } // Paper - OBFHELPER private final VillagePlace m; -@@ -125,6 +127,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -126,6 +129,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public void execute(Runnable runnable) { @@ -908,7 +924,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 if (queued == null) { queued = new java.util.ArrayDeque<>(); } -@@ -133,6 +136,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -134,6 +138,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public void run() { @@ -916,7 +932,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 if (queued == null) { return; } -@@ -287,6 +291,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -288,6 +293,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.world = worldserver; this.chunkGenerator = chunkgenerator; this.executor = iasynctaskhandler; @@ -932,7 +948,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 ThreadedMailbox<Runnable> threadedmailbox = ThreadedMailbox.a(executor, "worldgen"); iasynctaskhandler.getClass(); -@@ -381,6 +394,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -382,6 +396,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { this.playerViewDistanceTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<EntityPlayer> newState) -> { @@ -940,7 +956,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 if (newState.size() != 1) { return; } -@@ -399,7 +413,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -400,7 +415,11 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(rangeX, rangeZ); PlayerChunkMap.this.world.getChunkProvider().removeTicketAtLevel(TicketType.PLAYER, chunkPos, 31, chunkPos); // entity ticking level, TODO check on update @@ -953,7 +969,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 this.playerViewDistanceNoTickMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets); this.playerViewDistanceBroadcastMap = new com.destroystokyo.paper.util.misc.PlayerAreaMap(this.pooledLinkedPlayerHashSets, (EntityPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ, -@@ -416,6 +434,115 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -417,6 +436,115 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }); // Paper end - no-tick view distance } @@ -980,7 +996,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 + return playerchunk == null || unloadQueue.contains(playerchunk.location.pair()); + } + -+ private void updateChunkPriorityMap(it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap map, long chunk, int level) { ++ private void updateChunkPriorityMap(Long2IntOpenHashMap map, long chunk, int level) { + int prev = map.getOrDefault(chunk, -1); + if (level > prev) { + map.put(chunk, level); @@ -993,7 +1009,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 + return; + } + player.lastHighPriorityChecked = currentTick; -+ it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap priorities = new it.unimi.dsi.fastutil.longs.Long2IntOpenHashMap(); ++ Long2IntOpenHashMap priorities = new Long2IntOpenHashMap(); + + int viewDistance = getEffectiveNoTickViewDistance(); + BlockPosition.MutableBlockPosition pos = new BlockPosition.MutableBlockPosition(); @@ -1069,7 +1085,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 public void updatePlayerMobTypeMap(Entity entity) { if (!this.world.paperConfig.perPlayerMobSpawns) { -@@ -545,6 +672,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -546,6 +674,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { List<CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>>> list = Lists.newArrayList(); int j = chunkcoordintpair.x; int k = chunkcoordintpair.z; @@ -1077,7 +1093,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 for (int l = -i; l <= i; ++l) { for (int i1 = -i; i1 <= i; ++i1) { -@@ -563,6 +691,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -564,6 +693,14 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { ChunkStatus chunkstatus = (ChunkStatus) intfunction.apply(j1); CompletableFuture<Either<IChunkAccess, PlayerChunk.Failure>> completablefuture = playerchunk.a(chunkstatus, this); @@ -1092,7 +1108,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 list.add(completablefuture); } -@@ -1030,14 +1166,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1031,14 +1168,22 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { }; CompletableFuture<NBTTagCompound> chunkSaveFuture = this.world.asyncChunkTaskManager.getChunkSaveFuture(chunkcoordintpair.x, chunkcoordintpair.z); @@ -1120,7 +1136,7 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 return ret; // Paper end } -@@ -1174,7 +1318,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1175,7 +1320,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { long i = playerchunk.i().pair(); playerchunk.getClass(); @@ -1130,10 +1146,10 @@ index f0dc6efce2e0ff053f134993cce94afb9b5cd6f3..3292bdcd143995d52f8c983a8984af20 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4e7319e0bad256ce3213a7e9f3d97e319fad3b1c..cace81e707245ba35be3c6d536b56618045e4c20 100644 +index 7b079f0e594e24a7d8706c4ed5228c37c5fbe26d..5c3266d0dfcb0687c18eb636d0183e061c14e822 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1300,6 +1300,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1294,6 +1294,7 @@ public class PlayerConnection implements PacketListenerPlayIn { this.A = this.e; this.player.setLocation(d0, d1, d2, f, f1); @@ -1142,7 +1158,7 @@ index 4e7319e0bad256ce3213a7e9f3d97e319fad3b1c..cace81e707245ba35be3c6d536b56618 } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 382f334f82efefcfbd1781ac09e191cd27a0fb0c..273dce1feae284204a643dd06468e0b903745a1f 100644 +index cd75556eee435f90b042c4c57ec3c65497f0de9e..089e83ae257c6ec9dc6974b478e5a394c082f09b 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -196,8 +196,8 @@ public abstract class PlayerList { @@ -1164,7 +1180,7 @@ index 382f334f82efefcfbd1781ac09e191cd27a0fb0c..273dce1feae284204a643dd06468e0b9 Player player = entity.getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) socketaddress).getAddress(), ((java.net.InetSocketAddress) loginlistener.networkManager.getRawAddress()).getAddress()); -@@ -808,6 +809,7 @@ public abstract class PlayerList { +@@ -820,6 +821,7 @@ public abstract class PlayerList { // CraftBukkit end worldserver1.getChunkProvider().addTicket(TicketType.POST_TELEPORT, new ChunkCoordIntPair(location.getBlockX() >> 4, location.getBlockZ() >> 4), 1, entityplayer.getId()); // Paper @@ -1206,10 +1222,10 @@ index d7b9d9fd3a3b607278a3d72b0b306b0be2aa30ad..6fd852db6bcfbfbf84ec2acf6d23b08a public static <T> TicketType<T> a(String s, Comparator<T> comparator) { return new TicketType<>(s, comparator, 0L); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index f9a5ec5cb34425e346e9a7cc24986ece9a4c44e8..cc7c6204b6dcce766a0d3834f2963304b26107c6 100644 +index f35dda50fd9015a793708d214c648d75f9f87e2b..ae1f9dde6887988ca682f53cba316ce506dbc9c1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2520,6 +2520,10 @@ public class CraftWorld implements World { +@@ -2508,6 +2508,10 @@ public class CraftWorld implements World { return future; } @@ -1221,10 +1237,10 @@ index f9a5ec5cb34425e346e9a7cc24986ece9a4c44e8..cc7c6204b6dcce766a0d3834f2963304 net.minecraft.server.Chunk chunk = (net.minecraft.server.Chunk) either.left().orElse(null); return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk()); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index f2d61a03c540ff10a6949e637b40a8057be2f1dc..adf918fd757fe3147f897de3ade64a9adf1d3203 100644 +index ff18c2d8c4752149ace290495d130e12baa52756..9a812b34698feb7d09f1063a913363b3ea6820eb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -750,6 +750,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -743,6 +743,14 @@ public class CraftPlayer extends CraftHumanEntity implements Player { throw new UnsupportedOperationException("Cannot set rotation of players. Consider teleporting instead."); } diff --git a/Spigot-Server-Patches/0497-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch b/Spigot-Server-Patches/0492-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch index 0888e5d79b..11f5e50be7 100644 --- a/Spigot-Server-Patches/0497-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch +++ b/Spigot-Server-Patches/0492-Fix-Non-Full-Status-Chunk-NBT-Memory-Leak.patch @@ -16,7 +16,7 @@ We further improve it by making a copy of the nbt tag with only the memory it needs, so that we dont have to hold a copy to the entire compound. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index 4b7c4643f04448aaccc66f26a9dea2323bea420d..ac58fcb7985ebe0cfdab6e1400deb37c233ff637 100644 +index 3d06c87b64c209526bee2ea11b58d30fe9b1d062..335bb1dcb7285edabb6c5e7ec6ba4d6d40c60dcb 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -156,9 +156,9 @@ public class ChunkRegionLoader { diff --git a/Spigot-Server-Patches/0498-Optimize-sending-packets-to-nearby-locations-sounds-.patch b/Spigot-Server-Patches/0493-Optimize-sending-packets-to-nearby-locations-sounds-.patch index 21b6bd0475..ed747d2466 100644 --- a/Spigot-Server-Patches/0498-Optimize-sending-packets-to-nearby-locations-sounds-.patch +++ b/Spigot-Server-Patches/0493-Optimize-sending-packets-to-nearby-locations-sounds-.patch @@ -11,10 +11,10 @@ This will drastically cut down on packet sending cost for worlds with lots of players in them. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 273dce1feae284204a643dd06468e0b903745a1f..f8e0742ea9a42cf496b4b7e00201fed025b83889 100644 +index 089e83ae257c6ec9dc6974b478e5a394c082f09b..3b20dd067c6b10f2e5ffad65e5abda7a7008b1c0 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -1059,16 +1059,40 @@ public abstract class PlayerList { +@@ -1071,16 +1071,40 @@ public abstract class PlayerList { } public void sendPacketNearby(@Nullable EntityHuman entityhuman, double d0, double d1, double d2, double d3, ResourceKey<World> resourcekey, Packet<?> packet) { diff --git a/Spigot-Server-Patches/0499-Improve-Chunk-Status-Transition-Speed.patch b/Spigot-Server-Patches/0494-Improve-Chunk-Status-Transition-Speed.patch index ec57249421..2bd5191ec5 100644 --- a/Spigot-Server-Patches/0499-Improve-Chunk-Status-Transition-Speed.patch +++ b/Spigot-Server-Patches/0494-Improve-Chunk-Status-Transition-Speed.patch @@ -36,10 +36,10 @@ scenario / path: Previously would have hopped to SERVER around 12+ times there extra. diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 04dea2c9fd9337631a6289c7242338e166d6bc1e..446c401b3139f8c6c0e70d883340f0140d94b752 100644 +index b629afa7e6f046f1a09237f3355ec193c24e02d8..27c4dc6caf7b6303766dd8eee4812209600cd728 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -55,6 +55,13 @@ public class PlayerChunk { +@@ -58,6 +58,13 @@ public class PlayerChunk { this.playersInChunkTickRange = this.chunkMap.playerChunkTickRangeMap.getObjectsInRange(key); } // Paper end - optimise isOutsideOfRange @@ -54,10 +54,10 @@ index 04dea2c9fd9337631a6289c7242338e166d6bc1e..446c401b3139f8c6c0e70d883340f014 // Paper start - no-tick view distance public final Chunk getSendingChunk() { diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index 3292bdcd143995d52f8c983a8984af203ecd60ca..a35b161035dd26e437f5c49fd650802281aa66a1 100644 +index ddc2d2eff1ba05bd4174c5137f7750db6749306a..13c2da8000b22a4be98bbdd723fc06b04834b02d 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -739,7 +739,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -741,7 +741,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return either.mapLeft((list) -> { return (Chunk) list.get(list.size() / 2); }); @@ -66,7 +66,7 @@ index 3292bdcd143995d52f8c983a8984af203ecd60ca..a35b161035dd26e437f5c49fd6508022 } @Nullable -@@ -1089,7 +1089,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1091,7 +1091,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { IChunkAccess ichunkaccess = (IChunkAccess) optional.get(); if (ichunkaccess.getChunkStatus().b(chunkstatus)) { @@ -75,7 +75,7 @@ index 3292bdcd143995d52f8c983a8984af203ecd60ca..a35b161035dd26e437f5c49fd6508022 if (chunkstatus == ChunkStatus.LIGHT) { completablefuture1 = this.b(playerchunk, chunkstatus); -@@ -1105,7 +1105,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1107,7 +1107,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return this.b(playerchunk, chunkstatus); } } @@ -84,7 +84,7 @@ index 3292bdcd143995d52f8c983a8984af203ecd60ca..a35b161035dd26e437f5c49fd6508022 } } -@@ -1226,6 +1226,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -1228,6 +1228,12 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); }, (runnable) -> { diff --git a/Spigot-Server-Patches/0500-Fix-villager-trading-demand-MC-163962.patch b/Spigot-Server-Patches/0495-Fix-villager-trading-demand-MC-163962.patch index 96152b810e..96152b810e 100644 --- a/Spigot-Server-Patches/0500-Fix-villager-trading-demand-MC-163962.patch +++ b/Spigot-Server-Patches/0495-Fix-villager-trading-demand-MC-163962.patch diff --git a/Spigot-Server-Patches/0501-Maps-shouldn-t-load-chunks.patch b/Spigot-Server-Patches/0496-Maps-shouldn-t-load-chunks.patch index 6dd34a1a75..34d198574b 100644 --- a/Spigot-Server-Patches/0501-Maps-shouldn-t-load-chunks.patch +++ b/Spigot-Server-Patches/0496-Maps-shouldn-t-load-chunks.patch @@ -15,7 +15,7 @@ Previously maps would load all chunks in a certain radius depending on five ticks that movement occur in anyways. diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java -index a65266040dc14d7c679b8eb46188023aa35f83ed..90be8c6091dc590a020721f45c7ff7b137cc806d 100644 +index c6feee870be41188b5bced4bb9a8ae1b4e53c942..63b112b38a51873cf5769ad8506c3fdb9d52d42c 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -96,9 +96,9 @@ public class ItemWorldMap extends ItemWorldMapBase { diff --git a/Spigot-Server-Patches/0502-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch b/Spigot-Server-Patches/0497-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch index ed570b0067..9912dd3550 100644 --- a/Spigot-Server-Patches/0502-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch +++ b/Spigot-Server-Patches/0497-Use-seed-based-lookup-for-Treasure-Maps-Fixes-lag-fr.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Use seed based lookup for Treasure Maps - Fixes lag from diff --git a/src/main/java/net/minecraft/server/ItemWorldMap.java b/src/main/java/net/minecraft/server/ItemWorldMap.java -index 90be8c6091dc590a020721f45c7ff7b137cc806d..faa556d4358bc9890ae80c18ee10c38a8d46548e 100644 +index 63b112b38a51873cf5769ad8506c3fdb9d52d42c..910d1b3788fa713cadf2c8a56f595282ba6c1247 100644 --- a/src/main/java/net/minecraft/server/ItemWorldMap.java +++ b/src/main/java/net/minecraft/server/ItemWorldMap.java @@ -229,7 +229,7 @@ public class ItemWorldMap extends ItemWorldMapBase { @@ -19,10 +19,10 @@ index 90be8c6091dc590a020721f45c7ff7b137cc806d..faa556d4358bc9890ae80c18ee10c38a } diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c920cfbfdf50bec3a64793bf1058a4c856c3ba7c..a54e3ed06a7a1757d3c4ce96b21bed0177e1fa86 100644 +index 9d13745382d34693a0ebdcfe1c3392fb0b4f15b5..6ea416f25395fe8dac2d147c20e5d9c5a5083242 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -302,8 +302,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -303,8 +303,8 @@ public class WorldServer extends World implements GeneratorAccessSeed { this.worldDataServer.setThundering(flag1); } diff --git a/Spigot-Server-Patches/0503-Optimize-Bit-Operations-by-inlining.patch b/Spigot-Server-Patches/0498-Optimize-Bit-Operations-by-inlining.patch index cd3a9824d5..c709d0527d 100644 --- a/Spigot-Server-Patches/0503-Optimize-Bit-Operations-by-inlining.patch +++ b/Spigot-Server-Patches/0498-Optimize-Bit-Operations-by-inlining.patch @@ -7,10 +7,10 @@ Inline bit operations and reduce instruction count to make these hot operations faster diff --git a/src/main/java/net/minecraft/server/BlockPosition.java b/src/main/java/net/minecraft/server/BlockPosition.java -index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3cada6b3f 100644 +index 52ae74571b0d671a294900caedaa400b62d4ea34..2d887af902a33b0e28d8f0a6ac2e59c815a7856e 100644 --- a/src/main/java/net/minecraft/server/BlockPosition.java +++ b/src/main/java/net/minecraft/server/BlockPosition.java -@@ -24,14 +24,16 @@ public class BlockPosition extends BaseBlockPosition { +@@ -25,14 +25,16 @@ public class BlockPosition extends BaseBlockPosition { }).stable(); private static final Logger LOGGER = LogManager.getLogger(); public static final BlockPosition ZERO = new BlockPosition(0, 0, 0); @@ -35,7 +35,7 @@ index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3 public BlockPosition(int i, int j, int k) { super(i, j, k); -@@ -53,28 +55,29 @@ public class BlockPosition extends BaseBlockPosition { +@@ -54,28 +56,29 @@ public class BlockPosition extends BaseBlockPosition { this(baseblockposition.getX(), baseblockposition.getY(), baseblockposition.getZ()); } @@ -70,7 +70,7 @@ index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3 } public long asLong() { -@@ -83,12 +86,7 @@ public class BlockPosition extends BaseBlockPosition { +@@ -84,12 +87,7 @@ public class BlockPosition extends BaseBlockPosition { public static long asLong(int x, int y, int z) { return a(x, y, z); } // Paper - OBFHELPER public static long a(int i, int j, int k) { @@ -85,7 +85,7 @@ index 0d3a57900dc0bf5bc9729a3661a32da4e7ea1f33..a2ee39b7efca0851bca8dc0ec1c13fe3 public static long f(long i) { diff --git a/src/main/java/net/minecraft/server/SectionPosition.java b/src/main/java/net/minecraft/server/SectionPosition.java -index 6a8597c585e74ebea2e8bac2f9965f8760e19b67..7806f3c351cba3f0388da11888f900c48004dadf 100644 +index 8d325ec19c5d954785732d8e295b4ba150f740ca..f95925f1c5d091f1a129d0437bb6e175c6ac080f 100644 --- a/src/main/java/net/minecraft/server/SectionPosition.java +++ b/src/main/java/net/minecraft/server/SectionPosition.java @@ -16,7 +16,7 @@ public class SectionPosition extends BaseBlockPosition { @@ -131,12 +131,12 @@ index 6a8597c585e74ebea2e8bac2f9965f8760e19b67..7806f3c351cba3f0388da11888f900c4 - int j = b(blockposition.getY()); - int k = b(blockposition.getZ()); - -- return (short) (i << 8 | k << 4 | j); +- return (short) (i << 8 | k << 4 | j << 0); + return (short) ((blockposition.getX() & 15) << 8 | (blockposition.getZ() & 15) << 4 | blockposition.getY() & 15); // Paper - simplify/inline } - public static int c(int i) { -@@ -83,16 +87,16 @@ public class SectionPosition extends BaseBlockPosition { + public static int a(short short0) { +@@ -111,16 +115,16 @@ public class SectionPosition extends BaseBlockPosition { return this.getZ(); } @@ -159,7 +159,7 @@ index 6a8597c585e74ebea2e8bac2f9965f8760e19b67..7806f3c351cba3f0388da11888f900c4 } public int g() { -@@ -107,8 +111,10 @@ public class SectionPosition extends BaseBlockPosition { +@@ -135,8 +139,10 @@ public class SectionPosition extends BaseBlockPosition { return (this.c() << 4) + 15; } @@ -171,7 +171,7 @@ index 6a8597c585e74ebea2e8bac2f9965f8760e19b67..7806f3c351cba3f0388da11888f900c4 } public static long f(long i) { -@@ -129,17 +135,18 @@ public class SectionPosition extends BaseBlockPosition { +@@ -157,17 +163,18 @@ public class SectionPosition extends BaseBlockPosition { return new ChunkCoordIntPair(this.a(), this.c()); } @@ -197,7 +197,7 @@ index 6a8597c585e74ebea2e8bac2f9965f8760e19b67..7806f3c351cba3f0388da11888f900c4 } public Stream<BlockPosition> t() { -@@ -147,18 +154,11 @@ public class SectionPosition extends BaseBlockPosition { +@@ -175,18 +182,11 @@ public class SectionPosition extends BaseBlockPosition { } public static Stream<SectionPosition> a(SectionPosition sectionposition, int i) { diff --git a/Spigot-Server-Patches/0504-Optimize-Light-Engine.patch b/Spigot-Server-Patches/0499-Optimize-Light-Engine.patch index 250eef1b8d..1ff9900fb3 100644 --- a/Spigot-Server-Patches/0504-Optimize-Light-Engine.patch +++ b/Spigot-Server-Patches/0499-Optimize-Light-Engine.patch @@ -25,10 +25,10 @@ Massive update to light to improve performance and chunk loading/generation. 8) Fix NPE risk that crashes server in getting nibble data diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java -index 7c87ef638d538093e944341525a1027be5d15a0e..3a5a9aba111fed8b68818b95332b723ee2bce2ac 100644 +index afcbdd8e54ad936a4a3ac03341e1c52524624474..45c142c227bc258bbd5c8c03c6012663dccf8f3f 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java -@@ -1045,7 +1045,7 @@ public class ChunkProviderServer extends IChunkProvider { +@@ -1046,7 +1046,7 @@ public class ChunkProviderServer extends IChunkProvider { if (ChunkProviderServer.this.tickDistanceManager()) { return true; } else { @@ -38,7 +38,7 @@ index 7c87ef638d538093e944341525a1027be5d15a0e..3a5a9aba111fed8b68818b95332b723e } } finally { diff --git a/src/main/java/net/minecraft/server/LightEngineBlock.java b/src/main/java/net/minecraft/server/LightEngineBlock.java -index 07fadc21ee12138b52cc77c50da536fec5b032f5..a61d0a27e9525505eedaec8cde44216e807eb9a8 100644 +index 4db28b9a9b8a1e91911126172c6670c252dd49cb..636ed196d53971a3d0dc67d3e83032a9114b603b 100644 --- a/src/main/java/net/minecraft/server/LightEngineBlock.java +++ b/src/main/java/net/minecraft/server/LightEngineBlock.java @@ -13,9 +13,11 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB @@ -55,7 +55,7 @@ index 07fadc21ee12138b52cc77c50da536fec5b032f5..a61d0a27e9525505eedaec8cde44216e + // Paper end IBlockAccess iblockaccess = this.a.c(j >> 4, l >> 4); - return iblockaccess != null ? iblockaccess.h(this.f.d(j, k, l)) : 0; + return iblockaccess != null ? iblockaccess.g(this.f.d(j, k, l)) : 0; @@ -30,25 +32,33 @@ public final class LightEngineBlock extends LightEngineLayer<LightEngineStorageB } else if (k >= 15) { return k; @@ -1027,10 +1027,18 @@ index a35e7b392c74fadf2760d1fc2021e98d33858cb5..944094e8e770cc8c0205ef2aa6c48fff lightenginelayer.a(Long.MAX_VALUE, l3, 15, false); } diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java -index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd00b63172 100644 +index f8c2b957bb5b38f05251cccf5137a9c23262c3d6..ec8498c3db7a8d417f27eed5d3af38cb726b95b6 100644 --- a/src/main/java/net/minecraft/server/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java -@@ -15,15 +15,158 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -1,6 +1,7 @@ + package net.minecraft.server; + + import com.mojang.datafixers.util.Pair; ++import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; // Paper + import it.unimi.dsi.fastutil.objects.ObjectArrayList; + import it.unimi.dsi.fastutil.objects.ObjectList; + import it.unimi.dsi.fastutil.objects.ObjectListIterator; +@@ -15,15 +16,158 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { private static final Logger LOGGER = LogManager.getLogger(); private final ThreadedMailbox<Runnable> b; @@ -1077,13 +1085,13 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd + class LightQueue { + private int size = 0; + private int lowestPriority = MAX_PRIORITIES; -+ private final it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkLightQueue>[] buckets = new it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap[MAX_PRIORITIES]; ++ private final Long2ObjectLinkedOpenHashMap<ChunkLightQueue>[] buckets = new Long2ObjectLinkedOpenHashMap[MAX_PRIORITIES]; + private final java.util.concurrent.ConcurrentLinkedQueue<PendingLightTask> pendingTasks = new java.util.concurrent.ConcurrentLinkedQueue<>(); + private final java.util.concurrent.ConcurrentLinkedQueue<Runnable> priorityChanges = new java.util.concurrent.ConcurrentLinkedQueue<>(); + + private LightQueue() { + for (int i = 0; i < buckets.length; i++) { -+ buckets[i] = new it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<>(); ++ buckets[i] = new Long2ObjectLinkedOpenHashMap<>(); + } + } + @@ -1152,9 +1160,9 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd + run.run(); + } + boolean hasWork = false; -+ it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkLightQueue>[] buckets = this.buckets; ++ Long2ObjectLinkedOpenHashMap<ChunkLightQueue>[] buckets = this.buckets; + while (lowestPriority < MAX_PRIORITIES && !isEmpty()) { -+ it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap<ChunkLightQueue> bucket = buckets[lowestPriority]; ++ Long2ObjectLinkedOpenHashMap<ChunkLightQueue> bucket = buckets[lowestPriority]; + if (bucket.isEmpty()) { + lowestPriority++; + if (hasWork && lowestPriority <= 3) { @@ -1192,7 +1200,7 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd this.e = mailbox; this.b = threadedmailbox; } -@@ -110,13 +253,9 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -110,13 +254,9 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { } private void a(int i, int j, IntSupplier intsupplier, LightEngineThreaded.Update lightenginethreaded_update, Runnable runnable) { @@ -1209,7 +1217,7 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd } @Override -@@ -133,8 +272,20 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -133,8 +273,20 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { public CompletableFuture<IChunkAccess> a(IChunkAccess ichunkaccess, boolean flag) { ChunkCoordIntPair chunkcoordintpair = ichunkaccess.getPos(); @@ -1232,7 +1240,7 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd ChunkSection[] achunksection = ichunkaccess.getSections(); for (int i = 0; i < 16; ++i) { -@@ -152,55 +303,47 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { +@@ -152,55 +304,47 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { }); } @@ -1312,7 +1320,7 @@ index a9dc8466278f9ec2becbcb643e6e1c973df72b82..9d6d882ad1479771b2a9e7c3a14c71dd public void a(int i) { diff --git a/src/main/java/net/minecraft/server/NibbleArray.java b/src/main/java/net/minecraft/server/NibbleArray.java -index 8cedfdd820cc02a76607b53e0b054fc74654f907..a9795394c9b17f9f0ce4c4f9c8f51a48e950418e 100644 +index ff00830b95a17f66d0c913087492dbf4b066df8a..4085426af03f032cf405bdfd1e40a8e5dc27c1d1 100644 --- a/src/main/java/net/minecraft/server/NibbleArray.java +++ b/src/main/java/net/minecraft/server/NibbleArray.java @@ -8,6 +8,13 @@ import javax.annotation.Nullable; @@ -1330,22 +1338,22 @@ index 8cedfdd820cc02a76607b53e0b054fc74654f907..a9795394c9b17f9f0ce4c4f9c8f51a48 private static final int nibbleBucketSizeMultiplier = Integer.getInteger("Paper.nibbleBucketSize", 3072); private static final int maxPoolSize = Integer.getInteger("Paper.maxNibblePoolSize", (int) Math.min(6, Math.max(1, Runtime.getRuntime().maxMemory() / 1024 / 1024 / 1024)) * (nibbleBucketSizeMultiplier * 8)); diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java -index 446c401b3139f8c6c0e70d883340f0140d94b752..c14cdb60243e16810ad711d204678d51120c3403 100644 +index 27c4dc6caf7b6303766dd8eee4812209600cd728..676f0d28b0c8a590c6429a93902953636b3c1f11 100644 --- a/src/main/java/net/minecraft/server/PlayerChunk.java +++ b/src/main/java/net/minecraft/server/PlayerChunk.java -@@ -716,6 +716,7 @@ public class PlayerChunk { +@@ -724,6 +724,7 @@ public class PlayerChunk { ioPriority = com.destroystokyo.paper.io.PrioritizedTaskQueue.HIGH_PRIORITY; } chunkMap.world.asyncChunkTaskManager.raisePriority(location.x, location.z, ioPriority); + chunkMap.world.getChunkProvider().getLightEngine().queue.changePriority(location.pair(), getCurrentPriority(), priority); } if (getCurrentPriority() != priority) { - this.v.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority + this.u.a(this.location, this::getCurrentPriority, priority, this::setPriority); // use preferred priority diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java -index a35b161035dd26e437f5c49fd650802281aa66a1..03a79ff9929d0df6b5a2da9d86a31c0c67a4b8cf 100644 +index 13c2da8000b22a4be98bbdd723fc06b04834b02d..8a069cfcbf60f4ef409299cff59232c0cfd7db54 100644 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java +++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java -@@ -275,6 +275,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -277,6 +277,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } // Paper end @@ -1353,7 +1361,7 @@ index a35b161035dd26e437f5c49fd650802281aa66a1..03a79ff9929d0df6b5a2da9d86a31c0c public PlayerChunkMap(WorldServer worldserver, Convertable.ConversionSession convertable_conversionsession, DataFixer datafixer, DefinedStructureManager definedstructuremanager, Executor executor, IAsyncTaskHandler<Runnable> iasynctaskhandler, ILightAccess ilightaccess, ChunkGenerator chunkgenerator, WorldLoadListener worldloadlistener, Supplier<WorldPersistentData> supplier, int i, boolean flag) { super(new File(convertable_conversionsession.a(worldserver.getDimensionKey()), "region"), datafixer, flag); //this.visibleChunks = this.updatingChunks.clone(); // Paper - no more cloning -@@ -306,7 +307,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -308,7 +309,15 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { Mailbox<Runnable> mailbox = Mailbox.a("main", iasynctaskhandler::a); this.worldLoadListener = worldloadlistener; @@ -1370,7 +1378,7 @@ index a35b161035dd26e437f5c49fd650802281aa66a1..03a79ff9929d0df6b5a2da9d86a31c0c this.p = new ChunkTaskQueueSorter(ImmutableList.of(threadedmailbox, mailbox, threadedmailbox1), executor, Integer.MAX_VALUE); this.mailboxWorldGen = this.p.a(threadedmailbox, false); -@@ -652,6 +661,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -654,6 +663,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { // Paper end } @@ -1378,7 +1386,7 @@ index a35b161035dd26e437f5c49fd650802281aa66a1..03a79ff9929d0df6b5a2da9d86a31c0c protected IntSupplier c(long i) { return () -> { PlayerChunk playerchunk = this.getVisibleChunk(i); -@@ -779,6 +789,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { +@@ -781,6 +791,7 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { @Override public void close() throws IOException { try { @@ -1387,7 +1395,7 @@ index a35b161035dd26e437f5c49fd650802281aa66a1..03a79ff9929d0df6b5a2da9d86a31c0c this.world.asyncChunkTaskManager.close(true); // Paper - Required since we're closing regionfiles in the next line this.m.close(); diff --git a/src/main/java/net/minecraft/server/ThreadedMailbox.java b/src/main/java/net/minecraft/server/ThreadedMailbox.java -index 35f4d2d9591e625ab0bbeab7b606761e74965eec..cd30215dc098068ae034117c409cb295ebca58c1 100644 +index ebb9737995e0f738700d598af46a63f605f2b165..27e01bca675e46e814d18959702bb2acb24f9b1e 100644 --- a/src/main/java/net/minecraft/server/ThreadedMailbox.java +++ b/src/main/java/net/minecraft/server/ThreadedMailbox.java @@ -109,7 +109,8 @@ public class ThreadedMailbox<T> implements Mailbox<T>, AutoCloseable, Runnable { @@ -1401,10 +1409,10 @@ index 35f4d2d9591e625ab0bbeab7b606761e74965eec..cd30215dc098068ae034117c409cb295 this.a.a(t0); this.f(); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index a54e3ed06a7a1757d3c4ce96b21bed0177e1fa86..63c119072968586fab05ce3990f7c83373736f33 100644 +index 6ea416f25395fe8dac2d147c20e5d9c5a5083242..a21ce4855187b771b1c8a1ca3f914026d7b92e3a 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -709,6 +709,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -710,6 +710,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } gameprofilerfiller.exit(); timings.chunkTicksBlocks.stopTiming(); // Paper diff --git a/Spigot-Server-Patches/0505-Delay-Chunk-Unloads-based-on-Player-Movement.patch b/Spigot-Server-Patches/0500-Delay-Chunk-Unloads-based-on-Player-Movement.patch index eaddacca5f..51fcab8803 100644 --- a/Spigot-Server-Patches/0505-Delay-Chunk-Unloads-based-on-Player-Movement.patch +++ b/Spigot-Server-Patches/0500-Delay-Chunk-Unloads-based-on-Player-Movement.patch @@ -17,10 +17,10 @@ This allows servers with smaller worlds who do less long distance exploring to s wasting cpu cycles on saving/unloading/reloading chunks repeatedly. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 5af7e5c815752f2fd2b13c02a905796971401813..6e6534ab25dbebbad5d2ee848edb88ebcae86d03 100644 +index 6a62f2000a58312773a8cb57c546d65df980b844..e1f943507de05f9f9559b8625342a02d9b8a51d6 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -634,4 +634,13 @@ public class PaperWorldConfig { +@@ -623,4 +623,13 @@ public class PaperWorldConfig { private void viewDistance() { this.noTickViewDistance = this.getInt("viewdistances.no-tick-view-distance", -1); } @@ -35,7 +35,7 @@ index 5af7e5c815752f2fd2b13c02a905796971401813..6e6534ab25dbebbad5d2ee848edb88eb + } } diff --git a/src/main/java/net/minecraft/server/ChunkMapDistance.java b/src/main/java/net/minecraft/server/ChunkMapDistance.java -index 705c6e3a47a76509268075078f95871d313f6b76..eaed04f786b3c1e1a136163b096bd6aeeb571023 100644 +index 09fec533d7feebb90e989007dd19c952823550ba..3c7b225edbe23dc1959002293a6f8b816287b5a8 100644 --- a/src/main/java/net/minecraft/server/ChunkMapDistance.java +++ b/src/main/java/net/minecraft/server/ChunkMapDistance.java @@ -176,6 +176,27 @@ public abstract class ChunkMapDistance { diff --git a/Spigot-Server-Patches/0506-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/Spigot-Server-Patches/0501-Add-Plugin-Tickets-to-API-Chunk-Methods.patch index 8f47b0edce..73a1cc30fe 100644 --- a/Spigot-Server-Patches/0506-Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/Spigot-Server-Patches/0501-Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -22,10 +22,10 @@ wants it to collect even faster, they can restore that setting back to 1 instead Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 11c9b740b6b1ff30bd33c188c03f2b77b12faf7b..506e76eecd4be892bdc70367c0ee4d9764569ca7 100644 +index e73753c0a4158e3088964ff75a26953ae1b3fc43..1b19f0ac446fb68efb28cd0155ae732f216e272b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -346,7 +346,7 @@ public final class CraftServer implements Server { +@@ -345,7 +345,7 @@ public final class CraftServer implements Server { ambientSpawn = configuration.getInt("spawn-limits.ambient"); console.autosavePeriod = configuration.getInt("ticks-per.autosave"); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); @@ -34,7 +34,7 @@ index 11c9b740b6b1ff30bd33c188c03f2b77b12faf7b..506e76eecd4be892bdc70367c0ee4d97 minimumAPI = configuration.getString("settings.minimum-api"); loadIcon(); } -@@ -829,7 +829,7 @@ public final class CraftServer implements Server { +@@ -828,7 +828,7 @@ public final class CraftServer implements Server { waterAmbientSpawn = configuration.getInt("spawn-limits.water-ambient"); ambientSpawn = configuration.getInt("spawn-limits.ambient"); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); @@ -44,10 +44,10 @@ index 11c9b740b6b1ff30bd33c188c03f2b77b12faf7b..506e76eecd4be892bdc70367c0ee4d97 printSaveWarning = false; console.autosavePeriod = configuration.getInt("ticks-per.autosave"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f6be34225 100644 +index ae1f9dde6887988ca682f53cba316ce506dbc9c1..d266671305f1f14849ced7c52df817502ff750da 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -402,9 +402,22 @@ public class CraftWorld implements World { +@@ -407,9 +407,22 @@ public class CraftWorld implements World { @Override public Chunk getChunkAt(int x, int z) { @@ -71,7 +71,7 @@ index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f @Override public Chunk getChunkAt(Block block) { Preconditions.checkArgument(block != null, "null block"); -@@ -478,7 +491,7 @@ public class CraftWorld implements World { +@@ -483,7 +496,7 @@ public class CraftWorld implements World { public boolean unloadChunkRequest(int x, int z) { org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot if (isChunkLoaded(x, z)) { @@ -80,7 +80,7 @@ index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f } return true; -@@ -555,10 +568,12 @@ public class CraftWorld implements World { +@@ -560,10 +573,12 @@ public class CraftWorld implements World { org.spigotmc.AsyncCatcher.catchOp("chunk load"); // Spigot // Paper start - Optimize this method ChunkCoordIntPair chunkPos = new ChunkCoordIntPair(x, z); @@ -94,7 +94,7 @@ index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f if (immediate == null) { immediate = world.getChunkProvider().playerChunkMap.getUnloadingChunk(x, z); } -@@ -566,7 +581,7 @@ public class CraftWorld implements World { +@@ -571,7 +586,7 @@ public class CraftWorld implements World { if (!(immediate instanceof ProtoChunkExtension) && !(immediate instanceof net.minecraft.server.Chunk)) { return false; // not full status } @@ -103,7 +103,7 @@ index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f world.getChunkAt(x, z); // make sure we're at ticket level 32 or lower return true; } -@@ -593,7 +608,7 @@ public class CraftWorld implements World { +@@ -598,7 +613,7 @@ public class CraftWorld implements World { // we do this so we do not re-read the chunk data on disk } @@ -112,7 +112,7 @@ index cc7c6204b6dcce766a0d3834f2963304b26107c6..06d8ab61f3636a2c76531356f3d7fd6f world.getChunkProvider().getChunkAt(x, z, ChunkStatus.FULL, true); return true; // Paper end -@@ -2526,6 +2541,7 @@ public class CraftWorld implements World { +@@ -2514,6 +2529,7 @@ public class CraftWorld implements World { } return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> { net.minecraft.server.Chunk chunk = (net.minecraft.server.Chunk) either.left().orElse(null); diff --git a/Spigot-Server-Patches/0507-Fix-missing-chunks-due-to-integer-overflow.patch b/Spigot-Server-Patches/0502-Fix-missing-chunks-due-to-integer-overflow.patch index 7554af844d..935940026e 100644 --- a/Spigot-Server-Patches/0507-Fix-missing-chunks-due-to-integer-overflow.patch +++ b/Spigot-Server-Patches/0502-Fix-missing-chunks-due-to-integer-overflow.patch @@ -13,10 +13,10 @@ The fix for the issue is quite simple, casting chunk coordinates to longs allows the distance calculation to avoid overflow and work as intended. diff --git a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java -index 3abf1a61dfdb89c6df9338bc4947a64be5c91e2f..631a028dd262476f257c382f488320fee42584cd 100644 +index 844ad0fbdc6e2f9aee1d25fe21dcdf53eb28d559..9c15cd303ccc2928be4e3e7080e74e8314d7e0f2 100644 --- a/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java +++ b/src/main/java/net/minecraft/server/WorldChunkManagerTheEnd.java -@@ -50,7 +50,9 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager { +@@ -70,7 +70,9 @@ public class WorldChunkManagerTheEnd extends WorldChunkManager { int l = j / 2; int i1 = i % 2; int j1 = j % 2; diff --git a/Spigot-Server-Patches/0508-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch b/Spigot-Server-Patches/0503-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch index d34a476cfb..d34a476cfb 100644 --- a/Spigot-Server-Patches/0508-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch +++ b/Spigot-Server-Patches/0503-Fix-CraftScheduler-runTaskTimerAsynchronously-Plugin.patch diff --git a/Spigot-Server-Patches/0509-Fix-piston-physics-inconsistency-MC-188840.patch b/Spigot-Server-Patches/0504-Fix-piston-physics-inconsistency-MC-188840.patch index a11ff231eb..d283ab77e8 100644 --- a/Spigot-Server-Patches/0509-Fix-piston-physics-inconsistency-MC-188840.patch +++ b/Spigot-Server-Patches/0504-Fix-piston-physics-inconsistency-MC-188840.patch @@ -47,10 +47,10 @@ index f2f0b9f011bf5b5aa7d80c605cc885104bb934f8..56e4359ba32339e1bef58061585ff3e1 + } } diff --git a/src/main/java/net/minecraft/server/BlockPiston.java b/src/main/java/net/minecraft/server/BlockPiston.java -index 6b1253fe7e8d4bb71d4d19c063d3e84c167c4d7b..c3133814f1349b2f70b12967b1b5abc88f71f98c 100644 +index 0bab7dfb053c1aa92f5417c25fed5484e09bbec3..5d3bb5f393a1e0e4a2e8b9a466530a91279697a9 100644 --- a/src/main/java/net/minecraft/server/BlockPiston.java +++ b/src/main/java/net/minecraft/server/BlockPiston.java -@@ -368,12 +368,24 @@ public class BlockPiston extends BlockDirectional { +@@ -370,12 +370,24 @@ public class BlockPiston extends BlockDirectional { } for (k = list.size() - 1; k >= 0; --k) { @@ -79,15 +79,15 @@ index 6b1253fe7e8d4bb71d4d19c063d3e84c167c4d7b..c3133814f1349b2f70b12967b1b5abc8 } diff --git a/src/main/java/net/minecraft/server/TileEntityPiston.java b/src/main/java/net/minecraft/server/TileEntityPiston.java -index 5b941321a7fdc561e6b794a1dce5d600083c505d..e7b7e468fc874b0fbcd43f87d816a42420f9b05e 100644 +index 8b2758377b70aaf7a9d21a28d4bbe16389f22403..7d86f0fe55063f6875db9c6f99f4f72ed4144536 100644 --- a/src/main/java/net/minecraft/server/TileEntityPiston.java +++ b/src/main/java/net/minecraft/server/TileEntityPiston.java @@ -256,7 +256,7 @@ public class TileEntityPiston extends TileEntity implements ITickable { - IBlockData iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position); + IBlockData iblockdata = Block.b(this.a, (GeneratorAccess) this.world, this.position); - if (iblockdata.isAir()) { -- this.world.setTypeAndData(this.position, this.a, 84); + if (iblockdata.isAir()) { +- this.world.setTypeAndData(this.position, this.a, 84); + this.world.setTypeAndData(this.position, this.a, com.destroystokyo.paper.PaperConfig.allowPistonDuplication ? 84 : (84 | 2)); // Paper - force notify (flag 2), it's possible the set type by the piston block (which doesn't notify) set this block to air - Block.a(this.a, iblockdata, this.world, this.position, 3); - } else { - if (iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C)) { + Block.a(this.a, iblockdata, this.world, this.position, 3); + } else { + if (iblockdata.b(BlockProperties.C) && (Boolean) iblockdata.get(BlockProperties.C)) { diff --git a/Spigot-Server-Patches/0510-Fix-sand-duping.patch b/Spigot-Server-Patches/0505-Fix-sand-duping.patch index 6cf9476b0e..db9152f9e1 100644 --- a/Spigot-Server-Patches/0510-Fix-sand-duping.patch +++ b/Spigot-Server-Patches/0505-Fix-sand-duping.patch @@ -7,7 +7,7 @@ If the falling block dies during teleportation (entity#move), then we need to detect that by placing a check after the move. diff --git a/src/main/java/net/minecraft/server/EntityFallingBlock.java b/src/main/java/net/minecraft/server/EntityFallingBlock.java -index 40ab0a1e5b8e31f1ef3b2444366784a65f034341..6697b94550054ebbc8d4b3761bd9f36eb7e4ba8a 100644 +index 6a03359a781874ed657157e3407897dde71f5b45..9e9b8d8aef62b423828b69fce4875a2ea8fc9911 100644 --- a/src/main/java/net/minecraft/server/EntityFallingBlock.java +++ b/src/main/java/net/minecraft/server/EntityFallingBlock.java @@ -64,6 +64,11 @@ public class EntityFallingBlock extends Entity { diff --git a/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch b/Spigot-Server-Patches/0506-Prevent-position-desync-in-playerconnection-causing-.patch index a9a8693e35..8847ce29f2 100644 --- a/Spigot-Server-Patches/0511-Prevent-position-desync-in-playerconnection-causing-.patch +++ b/Spigot-Server-Patches/0506-Prevent-position-desync-in-playerconnection-causing-.patch @@ -14,13 +14,13 @@ behaviour, we need to move all of this dangerous logic outside of the move call and into an appropriate place in the tick method. diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index cace81e707245ba35be3c6d536b56618045e4c20..4050fa4b8ed060599fb3c14622737117fb2602df 100644 +index 5c3266d0dfcb0687c18eb636d0183e061c14e822..fa515ae73f2dffdae0ca6243901d973acac3de0c 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1097,6 +1097,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1091,6 +1091,11 @@ public class PlayerConnection implements PacketListenerPlayIn { this.player.move(EnumMoveType.PLAYER, new Vec3D(d7, d8, d9)); - this.player.c(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move + this.player.setOnGround(packetplayinflying.b()); // CraftBukkit - SPIGOT-5810, SPIGOT-5835: reset by this.player.move + // Paper start - prevent position desync + if (this.teleportPos != null) { + return; // ... thanks Mojang for letting move calls teleport across dimensions. diff --git a/Spigot-Server-Patches/0512-Fix-enderdragon-exp-dupe.patch b/Spigot-Server-Patches/0507-Fix-enderdragon-exp-dupe.patch index 654d69e3c6..a1d22516fa 100644 --- a/Spigot-Server-Patches/0512-Fix-enderdragon-exp-dupe.patch +++ b/Spigot-Server-Patches/0507-Fix-enderdragon-exp-dupe.patch @@ -7,20 +7,20 @@ Properly track death stage when unloading/loading in the dragon diff --git a/src/main/java/net/minecraft/server/EntityEnderDragon.java b/src/main/java/net/minecraft/server/EntityEnderDragon.java -index 73e9859e675902d9fc5942547966b52426a496a2..63a759cc18b5b765bc9d34f71dd775fd35dee280 100644 +index 0e7c5dd9224d06fecf75c00c0c56d610a8fa8f4c..6b2c5e8d4640e19d33cbfe76d2399e6100890dbc 100644 --- a/src/main/java/net/minecraft/server/EntityEnderDragon.java +++ b/src/main/java/net/minecraft/server/EntityEnderDragon.java @@ -830,6 +830,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { public void saveData(NBTTagCompound nbttagcompound) { super.saveData(nbttagcompound); - nbttagcompound.setInt("DragonPhase", this.bN.a().getControllerPhase().b()); + nbttagcompound.setInt("DragonPhase", this.bG.a().getControllerPhase().b()); + nbttagcompound.setInt("Paper.DeathTick", this.deathAnimationTicks); // Paper } @Override @@ -838,6 +839,7 @@ public class EntityEnderDragon extends EntityInsentient implements IMonster { if (nbttagcompound.hasKey("DragonPhase")) { - this.bN.setControllerPhase(DragonControllerPhase.getById(nbttagcompound.getInt("DragonPhase"))); + this.bG.setControllerPhase(DragonControllerPhase.getById(nbttagcompound.getInt("DragonPhase"))); } + this.deathAnimationTicks = nbttagcompound.getInt("Paper.DeathTick"); // Paper diff --git a/Spigot-Server-Patches/0513-Inventory-getHolder-method-without-block-snapshot.patch b/Spigot-Server-Patches/0508-Inventory-getHolder-method-without-block-snapshot.patch index 5ea9d7c297..9537acdc43 100644 --- a/Spigot-Server-Patches/0513-Inventory-getHolder-method-without-block-snapshot.patch +++ b/Spigot-Server-Patches/0508-Inventory-getHolder-method-without-block-snapshot.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Inventory getHolder method without block snapshot diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -index a04213325b8266623b076f1233539512a0a0207f..726631348243566654d08abe9b5bf4ab3a2885f9 100644 +index 5e0180ac658db9d7c9d90fd3d3c4eddf6f34c90d..bba9bddc1c0aacade9b7ad56afb1e630caa078fc 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventory.java -@@ -521,6 +521,13 @@ public class CraftInventory implements Inventory { +@@ -526,6 +526,13 @@ public class CraftInventory implements Inventory { return inventory.getOwner(); } diff --git a/Spigot-Server-Patches/0514-Expose-Arrow-getItemStack.patch b/Spigot-Server-Patches/0509-Expose-Arrow-getItemStack.patch index 6e89c259a7..4cf3ee13c6 100644 --- a/Spigot-Server-Patches/0514-Expose-Arrow-getItemStack.patch +++ b/Spigot-Server-Patches/0509-Expose-Arrow-getItemStack.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Expose Arrow getItemStack diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index c552962a9a2c8dac6794ef6698943c7d91ea45c4..f8772a853ea9b5ca45c78a2fd8bd3f1fa6abf5d2 100644 +index a7c475454e627e54d6771c5023144d55ad389ae3..890f5436b6e4e29759d26dbe6d0759cfa6a956df 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -520,6 +520,7 @@ public abstract class EntityArrow extends IProjectile { diff --git a/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch b/Spigot-Server-Patches/0510-Add-and-implement-PlayerRecipeBookClickEvent.patch index 3408f0cdc3..c04a1c9380 100644 --- a/Spigot-Server-Patches/0515-Add-and-implement-PlayerRecipeBookClickEvent.patch +++ b/Spigot-Server-Patches/0510-Add-and-implement-PlayerRecipeBookClickEvent.patch @@ -5,21 +5,21 @@ Subject: [PATCH] Add and implement PlayerRecipeBookClickEvent diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 4050fa4b8ed060599fb3c14622737117fb2602df..eb21aefa092d00e5ead2177282170fcf3617808c 100644 +index fa515ae73f2dffdae0ca6243901d973acac3de0c..5d2e7f7c38efeff71a49356dc82e9d8b845cb284 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2514,9 +2514,15 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2509,9 +2509,15 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinautorecipe, this, this.player.getWorldServer()); this.player.resetIdleTimer(); if (!this.player.isSpectator() && this.player.activeContainer.windowId == packetplayinautorecipe.b() && this.player.activeContainer.c(this.player) && this.player.activeContainer instanceof ContainerRecipeBook) { -- this.minecraftServer.getCraftingManager().a(packetplayinautorecipe.c()).ifPresent((irecipe) -> { +- this.minecraftServer.getCraftingManager().getRecipe(packetplayinautorecipe.c()).ifPresent((irecipe) -> { - ((ContainerRecipeBook) this.player.activeContainer).a(packetplayinautorecipe.d(), irecipe, this.player); - }); + // Paper start - fire event for clicking recipes in the recipe book + com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent event = new com.destroystokyo.paper.event.player.PlayerRecipeBookClickEvent( + player.getBukkitEntity(), org.bukkit.craftbukkit.util.CraftNamespacedKey.fromMinecraft(packetplayinautorecipe.c()), packetplayinautorecipe.d()); + if (event.callEvent()) { -+ this.minecraftServer.getCraftingManager().a(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> { ++ this.minecraftServer.getCraftingManager().getRecipe(org.bukkit.craftbukkit.util.CraftNamespacedKey.toMinecraft(event.getRecipe())).ifPresent((irecipe) -> { + ((ContainerRecipeBook) this.player.activeContainer).a(event.isMakeAll(), irecipe, this.player); + }); + } diff --git a/Spigot-Server-Patches/0516-Hide-sync-chunk-writes-behind-flag.patch b/Spigot-Server-Patches/0511-Hide-sync-chunk-writes-behind-flag.patch index 143846f239..0b83cd5202 100644 --- a/Spigot-Server-Patches/0516-Hide-sync-chunk-writes-behind-flag.patch +++ b/Spigot-Server-Patches/0511-Hide-sync-chunk-writes-behind-flag.patch @@ -9,10 +9,10 @@ on harddrives. -DPaper.enable-sync-chunk-writes=true to enable diff --git a/src/main/java/net/minecraft/server/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -index 1122861a8f9c12668e7bd9d65e63fc9166a66d1a..6786fd0947724069366a2375c710ec518a92f2b1 100644 +index 0aa8448d25f743a0d12e4c7f7c9c04fd9d5d0088..23f8e144fc6256bcc71269c03642172f3469fc4b 100644 --- a/src/main/java/net/minecraft/server/DedicatedServerProperties.java +++ b/src/main/java/net/minecraft/server/DedicatedServerProperties.java -@@ -98,7 +98,7 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr +@@ -100,7 +100,7 @@ public class DedicatedServerProperties extends PropertyManager<DedicatedServerPr this.maxWorldSize = this.a("max-world-size", (integer) -> { return MathHelper.clamp(integer, 1, 29999984); }, 29999984); diff --git a/Spigot-Server-Patches/0517-Limit-lightning-strike-effect-distance.patch b/Spigot-Server-Patches/0512-Limit-lightning-strike-effect-distance.patch index 5735d85dd7..ba4d95c172 100644 --- a/Spigot-Server-Patches/0517-Limit-lightning-strike-effect-distance.patch +++ b/Spigot-Server-Patches/0512-Limit-lightning-strike-effect-distance.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Limit lightning strike effect distance diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 6e6534ab25dbebbad5d2ee848edb88ebcae86d03..e471e764935e2a89560de56959a782b02e5e8fe1 100644 +index e1f943507de05f9f9559b8625342a02d9b8a51d6..d5a1ade21749bba420257f3ece7878f32148d6ff 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -@@ -643,4 +643,26 @@ public class PaperWorldConfig { +@@ -632,4 +632,26 @@ public class PaperWorldConfig { delayChunkUnloadsBy *= 20; } } @@ -36,7 +36,7 @@ index 6e6534ab25dbebbad5d2ee848edb88ebcae86d03..e471e764935e2a89560de56959a782b0 + } } diff --git a/src/main/java/net/minecraft/server/EntityLightning.java b/src/main/java/net/minecraft/server/EntityLightning.java -index 6f979e5f1f1567b140e9689298aff85de34f7413..b1b8748fa95aab25562c2f5397cb6454737fa508 100644 +index 7d9e3b636715106e467b383b9d1ab93407460971..180bfd4a60e18723b5fbae96123001284658afcb 100644 --- a/src/main/java/net/minecraft/server/EntityLightning.java +++ b/src/main/java/net/minecraft/server/EntityLightning.java @@ -56,6 +56,17 @@ public class EntityLightning extends Entity { diff --git a/Spigot-Server-Patches/0518-Add-permission-for-command-blocks.patch b/Spigot-Server-Patches/0513-Add-permission-for-command-blocks.patch index aa9357900b..bca930ee66 100644 --- a/Spigot-Server-Patches/0518-Add-permission-for-command-blocks.patch +++ b/Spigot-Server-Patches/0513-Add-permission-for-command-blocks.patch @@ -31,10 +31,10 @@ index 7e13b1cf6d92c3e0f2dab1ba1d42bd4f250e256c..3820acd65f3cd488dba964e6d9c45885 } else { if (entityhuman.getWorld().isClientSide) { diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index eb21aefa092d00e5ead2177282170fcf3617808c..e4e001dbbe351b88c186856cbebfe7f3fcd9f0fb 100644 +index 5d2e7f7c38efeff71a49356dc82e9d8b845cb284..dfbe66aad115b3977fadb190bda5c90aff089cf3 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -612,7 +612,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -606,7 +606,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinsetcommandblock, this, this.player.getWorldServer()); if (!this.minecraftServer.getEnableCommandBlock()) { this.player.sendMessage(new ChatMessage("advMode.notEnabled"), SystemUtils.b); @@ -43,7 +43,7 @@ index eb21aefa092d00e5ead2177282170fcf3617808c..e4e001dbbe351b88c186856cbebfe7f3 this.player.sendMessage(new ChatMessage("advMode.notAllowed"), SystemUtils.b); } else { CommandBlockListenerAbstract commandblocklistenerabstract = null; -@@ -675,7 +675,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -669,7 +669,7 @@ public class PlayerConnection implements PacketListenerPlayIn { PlayerConnectionUtils.ensureMainThread(packetplayinsetcommandminecart, this, this.player.getWorldServer()); if (!this.minecraftServer.getEnableCommandBlock()) { this.player.sendMessage(new ChatMessage("advMode.notEnabled"), SystemUtils.b); diff --git a/Spigot-Server-Patches/0514-Ensure-Entity-AABB-s-are-never-invalid.patch b/Spigot-Server-Patches/0514-Ensure-Entity-AABB-s-are-never-invalid.patch new file mode 100644 index 0000000000..505d8e0e6e --- /dev/null +++ b/Spigot-Server-Patches/0514-Ensure-Entity-AABB-s-are-never-invalid.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +Date: Sun, 10 May 2020 22:12:46 -0400 +Subject: [PATCH] Ensure Entity AABB's are never invalid + + +diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java +index f41c91c0f27e6df8181fafe4c4332ce57b952ea9..7f33bcfe79a4fc8466f2b111cda4ec6c0290ca2d 100644 +--- a/src/main/java/net/minecraft/server/Entity.java ++++ b/src/main/java/net/minecraft/server/Entity.java +@@ -391,7 +391,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + + public void setPosition(double d0, double d1, double d2) { + this.setPositionRaw(d0, d1, d2); +- this.a(this.size.a(d0, d1, d2)); ++ //this.a(this.size.a(d0, d1, d2)); // Paper - move into setPositionRaw + if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit + } + +@@ -2881,6 +2881,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return new AxisAlignedBB(vec3d, vec3d1); + } + ++ public final void setBoundingBox(AxisAlignedBB axisalignedbb) { a(axisalignedbb); } // Paper - OBFHELPER + public void a(AxisAlignedBB axisalignedbb) { + // CraftBukkit start - block invalid bounding boxes + double minX = axisalignedbb.minX, +@@ -3319,6 +3320,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + } + + public void setPositionRaw(double d0, double d1, double d2) { ++ // Paper start - never allow AABB to become desynced from position ++ // hanging has its own special logic ++ if (!(this instanceof EntityHanging) && (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2)) { ++ this.setBoundingBox(this.size.a(d0, d1, d2)); ++ } ++ // Paper end + if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) { + this.loc = new Vec3D(d0, d1, d2); + int i = MathHelper.floor(d0); diff --git a/Spigot-Server-Patches/0520-Optimize-WorldBorder-collision-checks-and-air.patch b/Spigot-Server-Patches/0515-Optimize-WorldBorder-collision-checks-and-air.patch index c6b9a9d8c0..f4287c6c27 100644 --- a/Spigot-Server-Patches/0520-Optimize-WorldBorder-collision-checks-and-air.patch +++ b/Spigot-Server-Patches/0515-Optimize-WorldBorder-collision-checks-and-air.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize WorldBorder collision checks and air diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 759a91f43c9890602f4bb372eb241ebc0128b310..9b5cad1f1137cb6c73f423dada1ae027218086ca 100644 +index 7f33bcfe79a4fc8466f2b111cda4ec6c0290ca2d..ad521f95aba0e82e3280351419ad23acfa283f9a 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -854,7 +854,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -819,7 +819,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke AxisAlignedBB axisalignedbb = this.getBoundingBox(); VoxelShapeCollision voxelshapecollision = VoxelShapeCollision.a(this); VoxelShape voxelshape = this.world.getWorldBorder().c(); @@ -37,7 +37,7 @@ index ed0f3ddbcb7d6ce8a59ae3829f4cb11ae75046cb..e841611bb7c36dffec44bb9e74a0a965 } } diff --git a/src/main/java/net/minecraft/server/VoxelShapes.java b/src/main/java/net/minecraft/server/VoxelShapes.java -index aeee4f11828e54ff9e873e452e19299822b1ec86..1fa7061f7adb539b6786fa11a0090f2c188ba9f2 100644 +index 450957c41e144ef2b238051c4d5a242ca2b9ae83..e21c747b6c39155c44bf30860681d67b0b29fb12 100644 --- a/src/main/java/net/minecraft/server/VoxelShapes.java +++ b/src/main/java/net/minecraft/server/VoxelShapes.java @@ -242,7 +242,7 @@ public final class VoxelShapes { @@ -50,7 +50,7 @@ index aeee4f11828e54ff9e873e452e19299822b1ec86..1fa7061f7adb539b6786fa11a0090f2c if (Math.abs(d0) < 1.0E-7D) { return 0.0D; diff --git a/src/main/java/net/minecraft/server/WorldBorder.java b/src/main/java/net/minecraft/server/WorldBorder.java -index 0ef92a320d132b443e76276b2c34a4626cf187db..b651eb87bb23deeb2a3f4a1c626ddde9b11a7b9e 100644 +index adab2bd76e7e99140218ddbdb00aa9c27c0d0183..f011869880fedae4b69e505491e8bdbc5f51dfba 100644 --- a/src/main/java/net/minecraft/server/WorldBorder.java +++ b/src/main/java/net/minecraft/server/WorldBorder.java @@ -42,6 +42,7 @@ public class WorldBorder { diff --git a/Spigot-Server-Patches/0521-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/0516-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 036b5d22c4..fbc5ac4d04 100644 --- a/Spigot-Server-Patches/0521-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/Spigot-Server-Patches/0516-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -26,10 +26,10 @@ index bc71070c670d1a64c60b9f19711a5e8a50ace56e..9efc743e028650ccc9cda5a2c9deb183 return 0; } diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 4c561181a977fd0244325880bb6a8cd6a54dcacc..8b2755a3b95e472e884976195d1d3551fc260e39 100644 +index a16495f69626356e5312f8804c66d40a29894b7e..1c878265be0f458ff264bc4a4011397e5b60b20e 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java -@@ -327,7 +327,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer +@@ -325,7 +325,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer @Override public void updateWorldSettings() { @@ -39,17 +39,17 @@ index 4c561181a977fd0244325880bb6a8cd6a54dcacc..8b2755a3b95e472e884976195d1d3551 @Override diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 84cd55ae46bd09ba2470998155ba64877b2d4cda..3130c68e7318a41e763575b245ee1b5298c92a16 100644 +index 4f0b79be16dbc8b528095f8ebfe80d70ef6074ce..a7b6be15b6c5d99fd8adc60c2d7f31a0b8ad4054 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1520,11 +1520,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1518,11 +1518,14 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas this.H = keypair; } - public void a(EnumDifficulty enumdifficulty, boolean flag) { - if (flag || !this.saveData.isDifficultyLocked()) { - this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); -- this.ba(); +- this.bb(); - this.getPlayerList().getPlayers().forEach(this::a); + // Paper start - fix per world difficulty + public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) { @@ -63,10 +63,10 @@ index 84cd55ae46bd09ba2470998155ba64877b2d4cda..3130c68e7318a41e763575b245ee1b52 } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index e4e001dbbe351b88c186856cbebfe7f3fcd9f0fb..8c02493bcdb6271870f8f1d558858ee3fb260014 100644 +index dfbe66aad115b3977fadb190bda5c90aff089cf3..522a88ab9592747d5d6c21cc5e0460dee05d8385 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -2778,7 +2778,7 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2773,7 +2773,7 @@ public class PlayerConnection implements PacketListenerPlayIn { public void a(PacketPlayInDifficultyChange packetplayindifficultychange) { PlayerConnectionUtils.ensureMainThread(packetplayindifficultychange, this, this.player.getWorldServer()); if (this.player.k(2) || this.isExemptPlayer()) { diff --git a/Spigot-Server-Patches/0522-Paper-dumpitem-command.patch b/Spigot-Server-Patches/0517-Paper-dumpitem-command.patch index 179527e475..179527e475 100644 --- a/Spigot-Server-Patches/0522-Paper-dumpitem-command.patch +++ b/Spigot-Server-Patches/0517-Paper-dumpitem-command.patch diff --git a/Spigot-Server-Patches/0523-Don-t-allow-null-UUID-s-for-chat.patch b/Spigot-Server-Patches/0518-Don-t-allow-null-UUID-s-for-chat.patch index 306d2a56f2..306d2a56f2 100644 --- a/Spigot-Server-Patches/0523-Don-t-allow-null-UUID-s-for-chat.patch +++ b/Spigot-Server-Patches/0518-Don-t-allow-null-UUID-s-for-chat.patch diff --git a/Spigot-Server-Patches/0519-Ensure-Entity-AABB-s-are-never-invalid.patch b/Spigot-Server-Patches/0519-Ensure-Entity-AABB-s-are-never-invalid.patch deleted file mode 100644 index 4f2c87bfa7..0000000000 --- a/Spigot-Server-Patches/0519-Ensure-Entity-AABB-s-are-never-invalid.patch +++ /dev/null @@ -1,129 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Aikar <[email protected]> -Date: Sun, 10 May 2020 22:12:46 -0400 -Subject: [PATCH] Ensure Entity AABB's are never invalid - - -diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index af9f906b4eb806c73f8ec98ea562393c2b48419e..759a91f43c9890602f4bb372eb241ebc0128b310 100644 ---- a/src/main/java/net/minecraft/server/Entity.java -+++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1,53 +1,54 @@ - package net.minecraft.server; - -+import co.aikar.timings.MinecraftTimings; -+import co.aikar.timings.Timing; - import com.google.common.collect.Iterables; - import com.google.common.collect.Lists; - import com.google.common.collect.Sets; - import it.unimi.dsi.fastutil.objects.Object2DoubleArrayMap; - import it.unimi.dsi.fastutil.objects.Object2DoubleMap; --import java.util.Arrays; --import java.util.Collection; --import java.util.Collections; --import java.util.Iterator; --import java.util.List; --import java.util.Locale; --import java.util.Optional; --import java.util.Random; --import java.util.Set; --import java.util.UUID; --import java.util.concurrent.atomic.AtomicInteger; --import java.util.stream.Stream; --import javax.annotation.Nullable; - import org.apache.logging.log4j.LogManager; - import org.apache.logging.log4j.Logger; -- --// CraftBukkit start - import org.bukkit.Bukkit; - import org.bukkit.Server; - import org.bukkit.block.BlockFace; - import org.bukkit.command.CommandSender; --import org.bukkit.entity.Hanging; --import org.bukkit.entity.LivingEntity; --import org.bukkit.entity.Vehicle; --import co.aikar.timings.MinecraftTimings; // Paper --import co.aikar.timings.Timing; // Paper --import org.bukkit.event.entity.EntityCombustByEntityEvent; --import org.bukkit.event.hanging.HangingBreakByEntityEvent; --import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; --import org.bukkit.event.vehicle.VehicleEnterEvent; --import org.bukkit.event.vehicle.VehicleExitEvent; - import org.bukkit.craftbukkit.CraftWorld; - import org.bukkit.craftbukkit.entity.CraftEntity; - import org.bukkit.craftbukkit.entity.CraftPlayer; - import org.bukkit.craftbukkit.event.CraftEventFactory; -+import org.bukkit.entity.Hanging; -+import org.bukkit.entity.LivingEntity; - import org.bukkit.entity.Pose; -+import org.bukkit.entity.Vehicle; - import org.bukkit.event.entity.EntityAirChangeEvent; -+import org.bukkit.event.entity.EntityCombustByEntityEvent; - import org.bukkit.event.entity.EntityCombustEvent; - import org.bukkit.event.entity.EntityDropItemEvent; - import org.bukkit.event.entity.EntityPortalEvent; - import org.bukkit.event.entity.EntityPoseChangeEvent; -+import org.bukkit.event.hanging.HangingBreakByEntityEvent; - import org.bukkit.event.player.PlayerTeleportEvent; -+import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -+import org.bukkit.event.vehicle.VehicleEnterEvent; -+import org.bukkit.event.vehicle.VehicleExitEvent; - import org.bukkit.plugin.PluginManager; -+ -+import javax.annotation.Nullable; -+import java.util.Arrays; -+import java.util.Collection; -+import java.util.Collections; -+import java.util.Iterator; -+import java.util.List; -+import java.util.Locale; -+import java.util.Optional; -+import java.util.Random; -+import java.util.Set; -+import java.util.UUID; -+import java.util.concurrent.atomic.AtomicInteger; -+import java.util.stream.Stream; -+ -+// CraftBukkit start - // CraftBukkit end - - public abstract class Entity implements INamableTileEntity, ICommandListener, KeyedObject { // Paper -@@ -425,10 +426,12 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - - public void setPosition(double d0, double d1, double d2) { - this.setPositionRaw(d0, d1, d2); -- float f = this.size.width / 2.0F; -- float f1 = this.size.height; -+ // Paper start - move into setPositionRaw -+ //float f = this.size.width / 2.0F; -+ //float f1 = this.size.height; - -- this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f)); -+ //this.a(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f)); -+ // Paper end - if (valid) ((WorldServer) world).chunkCheck(this); // CraftBukkit - } - -@@ -2907,6 +2910,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - return new AxisAlignedBB(vec3d, vec3d1); - } - -+ public final void setBoundingBox(AxisAlignedBB axisalignedbb) { a(axisalignedbb); } // Paper - OBFHELPER - public void a(AxisAlignedBB axisalignedbb) { - // CraftBukkit start - block invalid bounding boxes - double minX = axisalignedbb.minX, -@@ -3345,6 +3349,14 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - } - - public void setPositionRaw(double d0, double d1, double d2) { -+ // Paper start - never allow AABB to become desynced from position -+ // hanging has its own special logic -+ if (!(this instanceof EntityHanging) && (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2)) { -+ float f = this.size.width / 2.0F; -+ float f1 = this.size.height; -+ this.setBoundingBox(new AxisAlignedBB(d0 - (double) f, d1, d2 - (double) f, d0 + (double) f, d1 + (double) f1, d2 + (double) f)); -+ } -+ // Paper end - if (this.loc.x != d0 || this.loc.y != d1 || this.loc.z != d2) { - this.loc = new Vec3D(d0, d1, d2); - int i = MathHelper.floor(d0); diff --git a/Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch b/Spigot-Server-Patches/0519-Improve-Legacy-Component-serialization-size.patch index c4c00e14fb..d1896ba9c9 100644 --- a/Spigot-Server-Patches/0524-Improve-Legacy-Component-serialization-size.patch +++ b/Spigot-Server-Patches/0519-Improve-Legacy-Component-serialization-size.patch @@ -7,15 +7,15 @@ Don't constantly send format: false for all formatting options when parent alrea has it false diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java -index bfeea111b6f0d614073c13a3dc4996692f8ad136..00c24bf2fb1df7246d128c5bf33a2c01c4f398c2 100644 +index e796e956114d232601c91e6d45d721fd6952241b..8c6130746c8774a8bd7a565dd999f8b901179e73 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java @@ -45,6 +45,7 @@ public final class CraftChatMessage { // Separate pattern with no group 3, new lines are part of previous string private static final Pattern INCREMENTAL_PATTERN_KEEP_NEWLINES = Pattern.compile("(" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + "[0-9a-fk-orx])|((?:(?:https?):\\/\\/)?(?:[-\\w_\\.]{2,}\\.[a-z]{2,4}.*?(?=[\\.\\?!,;:]?(?:[" + String.valueOf(org.bukkit.ChatColor.COLOR_CHAR) + " ]|$))))", Pattern.CASE_INSENSITIVE); // ChatColor.b does not explicitly reset, its more of empty -+ private static final ChatModifier EMPTY = ChatModifier.b.setItalic(false); // Paper - OBFHELPER - private static final ChatModifier RESET = ChatModifier.b.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false); ++ private static final ChatModifier EMPTY = ChatModifier.a.setItalic(false); // Paper - OBFHELPER + private static final ChatModifier RESET = ChatModifier.a.setBold(false).setItalic(false).setUnderline(false).setStrikethrough(false).setRandom(false); private final List<IChatBaseComponent> list = new ArrayList<IChatBaseComponent>(); @@ -66,6 +67,7 @@ public final class CraftChatMessage { diff --git a/Spigot-Server-Patches/0525-Support-old-UUID-format-for-NBT.patch b/Spigot-Server-Patches/0520-Support-old-UUID-format-for-NBT.patch index dd0cf39941..198a1cfd31 100644 --- a/Spigot-Server-Patches/0525-Support-old-UUID-format-for-NBT.patch +++ b/Spigot-Server-Patches/0520-Support-old-UUID-format-for-NBT.patch @@ -24,10 +24,10 @@ index 66d503a91665952b98c8cdc06c9ad10782b0558b..dca47422816e0ff5cf56ee73d0aa7e2f uuid = nbttagcompound.a("Id"); } diff --git a/src/main/java/net/minecraft/server/NBTTagCompound.java b/src/main/java/net/minecraft/server/NBTTagCompound.java -index f608b35502890650adfc1df35e0794471f57ecbc..436f40bcd7817bedde4f6570c7c47dba7ff7034f 100644 +index 8dd91ddf9e1489ec035452c590cbd59afa44c18f..06d5acab794e3ee139a11f9b068e8a359c46db2c 100644 --- a/src/main/java/net/minecraft/server/NBTTagCompound.java +++ b/src/main/java/net/minecraft/server/NBTTagCompound.java -@@ -135,6 +135,12 @@ public class NBTTagCompound implements NBTBase { +@@ -136,6 +136,12 @@ public class NBTTagCompound implements NBTBase { public void setUUID(String prefix, UUID uuid) { a(prefix, uuid); } // Paper - OBFHELPER public void a(String s, UUID uuid) { @@ -40,7 +40,7 @@ index f608b35502890650adfc1df35e0794471f57ecbc..436f40bcd7817bedde4f6570c7c47dba this.map.put(s, GameProfileSerializer.a(uuid)); } -@@ -142,11 +148,21 @@ public class NBTTagCompound implements NBTBase { +@@ -143,11 +149,21 @@ public class NBTTagCompound implements NBTBase { @Nullable public UUID getUUID(String prefix) { return a(prefix); } // Paper - OBFHELPER @Nullable public UUID a(String s) { diff --git a/Spigot-Server-Patches/0526-Clean-up-duplicated-GameProfile-Properties.patch b/Spigot-Server-Patches/0521-Clean-up-duplicated-GameProfile-Properties.patch index 5d2c684b69..5d2c684b69 100644 --- a/Spigot-Server-Patches/0526-Clean-up-duplicated-GameProfile-Properties.patch +++ b/Spigot-Server-Patches/0521-Clean-up-duplicated-GameProfile-Properties.patch diff --git a/Spigot-Server-Patches/0527-Convert-legacy-attributes-in-Item-Meta.patch b/Spigot-Server-Patches/0522-Convert-legacy-attributes-in-Item-Meta.patch index 8b4a253ec6..8b4a253ec6 100644 --- a/Spigot-Server-Patches/0527-Convert-legacy-attributes-in-Item-Meta.patch +++ b/Spigot-Server-Patches/0522-Convert-legacy-attributes-in-Item-Meta.patch diff --git a/Spigot-Server-Patches/0528-Remove-some-streams-from-structures.patch b/Spigot-Server-Patches/0523-Remove-some-streams-from-structures.patch index 765a385274..9a130be253 100644 --- a/Spigot-Server-Patches/0528-Remove-some-streams-from-structures.patch +++ b/Spigot-Server-Patches/0523-Remove-some-streams-from-structures.patch @@ -6,29 +6,29 @@ Subject: [PATCH] Remove some streams from structures This showed up a lot in the spark profiler, should have a low-medium performance improvement. diff --git a/src/main/java/net/minecraft/server/BiomeBase.java b/src/main/java/net/minecraft/server/BiomeBase.java -index 30aeb45d63394b7d91c2dd7b92cfc9cefa3c088c..db198811ddecc00cbd398f3805bdf51b3239f390 100644 +index 260fd033c1017389a6f28447a6017b0ca15514d8..0854ac9ef586b378420d9899f3afd2755e6f9f33 100644 --- a/src/main/java/net/minecraft/server/BiomeBase.java +++ b/src/main/java/net/minecraft/server/BiomeBase.java -@@ -339,9 +339,11 @@ public class BiomeBase { - int j1 = l << 4; +@@ -209,9 +209,11 @@ public final class BiomeBase { + int l1 = j1 << 4; try { - structuremanager.a(SectionPosition.a(blockposition), structuregenerator).forEach((structurestart) -> { -- structurestart.a(generatoraccessseed, structuremanager, chunkgenerator, seededrandom, new StructureBoundingBox(i1, j1, i1 + 15, j1 + 15), new ChunkCoordIntPair(k, l)); +- structurestart.a(regionlimitedworldaccess, structuremanager, chunkgenerator, seededrandom, new StructureBoundingBox(k1, l1, k1 + 15, l1 + 15), new ChunkCoordIntPair(i1, j1)); - }); + // Paper start - remove structure streams + for (StructureStart<?> structureStart : structuremanager.getFeatureStarts(SectionPosition.a(blockposition), structuregenerator)) { -+ structureStart.a(generatoraccessseed, structuremanager, chunkgenerator, seededrandom, new StructureBoundingBox(i1, j1, i1 + 15, j1 + 15), new ChunkCoordIntPair(k, l)); ++ structureStart.a(regionlimitedworldaccess, structuremanager, chunkgenerator, seededrandom, new StructureBoundingBox(k1, l1, k1 + 15, l1 + 15), new ChunkCoordIntPair(i1, j1)); + } + // Paper end } catch (Exception exception) { CrashReport crashreport = CrashReport.a(exception, "Feature placement"); diff --git a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -index 733c6244e08f6b7277006c1ed801f2cfc8fc36e5..45b771e4121f2ef27c67d5a5ba2dadcfc0f944e0 100644 +index 4741d28aec73ffa1d5a9f60a4086eac3375c83b1..321ebe8891defb46f3ad3dfea37c9bb6e2025ad7 100644 --- a/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java +++ b/src/main/java/net/minecraft/server/ChunkGeneratorAbstract.java -@@ -417,7 +417,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -421,7 +421,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { while (iterator.hasNext()) { StructureGenerator<?> structuregenerator = (StructureGenerator) iterator.next(); @@ -37,7 +37,7 @@ index 733c6244e08f6b7277006c1ed801f2cfc8fc36e5..45b771e4121f2ef27c67d5a5ba2dadcf Iterator iterator1 = structurestart.d().iterator(); while (iterator1.hasNext()) { -@@ -449,7 +449,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { +@@ -453,7 +453,7 @@ public final class ChunkGeneratorAbstract extends ChunkGenerator { } } @@ -47,10 +47,16 @@ index 733c6244e08f6b7277006c1ed801f2cfc8fc36e5..45b771e4121f2ef27c67d5a5ba2dadcf double[][][] adouble = new double[2][this.p + 1][this.o + 1]; diff --git a/src/main/java/net/minecraft/server/StructureManager.java b/src/main/java/net/minecraft/server/StructureManager.java -index c434427ce7bd206ed5d2efa2560e593b1186c666..6c7804ac0e994ec03b95eda7a24139b65a59db7e 100644 +index c434427ce7bd206ed5d2efa2560e593b1186c666..f199368a6d78b0cd52f11ca2c8509d729b918852 100644 --- a/src/main/java/net/minecraft/server/StructureManager.java +++ b/src/main/java/net/minecraft/server/StructureManager.java -@@ -6,7 +6,7 @@ import javax.annotation.Nullable; +@@ -1,12 +1,13 @@ + package net.minecraft.server; + + import com.mojang.datafixers.DataFixUtils; ++import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper + import java.util.stream.Stream; + import javax.annotation.Nullable; public class StructureManager { @@ -59,13 +65,13 @@ index c434427ce7bd206ed5d2efa2560e593b1186c666..6c7804ac0e994ec03b95eda7a24139b6 private final GeneratorSettings b; public StructureManager(GeneratorAccess generatoraccess, GeneratorSettings generatorsettings) { -@@ -32,6 +32,20 @@ public class StructureManager { +@@ -32,6 +33,20 @@ public class StructureManager { }); } + // Paper start - remove structure streams + public java.util.List<StructureStart<?>> getFeatureStarts(SectionPosition sectionPosition, StructureGenerator<?> structureGenerator) { -+ java.util.List<StructureStart<?>> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(); ++ java.util.List<StructureStart<?>> list = new ObjectArrayList<>(); + for (Long curLong: getLevel().getChunkAt(sectionPosition.a(), sectionPosition.c(), ChunkStatus.STRUCTURE_REFERENCES).b(structureGenerator)) { + SectionPosition sectionPosition1 = SectionPosition.a(new ChunkCoordIntPair(curLong), 0); + StructureStart<?> structurestart = a(sectionPosition1, structureGenerator, getLevel().getChunkAt(sectionPosition1.a(), sectionPosition1.c(), ChunkStatus.STRUCTURE_STARTS)); @@ -80,7 +86,7 @@ index c434427ce7bd206ed5d2efa2560e593b1186c666..6c7804ac0e994ec03b95eda7a24139b6 @Nullable public StructureStart<?> a(SectionPosition sectionposition, StructureGenerator<?> structuregenerator, IStructureAccess istructureaccess) { return istructureaccess.a(structuregenerator); -@@ -50,13 +64,21 @@ public class StructureManager { +@@ -50,13 +65,21 @@ public class StructureManager { } public StructureStart<?> a(BlockPosition blockposition, boolean flag, StructureGenerator<?> structuregenerator) { diff --git a/Spigot-Server-Patches/0529-Remove-streams-from-classes-related-villager-gossip.patch b/Spigot-Server-Patches/0524-Remove-streams-from-classes-related-villager-gossip.patch index 9655386da1..f9bc60312e 100644 --- a/Spigot-Server-Patches/0529-Remove-streams-from-classes-related-villager-gossip.patch +++ b/Spigot-Server-Patches/0524-Remove-streams-from-classes-related-villager-gossip.patch @@ -5,16 +5,24 @@ Subject: [PATCH] Remove streams from classes related villager gossip diff --git a/src/main/java/net/minecraft/server/Reputation.java b/src/main/java/net/minecraft/server/Reputation.java -index 09d2fc5769089f6d29971d10de5b8209829baae8..dffac0dc85fe7d093c58663f91ad687a6be50ad5 100644 +index 09d2fc5769089f6d29971d10de5b8209829baae8..7315cf5ee476ed45b4c2a56a723639b264672cb6 100644 --- a/src/main/java/net/minecraft/server/Reputation.java +++ b/src/main/java/net/minecraft/server/Reputation.java -@@ -49,8 +49,21 @@ public class Reputation { +@@ -9,6 +9,7 @@ import com.mojang.serialization.DynamicOps; + import it.unimi.dsi.fastutil.objects.Object2IntMap; + import it.unimi.dsi.fastutil.objects.Object2IntMap.Entry; + import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap; ++import it.unimi.dsi.fastutil.objects.ObjectArrayList; // Paper + import it.unimi.dsi.fastutil.objects.ObjectIterator; + import java.util.Arrays; + import java.util.Collection; +@@ -49,8 +50,21 @@ public class Reputation { }); } + // Paper start - Remove streams from reputation + private List<Reputation.b> decompress() { -+ List<Reputation.b> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(); ++ List<Reputation.b> list = new ObjectArrayList<>(); + for (Map.Entry<UUID, Reputation.a> entry : getReputations().entrySet()) { + for (Reputation.b cur : entry.getValue().decompress(entry.getKey())) { + if (cur.a() != 0) @@ -31,7 +39,7 @@ index 09d2fc5769089f6d29971d10de5b8209829baae8..dffac0dc85fe7d093c58663f91ad687a if (list.isEmpty()) { return Collections.emptyList(); -@@ -117,7 +130,7 @@ public class Reputation { +@@ -117,7 +131,7 @@ public class Reputation { } public <T> Dynamic<T> a(DynamicOps<T> dynamicops) { @@ -40,7 +48,7 @@ index 09d2fc5769089f6d29971d10de5b8209829baae8..dffac0dc85fe7d093c58663f91ad687a return reputation_b.a(dynamicops); }).map(Dynamic::getValue))); } -@@ -142,18 +155,30 @@ public class Reputation { +@@ -142,18 +156,30 @@ public class Reputation { public static class a { // Paper - make public @@ -68,7 +76,7 @@ index 09d2fc5769089f6d29971d10de5b8209829baae8..dffac0dc85fe7d093c58663f91ad687a + } + + public List<Reputation.b> decompress(UUID uuid) { -+ List<Reputation.b> list = new it.unimi.dsi.fastutil.objects.ObjectArrayList<>(); ++ List<Reputation.b> list = new ObjectArrayList<>(); + for (Object2IntMap.Entry<ReputationType> entry : getEntries().object2IntEntrySet()) { + list.add(new Reputation.b(uuid, entry.getKey(), entry.getIntValue())); + } diff --git a/Spigot-Server-Patches/0530-Support-components-in-ItemMeta.patch b/Spigot-Server-Patches/0525-Support-components-in-ItemMeta.patch index e282bc8e11..1ca5493d0c 100644 --- a/Spigot-Server-Patches/0530-Support-components-in-ItemMeta.patch +++ b/Spigot-Server-Patches/0525-Support-components-in-ItemMeta.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Support components in ItemMeta diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java -index fd3e6cda6a0e7154c50608ba9a4b70f3c43c8f2a..94a6d0ad76b10b8790ffb2019bf6972472b04c3d 100644 +index b8770066a86df25d6ba9ecf74d846c730d228c01..2eb45e8e05b1a2ad6b8fcb204f2d2b06f9861643 100644 --- a/src/main/java/net/minecraft/server/IChatBaseComponent.java +++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java @@ -344,6 +344,7 @@ public interface IChatBaseComponent extends Message, IChatFormatted, Iterable<IC diff --git a/Spigot-Server-Patches/0531-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch b/Spigot-Server-Patches/0526-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch index b7c5a49bd4..5a51dd86c4 100644 --- a/Spigot-Server-Patches/0531-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch +++ b/Spigot-Server-Patches/0526-Improve-EntityTargetLivingEntityEvent-for-1.16-mobs.patch @@ -7,7 +7,7 @@ CraftBukkit has a bug in their implementation and is incorrectly handling forget Also adds more target reasons for why it forgot target. diff --git a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java -index 254a4afeed2148fc1a8d698c90ba0b98eda01687..51203fd30bfee57ef8d52d0360a64a7e1d6c65a3 100644 +index 7a3a1190b5c09629dbe74adbdebf2756207b9124..51203fd30bfee57ef8d52d0360a64a7e1d6c65a3 100644 --- a/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java +++ b/src/main/java/net/minecraft/server/BehaviorAttackTargetForget.java @@ -26,15 +26,15 @@ public class BehaviorAttackTargetForget<E extends EntityInsentient> extends Beha @@ -39,7 +39,7 @@ index 254a4afeed2148fc1a8d698c90ba0b98eda01687..51203fd30bfee57ef8d52d0360a64a7e + private void d(E e0, EntityTargetEvent.TargetReason reason) { // CraftBukkit start - EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); -- EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, old, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET); +- EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, null, (old != null && !old.isAlive()) ? EntityTargetEvent.TargetReason.TARGET_DIED : EntityTargetEvent.TargetReason.FORGOT_TARGET); + // Paper start - fix this event + //EntityLiving old = e0.getBehaviorController().getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); + EntityTargetEvent event = CraftEventFactory.callEntityTargetLivingEvent(e0, null, reason); diff --git a/Spigot-Server-Patches/0532-Add-entity-liquid-API.patch b/Spigot-Server-Patches/0527-Add-entity-liquid-API.patch index 13ec6d1177..faa0fbe2d6 100644 --- a/Spigot-Server-Patches/0532-Add-entity-liquid-API.patch +++ b/Spigot-Server-Patches/0527-Add-entity-liquid-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add entity liquid API diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java -index 9b5cad1f1137cb6c73f423dada1ae027218086ca..5a8bcd91dc5d030be531124106005ddf513e627f 100644 +index ad521f95aba0e82e3280351419ad23acfa283f9a..97e61dae7927d7da18fcb23d9e4bf639234af4a5 100644 --- a/src/main/java/net/minecraft/server/Entity.java +++ b/src/main/java/net/minecraft/server/Entity.java -@@ -1117,12 +1117,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1076,12 +1076,13 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.inWater; } @@ -16,34 +16,34 @@ index 9b5cad1f1137cb6c73f423dada1ae027218086ca..5a8bcd91dc5d030be531124106005ddf + public boolean isInRain() { // Paper - private -> public BlockPosition blockposition = this.getChunkCoordinates(); - return this.world.isRainingAt(blockposition) || this.world.isRainingAt(blockposition.a(0.0D, (double) this.size.height, 0.0D)); + return this.world.isRainingAt(blockposition) || this.world.isRainingAt(new BlockPosition((double) blockposition.getX(), this.getBoundingBox().maxY, (double) blockposition.getZ())); } + public final boolean isInBubbleColumn() { return k(); } // Paper - OBFHELPER private boolean k() { return this.world.getType(this.getChunkCoordinates()).a(Blocks.BUBBLE_COLUMN); } -@@ -1136,6 +1137,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke +@@ -1095,6 +1096,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke return this.isInWater() || this.isInRain() || this.k(); } -+ public final boolean isInWaterOrBubbleColumn() { return aD(); } // Paper - OBFHELPER - public boolean aD() { ++ public final boolean isInWaterOrBubbleColumn() { return aG(); } // Paper - OBFHELPER + public boolean aG() { return this.isInWater() || this.k(); } -@@ -1286,6 +1288,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke - this.inLava = true; +@@ -1237,6 +1239,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke + return this.O == tag; } -+ public final boolean isInLava() { return aN(); } // Paper - OBFHELPER - public boolean aN() { - return this.inLava; ++ public final boolean isInLava() { return aP(); } // Paper - OBFHELPER + public boolean aP() { + return !this.justCreated && this.M.getDouble(TagsFluid.LAVA) > 0.0D; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index a525a9e29f46c889a10d8c9fb70d8389fc204226..d1df4e5799de4bf0a1fcc6940e2498374cd3db9d 100644 +index 26376c995102753fcd298b1eea6e195bae238d65..b1fdc5737d332c6210d57793468da1eda8f8b9d2 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -@@ -1087,5 +1087,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { +@@ -1093,5 +1093,33 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason getEntitySpawnReason() { return getHandle().spawnReason; } diff --git a/Spigot-Server-Patches/0533-Update-itemstack-legacy-name-and-lore.patch b/Spigot-Server-Patches/0528-Update-itemstack-legacy-name-and-lore.patch index 934e8b519e..95c238c6db 100644 --- a/Spigot-Server-Patches/0533-Update-itemstack-legacy-name-and-lore.patch +++ b/Spigot-Server-Patches/0528-Update-itemstack-legacy-name-and-lore.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Update itemstack legacy name and lore diff --git a/src/main/java/net/minecraft/server/ItemStack.java b/src/main/java/net/minecraft/server/ItemStack.java -index 9a9678ed76b95131df0c12af5bba3440789699aa..3c56053e3075173edd22eccb277f51a12287ab56 100644 +index 8c82f80bb21611b54a35e61c04f5ba3ee9efbd7d..ace50805bfebbf4c3485ba1de334d975830a7d3c 100644 --- a/src/main/java/net/minecraft/server/ItemStack.java +++ b/src/main/java/net/minecraft/server/ItemStack.java @@ -83,6 +83,44 @@ public final class ItemStack { diff --git a/Spigot-Server-Patches/0534-Spawn-player-in-correct-world-on-login.patch b/Spigot-Server-Patches/0529-Spawn-player-in-correct-world-on-login.patch index fa510ccd99..6288d9fe79 100644 --- a/Spigot-Server-Patches/0534-Spawn-player-in-correct-world-on-login.patch +++ b/Spigot-Server-Patches/0529-Spawn-player-in-correct-world-on-login.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Spawn player in correct world on login diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index f8e0742ea9a42cf496b4b7e00201fed025b83889..9e438590113b2c7a318c812637c8aa14341df3e6 100644 +index 3b20dd067c6b10f2e5ffad65e5abda7a7008b1c0..46be525624209e4b89f96adcb464389e853a261a 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -119,7 +119,18 @@ public abstract class PlayerList { diff --git a/Spigot-Server-Patches/0535-Add-PrepareResultEvent.patch b/Spigot-Server-Patches/0530-Add-PrepareResultEvent.patch index 358e7bb8f8..767c4e6c46 100644 --- a/Spigot-Server-Patches/0535-Add-PrepareResultEvent.patch +++ b/Spigot-Server-Patches/0530-Add-PrepareResultEvent.patch @@ -8,7 +8,7 @@ Adds a new event for all crafting stations that generate a result slot item Anvil, Grindstone and Smithing now extend this event diff --git a/src/main/java/net/minecraft/server/Container.java b/src/main/java/net/minecraft/server/Container.java -index 4effcc860f9b1cf9f13f4c6ae02a6b16df459259..44db4851e2e6901e816b34c2037d00948c0a2008 100644 +index 1045bd6eaa977b0142b4496c3f872ffae767a0f1..73a057b074af938a03decb0a53784aff321411ab 100644 --- a/src/main/java/net/minecraft/server/Container.java +++ b/src/main/java/net/minecraft/server/Container.java @@ -126,6 +126,7 @@ public abstract class Container { @@ -32,7 +32,7 @@ index 24631b2bcb2a1d057c1fb6596ff401133c8b548a..fc2038df89f25c07f6f853f6df41fe9b // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java b/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java -index 2029d4dd9a2abe693c34723c379009578ab52503..ad9f234c4862d78b5a8e547aa8bb6528497de236 100644 +index 70f9c189cb92656ba07ef7c60cfff646c2980b9e..1b7724422fc5d6a99fe60837d1f48585775a933a 100644 --- a/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java +++ b/src/main/java/net/minecraft/server/ContainerAnvilAbstract.java @@ -65,6 +65,7 @@ public abstract class ContainerAnvilAbstract extends Container { @@ -44,10 +44,10 @@ index 2029d4dd9a2abe693c34723c379009578ab52503..ad9f234c4862d78b5a8e547aa8bb6528 } diff --git a/src/main/java/net/minecraft/server/ContainerCartography.java b/src/main/java/net/minecraft/server/ContainerCartography.java -index 91e1372952f07087f51b22f1c53f63d2cf2f40fc..79d328786f2e9ba386cb297bb8e7ec0ec3228a65 100644 +index d98d5446d034c416dc29a89320c360464163d700..10df5790a43aef85191bd50c1b49c74a8f976dd2 100644 --- a/src/main/java/net/minecraft/server/ContainerCartography.java +++ b/src/main/java/net/minecraft/server/ContainerCartography.java -@@ -154,6 +154,7 @@ public class ContainerCartography extends Container { +@@ -128,6 +128,7 @@ public class ContainerCartography extends Container { this.a(itemstack, itemstack1, itemstack2); } @@ -82,10 +82,10 @@ index 9490f74ee426e162844432073b3d78a2b6cddb32..1fe21ca13a1eecb64cb2d3f4f18993e1 @Override diff --git a/src/main/java/net/minecraft/server/ContainerSmithing.java b/src/main/java/net/minecraft/server/ContainerSmithing.java -index a54f6c96392fe4097aee3e6f95fe1244fa273542..50a4e305babbfefd83e5cf180ef6da1958c3215c 100644 +index f08337e59f6dc0cfda4ec822716ff75e9ca97291..a575dddb262021fd68b4db1435e67a1f0768c633 100644 --- a/src/main/java/net/minecraft/server/ContainerSmithing.java +++ b/src/main/java/net/minecraft/server/ContainerSmithing.java -@@ -65,6 +65,7 @@ public class ContainerSmithing extends ContainerAnvilAbstract { +@@ -68,6 +68,7 @@ public class ContainerSmithing extends ContainerAnvilAbstract { org.bukkit.craftbukkit.event.CraftEventFactory.callPrepareSmithingEvent(getBukkitView(), itemstack); // CraftBukkit } @@ -94,10 +94,10 @@ index a54f6c96392fe4097aee3e6f95fe1244fa273542..50a4e305babbfefd83e5cf180ef6da19 @Override diff --git a/src/main/java/net/minecraft/server/ContainerStonecutter.java b/src/main/java/net/minecraft/server/ContainerStonecutter.java -index 270bf7f3e6ca15891419f1ce3e88d9aff094bee6..a235f6406dc06ceafea6fbe429bf595da2fea07c 100644 +index c9505513e7e34637f8eebd68d756834479c1ca0c..5351bf137623a8909fea672c96a6057cf9726c97 100644 --- a/src/main/java/net/minecraft/server/ContainerStonecutter.java +++ b/src/main/java/net/minecraft/server/ContainerStonecutter.java -@@ -133,6 +133,7 @@ public class ContainerStonecutter extends Container { +@@ -134,6 +134,7 @@ public class ContainerStonecutter extends Container { this.a(iinventory, itemstack); } @@ -106,10 +106,10 @@ index 270bf7f3e6ca15891419f1ce3e88d9aff094bee6..a235f6406dc06ceafea6fbe429bf595d private void a(IInventory iinventory, ItemStack itemstack) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index d3ad06c853338d1de7e3e49910dd06b127451d73..0af6fd88d3a151c74353ba29e97d63560b2fe990 100644 +index 32202eb92207995b621d151481aa44bd3817e808..68e3d297876f356594d2df7d5ba72d70dd563e99 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -@@ -1549,19 +1549,44 @@ public class CraftEventFactory { +@@ -1553,19 +1553,44 @@ public class CraftEventFactory { return event; } diff --git a/Spigot-Server-Patches/0536-Allow-delegation-to-vanilla-chunk-gen.patch b/Spigot-Server-Patches/0531-Allow-delegation-to-vanilla-chunk-gen.patch index 5c9bb77f81..5af5d09bed 100644 --- a/Spigot-Server-Patches/0536-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/Spigot-Server-Patches/0531-Allow-delegation-to-vanilla-chunk-gen.patch @@ -27,10 +27,10 @@ index b51613040e4583ff056060b47b1f97a86ebcde51..5366314e5f889b5b8d7740bbd0f024d9 for (int l = 0; l < k; ++l) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 506e76eecd4be892bdc70367c0ee4d9764569ca7..6282a05ae855a6b55eec4980fbc1b356f65f500e 100644 +index 1b19f0ac446fb68efb28cd0155ae732f216e272b..7d83cf39ae4b78588a2cb5decccf53edfd448735 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1979,6 +1979,29 @@ public final class CraftServer implements Server { +@@ -1973,6 +1973,29 @@ public final class CraftServer implements Server { return new CraftChunkData(world); } @@ -47,7 +47,7 @@ index 506e76eecd4be892bdc70367c0ee4d9764569ca7..6282a05ae855a6b55eec4980fbc1b356 + net.minecraft.server.RegionLimitedWorldAccess genRegion = new net.minecraft.server.RegionLimitedWorldAccess(nmsWorld, list); + // call vanilla generator, one feature after another. Order here is important! + net.minecraft.server.ChunkGenerator chunkGenerator = nmsWorld.getChunkProvider().chunkGenerator; -+ chunkGenerator.createBiomes(protoChunk); ++ chunkGenerator.createBiomes(nmsWorld.r().b(IRegistry.ay), protoChunk); + chunkGenerator.buildNoise(genRegion, nmsWorld.getStructureManager(), protoChunk); + chunkGenerator.buildBase(genRegion, protoChunk); + // copy over generated sections diff --git a/Spigot-Server-Patches/0537-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch b/Spigot-Server-Patches/0532-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch index 3a8346c008..fd92f37204 100644 --- a/Spigot-Server-Patches/0537-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch +++ b/Spigot-Server-Patches/0532-Don-t-check-chunk-for-portal-on-world-gen-entity-add.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't check chunk for portal on world gen entity add diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index ce823833a0b308aeb11902652157575eabf09e3b..1a61bc7c8a532d11981e47cadfd57e92894bf4dd 100644 +index 01de9a9c965ce156f53577d19f1ca9a138657720..b92e74349b402b6a8687876073f974128fe242a4 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java -@@ -2914,7 +2914,7 @@ public abstract class EntityLiving extends Entity { +@@ -2917,7 +2917,7 @@ public abstract class EntityLiving extends Entity { Entity entity = this.getVehicle(); super.stopRiding(suppressCancellation); // Paper - suppress diff --git a/Spigot-Server-Patches/0538-Optimize-NetworkManager-Exception-Handling.patch b/Spigot-Server-Patches/0533-Optimize-NetworkManager-Exception-Handling.patch index f33218d96b..e0061a881a 100644 --- a/Spigot-Server-Patches/0538-Optimize-NetworkManager-Exception-Handling.patch +++ b/Spigot-Server-Patches/0533-Optimize-NetworkManager-Exception-Handling.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Optimize NetworkManager Exception Handling diff --git a/src/main/java/net/minecraft/server/EnumProtocol.java b/src/main/java/net/minecraft/server/EnumProtocol.java -index d384b1e857a5fe21a93e6fb956a2bfd777d92de3..ec3c8ec6a7c0a835d0bab9872d0ead68b2ff54df 100644 +index 32f5470baa88c3dc80db1bb547e1c982ac90237d..64df649e8d209246cc836793160eb0a1506826f8 100644 --- a/src/main/java/net/minecraft/server/EnumProtocol.java +++ b/src/main/java/net/minecraft/server/EnumProtocol.java -@@ -128,6 +128,7 @@ public enum EnumProtocol { +@@ -129,6 +129,7 @@ public enum EnumProtocol { @Nullable public Packet<?> a(int i) { diff --git a/Spigot-Server-Patches/0539-Fix-Concurrency-issue-in-WeightedList.patch b/Spigot-Server-Patches/0534-Fix-Concurrency-issue-in-WeightedList.patch index 2714f9eaeb..2714f9eaeb 100644 --- a/Spigot-Server-Patches/0539-Fix-Concurrency-issue-in-WeightedList.patch +++ b/Spigot-Server-Patches/0534-Fix-Concurrency-issue-in-WeightedList.patch diff --git a/Spigot-Server-Patches/0540-Optimize-the-advancement-data-player-iteration-to-be.patch b/Spigot-Server-Patches/0535-Optimize-the-advancement-data-player-iteration-to-be.patch index 61640b9c4e..61640b9c4e 100644 --- a/Spigot-Server-Patches/0540-Optimize-the-advancement-data-player-iteration-to-be.patch +++ b/Spigot-Server-Patches/0535-Optimize-the-advancement-data-player-iteration-to-be.patch diff --git a/Spigot-Server-Patches/0541-Fix-arrows-never-despawning-MC-125757.patch b/Spigot-Server-Patches/0536-Fix-arrows-never-despawning-MC-125757.patch index a65fde01f4..9cb34d891b 100644 --- a/Spigot-Server-Patches/0541-Fix-arrows-never-despawning-MC-125757.patch +++ b/Spigot-Server-Patches/0536-Fix-arrows-never-despawning-MC-125757.patch @@ -9,7 +9,7 @@ instead of getting stuck in a never despawn state (bubble columns, etc). diff --git a/src/main/java/net/minecraft/server/EntityArrow.java b/src/main/java/net/minecraft/server/EntityArrow.java -index f8772a853ea9b5ca45c78a2fd8bd3f1fa6abf5d2..0d43eb8e1712d1b98888db7579bc343ccb1e8989 100644 +index 890f5436b6e4e29759d26dbe6d0759cfa6a956df..b0218959a0e553b034745802765e0f93b62b32fb 100644 --- a/src/main/java/net/minecraft/server/EntityArrow.java +++ b/src/main/java/net/minecraft/server/EntityArrow.java @@ -133,6 +133,7 @@ public abstract class EntityArrow extends IProjectile { diff --git a/Spigot-Server-Patches/0542-Thread-Safe-Vanilla-Command-permission-checking.patch b/Spigot-Server-Patches/0537-Thread-Safe-Vanilla-Command-permission-checking.patch index 27c4d19077..43fdbf1b46 100644 --- a/Spigot-Server-Patches/0542-Thread-Safe-Vanilla-Command-permission-checking.patch +++ b/Spigot-Server-Patches/0537-Thread-Safe-Vanilla-Command-permission-checking.patch @@ -9,11 +9,11 @@ to race conditions. Plus, .canUse we want to be safe for async anyways. diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java -index 5e3fc338b0fe69a74465567e69721bc28c64dd17..ca0d664487a65a4768f0e65af6a320fd1875de8f 100644 +index 6976da79b20280fcd72dcfb8b48e2eb73257faf2..d9c47f3fc18266df3be1f564c01dfc3e26941380 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -75,10 +75,10 @@ public abstract class CommandNode<S> implements Comparable<CommandNode<S>> { - // CraftBukkit start + public synchronized boolean canUse(final S source) { if (source instanceof CommandListenerWrapper) { try { - ((CommandListenerWrapper) source).currentCommand = this; @@ -26,22 +26,23 @@ index 5e3fc338b0fe69a74465567e69721bc28c64dd17..ca0d664487a65a4768f0e65af6a320fd } // CraftBukkit end diff --git a/src/main/java/net/minecraft/server/CommandListenerWrapper.java b/src/main/java/net/minecraft/server/CommandListenerWrapper.java -index fa0f247e51c20ea0e3cbaccbc8dbb2a153d6121f..a4995ddc82100bc460cd2021dcfa8389769d5da0 100644 +index 7608b5021d66c39b8121f33829cd09d77c847277..90b0cf6470711101400d723747d1f302cf6e23bd 100644 --- a/src/main/java/net/minecraft/server/CommandListenerWrapper.java +++ b/src/main/java/net/minecraft/server/CommandListenerWrapper.java @@ -33,7 +33,7 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys private final ResultConsumer<CommandListenerWrapper> l; private final ArgumentAnchor.Anchor m; private final Vec2F n; -- public CommandNode currentCommand; // CraftBukkit +- public volatile CommandNode currentCommand; // CraftBukkit + public ThreadLocal<CommandNode> currentCommand = new ThreadLocal<>(); // CraftBukkit // Paper public CommandListenerWrapper(ICommandListener icommandlistener, Vec3D vec3d, Vec2F vec2f, WorldServer worldserver, int i, String s, IChatBaseComponent ichatbasecomponent, MinecraftServer minecraftserver, @Nullable Entity entity) { this(icommandlistener, vec3d, vec2f, worldserver, i, s, ichatbasecomponent, minecraftserver, entity, false, (commandcontext, flag, j) -> { -@@ -143,8 +143,11 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys +@@ -150,9 +150,11 @@ public class CommandListenerWrapper implements ICompletionProvider, com.destroys @Override public boolean hasPermission(int i) { // CraftBukkit start +- CommandNode currentCommand = this.currentCommand; + // Paper start - fix concurrency issue + CommandNode currentCommand = this.currentCommand.get(); if (currentCommand != null) { diff --git a/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch b/Spigot-Server-Patches/0538-Move-range-check-for-block-placing-up.patch index 1eec5e895f..41c58e23fc 100644 --- a/Spigot-Server-Patches/0543-Move-range-check-for-block-placing-up.patch +++ b/Spigot-Server-Patches/0538-Move-range-check-for-block-placing-up.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Move range check for block placing up diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 8c02493bcdb6271870f8f1d558858ee3fb260014..6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab 100644 +index 522a88ab9592747d5d6c21cc5e0460dee05d8385..bc613281d18efac7bb926d84ec54653368b93f43 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java -@@ -1433,15 +1433,19 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -1427,15 +1427,19 @@ public class PlayerConnection implements PacketListenerPlayIn { BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); EnumDirection enumdirection = movingobjectpositionblock.getDirection(); @@ -22,7 +22,7 @@ index 8c02493bcdb6271870f8f1d558858ee3fb260014..6259ff4a571abb842b4a1b15a43b2b7c + this.player.resetIdleTimer(); if (blockposition.getY() < this.minecraftServer.getMaxBuildHeight()) { - if (this.teleportPos == null && this.player.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) { + if (this.teleportPos == null && this.player.h((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) { // CraftBukkit start - Check if we can actually do something over this large a distance - Location eyeLoc = this.getPlayer().getEyeLocation(); - double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ()); diff --git a/Spigot-Server-Patches/0544-Fix-SPIGOT-5989.patch b/Spigot-Server-Patches/0539-Fix-SPIGOT-5989.patch index dc6cca3282..f3b20005da 100644 --- a/Spigot-Server-Patches/0544-Fix-SPIGOT-5989.patch +++ b/Spigot-Server-Patches/0539-Fix-SPIGOT-5989.patch @@ -10,10 +10,10 @@ This fixes that by checking if the modified spawn location is still at a respawn anchor. diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 9e438590113b2c7a318c812637c8aa14341df3e6..9382e8f79e8edec8885c629a36e230fbec50e1fb 100644 +index 46be525624209e4b89f96adcb464389e853a261a..73683aacdbf8b1be12c4d1788e9f197b2a023af7 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java -@@ -766,6 +766,7 @@ public abstract class PlayerList { +@@ -767,6 +767,7 @@ public abstract class PlayerList { // Paper start boolean isBedSpawn = false; boolean isRespawn = false; @@ -21,16 +21,16 @@ index 9e438590113b2c7a318c812637c8aa14341df3e6..9382e8f79e8edec8885c629a36e230fb // Paper end // CraftBukkit start - fire PlayerRespawnEvent -@@ -776,7 +777,7 @@ public abstract class PlayerList { +@@ -777,7 +778,7 @@ public abstract class PlayerList { Optional optional; if (blockposition != null) { -- optional = EntityHuman.getBed(worldserver1, blockposition, flag1, flag); -+ optional = EntityHuman.getBed(worldserver1, blockposition, flag1, true); // Paper - Fix SPIGOT-5989 +- optional = EntityHuman.getBed(worldserver1, blockposition, f, flag1, flag); ++ optional = EntityHuman.getBed(worldserver1, blockposition, f, flag1, true); // Paper - Fix SPIGOT-5989 } else { optional = Optional.empty(); } -@@ -809,7 +810,12 @@ public abstract class PlayerList { +@@ -821,7 +822,12 @@ public abstract class PlayerList { } // Spigot End @@ -44,7 +44,7 @@ index 9e438590113b2c7a318c812637c8aa14341df3e6..9382e8f79e8edec8885c629a36e230fb if (!flag) entityplayer.reset(); // SPIGOT-4785 isRespawn = true; // Paper } else { -@@ -847,8 +853,12 @@ public abstract class PlayerList { +@@ -859,8 +865,12 @@ public abstract class PlayerList { } // entityplayer1.syncInventory(); entityplayer1.setHealth(entityplayer1.getHealth()); diff --git a/Spigot-Server-Patches/0545-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch b/Spigot-Server-Patches/0540-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch index a89982dd56..58d8909709 100644 --- a/Spigot-Server-Patches/0545-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch +++ b/Spigot-Server-Patches/0540-Fix-SPIGOT-5824-Bukkit-world-container-is-not-used.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5824 Bukkit world-container is not used diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 79ac93c5f2cad09a5dd0450b55c709415d5fb3e6..fcd735098f3f818e68d2d80dab679e8789573e6b 100644 +index 95f3abe47a5ef4268bc6b7cdde94cba30303d786..52944bd5801a6ddf4df347dcdde9258d5b131b76 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -92,11 +92,20 @@ public class Main { +@@ -93,11 +93,20 @@ public class Main { return; } diff --git a/Spigot-Server-Patches/0546-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch b/Spigot-Server-Patches/0541-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch index 3afadc516b..7e80044293 100644 --- a/Spigot-Server-Patches/0546-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch +++ b/Spigot-Server-Patches/0541-Fix-SPIGOT-5885-Unable-to-disable-advancements.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix SPIGOT-5885 Unable to disable advancements diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index fcd735098f3f818e68d2d80dab679e8789573e6b..c426d1ed14177326c774d44c248f38229b3ad5be 100644 +index 52944bd5801a6ddf4df347dcdde9258d5b131b76..18521e2df4a45a8c4e67770028586ffd779ea519 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java -@@ -92,6 +92,7 @@ public class Main { +@@ -93,6 +93,7 @@ public class Main { return; } diff --git a/Spigot-Server-Patches/0547-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch b/Spigot-Server-Patches/0542-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch index e5620cb419..e5620cb419 100644 --- a/Spigot-Server-Patches/0547-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch +++ b/Spigot-Server-Patches/0542-Fix-AdvancementDataPlayer-leak-due-from-quitting-ear.patch diff --git a/Spigot-Server-Patches/0548-Add-missing-strikeLighting-call-to-World-spigot-stri.patch b/Spigot-Server-Patches/0543-Add-missing-strikeLighting-call-to-World-spigot-stri.patch index 74b4304105..5ccd84c38d 100644 --- a/Spigot-Server-Patches/0548-Add-missing-strikeLighting-call-to-World-spigot-stri.patch +++ b/Spigot-Server-Patches/0543-Add-missing-strikeLighting-call-to-World-spigot-stri.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing strikeLighting call to diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 06d8ab61f3636a2c76531356f3d7fd6f6be34225..ca0ca5e407661c7f2d1aa3c70990abaeedd816df 100644 +index d266671305f1f14849ced7c52df817502ff750da..4ab3db10e26dc9739c5afcfc423d1c68a2c4d1c9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -@@ -2604,6 +2604,7 @@ public class CraftWorld implements World { +@@ -2592,6 +2592,7 @@ public class CraftWorld implements World { lightning.teleportAndSync( loc.getX(), loc.getY(), loc.getZ() ); lightning.isEffect = true; lightning.isSilent = isSilent; diff --git a/Spigot-Server-Patches/0549-Fix-some-rails-connecting-improperly.patch b/Spigot-Server-Patches/0544-Fix-some-rails-connecting-improperly.patch index 0a3ad634bc..f94ef9cece 100644 --- a/Spigot-Server-Patches/0549-Fix-some-rails-connecting-improperly.patch +++ b/Spigot-Server-Patches/0544-Fix-some-rails-connecting-improperly.patch @@ -5,19 +5,19 @@ Subject: [PATCH] Fix some rails connecting improperly diff --git a/src/main/java/net/minecraft/server/BlockMinecartDetector.java b/src/main/java/net/minecraft/server/BlockMinecartDetector.java -index 06926c4ae1100c5848206b2c45d51e87f273416d..b8e91fca957c8a39c9fbf4f87c089c4ce710c8e0 100644 +index 9681e08edf34f17806819115336874b574b880bc..77fde30769860828b6f16eefb186962c140beaae 100644 --- a/src/main/java/net/minecraft/server/BlockMinecartDetector.java +++ b/src/main/java/net/minecraft/server/BlockMinecartDetector.java -@@ -50,6 +50,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { - } +@@ -51,6 +51,7 @@ public class BlockMinecartDetector extends BlockMinecartTrackAbstract { private void a(World world, BlockPosition blockposition, IBlockData iblockdata) { -+ if (iblockdata.getBlock() != this) { return; } // Paper - not our block, don't do anything - boolean flag = (Boolean) iblockdata.get(BlockMinecartDetector.POWERED); - boolean flag1 = false; - List<EntityMinecartAbstract> list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null); + if (this.canPlace(iblockdata, world, blockposition)) { ++ if (iblockdata.getBlock() != this) { return; } // Paper - not our block, don't do anything + boolean flag = (Boolean) iblockdata.get(BlockMinecartDetector.POWERED); + boolean flag1 = false; + List<EntityMinecartAbstract> list = this.a(world, blockposition, EntityMinecartAbstract.class, (Predicate) null); diff --git a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java -index d91b1b41aa2e3d3a12ebc52d19358032124135fb..a540b3e226b985f22daf1a69bf4e8cb578ab1476 100644 +index 5609eeec9a7991167b57b724fa3279d3e8bf6b94..0de3fa45487e996b79d1031c9ee4b0728cfe1bcf 100644 --- a/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java +++ b/src/main/java/net/minecraft/server/BlockMinecartTrackAbstract.java @@ -46,6 +46,7 @@ public abstract class BlockMinecartTrackAbstract extends Block { diff --git a/Spigot-Server-Patches/0550-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch b/Spigot-Server-Patches/0545-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch index 7cc6c0c256..7cc6c0c256 100644 --- a/Spigot-Server-Patches/0550-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch +++ b/Spigot-Server-Patches/0545-Optimize-Pathfinder-Remove-Streams-Optimized-collect.patch diff --git a/Spigot-Server-Patches/0551-Incremental-player-saving.patch b/Spigot-Server-Patches/0546-Incremental-player-saving.patch index ce7a11b17b..2ecc250b60 100644 --- a/Spigot-Server-Patches/0551-Incremental-player-saving.patch +++ b/Spigot-Server-Patches/0546-Incremental-player-saving.patch @@ -25,10 +25,10 @@ index 56e4359ba32339e1bef58061585ff3e12e4215f3..60f03502a7fd622d2de3b2da9fe8014b + } } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index e5a81f831813209d224ffedbc03f6d8243721a25..c72cfd2bdfbe4536f6799fc4dff195c1f66d4c94 100644 +index 918426385325e5157423cf10fcb2e0ab02d5853a..a947aabfc8c886b5a4be2626e06aa24c04e6f79b 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java -@@ -42,6 +42,7 @@ import org.bukkit.inventory.MainHand; +@@ -43,6 +43,7 @@ import org.bukkit.inventory.MainHand; public class EntityPlayer extends EntityHuman implements ICrafting { private static final Logger LOGGER = LogManager.getLogger(); @@ -37,10 +37,10 @@ index e5a81f831813209d224ffedbc03f6d8243721a25..c72cfd2bdfbe4536f6799fc4dff195c1 public NetworkManager networkManager; // Paper public final MinecraftServer server; diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3130c68e7318a41e763575b245ee1b5298c92a16..0defaec8a8a25b1a0172f211d599d07264977cfa 100644 +index a7b6be15b6c5d99fd8adc60c2d7f31a0b8ad4054..bbe793ca3667264eafa094bfea1c061011c73b92 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1228,9 +1228,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas +@@ -1226,9 +1226,15 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTas //if (autosavePeriod > 0 && this.ticks % autosavePeriod == 0) { // CraftBukkit // Paper - move down //MinecraftServer.LOGGER.debug("Autosave started"); // Paper serverAutoSave = (autosavePeriod > 0 && this.ticks % autosavePeriod == 0); // Paper @@ -59,7 +59,7 @@ index 3130c68e7318a41e763575b245ee1b5298c92a16..0defaec8a8a25b1a0172f211d599d072 // Paper start for (WorldServer world : getWorlds()) { diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 9382e8f79e8edec8885c629a36e230fbec50e1fb..38d83bb3183c6b8d7708e27b7427a757e3d26b0f 100644 +index 73683aacdbf8b1be12c4d1788e9f197b2a023af7..f9eb17cb6eda0b343240240720495751cf605385 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -482,6 +482,7 @@ public abstract class PlayerList { @@ -70,7 +70,7 @@ index 9382e8f79e8edec8885c629a36e230fbec50e1fb..38d83bb3183c6b8d7708e27b7427a757 this.playerFileData.save(entityplayer); ServerStatisticManager serverstatisticmanager = (ServerStatisticManager) entityplayer.getStatisticManager(); // CraftBukkit -@@ -1127,10 +1128,21 @@ public abstract class PlayerList { +@@ -1139,10 +1140,21 @@ public abstract class PlayerList { } public void savePlayers() { diff --git a/Spigot-Server-Patches/0547-Import-fastutil-classes.patch b/Spigot-Server-Patches/0547-Import-fastutil-classes.patch new file mode 100644 index 0000000000..78a19c3ace --- /dev/null +++ b/Spigot-Server-Patches/0547-Import-fastutil-classes.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Wed, 12 Aug 2020 11:33:04 +0200 +Subject: [PATCH] Import fastutil classes + + +diff --git a/src/main/java/net/minecraft/server/DataWatcher.java b/src/main/java/net/minecraft/server/DataWatcher.java +index be8e705fc3f2c31e4f84f59c977488d8ecd9cae1..e69093b411f76ea4090789576f8fb6635bd02ca5 100644 +--- a/src/main/java/net/minecraft/server/DataWatcher.java ++++ b/src/main/java/net/minecraft/server/DataWatcher.java +@@ -12,6 +12,7 @@ import java.util.Map; + import java.util.concurrent.locks.ReadWriteLock; + import java.util.concurrent.locks.ReentrantReadWriteLock; + import javax.annotation.Nullable; ++import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; // Paper + import org.apache.commons.lang3.ObjectUtils; + import org.apache.logging.log4j.LogManager; + import org.apache.logging.log4j.Logger; +@@ -21,7 +22,7 @@ public class DataWatcher { + private static final Logger LOGGER = LogManager.getLogger(); + private static final Map<Class<? extends Entity>, Integer> b = Maps.newHashMap(); + private final Entity entity; +- private final it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<DataWatcher.Item<?>> entries = new it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<>(); // Spigot - use better map // PAIL ++ private final Int2ObjectOpenHashMap<Item<?>> entries = new Int2ObjectOpenHashMap<>(); // Spigot - use better map // PAIL + // private final ReadWriteLock lock = new ReentrantReadWriteLock(); // Spigot - not required + private boolean f = true; + private boolean g; diff --git a/Spigot-Server-Patches/0548-Don-t-mark-null-chunk-sections-for-block-updates.patch b/Spigot-Server-Patches/0548-Don-t-mark-null-chunk-sections-for-block-updates.patch new file mode 100644 index 0000000000..a299083bad --- /dev/null +++ b/Spigot-Server-Patches/0548-Don-t-mark-null-chunk-sections-for-block-updates.patch @@ -0,0 +1,18 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Fri, 14 Aug 2020 23:41:19 +0200 +Subject: [PATCH] Don't mark null chunk sections for block updates + + +diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java +index 676f0d28b0c8a590c6429a93902953636b3c1f11..fc6197dd5bc7527ed66839c7e8316fb23ab5d14e 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/PlayerChunk.java +@@ -420,6 +420,7 @@ public class PlayerChunk { + this.a(world, blockposition, iblockdata); + } else { + ChunkSection chunksection = chunk.getSections()[sectionposition.getY()]; ++ if (chunksection == null) chunksection = new ChunkSection(sectionposition.getY(), chunk, world, true); // Paper - make a new chunk section if none was found + PacketPlayOutMultiBlockChange packetplayoutmultiblockchange = new PacketPlayOutMultiBlockChange(sectionposition, shortset, chunksection, this.x); + + this.a(packetplayoutmultiblockchange, false); diff --git a/Spigot-Server-Patches/0549-Remove-armour-stand-double-add-to-world.patch b/Spigot-Server-Patches/0549-Remove-armour-stand-double-add-to-world.patch new file mode 100644 index 0000000000..af664862c7 --- /dev/null +++ b/Spigot-Server-Patches/0549-Remove-armour-stand-double-add-to-world.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Fri, 14 Aug 2020 23:59:26 +0200 +Subject: [PATCH] Remove armour stand double add to world + + +diff --git a/src/main/java/net/minecraft/server/ItemArmorStand.java b/src/main/java/net/minecraft/server/ItemArmorStand.java +index 73b92c8a715ce1e9bbbdde7e94a605df76979960..c9a5d3b583076cf8f2f32b12c142beb3f5e22dc0 100644 +--- a/src/main/java/net/minecraft/server/ItemArmorStand.java ++++ b/src/main/java/net/minecraft/server/ItemArmorStand.java +@@ -33,7 +33,7 @@ public class ItemArmorStand extends Item { + return EnumInteractionResult.FAIL; + } + +- worldserver.addAllEntities(entityarmorstand); ++ // Paper - moved down + float f = (float) MathHelper.d((MathHelper.g(itemactioncontext.h() - 180.0F) + 22.5F) / 45.0F) * 45.0F; + + entityarmorstand.setPositionRotation(entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), f, 0.0F); +@@ -43,7 +43,7 @@ public class ItemArmorStand extends Item { + return EnumInteractionResult.FAIL; + } + // CraftBukkit end +- world.addEntity(entityarmorstand); ++ worldserver.addAllEntities(entityarmorstand); // Paper - moved down + world.playSound((EntityHuman) null, entityarmorstand.locX(), entityarmorstand.locY(), entityarmorstand.locZ(), SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); + } + diff --git a/Spigot-Server-Patches/0550-Fix-MC-187716-Use-configured-height.patch b/Spigot-Server-Patches/0550-Fix-MC-187716-Use-configured-height.patch new file mode 100644 index 0000000000..cad3812f33 --- /dev/null +++ b/Spigot-Server-Patches/0550-Fix-MC-187716-Use-configured-height.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +Date: Sat, 15 Aug 2020 08:04:49 -0500 +Subject: [PATCH] Fix MC-187716 Use configured height + + +diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java +index 6677740edb41901d6f8f92b6339e04b4e22cb6b6..dd3511d520cc385e4e89773e12d0e35aae8ecf3d 100644 +--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java ++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNether.java +@@ -29,7 +29,7 @@ public class WorldGenSurfaceNether extends WorldGenSurface<WorldGenSurfaceConfig + IBlockData iblockdata2 = worldgensurfaceconfigurationbase.a(); + IBlockData iblockdata3 = worldgensurfaceconfigurationbase.b(); + +- for (int k2 = 127; k2 >= 0; --k2) { ++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height + blockposition_mutableblockposition.d(k1, k2, l1); + IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition); + +diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java +index 1ff8b4eb10bffb0c33c2ad8d1d490d3da99e72f2..462f0b2baea4207d7d82f2d4e043a5a7999a1f42 100644 +--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java ++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherAbstract.java +@@ -37,7 +37,7 @@ public abstract class WorldGenSurfaceNetherAbstract extends WorldGenSurface<Worl + BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition(); + IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition.d(k1, 128, l1)); + +- for (int k2 = 127; k2 >= 0; --k2) { ++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height + blockposition_mutableblockposition.d(k1, k2, l1); + IBlockData iblockdata5 = ichunkaccess.getType(blockposition_mutableblockposition); + int l2; +diff --git a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java +index c3c31fa356b2cd63db312ec15c5e45320cf6cfbb..4618425bf8c0d90a5399986691b451d2a9311d5a 100644 +--- a/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java ++++ b/src/main/java/net/minecraft/server/WorldGenSurfaceNetherForest.java +@@ -27,7 +27,7 @@ public class WorldGenSurfaceNetherForest extends WorldGenSurface<WorldGenSurface + int j2 = -1; + IBlockData iblockdata2 = worldgensurfaceconfigurationbase.b(); + +- for (int k2 = 127; k2 >= 0; --k2) { ++ for (int k2 = k; k2 >= 0; --k2) { // Paper - fix MC-187716 - use configured height + blockposition_mutableblockposition.d(k1, k2, l1); + IBlockData iblockdata3 = worldgensurfaceconfigurationbase.a(); + IBlockData iblockdata4 = ichunkaccess.getType(blockposition_mutableblockposition); diff --git a/Spigot-Server-Patches/0551-Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch b/Spigot-Server-Patches/0551-Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch new file mode 100644 index 0000000000..b272d14219 --- /dev/null +++ b/Spigot-Server-Patches/0551-Fix-incorrect-return-for-WorldServer-addAllEntitiesS.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +Date: Sat, 15 Aug 2020 09:32:00 -0500 +Subject: [PATCH] Fix incorrect return for WorldServer#addAllEntitiesSafely + + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index a21ce4855187b771b1c8a1ca3f914026d7b92e3a..923efc17beb57688c956026c90aa86299331c8f9 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1236,7 +1236,11 @@ public class WorldServer extends World implements GeneratorAccessSeed { + if (entity.co().anyMatch(this::isUUIDTaken)) { + return false; + } else { +- return this.addAllEntities(entity, reason); // CraftBukkit ++ // Paper start - this method is _only_ designed to return false on duplicate uuids ++ // fixes issues with things such as a plugin cancelling spawn of a /summon ++ this.addAllEntities(entity, reason); // CraftBukkit ++ return true; ++ // Paper end + } + } + diff --git a/Spigot-Server-Patches/0553-Do-not-let-the-server-load-chunks-from-newer-version.patch b/Spigot-Server-Patches/0553-Do-not-let-the-server-load-chunks-from-newer-version.patch index f58f41602a..f6370da53f 100644 --- a/Spigot-Server-Patches/0553-Do-not-let-the-server-load-chunks-from-newer-version.patch +++ b/Spigot-Server-Patches/0553-Do-not-let-the-server-load-chunks-from-newer-version.patch @@ -9,7 +9,7 @@ the game, immediately stop the server to prevent data corruption. You can override this functionality at your own peril. diff --git a/src/main/java/net/minecraft/server/ChunkRegionLoader.java b/src/main/java/net/minecraft/server/ChunkRegionLoader.java -index ac58fcb7985ebe0cfdab6e1400deb37c233ff637..66a39d75394236f5ee745da7ac0b0ac5fe71f911 100644 +index 335bb1dcb7285edabb6c5e7ec6ba4d6d40c60dcb..a0353da423b13ce9be48a0ed194c0182808800d2 100644 --- a/src/main/java/net/minecraft/server/ChunkRegionLoader.java +++ b/src/main/java/net/minecraft/server/ChunkRegionLoader.java @@ -51,10 +51,24 @@ public class ChunkRegionLoader { diff --git a/Spigot-Server-Patches/0554-Brand-support.patch b/Spigot-Server-Patches/0554-Brand-support.patch index 0dacea0bc3..b28a255da1 100644 --- a/Spigot-Server-Patches/0554-Brand-support.patch +++ b/Spigot-Server-Patches/0554-Brand-support.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Brand support diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab..9ec90ad2310b794ccf161a50ad59cccde97a01ba 100644 +index bc613281d18efac7bb926d84ec54653368b93f43..250ae81b8ce99a2470c1fadc74e167586976a704 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -4,6 +4,7 @@ import com.google.common.primitives.Doubles; @@ -25,7 +25,7 @@ index 6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab..9ec90ad2310b794ccf161a50ad59cccd public PlayerConnection(MinecraftServer minecraftserver, NetworkManager networkmanager, EntityPlayer entityplayer) { this.minecraftServer = minecraftserver; this.networkManager = networkmanager; -@@ -2737,6 +2740,8 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2732,6 +2735,8 @@ public class PlayerConnection implements PacketListenerPlayIn { private static final MinecraftKey CUSTOM_REGISTER = new MinecraftKey("register"); private static final MinecraftKey CUSTOM_UNREGISTER = new MinecraftKey("unregister"); @@ -34,7 +34,7 @@ index 6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab..9ec90ad2310b794ccf161a50ad59cccd @Override public void a(PacketPlayInCustomPayload packetplayincustompayload) { PlayerConnectionUtils.ensureMainThread(packetplayincustompayload, this, this.player.getWorldServer()); -@@ -2764,6 +2769,11 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2759,6 +2764,11 @@ public class PlayerConnection implements PacketListenerPlayIn { try { byte[] data = new byte[packetplayincustompayload.data.readableBytes()]; packetplayincustompayload.data.readBytes(data); @@ -46,7 +46,7 @@ index 6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab..9ec90ad2310b794ccf161a50ad59cccd server.getMessenger().dispatchIncomingMessage(player.getBukkitEntity(), packetplayincustompayload.tag.toString(), data); } catch (Exception ex) { PlayerConnection.LOGGER.error("Couldn\'t dispatch custom payload", ex); -@@ -2773,6 +2783,12 @@ public class PlayerConnection implements PacketListenerPlayIn { +@@ -2768,6 +2778,12 @@ public class PlayerConnection implements PacketListenerPlayIn { } @@ -60,10 +60,10 @@ index 6259ff4a571abb842b4a1b15a43b2b7c3fd5f0ab..9ec90ad2310b794ccf161a50ad59cccd return (!this.player.joining && !this.networkManager.isConnected()) || this.processedDisconnect; // Paper } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index adf918fd757fe3147f897de3ade64a9adf1d3203..3ca1cf7e1c39b39e39f38d70ea786c5f0bb1e607 100644 +index 9a812b34698feb7d09f1063a913363b3ea6820eb..c756b2f3faf253420b4d5737389acaa2f38b34ab 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -@@ -2150,6 +2150,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { +@@ -2143,6 +2143,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { // Paper end }; diff --git a/Spigot-Server-Patches/0555-Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch b/Spigot-Server-Patches/0555-Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch new file mode 100644 index 0000000000..df710bbeb7 --- /dev/null +++ b/Spigot-Server-Patches/0555-Fix-MC-99259-Wither-Boss-Bar-doesn-t-update-until-in.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: jmp <[email protected]> +Date: Thu, 20 Aug 2020 19:24:13 -0700 +Subject: [PATCH] Fix MC-99259 Wither Boss Bar doesn't update until + invulnerability period is over + + +diff --git a/src/main/java/net/minecraft/server/EntityWither.java b/src/main/java/net/minecraft/server/EntityWither.java +index 1511212cbfbece279d9f66473bd6b5bc46b9e8e0..29bb74e51e73ab5b1ccc814b6599e0baf4d8094c 100644 +--- a/src/main/java/net/minecraft/server/EntityWither.java ++++ b/src/main/java/net/minecraft/server/EntityWither.java +@@ -343,8 +343,9 @@ public class EntityWither extends EntityMonster implements IRangedEntity { + this.heal(1.0F, EntityRegainHealthEvent.RegainReason.REGEN); // CraftBukkit + } + +- this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); ++ //this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); // Paper - Moved down + } ++ this.bossBattle.setProgress(this.getHealth() / this.getMaxHealth()); // Paper - Fix MC-99259 (Boss bar does not update until Wither invulnerability period ends) + } + + public static boolean c(IBlockData iblockdata) { diff --git a/Spigot-Server-Patches/0556-Fix-MC-197271.patch b/Spigot-Server-Patches/0556-Fix-MC-197271.patch new file mode 100644 index 0000000000..120d8bc0c2 --- /dev/null +++ b/Spigot-Server-Patches/0556-Fix-MC-197271.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: ishland <[email protected]> +Date: Sun, 23 Aug 2020 10:57:44 +0200 +Subject: [PATCH] Fix MC-197271 + +This patch only fixes an issue for servers running OpenJ9. + +diff --git a/src/main/java/net/minecraft/server/RegistryGeneration.java b/src/main/java/net/minecraft/server/RegistryGeneration.java +index 30db8342893e0af3028fbd8766642407cc109a5d..691f256427825a8e6b3eeaf317da2405954bff1d 100644 +--- a/src/main/java/net/minecraft/server/RegistryGeneration.java ++++ b/src/main/java/net/minecraft/server/RegistryGeneration.java +@@ -28,11 +28,11 @@ public class RegistryGeneration { + public static final IRegistry<ProcessorList> g = a(IRegistry.aw, () -> { + return ProcessorLists.b; + }); +- public static final IRegistry<WorldGenFeatureDefinedStructurePoolTemplate> h = a(IRegistry.ax, WorldGenFeaturePieces::a); ++ public static final IRegistry<WorldGenFeatureDefinedStructurePoolTemplate> h = a(IRegistry.ax, () -> WorldGenFeaturePieces.a()); // Paper - MC-197271 + public static final IRegistry<BiomeBase> WORLDGEN_BIOME = a(IRegistry.ay, () -> { + return BiomeRegistry.a; + }); +- public static final IRegistry<GeneratorSettingBase> j = a(IRegistry.ar, GeneratorSettingBase::i); ++ public static final IRegistry<GeneratorSettingBase> j = a(IRegistry.ar, () -> GeneratorSettingBase.i()); // Paper - MC-197271 + + private static <T> IRegistry<T> a(ResourceKey<? extends IRegistry<T>> resourcekey, Supplier<T> supplier) { + return a(resourcekey, Lifecycle.stable(), supplier); +@@ -46,9 +46,9 @@ public class RegistryGeneration { + MinecraftKey minecraftkey = resourcekey.a(); + + RegistryGeneration.k.put(minecraftkey, supplier); +- IRegistryWritable<R> iregistrywritable = RegistryGeneration.l; ++ IRegistryWritable<R> iregistrywritable = (IRegistryWritable<R>) RegistryGeneration.l; // Paper - decompile fix + +- return (IRegistryWritable) iregistrywritable.a(resourcekey, (Object) r0, lifecycle); ++ return (R) iregistrywritable.a((ResourceKey<R>) resourcekey, r0, lifecycle); // Paper - decompile fix + } + + public static <T> T a(IRegistry<? super T> iregistry, String s, T t0) { +@@ -56,11 +56,11 @@ public class RegistryGeneration { + } + + public static <V, T extends V> T a(IRegistry<V> iregistry, MinecraftKey minecraftkey, T t0) { +- return ((IRegistryWritable) iregistry).a(ResourceKey.a(iregistry.f(), minecraftkey), t0, Lifecycle.stable()); ++ return (T) ((IRegistryWritable) iregistry).a(ResourceKey.a(iregistry.f(), minecraftkey), t0, Lifecycle.stable()); // Paper - decompile fix + } + + public static <V, T extends V> T a(IRegistry<V> iregistry, int i, ResourceKey<V> resourcekey, T t0) { +- return ((IRegistryWritable) iregistry).a(i, resourcekey, t0, Lifecycle.stable()); ++ return (T) ((IRegistryWritable) iregistry).a(i, resourcekey, t0, Lifecycle.stable()); // Paper - decompile fix + } + + public static void a() {} diff --git a/Spigot-Server-Patches/0557-MC-197883-Bandaid-decode-issue.patch b/Spigot-Server-Patches/0557-MC-197883-Bandaid-decode-issue.patch new file mode 100644 index 0000000000..fd35ea34e4 --- /dev/null +++ b/Spigot-Server-Patches/0557-MC-197883-Bandaid-decode-issue.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar <[email protected]> +Date: Fri, 21 Aug 2020 21:05:28 -0400 +Subject: [PATCH] MC-197883: Bandaid decode issue + +Mojang has a mix of type and name in the data sets, but you can only +use one. + +This will retry as name if type is asked for and not found. + +diff --git a/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java b/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java +index de7d1e5e0319c65775d932144c268c2d55bb7dc7..bd6a0e1b5454e880a4f2a16be7dc8da64b73e11d 100644 +--- a/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java ++++ b/src/main/java/com/mojang/serialization/codecs/KeyDispatchCodec.java +@@ -48,7 +48,12 @@ public class KeyDispatchCodec<K, V> extends MapCodec<V> { + + @Override + public <T> DataResult<V> decode(final DynamicOps<T> ops, final MapLike<T> input) { +- final T elementName = input.get(typeKey); ++ // Paper start - bandaid MC-197883 ++ T elementName = input.get(typeKey); ++ if (elementName == null && "type".equals(typeKey)) { ++ elementName = input.get("name"); ++ } ++ // Paper end + if (elementName == null) { + return DataResult.error("Input does not contain a key [" + typeKey + "]: " + input); + } diff --git a/Spigot-Server-Patches/0558-Add-setMaxPlayers-API.patch b/Spigot-Server-Patches/0558-Add-setMaxPlayers-API.patch new file mode 100644 index 0000000000..f8fd039b9b --- /dev/null +++ b/Spigot-Server-Patches/0558-Add-setMaxPlayers-API.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Sat, 22 Aug 2020 23:59:30 +0200 +Subject: [PATCH] Add #setMaxPlayers API + + +diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java +index f9eb17cb6eda0b343240240720495751cf605385..33915eeb0229c0739d69b0ee2cb2251c9d99f87a 100644 +--- a/src/main/java/net/minecraft/server/PlayerList.java ++++ b/src/main/java/net/minecraft/server/PlayerList.java +@@ -67,7 +67,7 @@ public abstract class PlayerList { + public final WorldNBTStorage playerFileData; + private boolean hasWhitelist; + private final IRegistryCustom.Dimension s; +- protected final int maxPlayers; ++ protected int maxPlayers; public final void setMaxPlayers(int maxPlayers) { this.maxPlayers = maxPlayers; } // Paper - remove final and add setter + private int viewDistance; + private EnumGamemode u; + private boolean v; +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 7d83cf39ae4b78588a2cb5decccf53edfd448735..5f5b39b3b7e56e935d1f964fbfc3385a65b7e178 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -614,6 +614,13 @@ public final class CraftServer implements Server { + return playerList.getMaxPlayers(); + } + ++ // Paper start ++ @Override ++ public void setMaxPlayers(int maxPlayers) { ++ this.playerList.setMaxPlayers(maxPlayers); ++ } ++ // Paper end ++ + // NOTE: These are dependent on the corresponding call in MinecraftServer + // so if that changes this will need to as well + @Override diff --git a/Spigot-Server-Patches/0559-Don-t-require-FACING-data.patch b/Spigot-Server-Patches/0559-Don-t-require-FACING-data.patch new file mode 100644 index 0000000000..65c8d69860 --- /dev/null +++ b/Spigot-Server-Patches/0559-Don-t-require-FACING-data.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mariell Hoversholm <[email protected]> +Date: Sun, 23 Aug 2020 19:01:04 +0200 +Subject: [PATCH] Don't require FACING data + + +diff --git a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +index ca5eae350b971e93df708a29c426609423645430..40ac372281ba19cb776c14ffc957481367148f27 100644 +--- a/src/main/java/net/minecraft/server/DispenseBehaviorItem.java ++++ b/src/main/java/net/minecraft/server/DispenseBehaviorItem.java +@@ -7,20 +7,22 @@ import org.bukkit.event.block.BlockDispenseEvent; + // CraftBukkit end + + public class DispenseBehaviorItem implements IDispenseBehavior { ++ private EnumDirection enumdirection; // Paper + + public DispenseBehaviorItem() {} + + @Override + public final ItemStack dispense(ISourceBlock isourceblock, ItemStack itemstack) { ++ enumdirection = isourceblock.getBlockData().get(BlockDispenser.FACING); // Paper - cache facing direction + ItemStack itemstack1 = this.a(isourceblock, itemstack); + + this.a(isourceblock); +- this.a(isourceblock, (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING)); ++ this.a(isourceblock, enumdirection); // Paper - cache facing direction + return itemstack1; + } + + protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) { +- EnumDirection enumdirection = (EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING); ++ // Paper - cached enum direction + IPosition iposition = BlockDispenser.a(isourceblock); + ItemStack itemstack1 = itemstack.cloneAndSubtract(1); + diff --git a/Spigot-Server-Patches/0560-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch b/Spigot-Server-Patches/0560-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch new file mode 100644 index 0000000000..72ab8ba130 --- /dev/null +++ b/Spigot-Server-Patches/0560-Fix-SpawnChangeEvent-not-firing-for-all-use-cases.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: William Blake Galbreath <[email protected]> +Date: Sat, 22 Aug 2020 23:36:21 +0200 +Subject: [PATCH] Fix SpawnChangeEvent not firing for all use-cases + + +diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java +index 923efc17beb57688c956026c90aa86299331c8f9..efe10b7f587810749038b67db14af0bf8b9b4374 100644 +--- a/src/main/java/net/minecraft/server/WorldServer.java ++++ b/src/main/java/net/minecraft/server/WorldServer.java +@@ -1841,12 +1841,14 @@ public class WorldServer extends World implements GeneratorAccessSeed { + } + // Paper end + ++ public final void setSpawn(BlockPosition blockposition, float f) { this.a(blockposition, f); } // Paper - OBFHELPER + public void a(BlockPosition blockposition, float f) { + // Paper - configurable spawn radius + BlockPosition prevSpawn = this.getSpawn(); + //ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(new BlockPosition(this.worldData.a(), 0, this.worldData.c())); + + this.worldData.setSpawn(blockposition, f); ++ new org.bukkit.event.world.SpawnChangeEvent(getWorld(), MCUtil.toLocation(this, prevSpawn)).callEvent(); // Paper + if (this.keepSpawnInMemory) { + // if this keepSpawnInMemory is false a plugin has already removed our tickets, do not re-add + this.removeTicketsForSpawn(this.paperConfig.keepLoadedRange, prevSpawn); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 4ab3db10e26dc9739c5afcfc423d1c68a2c4d1c9..3e6924a05bd85563d75f51e4e275896c77d7ad42 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -388,11 +388,13 @@ public class CraftWorld implements World { + public boolean setSpawnLocation(int x, int y, int z, float angle) { + try { + Location previousLocation = getSpawnLocation(); +- world.worldData.setSpawn(new BlockPosition(x, y, z), angle); ++ world.setSpawn(new BlockPosition(x, y, z), angle); // Paper - use WorldServer#setSpawn + ++ // Paper start - move to nms.World + // Notify anyone who's listening. +- SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); +- server.getPluginManager().callEvent(event); ++ // SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); ++ // server.getPluginManager().callEvent(event); ++ // Paper end + + return true; + } catch (Exception e) { diff --git a/Spigot-Server-Patches/0561-Add-moon-phase-API.patch b/Spigot-Server-Patches/0561-Add-moon-phase-API.patch new file mode 100644 index 0000000000..fe747e3407 --- /dev/null +++ b/Spigot-Server-Patches/0561-Add-moon-phase-API.patch @@ -0,0 +1,22 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath <[email protected]> +Date: Sun, 23 Aug 2020 16:32:11 +0200 +Subject: [PATCH] Add moon phase API + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 3e6924a05bd85563d75f51e4e275896c77d7ad42..299f57ca2a65887a0d7e7c584fc1bd5c783b0db2 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -327,6 +327,11 @@ public class CraftWorld implements World { + public int getPlayerCount() { + return world.players.size(); + } ++ ++ @Override ++ public io.papermc.paper.world.MoonPhase getMoonPhase() { ++ return io.papermc.paper.world.MoonPhase.getPhase(getFullTime() / 24000L); ++ } + // Paper end + + private static final Random rand = new Random(); diff --git a/Spigot-Server-Patches/0562-Prevent-headless-pistons-from-being-created.patch b/Spigot-Server-Patches/0562-Prevent-headless-pistons-from-being-created.patch new file mode 100644 index 0000000000..4517ea2bd9 --- /dev/null +++ b/Spigot-Server-Patches/0562-Prevent-headless-pistons-from-being-created.patch @@ -0,0 +1,57 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: commandblockguy <[email protected]> +Date: Fri, 14 Aug 2020 14:44:14 -0500 +Subject: [PATCH] Prevent headless pistons from being created + +Prevent headless pistons from being created by explosions or tree/mushroom growth. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java +index 60f03502a7fd622d2de3b2da9fe8014b289f3d31..9fc12595a566f216620a7fb296d2d30e22332689 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java +@@ -436,6 +436,12 @@ public class PaperConfig { + set("settings.unsupported-settings.allow-tnt-duplication", null); + } + ++ public static boolean allowHeadlessPistons; ++ private static void allowHeadlessPistons() { ++ config.set("settings.unsupported-settings.allow-headless-pistons-readme", "This setting controls if players should be able to create headless pistons."); ++ allowHeadlessPistons = getBoolean("settings.unsupported-settings.allow-headless-pistons", false); ++ } ++ + public static int playerAutoSaveRate = -1; + public static int maxPlayerAutoSavePerTick = 10; + private static void playerAutoSaveRate() { +diff --git a/src/main/java/net/minecraft/server/Explosion.java b/src/main/java/net/minecraft/server/Explosion.java +index 766ec660fa8c59f02a5299c4770cc658fdf4b075..3ecbce7a5a2f125d1495f86c661a96159774d4a4 100644 +--- a/src/main/java/net/minecraft/server/Explosion.java ++++ b/src/main/java/net/minecraft/server/Explosion.java +@@ -135,6 +135,15 @@ public class Explosion { + + if (f > 0.0F && this.l.a(this, this.world, blockposition, iblockdata, f) && blockposition.getY() < 256 && blockposition.getY() >= 0) { // CraftBukkit - don't wrap explosions + set.add(blockposition); ++ // Paper start - prevent headless pistons from forming ++ if (!com.destroystokyo.paper.PaperConfig.allowHeadlessPistons && iblockdata.getBlock() == Blocks.MOVING_PISTON) { ++ TileEntityPiston extension = (TileEntityPiston)this.world.getTileEntity(blockposition); ++ if (extension.isHead()) { ++ EnumDirection direction = iblockdata.get(BlockPistonExtension.FACING); ++ set.add(blockposition.shift(direction.opposite())); ++ } ++ } ++ // Paper end + } + + d4 += d0 * 0.30000001192092896D; +diff --git a/src/main/java/net/minecraft/server/TileEntityPiston.java b/src/main/java/net/minecraft/server/TileEntityPiston.java +index 7d86f0fe55063f6875db9c6f99f4f72ed4144536..b0d52d7405ca24938ca753897f89e6fad575d04d 100644 +--- a/src/main/java/net/minecraft/server/TileEntityPiston.java ++++ b/src/main/java/net/minecraft/server/TileEntityPiston.java +@@ -42,6 +42,8 @@ public class TileEntityPiston extends TileEntity implements ITickable { + return this.b; + } + ++ public final boolean isHead() { return this.h(); } // Paper - OBFHELPER ++ + public boolean h() { + return this.g; + } diff --git a/Spigot-Server-Patches/0563-Brand-support.patch b/Spigot-Server-Patches/0563-Brand-support.patch new file mode 100644 index 0000000000..bc9a522afe --- /dev/null +++ b/Spigot-Server-Patches/0563-Brand-support.patch @@ -0,0 +1,19 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: DigitalRegent <[email protected]> +Date: Sat, 11 Apr 2020 13:10:58 +0200 +Subject: [PATCH] Brand support + + +diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +index c756b2f3faf253420b4d5737389acaa2f38b34ab..b97be51c6859fa2d45c07c853980adb05d11b65f 100644 +--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +@@ -2146,7 +2146,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { + // Paper start - brand support + @Override + public String getClientBrandName() { +- return getHandle().playerConnection.getClientBrandName(); ++ return getHandle().playerConnection != null ? getHandle().playerConnection.getClientBrandName() : null; + } + // Paper end + @@ -27,6 +27,8 @@ gitcmd="git -c commit.gpgsign=false" source "$basedir/scripts/functions.sh" +"$basedir"/scripts/requireDeps.sh || exit 1 + failed=0 case "$1" in "rb" | "rbp" | "rebuild") @@ -63,11 +65,21 @@ case "$1" in cd "$basedir" scripts/build.sh "$basedir" || exit 1 (cd Paper-API ; mvn clean install) || exit 1 + (cd Paper-MojangAPI ; mvn clean install) || exit 1 (cd Paper-Server ; mvn clean package) || exit 1 echo "Paper jar successfully built" ls -la Paper-Server/target/paper*.jar ) || failed=1 ;; + "i" | "install") + ( + set -e + cd "$basedir" + scripts/build.sh "$basedir" || exit 1 + mvn clean install || exit 1 + echo "Paper jar successfully built and installed to local repo" + ) || failed=1 + ;; "pc" | "paperclip") ( set -e diff --git a/Spigot-Server-Patches/0238-Configurable-Bed-Search-Radius.patch b/removed/1.16/0238-Configurable-Bed-Search-Radius.patch index 4e8d577fbd..4e8d577fbd 100644 --- a/Spigot-Server-Patches/0238-Configurable-Bed-Search-Radius.patch +++ b/removed/1.16/0238-Configurable-Bed-Search-Radius.patch diff --git a/scripts/checkoutpr.sh b/scripts/checkoutpr.sh index 3d07227ff6..204fb0ed9f 100755 --- a/scripts/checkoutpr.sh +++ b/scripts/checkoutpr.sh @@ -3,7 +3,7 @@ if [ -z "$1" ]; then echo "$0 <prID>" exit 1; fi -repo=$(git remote get-url origin | sed -E 's/github.com(:|\/)//g') +repo=$(git remote get-url origin | sed -E 's/(.*@)?github.com(:|\/)//g' | sed 's/.git$//g') data=$(curl -q https://api.github.com/repos/$repo/pulls/$1 2>/dev/null) url=$(echo -e "$data" | grep --color=none ssh_url | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g') ref=$(echo -e "$data" | grep --color=none '"head":' -A 3 | grep ref | head -n 1 |awk '{print $2}' | sed 's/"//g' | sed 's/,//g') @@ -16,23 +16,39 @@ git branch -D $branch 2>/dev/null 1>&2 git checkout -b $branch $up/$ref 2>/dev/null|| true echo "Merging $prevbranch into $branch" git fetch origin -git merge origin/$prevbranch - +read -p "Press 'm' to merge, 'r' to rebase, or 'n' for nothing" -n 1 -r >&2 +echo +if [[ "$REPLY" =~ ^[Mm]$ ]]; then + git merge origin/$prevbranch +elif [[ "$REPLY" =~ ^[Rr]$ ]]; then + git rebase master +fi echo "Dropping to new shell, exit to delete the refs" -bash -i +"${SHELL:-bash}" -i read -p "Press 'p' to push. " -n 1 -r >&2 echo -if [[ "d$REPLY" =~ ^d[Pp]$ ]]; then +pushed=0 +if [[ "$REPLY" =~ ^[Pp]$ ]]; then git push $up $branch:$ref -f - + pushed=1 echo "Pushed" >&2 fi echo "Deleting branch/upstream" git checkout $prevbranch +if [[ "$pushed" == "1" ]]; then + read -p "Press 'm' to merge or 'r' to rebase merge " -n 1 -r >&2 + if [[ "$REPLY" =~ ^[Mm]$ ]]; then + git merge $branch + fi + if [[ "$REPLY" =~ ^[Rr]$ ]]; then + git merge --ff-only $branch + fi +fi + git branch -D $branch git remote remove $up git gc #git branch -u $up/$ref $branch -#git checkout $branch
\ No newline at end of file +#git checkout $branch diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 269f68bcd4..ddeef85baa 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -106,6 +106,7 @@ done # dont forget \ at end of each line but last importLibrary com.mojang authlib com/mojang/authlib yggdrasil/YggdrasilGameProfileRepository.java importLibrary com.mojang datafixerupper com/mojang/datafixers/util Either.java +importLibrary com.mojang datafixerupper com/mojang/serialization/codecs KeyDispatchCodec.java ######################################################## ######################################################## diff --git a/scripts/requireDeps.sh b/scripts/requireDeps.sh new file mode 100755 index 0000000000..911460e872 --- /dev/null +++ b/scripts/requireDeps.sh @@ -0,0 +1,28 @@ +#!/bin/sh +set -ue + +# Check if an application is on the PATH. +# If it is not, return with non-zero. +_is_dep_available() { + command -v "$1" >/dev/null || (echo "$1 ${2:-was not found and is a required dependency}"; return 1) +} + +if [ -z "${1:-}" ]; then + # No specific dependency was found; let's just check for all required ones. + _is_dep_available git + _is_dep_available patch + _is_dep_available mvn + + # Ensure we don't have a JAVA_HOME set first. + # Maven should work fine without the JAVA_HOME var as long as the JDK is on the PATH. + if [ -z "${JAVA_HOME:-}" ]; then + _is_dep_available javac "was not found; you can download the JDK from https://adoptopenjdk.net/ or via your package manager" + fi +else + # Require all dependencies provided. + for dep in $@; do + _is_dep_available "$dep" + done +fi + +# vim: set ff=unix autoindent ts=4 sw=4 tw=0 et : diff --git a/work/BuildData b/work/BuildData -Subproject be3371e67489b5a2293306e24420793106baadc +Subproject 2589242ccafbffaeb0a36d16e9f59f97ab3411b diff --git a/work/Bukkit b/work/Bukkit -Subproject eeb1042f1ac356cc989dd1c4e35b37ee0ab9389 +Subproject 29e9b367a4abdf77098b02318c22f24b92a218d diff --git a/work/CraftBukkit b/work/CraftBukkit -Subproject f6227934a3462237f45b494b5d8a71795e998d0 +Subproject bad55dbb5a5268934f3fcfc467bcd44c4042663 diff --git a/work/Spigot b/work/Spigot -Subproject 9639cf78974513349ec5d78f22d27365bebd0d0 +Subproject d65430a1cd93c9158dad04e0a7c21cb4a4d4ba7 |