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
---
+
+
+
### 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
---
+
+
**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
---
+
+
+
### 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
---
+
+
+
### 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 @@
com.destroystokyo.paper
paper-mojangapi
- 1.16.1-R0.1-SNAPSHOT
+ 1.16.2-R0.1-SNAPSHOT
jar
Paper-MojangAPI
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
- spigot-api
+ com.destroystokyo.paper
+ paper-api
- 1.16.1-R0.1-SNAPSHOT
+ 1.16.2-R0.1-SNAPSHOT
jar
- Spigot-API
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 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 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 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 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 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 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 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 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 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 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 {
diff --git a/Spigot-API-Patches/0153-Material-API-additions.patch b/Spigot-API-Patches/0152-Material-API-additions.patch
similarity index 82%
rename from Spigot-API-Patches/0153-Material-API-additions.patch
rename to 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 {
//
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
-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
similarity index 99%
rename from Spigot-API-Patches/0154-Add-Material-Tags.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0155-Allow-setting-the-vex-s-summoner.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0156-Add-LivingEntity-getTargetEntity.patch
rename to 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
similarity index 89%
rename from Spigot-API-Patches/0157-Add-sun-related-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0158-Here-s-Johnny.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0159-Turtle-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0160-Implement-getters-and-setters-for-EntityItem-owner-a.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0161-Add-spectator-target-events.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0162-Add-more-Witch-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0163-Make-the-default-permission-message-configurable.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0164-Support-cancellation-supression-of-EntityDismount-Ve.patch
rename to 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
similarity index 91%
rename from Spigot-API-Patches/0165-Add-more-Zombie-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0166-Change-the-reserved-channel-check-to-be-sensible.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0167-Add-PlayerConnectionCloseEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0168-Add-APIs-to-replace-OfflinePlayer-getLastPlayed.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0169-BlockDestroyEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0170-Add-ItemStack-Recipe-API-helper-methods.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0171-Add-WhitelistToggleEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0172-Annotation-Test-changes.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0173-Entity-getEntitySpawnReason.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0174-Add-GS4-Query-event.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0175-Add-PlayerPostRespawnEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0176-Ignore-package-private-methods-for-nullability-annot.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0177-Flip-some-Spigot-API-null-annotations.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0178-Server-Tick-Events.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0179-PlayerDeathEvent-getItemsToKeep.patch
rename to 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
similarity index 98%
rename from Spigot-API-Patches/0180-Add-Heightmap-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0181-Mob-Spawner-API-Enhancements.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0182-Add-BlockSoundGroup-interface.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0183-Amend-PlayerInteractAtEntityEvent-javadoc-for-ArmorS.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0184-Make-PlayerEvent-public.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0185-Increase-custom-payload-channel-message-size.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0186-Expose-the-internal-current-tick.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0187-PlayerDeathEvent-shouldDropExperience.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0188-Add-effect-to-block-break-naturally.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0189-Add-ThrownEggHatchEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0190-Entity-Jump-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0191-add-hand-to-BlockMultiPlaceEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0192-Add-tick-times-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0193-Expose-MinecraftServer-isRunning.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0194-Disable-Sync-Events-firing-Async-errors-during-shutd.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0195-Make-JavaPluginLoader-thread-safe.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0196-Add-Player-Client-Options-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0197-Add-PlayerAttackEntityCooldownResetEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0198-Fix-Potion-toItemStack-swapping-the-extended-and-upg.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0199-Villager-Restocks-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0200-Expose-game-version.patch
rename to 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
similarity index 76%
rename from Spigot-API-Patches/0201-Add-item-slot-convenience-methods.patch
rename to 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
similarity index 99%
rename from Spigot-API-Patches/0202-Add-Mob-Goal-API.patch
rename to 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_RANDOM_JUMP = GoalKey.of(Slime.class, NamespacedKey.minecraft("slime_random_jump"));
+ GoalKey SPIDER_MELEE_ATTACK = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_melee_attack"));
+ GoalKey SPIDER_NEAREST_ATTACKABLE_TARGET = GoalKey.of(Spider.class, NamespacedKey.minecraft("spider_nearest_attackable_target"));
++ GoalKey STRIDER_GO_TO_LAVA = GoalKey.of(Strider.class, NamespacedKey.minecraft("strider_go_to_lava"));
+ GoalKey SQUID = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid"));
+ GoalKey SQUID_FLEE = GoalKey.of(Squid.class, NamespacedKey.minecraft("squid_flee"));
+ GoalKey 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
similarity index 90%
rename from Spigot-API-Patches/0203-World-view-distance-api.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0204-Add-villager-reputation-API.patch
rename to 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
similarity index 92%
rename from Spigot-API-Patches/0205-Spawn-Reason-API.patch
rename to 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 spawn(@NotNull Location location, @NotNull Class 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
similarity index 93%
rename from Spigot-API-Patches/0206-Potential-bed-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0207-Prioritise-own-classes-where-possible.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0208-Add-Raw-Byte-ItemStack-Serialization.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0209-Provide-a-useful-PluginClassLoader-toString.patch
rename to 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
similarity index 92%
rename from Spigot-API-Patches/0210-Inventory-getHolder-method-without-block-snapshot.patch
rename to 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 {
+@@ -384,6 +384,17 @@ public interface Inventory extends Iterable {
@Nullable
public InventoryHolder getHolder();
diff --git a/Spigot-API-Patches/0211-Expose-Arrow-getItemStack.patch b/Spigot-API-Patches/0210-Expose-Arrow-getItemStack.patch
similarity index 100%
rename from Spigot-API-Patches/0211-Expose-Arrow-getItemStack.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0212-Add-and-implement-PlayerRecipeBookClickEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0213-Support-components-in-ItemMeta.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0214-added-2-new-TargetReasons-for-1.16-mob-behavior.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0215-Add-entity-liquid-API.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0216-Add-PrepareResultEvent-PrepareGrindstoneEvent.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0217-Allow-delegation-to-vanilla-chunk-gen.patch
rename to 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
similarity index 100%
rename from Spigot-API-Patches/0218-Support-hex-colors-in-getLastColors.patch
rename to 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
+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
+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 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
similarity index 100%
rename from Spigot-API-Patches/0219-Brand-support.patch
rename to 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
- spigot
+ paper
jar
- 1.16.1-R0.1-SNAPSHOT
+ 1.16.2-R0.1-SNAPSHOT
- Spigot
- https://www.spigotmc.org/
+ Paper
@@ -27,7 +27,7 @@ index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef5003156
+
UTF-8
unknown
- 1.16.1
+ 1.16.2
@@ -19,16 +18,22 @@
@@ -190,7 +190,7 @@ index db08e98c60084b16ee18455ce014a6ea305f89c5..52834690de9f07c9c4838dbef5003156
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 {
+@@ -468,4 +469,10 @@ public class EntityTypes {
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 resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
+ protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier 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 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 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) 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 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 c = Sets.newHashSet();
-- public static final RegistryBlockID d = new RegistryBlockID<>();
-- protected static final NoiseGenerator3 e = new NoiseGenerator3(new SeededRandom(1234L), ImmutableList.of(0));
-+ public static final RegistryBlockID 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 WorldGenCarverWrapper a(WorldGenCarverAbstract 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 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 a(BlockPosition blockposition, int i, EnumDirection enumdirection, EnumDirection enumdirection1) {
++ public static Iterable 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() {
+ 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()).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))); // 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()).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)));
private static final EnumProtocol[] e = new EnumProtocol[4];
private static final Map>, EnumProtocol> f = Maps.newHashMap();
-@@ -98,7 +98,7 @@ public enum EnumProtocol {
+@@ -98,7 +99,7 @@ public enum EnumProtocol {
private final List>> 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 implements Mailbox {
+ } 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 > String a(IBlockState iblockstate, Comparable> comparable) {
++ private > String a(IBlockState iblockstate, T comparable) { // Paper - decompile error
+ return iblockstate.a(comparable);
+ }
+ };
+@@ -47,11 +47,11 @@ public abstract class IBlockDataHolder {
+ }
+
+ public > S a(IBlockState 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 a(Collection collection, T t0) {
+- Iterator iterator = collection.iterator();
++ Iterator iterator = collection.iterator(); // Paper
+
+ do {
+ if (!iterator.hasNext()) {
+@@ -93,7 +93,7 @@ public abstract class IBlockDataHolder {
+ 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 {
+ 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 {
+ 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 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 List a(Class extends T> oclass, PathfinderTargetCondition pathfindertargetcondition, EntityLiving entityliving, AxisAlignedBB axisalignedbb) {
List list = this.a(oclass, axisalignedbb, (Predicate) null);
List 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 implements Registry {
@@ -633,11 +582,25 @@ index 7f89562e90ede1bdd06b71c0798d986ccbb7886e..4efcb8b595750891b421e524812542f0
}
this.c.set(i, t0);
+@@ -41,6 +41,13 @@ public class RegistryBlockID implements Registry {
+ 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 implements Registry {
+@@ -17,11 +17,18 @@ public class RegistryID implements Registry {
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 implements Registry {
+ return this.c(this.b(k0, this.d(k0)));
+ }
+@@ -55,9 +62,9 @@ public class RegistryID implements Registry {
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> it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next();
++ Object2IntMap.Entry> 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
+@@ -38,13 +38,13 @@ public abstract class StructureGenerator
+ public static final StructureGenerator BASTION_REMNANT = a("Bastion_Remnant", new WorldGenFeatureBastionRemnant(WorldGenFeatureVillageConfiguration.a), WorldGenStage.Decoration.SURFACE_STRUCTURES);
+ public static final List> t = ImmutableList.of(StructureGenerator.PILLAGER_OUTPOST, StructureGenerator.VILLAGE, StructureGenerator.NETHER_FOSSIL);
+ private static final MinecraftKey w = new MinecraftKey("jigsaw");
+- private static final Map 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 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(); // Paper - decompile fix
+ private final Codec>> y;
+
private static > 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 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 b(Iterable iterable, @Nullable T t0) {
Iterator 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 Strategy k() {
@@ -709,7 +701,7 @@ index a1a5460e429356b52a75037c809cec85bd99084a..80ee8d196436e271833503a0e123401d
}
public static CompletableFuture> 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 implements Mailbox, 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 {
+@@ -180,9 +180,9 @@ public class VillagePlace extends RegionFileSection {
}
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 {
+@@ -200,7 +200,7 @@ public class VillagePlace extends RegionFileSection {
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 {
+@@ -252,7 +252,7 @@ public class VillagePlace extends RegionFileSection {
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> a = (Map) SystemUtils.a((Object) Maps.newHashMap(), (hashmap) -> {
+ public static final Map> 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.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.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.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 to ImmutableMap..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.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.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 to ImmutableMap..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 b(Supplier 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 {
@@ -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 {
+@@ -106,6 +106,7 @@ public class BaseBlockPosition implements Comparable {
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 loadedChunkMap = new it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap<>(8192, 0.5f);
++ final Long2ObjectOpenHashMap 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 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 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 {
- return this.bq.height;
+@@ -310,8 +311,8 @@ public class EntityTypes {
+ 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 implements Mailbox void mergeSortedSets(final java.util.function.Consumer consumer, final java.util.Comparator super T> comparator, final java.util.SortedSet...sets) {
-+ final it.unimi.dsi.fastutil.objects.ObjectRBTreeSet all = new it.unimi.dsi.fastutil.objects.ObjectRBTreeSet<>(comparator);
++ final ObjectRBTreeSet 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 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> {
@@ -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> {
+@@ -334,9 +336,9 @@ public class NetworkManager extends SimpleChannelInboundHandler> {
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 {
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 g;
private boolean h;
- private boolean i;
-@@ -133,6 +133,7 @@ public class PacketPlayOutMapChunk implements Packet {
+
+@@ -129,6 +129,7 @@ public class PacketPlayOutMapChunk implements Packet {
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 CHUNK_STATUSES = ChunkStatus.a();
private static final PlayerChunk.State[] CHUNK_STATES = PlayerChunk.State.values();
private final AtomicReferenceArray>> statusFutures;
@@ -3943,16 +3926,16 @@ index dc5e59bcecbe080445f33daa01b81ba747ed6337..ca41e420a1ab22f097dd0b98e156fd51
private CompletableFuture 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> getStatusFutureUnchecked(ChunkStatus chunkstatus) {
CompletableFuture> 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> 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>) 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 implements Registry {
+@@ -64,6 +64,7 @@ public class RegistryBlockID implements Registry {
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 TicketType a(String s, Comparator 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 resourcekey, ResourceKey resourcekey1, DimensionManager dimensionmanager, Supplier supplier, boolean flag, boolean flag1, long i, org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env) {
+ protected World(WorldDataMutable worlddatamutable, ResourceKey resourcekey, final DimensionManager dimensionmanager, Supplier 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 entitiesByUUID = Maps.newHashMap();
private final Queue entitiesToAdd = Queues.newArrayDeque();
private final List 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 it_unimi_dsi_fastutil_objects_object2intmap_entry = (it.unimi.dsi.fastutil.objects.Object2IntMap.Entry) objectiterator.next();
++ Object2IntMap.Entry 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> 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 {
+@@ -253,6 +253,7 @@ public class EntityTypes {
}
}
+ 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 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 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 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 resourcePackRepository;
+ private final ResourcePackRepository resourcePackRepository;
private final ScoreboardServer scoreboardServer;
@Nullable
-@@ -712,6 +712,7 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant= 5000000000L) {
-@@ -1025,14 +1046,12 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant 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 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 d = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.i);
- private static final DataWatcherObject bv = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
+ private static final DataWatcherObject bo = DataWatcher.a(EntityZombie.class, DataWatcherRegistry.b);
public static final DataWatcherObject 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= 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 implements I
+@@ -10,8 +10,8 @@ import javax.annotation.Nullable;
+ public class BlockChest extends BlockChestAbstract implements IBlockWaterlogged {
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
- public static final BlockStateEnum c = BlockProperties.aF;
+- public static final BlockStateEnum c = BlockProperties.aF;
- public static final BlockStateBoolean d = BlockProperties.C;
++ public static final BlockStateEnum c = BlockProperties.aF; public static final BlockStateEnum 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 {
+ return Collections.unmodifiableCollection(this.b.keySet());
+ }
+
++ public > boolean contains(IBlockState iblockstate) { return this.b(iblockstate); } // Paper - OBFHELPER
+ public > boolean b(IBlockState 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= 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 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 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 list = (List) villageplace.b((villageplacetype) -> {
- return villageplacetype == VillagePlaceType.v;
- }, blockposition, searchRadius, VillagePlace.Occupancy.ANY).collect(Collectors.toList()); // CraftBukkit - searchRadius
+ public Optional 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 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 {
@@ -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 blockIds;
-+ final DataPaletteBlock blockIds;
++ final DataPaletteBlock 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 {
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 THE_NETHER = ResourceKey.a(IRegistry.ae, new MinecraftKey("the_nether"));
- public static final ResourceKey THE_END = ResourceKey.a(IRegistry.ae, new MinecraftKey("the_end"));
+ public static final ResourceKey THE_NETHER = ResourceKey.a(IRegistry.L, new MinecraftKey("the_nether"));
+ public static final ResourceKey THE_END = ResourceKey.a(IRegistry.L, new MinecraftKey("the_end"));
private static final EnumDirection[] a = EnumDirection.values();
- public final List tileEntityList = Lists.newArrayList();
+ //public final List tileEntityList = Lists.newArrayList(); // Paper - remove unused list
public final List tileEntityListTick = Lists.newArrayList();
protected final List tileEntityListPending = Lists.newArrayList();
protected final java.util.Set 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.EditableProperty 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> {
@@ -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 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 transaction = new java.util.ArrayList();
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 d = Maps.newHashMap();
-- private final Map e = Maps.newHashMap();
-+ private final Map d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
-+ private final Map e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
- private final Deque f = new java.util.concurrent.LinkedBlockingDeque(); // 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 listeningChannels = Collections.synchronizedList(Lists.newArrayList());
private final List 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
- UUID uuid = EntityHuman.a(new GameProfile((UUID) null, s));
- GameProfile gameprofile = new GameProfile(uuid, s);
+ 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 = 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
+@@ -142,6 +142,7 @@ public abstract class StructureGenerator
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 Collector, ?, Map> 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 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 d = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
-+ private final Map d = new java.util.concurrent.ConcurrentHashMap<>();private final Map nameCache = d; // Paper - OBFHELPER // Paper
- private final Map e = new java.util.concurrent.ConcurrentHashMap<>(); // Paper
- private final Deque