diff options
181 files changed, 919 insertions, 976 deletions
diff --git a/build-data/spigot-server-patches/re-add-asm-dependency.patch b/build-data/spigot-server-patches/re-add-asm-dependency.patch new file mode 100644 index 0000000000..fcf343fa1d --- /dev/null +++ b/build-data/spigot-server-patches/re-add-asm-dependency.patch @@ -0,0 +1,29 @@ +--- /dev/null 2024-01-13 10:03:30.400485704 -0800 ++++ CraftBukkit-Patches/9999-re-add-asm-dependency.patch 2024-01-13 21:41:27.650692678 -0800 +@@ -0,0 +1,26 @@ ++From e5eb4fb3bfb61dfd2dc97411cfab5fa94033b90c Mon Sep 17 00:00:00 2001 ++From: Jake Potrebic <[email protected]> ++Date: Sat, 13 Jan 2024 21:41:02 -0800 ++Subject: [PATCH] re add asm dependency ++ ++ ++diff --git a/pom.xml b/pom.xml ++index 266853a682..d18fdadf92 100644 ++--- a/pom.xml +++++ b/pom.xml ++@@ -58,6 +58,12 @@ ++ <version>2.19.0</version> ++ <scope>compile</scope> ++ </dependency> +++ <dependency> +++ <groupId>org.ow2.asm</groupId> +++ <artifactId>asm</artifactId> +++ <version>9.5</version> +++ <scope>compile</scope> +++ </dependency> ++ <dependency> ++ <groupId>org.ow2.asm</groupId> ++ <artifactId>asm-commons</artifactId> ++-- ++2.43.0 ++ diff --git a/build.gradle.kts b/build.gradle.kts index f3b72af683..ed586bbaf9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -93,6 +93,8 @@ paperweight { mappingsPatch = layout.projectDirectory.file("build-data/mappings-patch.tiny") reobfMappingsPatch = layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny") + spigotServerPatchPatchesDir = layout.projectDirectory.dir("build-data/spigot-server-patches") + reobfPackagesToFix.addAll( "co.aikar.timings", "com.destroystokyo.paper", diff --git a/patches/api/0006-Adventure.patch b/patches/api/0006-Adventure.patch index 64917282ad..7b97eacfe5 100644 --- a/patches/api/0006-Adventure.patch +++ b/patches/api/0006-Adventure.patch @@ -1522,7 +1522,7 @@ index efb97712cc9dc7c1e12a59f5b94e4f2ad7c6b7d8..3024468af4c073324e536c1cb26beffb return warning == null || warning.value(); } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 6e7d5545e0f79d81832ccd5c8405a70d8daa256f..d59acc729ad5af515b8ef4c98a3edeb440854820 100644 +index d453a9753620e23e93e24b0c62bec5515d11dbcc..4c878531d9d8d0aee6832fd10b339a32f219fa9a 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -45,7 +45,7 @@ import org.jetbrains.annotations.Nullable; @@ -4185,10 +4185,10 @@ index e12996492c1558fed9fab30de9f8018e0ed7fac3..002acfbdce1db10f7ba1b6a013e678f5 /** diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index e606f63a284db71663aee667597447b875e20627..6b1c55249b39a45c33ac49bacef4e9d80ba8cc3a 100644 +index 096e0d60c4542fec66898b6aa8ea9820a1ef483b..3e7f92dc0aea0ea555dd02c50a1102da46fe74c4 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -217,4 +217,24 @@ public interface ItemFactory { +@@ -215,4 +215,24 @@ public interface ItemFactory { */ @NotNull ItemStack enchantItem(@NotNull final ItemStack item, final int level, final boolean allowTreasures); diff --git a/patches/api/0018-Add-view-distance-API.patch b/patches/api/0018-Add-view-distance-API.patch index 823558c2f7..692c0e5716 100644 --- a/patches/api/0018-Add-view-distance-API.patch +++ b/patches/api/0018-Add-view-distance-API.patch @@ -8,10 +8,10 @@ Add per player no-tick, tick, and send view distances. Also add send/no-tick view distance to World. diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index d59acc729ad5af515b8ef4c98a3edeb440854820..33f0cecdcd28efd721c58ebf1eb664bb5dba3803 100644 +index 4c878531d9d8d0aee6832fd10b339a32f219fa9a..52977ba7aba446f74bf6befe065f722eaafee0c2 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java -@@ -2869,6 +2869,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -2875,6 +2875,62 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @NotNull public Set<FeatureFlag> getFeatureFlags(); diff --git a/patches/api/0066-Add-getI18NDisplayName-API.patch b/patches/api/0066-Add-getI18NDisplayName-API.patch index ca75771d14..ad040bab77 100644 --- a/patches/api/0066-Add-getI18NDisplayName-API.patch +++ b/patches/api/0066-Add-getI18NDisplayName-API.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 6b1c55249b39a45c33ac49bacef4e9d80ba8cc3a..cccf5d3dfd368c434dcafb0e9319f09a668c7ec2 100644 +index 3e7f92dc0aea0ea555dd02c50a1102da46fe74c4..16131648915ad4065b82905ab7c799e7554cca2d 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -237,4 +237,20 @@ public interface ItemFactory { +@@ -235,4 +235,20 @@ public interface ItemFactory { @NotNull net.kyori.adventure.text.Component displayName(@NotNull ItemStack itemStack); // Paper end - Adventure diff --git a/patches/api/0067-ensureServerConversions-API.patch b/patches/api/0067-ensureServerConversions-API.patch index 75f8c9aded..7931718810 100644 --- a/patches/api/0067-ensureServerConversions-API.patch +++ b/patches/api/0067-ensureServerConversions-API.patch @@ -7,10 +7,10 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index cccf5d3dfd368c434dcafb0e9319f09a668c7ec2..246b58f52e914c45f357240b155c826b1d40b202 100644 +index 16131648915ad4065b82905ab7c799e7554cca2d..a3d40ca984202a5fec0cfcc97266f32408c37638 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -253,4 +253,18 @@ public interface ItemFactory { +@@ -251,4 +251,18 @@ public interface ItemFactory { @Deprecated String getI18NDisplayName(@Nullable ItemStack item); // Paper end - add getI18NDisplayName diff --git a/patches/api/0162-Support-cancellation-supression-of-EntityDismount-Ve.patch b/patches/api/0162-Support-cancellation-supression-of-EntityDismount-Ve.patch index 6eec419672..b600b869ba 100644 --- a/patches/api/0162-Support-cancellation-supression-of-EntityDismount-Ve.patch +++ b/patches/api/0162-Support-cancellation-supression-of-EntityDismount-Ve.patch @@ -20,6 +20,48 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! +diff --git a/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java b/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java +index 00c3f50532392455070ae77ee4ad77cbf8d8827c..91188d77ff350aef20c3bde2bd27a8096825f337 100644 +--- a/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java ++++ b/src/main/java/org/bukkit/event/entity/EntityDismountEvent.java +@@ -13,10 +13,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { + private static final HandlerList handlers = new HandlerList(); + private boolean cancelled; + private final Entity dismounted; ++ private final boolean isCancellable; // Paper + + public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted) { ++ // Paper start ++ this(what, dismounted, true); ++ } ++ ++ public EntityDismountEvent(@NotNull Entity what, @NotNull Entity dismounted, boolean isCancellable) { ++ // Paper end + super(what); + this.dismounted = dismounted; ++ this.isCancellable = isCancellable; // Paper + } + + /** +@@ -36,9 +44,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { + + @Override + public void setCancelled(boolean cancel) { ++ // Paper start ++ if (cancel && !this.isCancellable) { ++ return; ++ } + this.cancelled = cancel; + } + ++ public boolean isCancellable() { ++ return this.isCancellable; ++ // Paper end ++ } ++ + @NotNull + @Override + public HandlerList getHandlers() { diff --git a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java b/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java index 963b9ead4ca0426b2e95c5641b0e89317c48853d..39f6afd2f9cbcff6a74a91a21dcc3e29d2497dd8 100644 --- a/src/main/java/org/bukkit/event/vehicle/VehicleExitEvent.java @@ -64,10 +106,10 @@ index 963b9ead4ca0426b2e95c5641b0e89317c48853d..39f6afd2f9cbcff6a74a91a21dcc3e29 @Override public HandlerList getHandlers() { diff --git a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -index 00d8ec81b4ae6ca5e438161ec9135e3c1edea6f4..a7632c8f5cb1bce4be0e456ec34f4a69c5ce80f3 100644 +index be9560ffaa2d136ff1b5cd944baa678c1a938533..6533d1e0c5cb23e4a5e2831a56c5dbebe2d20f76 100644 --- a/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java +++ b/src/main/java/org/spigotmc/event/entity/EntityDismountEvent.java -@@ -14,10 +14,19 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { +@@ -21,10 +21,19 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { private static final HandlerList handlers = new HandlerList(); private boolean cancelled; private final Entity dismounted; @@ -88,7 +130,7 @@ index 00d8ec81b4ae6ca5e438161ec9135e3c1edea6f4..a7632c8f5cb1bce4be0e456ec34f4a69 } @NotNull -@@ -32,9 +41,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { +@@ -39,9 +48,18 @@ public class EntityDismountEvent extends EntityEvent implements Cancellable { @Override public void setCancelled(boolean cancel) { diff --git a/patches/api/0167-Add-ItemStack-Recipe-API-helper-methods.patch b/patches/api/0167-Add-ItemStack-Recipe-API-helper-methods.patch index d01ff8e6d9..61a45e967f 100644 --- a/patches/api/0167-Add-ItemStack-Recipe-API-helper-methods.patch +++ b/patches/api/0167-Add-ItemStack-Recipe-API-helper-methods.patch @@ -9,13 +9,13 @@ Redirects some of upstream's APIs to these new methods to avoid usage of magic values and the deprecated RecipeChoice#getItemStack diff --git a/src/main/java/org/bukkit/inventory/RecipeChoice.java b/src/main/java/org/bukkit/inventory/RecipeChoice.java -index 90208bc96085f05a3b657b9467b1670d00b03104..523818cbb0d6c90481ec97123e7fe0e2ff4eea14 100644 +index 6734bc9d7a6eee8ee40419ae3fe245b67eabaca6..db8bcc66bdc4bedfffb4705db6338eda4c0ad29a 100644 --- a/src/main/java/org/bukkit/inventory/RecipeChoice.java +++ b/src/main/java/org/bukkit/inventory/RecipeChoice.java @@ -146,8 +146,6 @@ public interface RecipeChoice extends Predicate<ItemStack>, Cloneable { /** - * Represents a choice that will be valid only one of the stacks is exactly - * matched (aside from stack size). + * Represents a choice that will be valid only if one of the stacks is + * exactly matched (aside from stack size). - * <br> - * <b>Only valid for shaped recipes</b> */ diff --git a/patches/api/0173-Fix-Spigot-annotation-mistakes.patch b/patches/api/0173-Fix-Spigot-annotation-mistakes.patch index b85950c0d4..1ca860f01a 100644 --- a/patches/api/0173-Fix-Spigot-annotation-mistakes.patch +++ b/patches/api/0173-Fix-Spigot-annotation-mistakes.patch @@ -600,7 +600,7 @@ index e455eb21abf121dc6ff10ff8a13dd06f67096a8f..bbc01e7c192ae6689c301670047ff114 return origin; } diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java -index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80cf047a75 100644 +index b13f6d4ae42c981b051c6ef81b0f572039faded4..59a52583f433859b0a12a44c53970db87cde08aa 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -416,9 +416,8 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient @@ -622,31 +622,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80 public class Spigot { /** -@@ -3712,8 +3712,12 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - * @param loc The location to strike lightning - * @param isSilent Whether this strike makes no sound - * @return The lightning entity. -+ * @deprecated The lightning strike sound has been moved into the client and -+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead -+ * for a consistent behavior. - */ - @NotNull -+ @Deprecated // Paper - public LightningStrike strikeLightning(@NotNull Location loc, boolean isSilent) { - throw new UnsupportedOperationException("Not supported yet."); - } -@@ -3724,14 +3728,22 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient - * @param loc The location to strike lightning - * @param isSilent Whether this strike makes no sound - * @return The lightning entity. -+ * @deprecated The lightning strike sound has been moved into the client and -+ * this doesn't prevent the sound being played. Use the regular (non spigot) methods instead -+ * for a consistent behavior. - */ - @NotNull -+ @Deprecated // Paper - public LightningStrike strikeLightningEffect(@NotNull Location loc, boolean isSilent) { - throw new UnsupportedOperationException("Not supported yet."); +@@ -3737,7 +3737,11 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient } } @@ -658,7 +634,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80 Spigot spigot(); // Spigot end -@@ -3918,9 +3930,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -3924,9 +3928,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * Gets the dimension ID of this environment * * @return dimension ID @@ -670,7 +646,7 @@ index 313602704694c85bbac96b68deab67cd25f9913c..44ed5e72f17f156c9cf270fee31a9b80 public int getId() { return id; } -@@ -3930,9 +3942,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient +@@ -3936,9 +3940,9 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient * * @param id The ID of the environment * @return The environment @@ -802,10 +778,10 @@ index e3f440c9d9ce3b5710ed1b7f71522899fb98459f..a4578c520aa1078a741aac4b12fe89bf @Nullable public static EntityType fromName(@Nullable String name) { diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java -index c49628f2638da68e1ec126e53c8b7c74b0d81b22..8dc433baba7060df5cfe6fc10210a5a27287987d 100644 +index b27447d7a2833f84cf05946c851f5b6740a578e3..5afeb2f6c82e8f752229462c2d7846f6ae7a4b44 100644 --- a/src/main/java/org/bukkit/entity/LightningStrike.java +++ b/src/main/java/org/bukkit/entity/LightningStrike.java -@@ -84,20 +84,31 @@ public interface LightningStrike extends Entity { +@@ -84,6 +84,10 @@ public interface LightningStrike extends Entity { public void setCausingPlayer(@Nullable Player player); // Spigot start @@ -815,17 +791,8 @@ index c49628f2638da68e1ec126e53c8b7c74b0d81b22..8dc433baba7060df5cfe6fc10210a5a2 + @Deprecated // Paper public class Spigot extends Entity.Spigot { -- /* -+ /** - * Returns whether the strike is silent. - * - * @return whether the strike is silent. -+ * @deprecated The lightning strike sound has been moved into the client and -+ * this can't predict if the sound will be played or not accurately. - */ -+ @Deprecated // Paper - public boolean isSilent() { - throw new UnsupportedOperationException("Not supported yet."); + /** +@@ -98,8 +102,12 @@ public interface LightningStrike extends Entity { } } @@ -1410,7 +1377,7 @@ index 002acfbdce1db10f7ba1b6a013e678f504ac6e69..8d14426eb1ebea27058d5f22ea652f22 return getPlayer().getItemOnCursor(); } diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 246b58f52e914c45f357240b155c826b1d40b202..53457348eaf2e1ef2e844eae87ac94f701525c92 100644 +index a3d40ca984202a5fec0cfcc97266f32408c37638..6aeae6b78106b8fd434614591adb5ead41dec8e1 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -30,7 +30,7 @@ public interface ItemFactory { diff --git a/patches/api/0213-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/api/0213-Create-HoverEvent-from-ItemStack-Entity.patch index 6c5c79f039..2ed2600f9a 100644 --- a/patches/api/0213-Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/api/0213-Create-HoverEvent-from-ItemStack-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 53457348eaf2e1ef2e844eae87ac94f701525c92..8c248dac47464757e013c25393fe9bf604ded7c2 100644 +index 6aeae6b78106b8fd434614591adb5ead41dec8e1..198eebd45a2efa6986a8f4b613424eb8b6d3a039 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java -@@ -267,4 +267,65 @@ public interface ItemFactory { +@@ -265,4 +265,65 @@ public interface ItemFactory { @NotNull ItemStack ensureServerConversions(@NotNull ItemStack item); // Paper end - ensure server conversions API diff --git a/patches/api/0227-More-lightning-API.patch b/patches/api/0227-More-lightning-API.patch index 4197f480bf..c4924dcdf2 100644 --- a/patches/api/0227-More-lightning-API.patch +++ b/patches/api/0227-More-lightning-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More lightning API diff --git a/src/main/java/org/bukkit/entity/LightningStrike.java b/src/main/java/org/bukkit/entity/LightningStrike.java -index 8dc433baba7060df5cfe6fc10210a5a27287987d..0b9e02bb88a1b1fe7378c11f1cca9c93b183f814 100644 +index 5afeb2f6c82e8f752229462c2d7846f6ae7a4b44..924ee7fcc3f87eb8553ef473a7d9671f0f469dd1 100644 --- a/src/main/java/org/bukkit/entity/LightningStrike.java +++ b/src/main/java/org/bukkit/entity/LightningStrike.java @@ -22,7 +22,9 @@ public interface LightningStrike extends Entity { @@ -28,7 +28,7 @@ index 8dc433baba7060df5cfe6fc10210a5a27287987d..0b9e02bb88a1b1fe7378c11f1cca9c93 public void setFlashes(int flashes); /** -@@ -111,4 +115,42 @@ public interface LightningStrike extends Entity { +@@ -110,4 +114,42 @@ public interface LightningStrike extends Entity { @Deprecated // Paper Spigot spigot(); // Spigot end diff --git a/patches/api/0355-Add-enchantWithLevels-API.patch b/patches/api/0355-Add-enchantWithLevels-API.patch index af548612d5..8f20c5121e 100644 --- a/patches/api/0355-Add-enchantWithLevels-API.patch +++ b/patches/api/0355-Add-enchantWithLevels-API.patch @@ -7,13 +7,13 @@ Deprecate upstream's newer and poorly implemented similar API. diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java -index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b6060ca75 100644 +index 198eebd45a2efa6986a8f4b613424eb8b6d3a039..f680545b6b59bf8d2ad154b0472dda4cba42a162 100644 --- a/src/main/java/org/bukkit/inventory/ItemFactory.java +++ b/src/main/java/org/bukkit/inventory/ItemFactory.java @@ -185,8 +185,11 @@ public interface ItemFactory { * @param level the level to use, which is the level in the enchantment table * @param allowTreasures allows treasure enchants, e.g. mending, if true. - * @return the modified ItemStack, or a copy if the ItemStack cannot be enchanted directly + * @return a new ItemStack containing the result of the Enchantment + * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly + * designed and was originally broken. */ @@ -22,10 +22,10 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b ItemStack enchantItem(@NotNull final Entity entity, @NotNull final ItemStack item, final int level, final boolean allowTreasures); /** -@@ -200,8 +203,11 @@ public interface ItemFactory { +@@ -199,8 +202,11 @@ public interface ItemFactory { + * @param level the level to use, which is the level in the enchantment table * @param allowTreasures allow the treasure enchants, e.g. mending, if true. - * @return the modified ItemStack, or a copy if the ItemStack cannot be - * enchanted directly + * @return a new ItemStack containing the result of the Enchantment + * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly + * designed and was originally broken. */ @@ -34,10 +34,10 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b ItemStack enchantItem(@NotNull final World world, @NotNull final ItemStack item, final int level, final boolean allowTreasures); /** -@@ -214,8 +220,11 @@ public interface ItemFactory { +@@ -212,8 +218,11 @@ public interface ItemFactory { + * @param level the level to use, which is the level in the enchantment table * @param allowTreasures allow treasure enchantments, e.g. mending, if true. - * @return the modified ItemStack, or a copy if the ItemStack cannot be - * enchanted directly + * @return a new ItemStack containing the result of the Enchantment + * @deprecated use {@link #enchantWithLevels(ItemStack, int, boolean, java.util.Random)}. This method's implementation is poorly + * designed and was originally broken. */ @@ -46,7 +46,7 @@ index 8c248dac47464757e013c25393fe9bf604ded7c2..0217f98a74140bbae454d467de27c12b ItemStack enchantItem(@NotNull final ItemStack item, final int level, final boolean allowTreasures); // Paper start - Adventure -@@ -328,4 +337,22 @@ public interface ItemFactory { +@@ -326,4 +335,22 @@ public interface ItemFactory { @Deprecated net.md_5.bungee.api.chat.hover.content.Content hoverContentOf(@NotNull org.bukkit.entity.Entity entity, @NotNull net.md_5.bungee.api.chat.BaseComponent[] customName); // Paper end - bungee hover events diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index a7d8619191..1b657abc0b 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -28,7 +28,7 @@ index 37dab9e868dbfb019c271a547d975a48ad1cb571..3811c0d849a3eb028ed1a6b7a2d4747f +/.factorypath diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..700ec4dda905cee41ae3fe2a420d8c6db64a13e8 +index 0000000000000000000000000000000000000000..09bffd973b184c40cce29d81430700ee4065555f --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,140 @@ @@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..700ec4dda905cee41ae3fe2a420d8c6d + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") { + exclude(group = "org.apache.logging.log4j", module = "log4j-api") + } -+ implementation("org.ow2.asm:asm:9.5") ++ implementation("org.ow2.asm:asm-commons:9.5") + implementation("commons-lang:commons-lang:2.6") + runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") + runtimeOnly("com.mysql:mysql-connector-j:8.2.0") @@ -174,10 +174,10 @@ index 0000000000000000000000000000000000000000..700ec4dda905cee41ae3fe2a420d8c6d +} diff --git a/pom.xml b/pom.xml deleted file mode 100644 -index 123a4526359c53823898b743d9233c22ce6a8989..0000000000000000000000000000000000000000 +index d18fdadf925df41f04941dcc7eecdd3cadf5364a..0000000000000000000000000000000000000000 --- a/pom.xml +++ /dev/null -@@ -1,602 +0,0 @@ +@@ -1,608 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> @@ -244,6 +244,12 @@ index 123a4526359c53823898b743d9233c22ce6a8989..00000000000000000000000000000000 - <version>9.5</version> - <scope>compile</scope> - </dependency> +- <dependency> +- <groupId>org.ow2.asm</groupId> +- <artifactId>asm-commons</artifactId> +- <version>9.5</version> +- <scope>compile</scope> +- </dependency> - <!-- Mojang depends --> - <dependency> - <groupId>com.github.oshi</groupId> diff --git a/patches/server/0003-Build-system-changes.patch b/patches/server/0003-Build-system-changes.patch index 87bae9ad99..facc352dca 100644 --- a/patches/server/0003-Build-system-changes.patch +++ b/patches/server/0003-Build-system-changes.patch @@ -9,10 +9,10 @@ public net.minecraft.server.packs.VanillaPackResourcesBuilder safeGetPath(Ljava/ Co-authored-by: Jake Potrebic <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627bddb0b2b1 100644 +index 09bffd973b184c40cce29d81430700ee4065555f..e7fa464573909d4c3d649ebb5f40ef54055e09a8 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -9,10 +9,9 @@ plugins { +@@ -9,9 +9,7 @@ plugins { dependencies { implementation(project(":paper-api")) implementation("jline:jline:2.12.1") @@ -20,12 +20,10 @@ index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627b - exclude(group = "org.apache.logging.log4j", module = "log4j-api") - } + implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.5") -+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm-commons:9.5") implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") - runtimeOnly("com.mysql:mysql-connector-j:8.2.0") -@@ -35,6 +34,7 @@ tasks.jar { +@@ -35,6 +33,7 @@ tasks.jar { val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim() val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\"" val date = git("show", "-s", "--format=%ci", gitHash).getText().trim() // Paper @@ -33,7 +31,7 @@ index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627b attributes( "Main-Class" to "org.bukkit.craftbukkit.Main", "Implementation-Title" to "CraftBukkit", -@@ -43,6 +43,9 @@ tasks.jar { +@@ -43,6 +42,9 @@ tasks.jar { "Specification-Title" to "Bukkit", "Specification-Version" to project.version, "Specification-Vendor" to "Bukkit Team", @@ -43,7 +41,7 @@ index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627b ) for (tld in setOf("net", "com", "org")) { attributes("$tld/bukkit", "Sealed" to true) -@@ -50,6 +53,11 @@ tasks.jar { +@@ -50,6 +52,11 @@ tasks.jar { } } @@ -55,7 +53,7 @@ index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627b publishing { publications.create<MavenPublication>("maven") { artifact(tasks.shadowJar) -@@ -76,6 +84,17 @@ tasks.shadowJar { +@@ -76,6 +83,17 @@ tasks.shadowJar { } } @@ -73,7 +71,7 @@ index 700ec4dda905cee41ae3fe2a420d8c6db64a13e8..14eae4cf079a384691c72c2f70ba627b tasks.test { exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") useJUnitPlatform() -@@ -134,7 +153,14 @@ tasks.registerRunTask("runReobf") { +@@ -134,7 +152,14 @@ tasks.registerRunTask("runReobf") { classpath(runtimeClasspathWithoutVanillaServer) } diff --git a/patches/server/0004-Test-changes.patch b/patches/server/0004-Test-changes.patch index 53e097733f..f236e6220f 100644 --- a/patches/server/0004-Test-changes.patch +++ b/patches/server/0004-Test-changes.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Test changes diff --git a/build.gradle.kts b/build.gradle.kts -index f83cda5b820ebb3dcbc3a39059579ba9487586e8..ef91080dc7123677190839b057c3458c4d5b9f32 100644 +index e7fa464573909d4c3d649ebb5f40ef54055e09a8..2df1cae62cff433a7f3f55f561f70719bb6a745b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -58,6 +58,12 @@ tasks.compileJava { +@@ -57,6 +57,12 @@ tasks.compileJava { options.setIncremental(false) } diff --git a/patches/server/0005-Paper-config-files.patch b/patches/server/0005-Paper-config-files.patch index 8106551cac..d94619106b 100644 --- a/patches/server/0005-Paper-config-files.patch +++ b/patches/server/0005-Paper-config-files.patch @@ -15,13 +15,13 @@ public net.minecraft.server.dedicated.DedicatedServerProperties reload(Lnet/mine public net.minecraft.world.level.NaturalSpawner SPAWNING_CATEGORIES diff --git a/build.gradle.kts b/build.gradle.kts -index 6049006d0676838a3330903e587c35643caa7caf..89064b339ce27a09ad546c62a36459534d138c29 100644 +index 2df1cae62cff433a7f3f55f561f70719bb6a745b..65e9d5918d46b123fb4f8122344a7d3863aec758 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -12,6 +12,7 @@ dependencies { +@@ -11,6 +11,7 @@ dependencies { + implementation("jline:jline:2.12.1") implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.5") - implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation + implementation("org.ow2.asm:asm-commons:9.5") + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") @@ -4838,7 +4838,7 @@ index 6b0a1ff870e013a83f7922021ab296bb1c716079..403c57fc683bb0497602e1a9ec7b81b2 String s = (String) Optional.ofNullable((String) optionset.valueOf("world")).orElse(dedicatedserversettings.getProperties().levelName); LevelStorageSource convertable = LevelStorageSource.createDefault(file.toPath()); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8cc3fd73eaa41b87c63cf26e299affca16f20d87..7193029f1f8b5db7d94306e7dd07c5053795533c 100644 +index dafeae664880f6da2f1aa0d9b4fbd743ed9b5572..15bdddae68db770690ddfcb19c7ecdbedbfa8cb7 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -295,6 +295,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -4964,7 +4964,7 @@ index 8487fa452e4009c0f2a23a0d4eac4bf56f91447b..00ddf94c5bade8c0c486337ce920f59d this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0656c3f599bd92f8e5ba13495c46614a2eab6c73..468f4bb6d65a1608782e11fd91462ac50778ae3f 100644 +index 8318b4a56b4a0235a00caba9df4ba41c85eb13bc..b5256eefb64808ae15bd622a8eccbe13454b4564 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -915,6 +915,7 @@ public final class CraftServer implements Server { @@ -5000,7 +5000,7 @@ index a7921cde2b6275d730879b2814cc5f430520b051..686d6376322dab126393198da87e0282 }; diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index 32feb7c02cff0d54384317f11b75be46dea337c4..d10b1d3a134e11fa8417fa3c845f088d8fc1f71c 100644 +index 6b778bed6d61f941c839dec01b8733a9b1fbefec..df29015e3d5ca49297fe87090fd6446962e59adb 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -96,7 +96,7 @@ public class SpigotConfig diff --git a/patches/server/0006-MC-Dev-fixes.patch b/patches/server/0006-MC-Dev-fixes.patch index c4892651d5..8e5eb9dca7 100644 --- a/patches/server/0006-MC-Dev-fixes.patch +++ b/patches/server/0006-MC-Dev-fixes.patch @@ -103,10 +103,10 @@ index 279df2598c54e5b035c2945c59812baf1f97356b..e1bddbbdbeea79115d0f987065c34e0f }; } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index afd39623d2c2e9270510a6a83b5918392442744d..21e84dfd9ee3f8ce6234581ec31c64c35021d3c8 100644 +index 15bdddae68db770690ddfcb19c7ecdbedbfa8cb7..650bf3483414751fbda7bff584af55df49cef22d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1876,7 +1876,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1863,7 +1863,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa PackRepository resourcepackrepository = this.packRepository; Objects.requireNonNull(this.packRepository); diff --git a/patches/server/0008-CB-fixes.patch b/patches/server/0008-CB-fixes.patch index fc96fcbefb..6d761eda94 100644 --- a/patches/server/0008-CB-fixes.patch +++ b/patches/server/0008-CB-fixes.patch @@ -17,7 +17,7 @@ Subject: [PATCH] CB fixes Co-authored-by: Spottedleaf <[email protected]> diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 92cb1c23f2ef95f9be6c688146ee81aae5ac101c..9cf839be15126444d4d2ffdb7faa637859941d6b 100644 +index 674c996af91de91ee6302cc67334b836ea4fa4de..93867b8883c6f5d5086e8fdc153e6d7c1e5d9fec 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -296,7 +296,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -84,10 +84,10 @@ index 809fdf2da78293391aa5c60c04f4ad652b152eec..955b0abd4019fc45df84719eee6bf413 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 468f4bb6d65a1608782e11fd91462ac50778ae3f..0a39f95c77f0a2015200bb95b17eee9cbe95c416 100644 +index b5256eefb64808ae15bd622a8eccbe13454b4564..82d5c749a70f7a808c073263e861e09913c529d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2455,7 +2455,13 @@ public final class CraftServer implements Server { +@@ -2454,7 +2454,13 @@ public final class CraftServer implements Server { Preconditions.checkArgument(key != null, "NamespacedKey key cannot be null"); LootDataManager registry = this.getServer().getLootData(); diff --git a/patches/server/0009-MC-Utils.patch b/patches/server/0009-MC-Utils.patch index 555936c837..e7930bb85b 100644 --- a/patches/server/0009-MC-Utils.patch +++ b/patches/server/0009-MC-Utils.patch @@ -6051,7 +6051,7 @@ index 44cac39893eb968aa8ea21ee571c0dcb866ce06c..5151d68ba6ec72a7124f298253c5f0af + } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fb9f70b08e96ba4de52dca717ee245c405bf06e5..d4fb6d031acbb009fcb600718a16ac0b5437d88e 100644 +index 650bf3483414751fbda7bff584af55df49cef22d..0c77b4b201f6586b4d143ce2c3e710bf9d276a20 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -296,6 +296,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -6080,7 +6080,7 @@ index fb9f70b08e96ba4de52dca717ee245c405bf06e5..d4fb6d031acbb009fcb600718a16ac0b if ( tickCount++ % MinecraftServer.SAMPLE_INTERVAL == 0 ) { long curTime = Util.getMillis(); -@@ -1264,7 +1269,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1258,7 +1263,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftServer.LOGGER.debug("Autosave finished"); SpigotTimings.worldSaveTimer.stopTiming(); // Spigot } @@ -6089,7 +6089,7 @@ index fb9f70b08e96ba4de52dca717ee245c405bf06e5..d4fb6d031acbb009fcb600718a16ac0b this.profiler.push("tallying"); long j = Util.getNanos() - i; int k = this.tickCount % 100; -@@ -1388,6 +1393,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1382,6 +1387,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa try { worldserver.timings.doTick.startTiming(); // Spigot worldserver.tick(shouldKeepTicking); @@ -6100,7 +6100,7 @@ index fb9f70b08e96ba4de52dca717ee245c405bf06e5..d4fb6d031acbb009fcb600718a16ac0b + // Paper end worldserver.timings.doTick.stopTiming(); // Spigot } catch (Throwable throwable) { - // Spigot Start + CrashReport crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java index 1641bdf8725df778ba91bf5cd22c1ebbb3745058..facfdbb87e89f4db33ce13233c2ba4366d35c15b 100644 --- a/src/main/java/net/minecraft/server/level/ChunkHolder.java @@ -7160,10 +7160,10 @@ index 337e0a7b3c14e1b1a28744920e0dc0a69e0c5a87..f5829ae484d93b547a5437b85a962134 @Override public void tell(R runnable) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 06d015dd8b14008f3fe2fae5005a4d41be26346b..d0f1cd32aa71f275c9975d1cedc8895fb2e8a174 100644 +index 8957b7082f310b2b8aed5f5a68847d6dc773177a..a1f658f4dafd47de0020d96667b090aa88c69f9c 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -328,6 +328,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -330,6 +330,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.level.hasChunk((int) Math.floor(this.getX()) >> 4, (int) Math.floor(this.getZ()) >> 4); } // CraftBukkit end @@ -7795,7 +7795,7 @@ index 98836000cbca2a21649cb8f2a466986373405ea1..bbbf6dd8e566ecdca8794e3b03765fe7 return false; } else { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e124f481304bf65eb5b110db41005fa0cb69d835..8bc43dde03f461d9f7470c521f47e959d07cde67 100644 +index 16785a8dab5a2e786e17db049c027ed1c13f5ef6..9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -245,8 +245,8 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -7818,7 +7818,7 @@ index e124f481304bf65eb5b110db41005fa0cb69d835..8bc43dde03f461d9f7470c521f47e959 if (playerChunk == null) return false; playerChunk.getTickingChunkFuture().thenAccept(either -> { -@@ -2027,4 +2027,32 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2018,4 +2018,32 @@ public class CraftWorld extends CraftRegionAccessor implements World { return this.spigot; } // Spigot end @@ -7894,7 +7894,7 @@ index 70165d287156f46b793eb23dd30b601289c0ffb1..758bf988432bb34aad9386e3f4e8bba6 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 1938288a019cd0815bf944868ee4b9a345703b4e..7278ac809eff364e8b838d63a2ec1291493869f8 100644 +index 97c8723d19233fb0a12e446594b18c50f34f11f1..cba729914a3adaee2507e2916a4cfb585869746d 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -23,6 +23,16 @@ import org.bukkit.material.MaterialData; @@ -8276,7 +8276,7 @@ index 96c4f7aed548a181f6b1487e58dcf157bae52daa..837e3d6ee71566b5a6f37a4943829133 public void clear() { // Create new array to reset memory usage to initial capacity diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index d10b1d3a134e11fa8417fa3c845f088d8fc1f71c..1d066ce7dcf5f548c2a34d308d4422ab4fd02e5a 100644 +index df29015e3d5ca49297fe87090fd6446962e59adb..e6e070db9a6ee78e65dbff6f18cb5c8784202b9f 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -118,7 +118,11 @@ public class SpigotConfig diff --git a/patches/server/0010-Adventure.patch b/patches/server/0010-Adventure.patch index 59f6755727..93b956b36b 100644 --- a/patches/server/0010-Adventure.patch +++ b/patches/server/0010-Adventure.patch @@ -2648,7 +2648,7 @@ index a5578cbce2d1d39ba3315e53425d5323e6823a65..7a036c08fa67504d06c8f72a32c22814 @Override diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index d4fb6d031acbb009fcb600718a16ac0b5437d88e..47f01de166a4048824f3075deb596084b7d42978 100644 +index 0c77b4b201f6586b4d143ce2c3e710bf9d276a20..3691fd58c7baf98b15c50fa4dacf3a35f4f9b4b8 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -191,6 +191,7 @@ import org.bukkit.craftbukkit.SpigotTimings; // Spigot @@ -2669,7 +2669,7 @@ index d4fb6d031acbb009fcb600718a16ac0b5437d88e..47f01de166a4048824f3075deb596084 private int playerIdleTimeout; private final long[] tickTimesNanos; private long aggregatedTickTimesNanos; -@@ -1317,7 +1317,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1311,7 +1311,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private ServerStatus buildServerStatus() { ServerStatus.Players serverping_serverpingplayersample = this.buildPlayerStatus(); @@ -2678,7 +2678,7 @@ index d4fb6d031acbb009fcb600718a16ac0b5437d88e..47f01de166a4048824f3075deb596084 } private ServerStatus.Players buildPlayerStatus() { -@@ -1349,6 +1349,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1343,6 +1343,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa SpigotTimings.schedulerTimer.startTiming(); // Spigot this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit SpigotTimings.schedulerTimer.stopTiming(); // Spigot @@ -2686,7 +2686,7 @@ index d4fb6d031acbb009fcb600718a16ac0b5437d88e..47f01de166a4048824f3075deb596084 this.profiler.push("commandFunctions"); SpigotTimings.commandFunctionsTimer.startTiming(); // Spigot this.getFunctions().tick(); -@@ -1728,10 +1729,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1715,10 +1716,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public String getMotd() { @@ -2708,7 +2708,7 @@ index d4fb6d031acbb009fcb600718a16ac0b5437d88e..47f01de166a4048824f3075deb596084 this.motd = motd; } -@@ -2452,23 +2463,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2439,23 +2450,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void logChatMessage(Component message, ChatType.Bound params, @Nullable String prefix) { @@ -2933,7 +2933,7 @@ index a60fef571c94858998a91711b17d3670c28a81bd..04a728a16bb629adbae1cd8586764a6d @Override diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 04344fd06419ed849f4e49b89a34d48141410b4e..36e659171d299b116b48cae868a20be467ce4ae2 100644 +index 520f0742210342b43aa854b1e8b0c42a84935a9c..d13a662895737180f3d75b6e357ff90c72b0fe08 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -44,6 +44,7 @@ import net.minecraft.nbt.ListTag; @@ -3008,33 +3008,33 @@ index 04344fd06419ed849f4e49b89a34d48141410b4e..36e659171d299b116b48cae868a20be4 @Override diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 03c6c96fd259215c68c70f7285701cb80cf89685..315f51b6c76695e204ddfae3419103c797ad2dfd 100644 +index b62f20585e8d4d62b734b21112ee773dae6e9f51..55c15d942ddd230dec073039b7c5f95a14ff937c 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -285,7 +285,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { - final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); - if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { -- event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); -+ event.disallow(asyncEvent.getResult(), asyncEvent.kickMessage()); // Paper - Adventure - } - Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() { - @Override -@@ -296,12 +296,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - - ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); - if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { -- ServerLoginPacketListenerImpl.this.disconnect(event.getKickMessage()); -+ ServerLoginPacketListenerImpl.this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure - return; - } - } else { - if (asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { -- ServerLoginPacketListenerImpl.this.disconnect(asyncEvent.getKickMessage()); -+ ServerLoginPacketListenerImpl.this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(asyncEvent.kickMessage())); // Paper - Adventure - return; - } - } +@@ -292,7 +292,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { + final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); + if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) { +- event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); ++ event.disallow(asyncEvent.getResult(), asyncEvent.kickMessage()); // Paper - Adventure + } + Waitable<PlayerPreLoginEvent.Result> waitable = new Waitable<PlayerPreLoginEvent.Result>() { + @Override +@@ -304,12 +304,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + + ServerLoginPacketListenerImpl.this.server.processQueue.add(waitable); + if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { +- this.disconnect(event.getKickMessage()); ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(event.kickMessage())); // Paper - Adventure + return; + } + } else { + if (asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { +- this.disconnect(asyncEvent.getKickMessage()); ++ this.disconnect(io.papermc.paper.adventure.PaperAdventure.asVanilla(asyncEvent.kickMessage())); // Paper - Adventure + return; + } + } diff --git a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java index b23480fab4a7cba922b36cb31d4f77f720bf3aac..7dd3dfd2ccc820d45849a89707239b7dbcaf44c3 100644 --- a/src/main/java/net/minecraft/server/network/ServerStatusPacketListenerImpl.java @@ -3354,7 +3354,7 @@ index 23bdb77690ba15bcbbfb0c70af23336d08ac7752..8f144a357174bbe096ac9b38a5e67a61 } collection = icons; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d14312b874 100644 +index 82d5c749a70f7a808c073263e861e09913c529d4..a3ef246b6765f93605bb3af6525adff01e71dd46 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -608,8 +608,10 @@ public final class CraftServer implements Server { @@ -3422,7 +3422,7 @@ index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d1 for (CommandSender recipient : recipients) { recipient.sendMessage(message); -@@ -2015,6 +2038,14 @@ public final class CraftServer implements Server { +@@ -2014,6 +2037,14 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, type); } @@ -3437,7 +3437,7 @@ index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d1 @Override public Inventory createInventory(InventoryHolder owner, InventoryType type, String title) { Preconditions.checkArgument(type != null, "InventoryType cannot be null"); -@@ -2029,13 +2060,28 @@ public final class CraftServer implements Server { +@@ -2028,13 +2059,28 @@ public final class CraftServer implements Server { return CraftInventoryCreator.INSTANCE.createInventory(owner, size); } @@ -3466,7 +3466,7 @@ index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d1 public Merchant createMerchant(String title) { return new CraftMerchantCustom(title == null ? InventoryType.MERCHANT.getDefaultTitle() : title); } -@@ -2100,6 +2146,17 @@ public final class CraftServer implements Server { +@@ -2099,6 +2145,17 @@ public final class CraftServer implements Server { return Thread.currentThread().equals(this.console.serverThread) || this.console.hasStopped() || !org.spigotmc.AsyncCatcher.enabled; // All bets are off if we have shut down (e.g. due to watchdog) } @@ -3484,7 +3484,7 @@ index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d1 @Override public String getMotd() { return this.console.getMotd(); -@@ -2534,4 +2591,57 @@ public final class CraftServer implements Server { +@@ -2533,4 +2590,57 @@ public final class CraftServer implements Server { return this.spigot; } // Spigot end @@ -3543,7 +3543,7 @@ index 0a39f95c77f0a2015200bb95b17eee9cbe95c416..4e155510337d73cd65f722c1360d87d1 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 8bc43dde03f461d9f7470c521f47e959d07cde67..d98020ea7f56418fdab03c7e7772ce062672b728 100644 +index 9bd43d8859874c4d499f9b8d5ae6e08a23e0d4f2..68a7db9c840f101950435b386058f4cf409bfc05 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -155,6 +155,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -3597,7 +3597,7 @@ index 8bc43dde03f461d9f7470c521f47e959d07cde67..d98020ea7f56418fdab03c7e7772ce06 private static Map<String, GameRules.Key<?>> gamerules; public static synchronized Map<String, GameRules.Key<?>> getGameRulesNMS() { -@@ -2054,5 +2091,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2045,5 +2082,18 @@ public class CraftWorld extends CraftRegionAccessor implements World { return ret; } @@ -4085,7 +4085,7 @@ index 758bf988432bb34aad9386e3f4e8bba68891660b..e269812e6193492afc3f25612edafa1a @Override public boolean isPermissionSet(String name) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index a93534f9e855df5ee10b90fb2126870a30f23421..233dd760713a48770178c5fb532f86aee52ad0aa 100644 +index 4a70c2dfb3606bb67b80e99cae316906385f7ff3..52222f15399f2e1828f93b0f69e34157e3abff23 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -320,9 +320,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -4670,7 +4670,7 @@ index 5725b0281ac53a2354b233223259d6784353bc6e..9ef939b76d06874b856e0c850addb364 @Override public int getLineWidth() { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 97cb754bcac8b1c511c59f9cd1c007749d8b7965..756fc13c34cceeab054ee8e9678a16a56cc3f8ea 100644 +index ec1c0080642914ceeb931ee6ebdab31c2c6f1f59..a0dc52c805a82e267b66502a480cf76bc82a20d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -904,7 +904,7 @@ public class CraftEventFactory { @@ -4814,12 +4814,12 @@ index 4dd9a80af9901287ab6740b072f2b89678c3d0cb..b2586684295b295a3196a2a9cf724cec public String getTitle() { return this.title; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 293c1b23ea78891a08830887ba18b2f597d65c01..4c5ef6472947baf2ca3cc294eed77ceebd6cd5af 100644 +index d2c54674711f5d4b0273de628cc6d244969de057..0875dfe89644f5f54d004488ed980092b31c6416 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -498,4 +498,17 @@ public final class CraftItemFactory implements ItemFactory { - EnchantmentHelper.enchantItem(source, craft.handle, level, allowTreasures); - return craft; +@@ -492,4 +492,17 @@ public final class CraftItemFactory implements ItemFactory { + CraftItemStack craft = (CraftItemStack) itemStack; + return CraftItemStack.asCraftMirror(EnchantmentHelper.enchantItem(source, craft.handle, level, allowTreasures)); } + + // Paper start - Adventure @@ -5092,10 +5092,10 @@ index cc588fb207062829637adad79129ca91950496cb..8b27ca7606869798486c3afd03e86205 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index adc67d73681ad5486c266e2a464ae2a1385ba7f4..fbde42a814f846ce8c9df6ea621f10610d9322b3 100644 +index 92e73e0a41a7f63c51e426534ecb2604d9fca958..fcef34d7c88f7f8e21f9789ce3d0962e64d2f092 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -750,6 +750,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -751,6 +751,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return !(this.hasDisplayName() || this.hasLocalizedName() || this.hasEnchants() || (this.lore != null) || this.hasCustomModelData() || this.hasBlockData() || this.hasRepairCost() || !this.unhandledTags.isEmpty() || !this.persistentDataContainer.isEmpty() || this.hideFlag != 0 || this.isUnbreakable() || this.hasDamage() || this.hasAttributeModifiers()); } @@ -5114,7 +5114,7 @@ index adc67d73681ad5486c266e2a464ae2a1385ba7f4..fbde42a814f846ce8c9df6ea621f1061 @Override public String getDisplayName() { return CraftChatMessage.fromJSONComponent(this.displayName); -@@ -785,6 +797,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -786,6 +798,18 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore != null && !this.lore.isEmpty(); } diff --git a/patches/server/0011-Paper-command.patch b/patches/server/0011-Paper-command.patch index 85195efecb..e9db4d01db 100644 --- a/patches/server/0011-Paper-command.patch +++ b/patches/server/0011-Paper-command.patch @@ -617,7 +617,7 @@ index c56c7293261ec2601ab02d051b37e820f023f0ff..faab5e8c952a2af6a286043617cded4e this.setPvpAllowed(dedicatedserverproperties.pvp); this.setFlightAllowed(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4e155510337d73cd65f722c1360d87d14312b874..cded844ac9fb2167fd0c751d47439d6597e34d05 100644 +index a3ef246b6765f93605bb3af6525adff01e71dd46..606aa8bc3c1dbbe7c20e702042e7ff2335544398 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -939,6 +939,7 @@ public final class CraftServer implements Server { @@ -628,7 +628,7 @@ index 4e155510337d73cd65f722c1360d87d14312b874..cded844ac9fb2167fd0c751d47439d65 this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); -@@ -2635,6 +2636,34 @@ public final class CraftServer implements Server { +@@ -2634,6 +2635,34 @@ public final class CraftServer implements Server { // Paper end // Paper start diff --git a/patches/server/0014-Timings-v2.patch b/patches/server/0014-Timings-v2.patch index 839ff00321..cdefaab731 100644 --- a/patches/server/0014-Timings-v2.patch +++ b/patches/server/0014-Timings-v2.patch @@ -712,7 +712,7 @@ index daedf825e68655492f5ab776bc206a5eb87c0170..7de24c39b460e43d27839b3821e67213 } catch (Exception exception) { label25: diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c2084a4c4 100644 +index 3691fd58c7baf98b15c50fa4dacf3a35f4f9b4b8..069af49a03e0d313499f8d1815c8299ec034de61 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -186,7 +186,7 @@ import org.bukkit.craftbukkit.Main; @@ -732,7 +732,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c // CraftBukkit start if (this.server != null) { this.server.disablePlugins(); -@@ -1144,9 +1145,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1138,9 +1139,21 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa private boolean haveTime() { // CraftBukkit start @@ -754,7 +754,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c private void executeModerately() { this.runAllTasks(); java.util.concurrent.locks.LockSupport.parkNanos("executing tasks", 1000L); -@@ -1154,9 +1167,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1148,9 +1161,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } protected void waitUntilNextTick() { @@ -766,7 +766,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c }); } -@@ -1245,9 +1258,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1239,9 +1252,17 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } public void tickServer(BooleanSupplier shouldKeepTicking) { @@ -785,7 +785,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c ++this.tickCount; this.tickRateManager.tick(); this.tickChildren(shouldKeepTicking); -@@ -1261,15 +1282,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1255,15 +1276,18 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.autosavePeriod > 0 && this.ticksUntilAutosave <= 0) { this.ticksUntilAutosave = this.autosavePeriod; // CraftBukkit end @@ -806,7 +806,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c this.profiler.push("tallying"); long j = Util.getNanos() - i; int k = this.tickCount % 100; -@@ -1283,8 +1307,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1277,8 +1301,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.logTickTime(l - i); this.profiler.pop(); org.spigotmc.WatchdogThread.tick(); // Spigot @@ -816,7 +816,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c } private int computeNextAutosaveInterval() { -@@ -1346,26 +1369,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1340,26 +1363,26 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getPlayerList().getPlayers().forEach((entityplayer) -> { entityplayer.connection.suspendFlushing(); }); @@ -850,7 +850,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c // Send time updates to everyone, it will get the right time from the world the player is in. if (this.tickCount % 20 == 0) { for (int i = 0; i < this.getPlayerList().players.size(); ++i) { -@@ -1373,7 +1396,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1367,7 +1390,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa entityplayer.connection.send(new ClientboundSetTimePacket(entityplayer.level().getGameTime(), entityplayer.getPlayerTime(), entityplayer.level().getGameRules().getBoolean(GameRules.RULE_DAYLIGHT))); // Add support for per player time } } @@ -859,7 +859,7 @@ index 47f01de166a4048824f3075deb596084b7d42978..57e15d66bf59c23d9dc87aa811ff6c3c while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); -@@ -1419,24 +1442,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1406,24 +1429,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } this.profiler.popPush("connection"); @@ -1242,7 +1242,7 @@ index aa2c9b13b86130a613ed171a3c16f3639e7c82c6..d00b789d8deb0163726acbcb10edb096 this.entityManager.saveAll(); } else { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 36e659171d299b116b48cae868a20be467ce4ae2..38260251813a8fc5d1f5c1b2bbec9a112d00bafd 100644 +index d13a662895737180f3d75b6e357ff90c72b0fe08..ce7caf08865df9ff032ba6c42308ea3ce4de6226 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -322,7 +322,6 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -1313,7 +1313,7 @@ index 6e9f5a404511f3703298def67402b87eca2f28a0..f5a4191977e8675952fc689744c8a39e public UserWhiteList getWhiteList() { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d0f1cd32aa71f275c9975d1cedc8895fb2e8a174..a1a744657f8802852c161258382c5891858ebfa6 100644 +index a1f658f4dafd47de0020d96667b090aa88c69f9c..8811646495f37587e7976edd8b9558cda412edb1 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -135,7 +135,6 @@ import org.bukkit.craftbukkit.event.CraftPortalEvent; @@ -1324,7 +1324,7 @@ index d0f1cd32aa71f275c9975d1cedc8895fb2e8a174..a1a744657f8802852c161258382c5891 import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.hanging.HangingBreakByEntityEvent; import org.bukkit.event.vehicle.VehicleBlockCollisionEvent; -@@ -312,7 +311,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -314,7 +313,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Marks an entity, that it was removed by a plugin via Entity#remove // Main use case currently is for SPIGOT-7487, preventing dropping of leash when leash is removed public boolean pluginRemoved = false; @@ -1332,7 +1332,7 @@ index d0f1cd32aa71f275c9975d1cedc8895fb2e8a174..a1a744657f8802852c161258382c5891 // Spigot start public final org.spigotmc.ActivationRange.ActivationType activationType = org.spigotmc.ActivationRange.initializeEntityActivationType(this); public final boolean defaultActivationState; -@@ -809,7 +807,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -811,7 +809,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void move(MoverType movementType, Vec3 movement) { @@ -1340,7 +1340,7 @@ index d0f1cd32aa71f275c9975d1cedc8895fb2e8a174..a1a744657f8802852c161258382c5891 if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -970,7 +967,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -972,7 +969,6 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.level().getProfiler().pop(); } } @@ -1603,7 +1603,7 @@ index 0eb09ce5c850d85ffd7229d27cf06b3e0edda11b..cc1d7626a82881c4410d65c6a33dadae }; } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a34037d03674ab64c1ef15a4c0cdb63dbad6d7af..491f59cdf41b686b7d03533c8d34cf367d6c658e 100644 +index 6a6923c1bc597831921cc3515e0e94f5172ef3e1..f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -368,7 +368,7 @@ public final class CraftServer implements Server { @@ -1615,7 +1615,7 @@ index a34037d03674ab64c1ef15a4c0cdb63dbad6d7af..491f59cdf41b686b7d03533c8d34cf36 this.overrideSpawnLimits(); console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); this.warningState = WarningState.value(this.configuration.getString("settings.deprecated-verbose")); -@@ -2548,12 +2548,31 @@ public final class CraftServer implements Server { +@@ -2547,12 +2547,31 @@ public final class CraftServer implements Server { private final org.bukkit.Server.Spigot spigot = new org.bukkit.Server.Spigot() { diff --git a/patches/server/0018-Rewrite-chunk-system.patch b/patches/server/0018-Rewrite-chunk-system.patch index 77a109a4fb..0545ea7ce1 100644 --- a/patches/server/0018-Rewrite-chunk-system.patch +++ b/patches/server/0018-Rewrite-chunk-system.patch @@ -16644,7 +16644,7 @@ index a5e438a834826161c52ca9db57d234d9ff80a591..b8bc1b9b8e8a33df90a963f9f9769292 @Override diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java -index 884731fa4ebbbdc7c06ff670941f36ef3bf384ad..360ecf561cde34b07929519a67485e0315e4676c 100644 +index ba58580f4c60205d1c7a7b7dfcdc22c4fafc9bc6..9d32d03ad59a6e2dfef2c157e621f9ef43098534 100644 --- a/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java @@ -305,6 +305,7 @@ public class Main { @@ -16656,7 +16656,7 @@ index 884731fa4ebbbdc7c06ff670941f36ef3bf384ad..360ecf561cde34b07929519a67485e03 DedicatedServer dedicatedserver1 = new DedicatedServer(optionset, worldLoader.get(), thread, convertable_conversionsession, resourcepackrepository, worldstem, dedicatedserversettings, DataFixers.getDataFixer(), services, LoggerChunkProgressListener::new); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 206751253a02a5f144bbf7bfc5401577767e9030..b608788552d380328b729ce6164e0fc60cf3fefd 100644 +index 069af49a03e0d313499f8d1815c8299ec034de61..cfab6bdf3c3eaf456b60653377df05fcf74c53e3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -300,7 +300,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -16783,7 +16783,7 @@ index 206751253a02a5f144bbf7bfc5401577767e9030..b608788552d380328b729ce6164e0fc6 long i; if (!this.isPaused() && this.tickRateManager.isSprinting() && this.tickRateManager.checkShouldSprintThisTick()) { -@@ -1144,6 +1133,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1138,6 +1127,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } private boolean haveTime() { @@ -16795,7 +16795,7 @@ index 206751253a02a5f144bbf7bfc5401577767e9030..b608788552d380328b729ce6164e0fc6 // CraftBukkit start if (isOversleep) return canOversleep();// Paper - because of our changes, this logic is broken return this.forceTicks || this.runningTask() || Util.getNanos() < (this.mayHaveDelayedTasks ? this.delayedTasksMaxNextTickTimeNanos : this.nextTickTimeNanos); -@@ -2357,7 +2351,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2344,7 +2338,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // CraftBukkit start @Override public boolean isSameThread() { @@ -16805,7 +16805,7 @@ index 206751253a02a5f144bbf7bfc5401577767e9030..b608788552d380328b729ce6164e0fc6 public boolean isDebugging() { diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index cb95818bfb5f0a9274b4e0f2530000bfca7ffc87..b6d5e0962abb62a30c1561d3b1e970884b5b13dc 100644 +index dfb37ddb89c2f43d9f9a34a6b2d38616575eb39b..0f516d126ce834adadd6a57a762e34c996403ab2 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -399,7 +399,34 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -19538,7 +19538,7 @@ index 5cd680d2ed47aadb5e65a775d70bc662a92e3d7a..1ad6b62ee53e2ee4a710211dfc750780 } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 96b1e1669b4a425bc18e5c00da18a79f20fc3e9b..c64448bec0dd18a49b2151c9e2ca528a65264031 100644 +index d00b789d8deb0163726acbcb10edb0965ac9f326..ded164bbc983a058c944ebf43d2f46f3deeb59da 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -195,7 +195,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -20494,7 +20494,7 @@ index c509a1318bcef38fd4927e38b6ee9846853e2d15..5de5209e04d631bd6a50e28e8d3abebf this.desiredChunksPerTick = Double.isNaN((double)desiredBatchSize) ? 0.01F : Mth.clamp(desiredBatchSize, 0.01F, 64.0F); if (this.unacknowledgedBatches == 0) { diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 38260251813a8fc5d1f5c1b2bbec9a112d00bafd..d22341dd864ac3423ec4ae1e3f4febefe24ae3f6 100644 +index ce7caf08865df9ff032ba6c42308ea3ce4de6226..a8e8c90718a7562fd75fe66e76dbc0f8af11db35 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -696,6 +696,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -20663,10 +20663,10 @@ index 640db9f71608310a64e09f1e3e677c01e6ccd98a..f2a7cb6ebed7a4b4019a09af2a025f62 if (flag1) { ++this.converted; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a1a744657f8802852c161258382c5891858ebfa6..fa3d294b36eb0c23b293466fc72bd2970a452b55 100644 +index 8811646495f37587e7976edd8b9558cda412edb1..80affc349b03d3eba394b6d882d29efb4bbbf4a2 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -332,6 +332,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -334,6 +334,58 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end @@ -20725,7 +20725,7 @@ index a1a744657f8802852c161258382c5891858ebfa6..fa3d294b36eb0c23b293466fc72bd297 public Entity(EntityType<?> type, Level world) { this.id = Entity.ENTITY_COUNTER.incrementAndGet(); this.passengers = ImmutableList.of(); -@@ -2293,11 +2345,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2295,11 +2347,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return InteractionResult.PASS; } @@ -21076,7 +21076,7 @@ index b6a3c75b84d9f768afee33aa0f226207b307c1c0..2ec2b1d9d987c7f31c685aec3d3c87f4 <T extends Entity> List<T> getEntities(EntityTypeTest<Entity, T> filter, AABB box, Predicate<? super T> predicate); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 6e3bdcea55490b23066ab90966698e59847cdffa..edf40e3fea58d0978311dd9e2d14e99bc7036593 100644 +index 6dbc4c74b4d6b8e6c4763366e70ca9292b4a25d5..796c7ecedbf7a82697598918d484d80635fb16a8 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -456,6 +456,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -22672,7 +22672,7 @@ index b1aeb021e53a233bfb0439d38f1a889ed6fc301d..7687a81bfa420e8377308fea3d673814 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 491f59cdf41b686b7d03533c8d34cf367d6c658e..611f3cb97e801e8ffff7a41cafc1d63d71ff841c 100644 +index f7ff043c99268d5d8d139e2a4d8cd0817b7bb96b..b41a5263cef159f90a60c62561753482c3f5eeb7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1195,7 +1195,7 @@ public final class CraftServer implements Server { @@ -22693,7 +22693,7 @@ index 491f59cdf41b686b7d03533c8d34cf367d6c658e..611f3cb97e801e8ffff7a41cafc1d63d handle.convertable.close(); } catch (Exception ex) { this.getLogger().log(Level.SEVERE, null, ex); -@@ -2131,7 +2131,7 @@ public final class CraftServer implements Server { +@@ -2130,7 +2130,7 @@ public final class CraftServer implements Server { @Override public boolean isPrimaryThread() { @@ -22703,7 +22703,7 @@ index 491f59cdf41b686b7d03533c8d34cf367d6c658e..611f3cb97e801e8ffff7a41cafc1d63d // Paper start - Adventure diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index d98020ea7f56418fdab03c7e7772ce062672b728..814842871ea8e2104a0842919757cfbccabadc30 100644 +index 68a7db9c840f101950435b386058f4cf409bfc05..3c7fdf150f39a75794a6927bd545c3eb9c480d6f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -325,10 +325,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch index 797efac184..4b0e79f2b2 100644 --- a/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch +++ b/patches/server/0027-Show-Paper-in-client-crashes-server-lists-and-Mojang.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Show 'Paper' in client crashes, server lists, and Mojang diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index b608788552d380328b729ce6164e0fc60cf3fefd..457b0f1f469436f6caa7473d91f906f1a61d6c74 100644 +index cfab6bdf3c3eaf456b60653377df05fcf74c53e3..0c3a23502ab6cb9e1f027b1050dd6849ceb181d9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1559,7 +1559,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1546,7 +1546,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @DontObfuscate public String getServerModName() { @@ -19,7 +19,7 @@ index b608788552d380328b729ce6164e0fc60cf3fefd..457b0f1f469436f6caa7473d91f906f1 public SystemReport fillSystemReport(SystemReport details) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 668263f6b58e04461564687f75ae75504beb1996..1c8363ea23c76633b69e4b98b35ea4feb6c1d2ff 100644 +index c41e0fe3421a9066a4a32e74fcc3a414d7006bbd..452fcc1106e25db87c1dd29fb839c45c63a0ce89 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -261,7 +261,7 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; diff --git a/patches/server/0031-Further-improve-server-tick-loop.patch b/patches/server/0031-Further-improve-server-tick-loop.patch index 467d67138a..bd99c7efa4 100644 --- a/patches/server/0031-Further-improve-server-tick-loop.patch +++ b/patches/server/0031-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 9d2ec082302a422e3135dc0ff6fedf86456b74b5..2defe6f950b8a5e1f039f61fa30343ccc7d4617a 100644 +index 0c3a23502ab6cb9e1f027b1050dd6849ceb181d9..21fc0ce46567d7bd7f24759779f8586efe72fc9f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -283,7 +283,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -141,10 +141,10 @@ index 9d2ec082302a422e3135dc0ff6fedf86456b74b5..2defe6f950b8a5e1f039f61fa30343cc this.startMetricsRecordingTick(); this.profiler.push("tick"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index a0608611d17d2e4c05f04c9dc14b6a65e7f63f8d..e2da717c11f48573babe27d0dac1d679e8eb6964 100644 +index 452fcc1106e25db87c1dd29fb839c45c63a0ce89..73ed8a00ed83a0f7da7a5f69e743850d7a5b76cc 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2573,6 +2573,17 @@ public final class CraftServer implements Server { +@@ -2572,6 +2572,17 @@ public final class CraftServer implements Server { return CraftMagicNumbers.INSTANCE; } diff --git a/patches/server/0033-Entity-Origin-API.patch b/patches/server/0033-Entity-Origin-API.patch index 018485972a..123d44ed16 100644 --- a/patches/server/0033-Entity-Origin-API.patch +++ b/patches/server/0033-Entity-Origin-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Entity Origin API diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index c64448bec0dd18a49b2151c9e2ca528a65264031..88e9f55c50d2952df9c3b19cf95025c20ade9ffc 100644 +index ded164bbc983a058c944ebf43d2f46f3deeb59da..9c6e9d628765fe8aaf0a275a57cede21d40fad23 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -2403,6 +2403,15 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -25,10 +25,10 @@ index c64448bec0dd18a49b2151c9e2ca528a65264031..88e9f55c50d2952df9c3b19cf95025c2 public void onTrackingEnd(Entity entity) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index fa3d294b36eb0c23b293466fc72bd2970a452b55..30f7702f4fa3452cdc15df5ca8873bed08c9b30f 100644 +index 80affc349b03d3eba394b6d882d29efb4bbbf4a2..37eab94ce7e4ba01c2c8a5fb15ef1f6ef314ccc9 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -317,7 +317,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -319,7 +319,27 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public long activatedTick = Integer.MIN_VALUE; public void inactiveTick() { } // Spigot end @@ -56,7 +56,7 @@ index fa3d294b36eb0c23b293466fc72bd2970a452b55..30f7702f4fa3452cdc15df5ca8873bed public float getBukkitYaw() { return this.yRot; } -@@ -2093,6 +2113,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2095,6 +2115,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.bukkitEntity.storeBukkitValues(nbttagcompound); } // CraftBukkit end @@ -72,7 +72,7 @@ index fa3d294b36eb0c23b293466fc72bd2970a452b55..30f7702f4fa3452cdc15df5ca8873bed return nbttagcompound; } catch (Throwable throwable) { CrashReport crashreport = CrashReport.forThrowable(throwable, "Saving entity NBT"); -@@ -2220,6 +2249,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2222,6 +2251,20 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // CraftBukkit end diff --git a/patches/server/0035-Configurable-top-of-nether-void-damage.patch b/patches/server/0035-Configurable-top-of-nether-void-damage.patch index f627ec2acc..604c2aa416 100644 --- a/patches/server/0035-Configurable-top-of-nether-void-damage.patch +++ b/patches/server/0035-Configurable-top-of-nether-void-damage.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Configurable top of nether void damage Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9f3598371c854ec74f3b5752c9779d6c0d99ec39..450a55fd1b01ac67d911d152a04a3dee3aa0a2e9 100644 +index 37eab94ce7e4ba01c2c8a5fb15ef1f6ef314ccc9..16fa26878fc7bcf5d22d779ce7b37a59582ba033 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -720,7 +720,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -722,7 +722,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void checkBelowWorld() { diff --git a/patches/server/0040-Optimize-explosions.patch b/patches/server/0040-Optimize-explosions.patch index 3dcb4f4ca3..bfe5d90649 100644 --- a/patches/server/0040-Optimize-explosions.patch +++ b/patches/server/0040-Optimize-explosions.patch @@ -10,10 +10,10 @@ This patch adds a per-tick cache that is used for storing and retrieving an entity's exposure during an explosion. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2f04f10f5819be04b98ac0b52a2d7f4dfa525cea..e0a2759169f41b68b8e1bc48f0b323c0a4bc1fed 100644 +index 21fc0ce46567d7bd7f24759779f8586efe72fc9f..8072eedb5bc699aa5b04fbca39f4db30534cde4b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1492,6 +1492,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1479,6 +1479,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.profiler.pop(); this.profiler.pop(); @@ -120,7 +120,7 @@ index c5d644876e0c92a444a574ee7571227e19b28482..4e382cfae7a3a1889bc36bad24c6ea38 + // Paper end } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 8bfab45b506aa514956a99354a7dc5009ffa9cbf..cf081c6d270053b7d9a042b65495fe17f0ee4826 100644 +index 05b07a2f0b693f10da66eb51d332436caff9f9c6..4e43a957b000f852ea889ead0eb213eedaf57a5a 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -170,6 +170,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0054-Expose-server-CommandMap.patch b/patches/server/0054-Expose-server-CommandMap.patch index 2bb0b0faac..7d752e224e 100644 --- a/patches/server/0054-Expose-server-CommandMap.patch +++ b/patches/server/0054-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 638d978d86ee324e2eddfebda02ae54572982935..236bbec16b90a71d42d7b55fb5fedbf1a8b350dc 100644 +index 7e7dfec65f1756e21eb79359e13d429fe1955bba..6cd22b11b1fec22087dca1b8dcfbc9c19a499399 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2113,6 +2113,7 @@ public final class CraftServer implements Server { +@@ -2112,6 +2112,7 @@ public final class CraftServer implements Server { return this.helpMap; } diff --git a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch b/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch index fbfb36d4e2..ba1e9aaad7 100644 --- a/patches/server/0066-Allow-Reloading-of-Custom-Permissions.patch +++ b/patches/server/0066-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 88e37ce4f8bfd9dd6681c16d0dcfdf3cae8b9f12..01a281dd074726f417c43db33f36a5cfce02d058 100644 +index c893e7ed3d5db0de6a248f924a4f6f747fc71f00..b88ad110166915173d32fd00dd6bf8b22009b601 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2721,5 +2721,23 @@ public final class CraftServer implements Server { +@@ -2720,5 +2720,23 @@ public final class CraftServer implements Server { } return this.adventure$audiences; } diff --git a/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch index 30bd005856..edad16891d 100644 --- a/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch +++ b/patches/server/0068-Handle-Item-Meta-Inconsistencies.patch @@ -70,7 +70,7 @@ index 9861cd23b07f8fbacb1d125af835dee58c2debbb..b0ea04fc0bac640f7076100e44c16c03 public boolean isEnchanted() { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 7278ac809eff364e8b838d63a2ec1291493869f8..7dd0c000fa7f363997178ffa6de7d39e17702348 100644 +index cba729914a3adaee2507e2916a4cfb585869746d..a05f01ca9a9bc88e414c8cf89c01c7e993e27dd2 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -188,28 +188,11 @@ public final class CraftItemStack extends ItemStack { @@ -168,7 +168,7 @@ index 7278ac809eff364e8b838d63a2ec1291493869f8..7dd0c000fa7f363997178ffa6de7d39e static Map<Enchantment, Integer> getEnchantments(net.minecraft.world.item.ItemStack item) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da41c3dac7c 100644 +index fcef34d7c88f7f8e21f9789ce3d0962e64d2f092..9dbadab7134c7bb56572cf8c89148b6c743e9bcd 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -6,6 +6,7 @@ import com.google.common.collect.ImmutableList; @@ -195,7 +195,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 import java.util.logging.Level; import java.util.logging.Logger; import javax.annotation.Nonnull; -@@ -276,7 +279,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -277,7 +280,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private List<String> lore; // null and empty are two different states internally private Integer customModelData; private CompoundTag blockData; @@ -204,7 +204,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 private Multimap<Attribute, AttributeModifier> attributeModifiers; private int repairCost; private int hideFlag; -@@ -287,7 +290,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -288,7 +291,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; @@ -213,7 +213,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only -@@ -308,7 +311,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -309,7 +312,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.blockData = meta.blockData; if (meta.enchantments != null) { @@ -222,7 +222,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 } if (meta.hasAttributeModifiers()) { -@@ -391,13 +394,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -392,13 +395,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -238,7 +238,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 for (int i = 0; i < ench.size(); i++) { String id = ((CompoundTag) ench.get(i)).getString(CraftMetaItem.ENCHANTMENTS_ID.NBT); -@@ -550,13 +553,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -551,13 +554,13 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -254,7 +254,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 for (Map.Entry<?, ?> entry : ench.entrySet()) { // Doctor older enchants String enchantKey = entry.getKey().toString(); -@@ -832,14 +835,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -833,14 +836,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Override public Map<Enchantment, Integer> getEnchants() { @@ -271,7 +271,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 } if (ignoreRestrictions || level >= ench.getStartLevel() && level <= ench.getMaxLevel()) { -@@ -1226,7 +1229,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1227,7 +1230,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.customModelData = this.customModelData; clone.blockData = this.blockData; if (this.enchantments != null) { @@ -280,7 +280,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 } if (this.hasAttributeModifiers()) { clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); -@@ -1468,4 +1471,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1469,4 +1472,22 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftMetaItem.HANDLED_TAGS; } } diff --git a/patches/server/0074-Use-a-Shared-Random-for-Entities.patch b/patches/server/0074-Use-a-Shared-Random-for-Entities.patch index ff81d34d34..0c3d54988f 100644 --- a/patches/server/0074-Use-a-Shared-Random-for-Entities.patch +++ b/patches/server/0074-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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 08e3e87b2aa9d586cd1b441e7314d0775f7537c8..cc762d3eb68d2f8bf9529ecf07adfc343953c7a2 100644 +index 76dddcd1a339842e6214bb1e4b813a858dbee63b..39ef390739c4bde28c87c1b83610602a86afd6ad 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -163,6 +163,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -165,6 +165,79 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } @@ -89,7 +89,7 @@ index 08e3e87b2aa9d586cd1b441e7314d0775f7537c8..cc762d3eb68d2f8bf9529ecf07adfc34 private CraftEntity bukkitEntity; public CraftEntity getBukkitEntity() { -@@ -411,7 +484,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -413,7 +486,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.bb = Entity.INITIAL_AABB; this.stuckSpeedMultiplier = Vec3.ZERO; this.nextStep = 1.0F; diff --git a/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch index db341b55c9..ff6fee9318 100644 --- a/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch +++ b/patches/server/0077-Only-process-BlockPhysicsEvent-if-a-plugin-has-a-lis.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Only process BlockPhysicsEvent if a plugin has a listener Saves on some object allocation and processing when no plugin listens to this diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index e0a2759169f41b68b8e1bc48f0b323c0a4bc1fed..180bcaa2b5a74c527d8556301fb4a8161c76a64c 100644 +index 8072eedb5bc699aa5b04fbca39f4db30534cde4b..62a40958f3cd1fa42073071e23e4307beccad722 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1453,6 +1453,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1447,6 +1447,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -18,7 +18,7 @@ index e0a2759169f41b68b8e1bc48f0b323c0a4bc1fed..180bcaa2b5a74c527d8556301fb4a816 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 148d1a15e861a26c8fd49204f9bd9821f3cde2fd..f95d4fc714b98a86d732d16f0b783cd943ce0c15 100644 +index 2fe69d7f530adaba026d3903f109987ac8d7da8d..404193d1a674ae8e92b4fcf5efdec6052fff21b4 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -30,7 +30,7 @@ index 148d1a15e861a26c8fd49204f9bd9821f3cde2fd..f95d4fc714b98a86d732d16f0b783cd9 @Override public LevelChunk getChunkIfLoaded(int x, int z) { // Paper - this was added in world too but keeping here for NMS ABI return this.chunkSource.getChunk(x, z, false); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index dce30af3c82d6fe13fa7edec451aedc6d1db9a34..866fa3107c52a3a6c8163140b0f90fb1f6520083 100644 +index 0af602c33d9940a0db68b2245e8caed2d78518fe..cd3a99585a471981b9fa1f614ddddfce570ee0e7 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -583,7 +583,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0093-remove-null-possibility-for-getServer-singleton.patch b/patches/server/0093-remove-null-possibility-for-getServer-singleton.patch index 72c4c385e4..b97780e69d 100644 --- a/patches/server/0093-remove-null-possibility-for-getServer-singleton.patch +++ b/patches/server/0093-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 24f7ecc68c206346e4e2957bc27bf5579ba1b663..3ecb45c98bfbc189e8235e980b14ee6b11536cc5 100644 +index a5b20c68eef32aa2bafe23d7975c7d6e8a928319..bb964c3ca029a777d86c15251510d7cb13d2f82c 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -190,6 +190,7 @@ import co.aikar.timings.MinecraftTimings; // Paper @@ -25,7 +25,7 @@ index 24f7ecc68c206346e4e2957bc27bf5579ba1b663..3ecb45c98bfbc189e8235e980b14ee6b this.metricsRecorder = InactiveMetricsRecorder.INSTANCE; this.profiler = this.metricsRecorder.getProfiler(); this.onMetricsRecordingStopped = (methodprofilerresults) -> { -@@ -2433,9 +2435,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2420,9 +2422,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return false; } diff --git a/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch b/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch index edfd811f40..53f5ac4632 100644 --- a/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch +++ b/patches/server/0096-LootTable-API-Replenishable-Lootables-Feature.patch @@ -504,10 +504,10 @@ index 0000000000000000000000000000000000000000..9cfa5d36a6991067a3866e0d437749fa + } +} diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index e0534859f631e0bdec2db4ae92de0036c4bc62d2..d63cbd3e0e49a5c00d411574a3ca1d081c23dfdd 100644 +index 39ef390739c4bde28c87c1b83610602a86afd6ad..edbfc7bc783833a62542a4515dde13034ae29c10 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -236,6 +236,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -238,6 +238,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // Paper end diff --git a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch b/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch index e99eb4b922..8c58e6d697 100644 --- a/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch +++ b/patches/server/0105-Add-setting-for-proxy-online-mode-status.patch @@ -43,15 +43,15 @@ index 78b11d6fd74fb0714a8013fdc78d096643c4f83c..6a64c58fff9bbed542bf29a029531996 } 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 b1cf58579bdb48d97b27f4295212cfb63a9eb98f..ee4d991c027b1390f3c995a82ebecc72e5622c9f 100644 +index f8613718893c778cac3396fcedba1cf8144f0f0e..876c82e1f1e74417978fd974bd747562b9f8ccdd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1822,7 +1822,7 @@ public final class CraftServer implements Server { - // Spigot Start +@@ -1821,7 +1821,7 @@ public final class CraftServer implements Server { + if (result == null) { GameProfile profile = null; // Only fetch an online UUID in online mode -- if ( this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee ) -+ if ( this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ) // Paper - Handle via setting - { +- if (this.getOnlineMode() || org.spigotmc.SpigotConfig.bungee) { // Spigot: bungee = online mode, for now. ++ if (this.getOnlineMode() || io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()) { // Paper - Handle via setting + // This is potentially blocking :( profile = this.console.getProfileCache().get(name).orElse(null); } diff --git a/patches/server/0111-Cache-user-authenticator-threads.patch b/patches/server/0111-Cache-user-authenticator-threads.patch index 7b14edf13f..caf58cd14f 100644 --- a/patches/server/0111-Cache-user-authenticator-threads.patch +++ b/patches/server/0111-Cache-user-authenticator-threads.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Cache user authenticator threads diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 315f51b6c76695e204ddfae3419103c797ad2dfd..db07502d4d7b73c0e74814334be6603121f60673 100644 +index 55c15d942ddd230dec073039b7c5f95a14ff937c..d4e709b3e3df489d125ab20a98dc4b34bf61dcc9 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -49,6 +49,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -16,28 +16,30 @@ index 315f51b6c76695e204ddfae3419103c797ad2dfd..db07502d4d7b73c0e74814334be66031 private static final int MAX_TICKS_BEFORE_LOGIN = 600; private static final Component DISCONNECT_UNEXPECTED_QUERY = Component.translatable("multiplayer.disconnect.unexpected_query_response"); private final byte[] challenge; -@@ -140,8 +141,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -140,7 +141,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, this.connection.send(new ClientboundHelloPacket("", this.server.getKeyPair().getPublic().getEncoded(), this.challenge)); } else { - // Spigot start -- new Thread("User Authenticator #" + ServerLoginPacketListenerImpl.UNIQUE_THREAD_ID.incrementAndGet()) { -- -+ // Paper start - Cache authenticator threads -+ authenticatorPool.execute(new Runnable() { + // CraftBukkit start +- Thread thread = new Thread("User Authenticator #" + ServerLoginPacketListenerImpl.UNIQUE_THREAD_ID.incrementAndGet()) { ++ // Paper start - Cache authenticator threads ++ authenticatorPool.execute(new Runnable() { + @Override public void run() { - try { -@@ -151,7 +152,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -155,10 +157,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, ServerLoginPacketListenerImpl.this.server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + ServerLoginPacketListenerImpl.this.requestedUsername, ex); } } -- }.start(); -+ }); -+ // Paper end - // Spigot end +- }; +- +- thread.setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(ServerLoginPacketListenerImpl.LOGGER)); +- thread.start(); ++ }); ++ // Paper end + // CraftBukkit end } -@@ -218,7 +220,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -225,7 +225,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, throw new IllegalStateException("Protocol error", cryptographyexception); } @@ -47,7 +49,7 @@ index 315f51b6c76695e204ddfae3419103c797ad2dfd..db07502d4d7b73c0e74814334be66031 public void run() { String s1 = (String) Objects.requireNonNull(ServerLoginPacketListenerImpl.this.requestedUsername, "Player name not initialized"); -@@ -264,10 +267,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -273,10 +274,8 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, return ServerLoginPacketListenerImpl.this.server.getPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; } @@ -59,4 +61,4 @@ index 315f51b6c76695e204ddfae3419103c797ad2dfd..db07502d4d7b73c0e74814334be66031 + // Paper end } - // Spigot start + // CraftBukkit start diff --git a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch b/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch index b01f90503e..9bd7e06637 100644 --- a/patches/server/0112-Allow-Reloading-of-Command-Aliases.patch +++ b/patches/server/0112-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 4e08bf3b40fc066359898259c49ad98edbb4143d..3dca4710f2d95febd9a5c2f64ab50f13c825b472 100644 +index 876c82e1f1e74417978fd974bd747562b9f8ccdd..3f321cf8a3fa4bc80402ca25d58e0dde62c4e3d5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2747,5 +2747,24 @@ public final class CraftServer implements Server { +@@ -2746,5 +2746,24 @@ public final class CraftServer implements Server { DefaultPermissions.registerCorePermissions(); CraftDefaultPermissions.registerCorePermissions(); } diff --git a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch index a32b063cb9..8ba21c023a 100644 --- a/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch +++ b/patches/server/0126-ExperienceOrbs-API-for-Reason-Source-Triggering-play.patch @@ -311,10 +311,10 @@ index 756a8ae14ffc46d6ebe0a858a03fb2e89b8e118a..89a62fbeeb78c864938a1cea84178478 } diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index e72ed2ed8664cbc408cbe1e38f1f0acacc3841dd..2f628f36c32752d1bac910e180b90639c1ae2c9d 100644 +index 65e7dcace8607c4d15938c697c882761c067f08e..7a13042631bea761952490cfd14dc20147405161 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -650,7 +650,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -651,7 +651,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit j = event.getExpToDrop(); // CraftBukkit end diff --git a/patches/server/0127-Cap-Entity-Collisions.patch b/patches/server/0127-Cap-Entity-Collisions.patch index 6ad912267d..3a5642f78d 100644 --- a/patches/server/0127-Cap-Entity-Collisions.patch +++ b/patches/server/0127-Cap-Entity-Collisions.patch @@ -12,10 +12,10 @@ just as it does in Vanilla, but entity pushing logic will be capped. You can set this to 0 to disable collisions. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1b7b3114cd6ced0587a0e7e4a4c94584c72ed17f..ffd38defdd9b56b1849a3b4e312de2cff7b964c2 100644 +index edbfc7bc783833a62542a4515dde13034ae29c10..515d0f3a7ea6f19ce8f1cb16d798d898894be445 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -392,6 +392,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -394,6 +394,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void inactiveTick() { } // Spigot end // Paper start @@ -24,7 +24,7 @@ index 1b7b3114cd6ced0587a0e7e4a4c94584c72ed17f..ffd38defdd9b56b1849a3b4e312de2cf private org.bukkit.util.Vector origin; @javax.annotation.Nullable diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 0b6dce5015144cadee3dc856b7e0d152aa66aca3..b8ac19ae63579bf5325b0ebfa37293c170df6205 100644 +index 77a4122cf5a11b29b14a7fc4ac6420ccea49af1b..202e3b66a81de2f76d5a8bba3538f1554b8debf3 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3348,10 +3348,12 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch index bf2ba03dfc..7d5c1c9026 100644 --- a/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch +++ b/patches/server/0131-Add-configuration-option-to-prevent-player-names-fro.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add configuration option to prevent player names from being diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 3dca4710f2d95febd9a5c2f64ab50f13c825b472..6147774dbfddf50cc2f1fb26ee29122f94d4e009 100644 +index 3f321cf8a3fa4bc80402ca25d58e0dde62c4e3d5..b4d08a9178575d245b69a81311b47433c4682de7 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2766,5 +2766,10 @@ public final class CraftServer implements Server { +@@ -2765,5 +2765,10 @@ public final class CraftServer implements Server { commandMap.registerServerAliases(); return true; } diff --git a/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch index be26ece2e0..321709f253 100644 --- a/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/0132-Use-TerminalConsoleAppender-for-console-improvements.patch @@ -25,7 +25,7 @@ Other changes: Co-Authored-By: Emilia Kond <[email protected]> diff --git a/build.gradle.kts b/build.gradle.kts -index 89064b339ce27a09ad546c62a36459534d138c29..63ed761efdb11533905a8a44a7564d86c7e0bc90 100644 +index 65e9d5918d46b123fb4f8122344a7d3863aec758..7a3c96318f95fcd6cf6fd94415958382d1193ec6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,9 +6,30 @@ plugins { @@ -58,9 +58,9 @@ index 89064b339ce27a09ad546c62a36459534d138c29..63ed761efdb11533905a8a44a7564d86 + alsoShade(log4jPlugins.output) + // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.5") - implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation -@@ -79,7 +100,7 @@ relocation { + implementation("org.ow2.asm:asm-commons:9.5") + implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files +@@ -78,7 +99,7 @@ relocation { } tasks.shadowJar { @@ -250,7 +250,7 @@ index 8323f135d6bf2e1f12525e05094ffa3f2420e7e1..a143ea1e58464a3122fbd8ccafe417bd } } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 16979931782eb60c0bdd419e0b8ec061c0d826fb..efb45a794f6f99fafc63202fe88ade8a722ba14b 100644 +index 981a2927f0baa5146da732ffa8469d7a210e4170..eb443925f77aff634d4630089d7c2d096dfe8005 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -155,7 +155,7 @@ import org.slf4j.Logger; @@ -290,7 +290,7 @@ index 16979931782eb60c0bdd419e0b8ec061c0d826fb..efb45a794f6f99fafc63202fe88ade8a Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this)); // CraftBukkit end this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files -@@ -1178,7 +1182,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1172,7 +1176,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa org.spigotmc.WatchdogThread.doStop(); // Spigot // CraftBukkit start - Restore terminal to original settings try { @@ -299,7 +299,7 @@ index 16979931782eb60c0bdd419e0b8ec061c0d826fb..efb45a794f6f99fafc63202fe88ade8a } catch (Exception ignored) { } // CraftBukkit end -@@ -1688,7 +1692,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1675,7 +1679,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public void sendSystemMessage(Component message) { @@ -387,7 +387,7 @@ index 8550245a088be78359b55fa0cc582df35dbbebed..ea7effdb4274c7e2c19d737a74b1fc58 this.bans = new UserBanList(PlayerList.USERBANLIST_FILE); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 5e54e785cf91a6d5e295620df59b7fd5c17062e3..22656e27aeb2b6de8bb2be2d7db402a4a81fec87 100644 +index b4d08a9178575d245b69a81311b47433c4682de7..dc43f7da2851727ea3be618386a6555c515bbddd 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -42,7 +42,7 @@ import java.util.logging.Level; diff --git a/patches/server/0138-Basic-PlayerProfile-API.patch b/patches/server/0138-Basic-PlayerProfile-API.patch index b8a96c4717..69a7b347c6 100644 --- a/patches/server/0138-Basic-PlayerProfile-API.patch +++ b/patches/server/0138-Basic-PlayerProfile-API.patch @@ -612,7 +612,7 @@ index 9c500642eb2b59bf9aabd6b5d563e5fb15603056..731a7c0363c8c91d25b35f7cbbb48087 String s1 = name.toLowerCase(Locale.ROOT); GameProfileCache.GameProfileInfo usercache_usercacheentry = (GameProfileCache.GameProfileInfo) this.profilesByName.get(s1); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 22656e27aeb2b6de8bb2be2d7db402a4a81fec87..0cb507dde784443fea2a9ca2acb7a77e225cfbc5 100644 +index dc43f7da2851727ea3be618386a6555c515bbddd..07d88fbfcfde48fbebe8081633beca48df658bd0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -260,6 +260,9 @@ import org.yaml.snakeyaml.error.MarkedYAMLException; @@ -633,7 +633,7 @@ index 22656e27aeb2b6de8bb2be2d7db402a4a81fec87..0cb507dde784443fea2a9ca2acb7a77e CraftItemFactory.instance(); } -@@ -2775,5 +2779,42 @@ public final class CraftServer implements Server { +@@ -2774,5 +2778,42 @@ public final class CraftServer implements Server { public boolean suggestPlayerNamesWhenNullTabCompletions() { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0140-Shoulder-Entities-Release-API.patch b/patches/server/0140-Shoulder-Entities-Release-API.patch index 5ad94990b1..5df1057b9f 100644 --- a/patches/server/0140-Shoulder-Entities-Release-API.patch +++ b/patches/server/0140-Shoulder-Entities-Release-API.patch @@ -59,11 +59,11 @@ index 09d5561deb40549ce6a7661ebfd9b9db24db0d12..9db07751cf1321c7fd15b2345729deaa @Override public abstract boolean isSpectator(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 233dd760713a48770178c5fb532f86aee52ad0aa..b143c417b70bbc4d5fdbe1b31f3a86594ea82ae9 100644 +index 52222f15399f2e1828f93b0f69e34157e3abff23..e6b16e3db7a197c7af0c4fdb782749c3c3f37538 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -516,6 +516,32 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { - this.getHandle().getCooldowns().addCooldown(CraftMagicNumbers.getItem(material), ticks); + this.getHandle().getCooldowns().addCooldown(CraftItemType.bukkitToMinecraft(material), ticks); } + // Paper start diff --git a/patches/server/0143-Entity-fromMobSpawner.patch b/patches/server/0143-Entity-fromMobSpawner.patch index a19919f3e5..de3adaf377 100644 --- a/patches/server/0143-Entity-fromMobSpawner.patch +++ b/patches/server/0143-Entity-fromMobSpawner.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Entity#fromMobSpawner() diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index ffd38defdd9b56b1849a3b4e312de2cff7b964c2..451ba2db54dc1682924fa65283bc88687157322e 100644 +index 515d0f3a7ea6f19ce8f1cb16d798d898894be445..d66d30a016ac04d5f051e59ca168a6c2bb8794ab 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -393,6 +393,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -395,6 +395,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Spigot end // Paper start protected int numCollisions = 0; // Paper @@ -16,7 +16,7 @@ index ffd38defdd9b56b1849a3b4e312de2cff7b964c2..451ba2db54dc1682924fa65283bc8868 @javax.annotation.Nullable private org.bukkit.util.Vector origin; @javax.annotation.Nullable -@@ -2200,6 +2201,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2202,6 +2203,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -27,7 +27,7 @@ index ffd38defdd9b56b1849a3b4e312de2cff7b964c2..451ba2db54dc1682924fa65283bc8868 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2340,6 +2345,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2342,6 +2347,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.originWorld = originWorld; origin = new org.bukkit.util.Vector(originTag.getDouble(0), originTag.getDouble(1), originTag.getDouble(2)); } @@ -49,7 +49,7 @@ index bd48f49d50709354abc5bcff155b5abb9ab20191..1a5fb001e28997a113ad8133e9dc9462 if (org.bukkit.craftbukkit.event.CraftEventFactory.callSpawnerSpawnEvent(entity, pos).isCancelled()) { continue; diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java -index 9ff8190002d25a13e6166e076b54a006cff0b47d..b96f65776155f57d599a0a0d06456c95088d38fb 100644 +index 74937603e7b8308fd314d650d9d966e8abd2c725..deb355b2188a49f818aaddad6c4ce60de94428e0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -1012,5 +1012,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { diff --git a/patches/server/0145-Implement-ensureServerConversions-API.patch b/patches/server/0145-Implement-ensureServerConversions-API.patch index 534e55e44d..c4acab74e4 100644 --- a/patches/server/0145-Implement-ensureServerConversions-API.patch +++ b/patches/server/0145-Implement-ensureServerConversions-API.patch @@ -7,7 +7,7 @@ This will take a Bukkit ItemStack and run it through any conversions a server pr to ensure it meets latest minecraft expectations. diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java -index e6a47317eb24fc65ed02a4d4f9c4b19b5abc920d..8e8bcf829818fbbaedb13d9eddca096d457c511a 100644 +index b0ea04fc0bac640f7076100e44c16c03b86b2a0e..7f85121b6830ebf480c5ca7b42d3c835911de836 100644 --- a/src/main/java/net/minecraft/world/item/ItemStack.java +++ b/src/main/java/net/minecraft/world/item/ItemStack.java @@ -229,7 +229,7 @@ public final class ItemStack { @@ -20,10 +20,10 @@ index e6a47317eb24fc65ed02a4d4f9c4b19b5abc920d..8e8bcf829818fbbaedb13d9eddca096d this.save(savedStack); savedStack = (CompoundTag) MinecraftServer.getServer().fixerUpper.update(References.ITEM_STACK, new Dynamic(NbtOps.INSTANCE, savedStack), version, CraftMagicNumbers.INSTANCE.getDataVersion()).getValue(); diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 4c5ef6472947baf2ca3cc294eed77ceebd6cd5af..edb3b4efb38a644e312bf4dde4c756bec21192f7 100644 +index 0875dfe89644f5f54d004488ed980092b31c6416..89bc6cb62123bc17d579b578c4d1d2e5f8c40837 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -511,4 +511,11 @@ public final class CraftItemFactory implements ItemFactory { +@@ -505,4 +505,11 @@ public final class CraftItemFactory implements ItemFactory { return io.papermc.paper.adventure.PaperAdventure.asAdventure(CraftItemStack.asNMSCopy(itemStack).getDisplayName()); } // Paper end - Adventure diff --git a/patches/server/0146-Implement-getI18NDisplayName.patch b/patches/server/0146-Implement-getI18NDisplayName.patch index 7248d82fa0..0b1d065a44 100644 --- a/patches/server/0146-Implement-getI18NDisplayName.patch +++ b/patches/server/0146-Implement-getI18NDisplayName.patch @@ -8,10 +8,10 @@ Currently the server only supports the English language. To override this, You must replace the language file embedded in the server jar. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index edb3b4efb38a644e312bf4dde4c756bec21192f7..b6f5e63c7e7e45dd3eb15bad5c6bee9d5417311e 100644 +index 89bc6cb62123bc17d579b578c4d1d2e5f8c40837..71db89105c70cb70726fb6a732b899297aeee82a 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -518,4 +518,19 @@ public final class CraftItemFactory implements ItemFactory { +@@ -512,4 +512,19 @@ public final class CraftItemFactory implements ItemFactory { return CraftItemStack.asCraftMirror(CraftItemStack.asNMSCopy(item)); } // Paper end - ensure server conversions API diff --git a/patches/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch b/patches/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch index 7cac368e87..4be32e210e 100644 --- a/patches/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch +++ b/patches/server/0152-Allow-specifying-a-custom-authentication-servers-dow.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Allow specifying a custom "authentication servers down" kick diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index a738f70c9c2f8832277a239e6d79d91d663d4cf9..2337d5f0a29201b5f2d3d1734d8feb6c6177b4b3 100644 +index 657466fc6e28cbb414549044f75eef7310d7aab9..6bc7df78ea2ecc97b886dcd082d8b5fb047ae2b7 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -255,7 +255,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -262,7 +262,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, ServerLoginPacketListenerImpl.LOGGER.warn("Authentication servers are down but will let them in anyway!"); ServerLoginPacketListenerImpl.this.startClientVerification(ServerLoginPacketListenerImpl.this.createOfflineProfile(s1)); // Spigot } else { diff --git a/patches/server/0164-API-to-get-a-BlockState-without-a-snapshot.patch b/patches/server/0164-API-to-get-a-BlockState-without-a-snapshot.patch index 3bc16e11c4..71620cdbbd 100644 --- a/patches/server/0164-API-to-get-a-BlockState-without-a-snapshot.patch +++ b/patches/server/0164-API-to-get-a-BlockState-without-a-snapshot.patch @@ -51,7 +51,7 @@ index 63acd109a79ed752a05df3d4f1b99309297c2055..d156f7cc71050f13b2feca00c52ca6b6 return null; } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index 61d696a59d7bea0b1908fe4fb63e4143bb1e218d..29bbd44a0d15d78e13d91003fea1460efdf19e88 100644 +index a1c1a101aa424e74309f6f4c0a53a6a8db5df441..013298c424025cd88f15d61e50d196f70fa4c58b 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -328,6 +328,13 @@ public class CraftBlock implements Block { @@ -114,10 +114,10 @@ index 22af1b41eec06d660dbe47c463014bcdd96fc5b6..f046f507a095e0cb8f839b9b4b06add3 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 183d6146dec231629b4892fcb2fe96d88cc74b4c..2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e 100644 +index 8b454bdb8a9a202ece4912320f3ac373e4fff65c..76a3f4ad26718f95f4cf64206efe16e598fa2285 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -@@ -383,15 +383,30 @@ public final class CraftBlockStates { +@@ -382,15 +382,30 @@ public final class CraftBlockStates { } public static BlockState getBlockState(Block block) { @@ -149,10 +149,10 @@ index 183d6146dec231629b4892fcb2fe96d88cc74b4c..2fe8f7dfefd6e1f9b06f1d4821894091 public static BlockState getBlockState(Material material, @Nullable CompoundTag blockEntityTag) { diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -index cf9f0a8a8d2582e17e9b54269966bbfd4d9ae2a0..268563389077f92921411e866ec26e312e33ee23 100644 +index dbb9a5b2f8d3bc0b13e0f56f6e8a0d9a7b761327..3001bb0e3d4af9b16645a0136093db594b89ab01 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -@@ -173,4 +173,10 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { +@@ -177,4 +177,10 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { public String serialize() { return CraftNBTTagConfigSerializer.serialize(this.toTagCompound()); } diff --git a/patches/server/0165-AsyncTabCompleteEvent.patch b/patches/server/0165-AsyncTabCompleteEvent.patch index 05b0863be5..30ae11adb3 100644 --- a/patches/server/0165-AsyncTabCompleteEvent.patch +++ b/patches/server/0165-AsyncTabCompleteEvent.patch @@ -16,7 +16,7 @@ Also adds isCommand and getLocation to the sync TabCompleteEvent Co-authored-by: Aikar <[email protected]> diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 61671ef718bd921ad0051f717a871d3db2ac5eab..a128040002fd9f297b9ea501af357c598cbe7af2 100644 +index 95df25f6c3ce3e945bca95bc5b5ab0c0863d94c1..9c0440a6e3768ca6300e128da7f1b11a96f10f91 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -688,12 +688,16 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -91,10 +91,10 @@ index 61671ef718bd921ad0051f717a871d3db2ac5eab..a128040002fd9f297b9ea501af357c59 @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 078e9bd8d93e6f6d6b68841566a6ee5f27deb402..93f6b1e469d5fe240ebdba98f969cf9b3b987da9 100644 +index 11080e6dd4ae30e20a724cb62750f1bbd63323e8..d921903070fd03abf1db15d805caf5d6bda971a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2228,7 +2228,7 @@ public final class CraftServer implements Server { +@@ -2227,7 +2227,7 @@ public final class CraftServer implements Server { offers = this.tabCompleteChat(player, message); } diff --git a/patches/server/0173-Add-ArmorStand-Item-Meta.patch b/patches/server/0173-Add-ArmorStand-Item-Meta.patch index d935a8709c..c718255889 100644 --- a/patches/server/0173-Add-ArmorStand-Item-Meta.patch +++ b/patches/server/0173-Add-ArmorStand-Item-Meta.patch @@ -255,10 +255,10 @@ index b77f5832265be5aaf96d95fcac4737919720fa6e..e15723080445b09852512132039ca2cd + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 89dac1d16a90717e6a99d41e8ea04810f78fdee4..27b87d5bdbbbbcc24d4af52df664f51bd5c861ca 100644 +index 9dbadab7134c7bb56572cf8c89148b6c743e9bcd..ff199678850d848c5d2ce76270d674738eec58f7 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -1461,6 +1461,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1462,6 +1462,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaCrossbow.CHARGED.NBT, CraftMetaCrossbow.CHARGED_PROJECTILES.NBT, CraftMetaSuspiciousStew.EFFECTS.NBT, @@ -274,10 +274,10 @@ index 89dac1d16a90717e6a99d41e8ea04810f78fdee4..27b87d5bdbbbbcc24d4af52df664f51b CraftMetaCompass.LODESTONE_POS.NBT, CraftMetaCompass.LODESTONE_TRACKED.NBT, diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index ac3b9ab1f81ddb796bdffb26c00afe75ef1a606c..3effe3c3b7ad949bc786e1b6e560553f2ca3f233 100644 +index 78a2422d648fbcf0d456420d2124e03de6cfb8e0..652207b92ac20c1ba3d20939dc2bbee3c494bf5f 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -365,6 +365,7 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -364,6 +364,7 @@ public class ItemMetaTest extends AbstractTestingBase { final CraftMetaArmorStand meta = (CraftMetaArmorStand) cleanStack.getItemMeta(); meta.entityTag = new CompoundTag(); meta.entityTag.putBoolean("Small", true); diff --git a/patches/server/0178-Implement-extended-PaperServerListPingEvent.patch b/patches/server/0178-Implement-extended-PaperServerListPingEvent.patch index bbd18e10ce..c3a21b7e23 100644 --- a/patches/server/0178-Implement-extended-PaperServerListPingEvent.patch +++ b/patches/server/0178-Implement-extended-PaperServerListPingEvent.patch @@ -181,7 +181,7 @@ index 0000000000000000000000000000000000000000..6b0bdc266109cdfb874f08bf74323603 + +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 721219807fd9abd12123cf0f3a0e3afd5839bf30..584dca7c8aa5fc3bc73101482acd6ad892019a3d 100644 +index eb443925f77aff634d4630089d7c2d096dfe8005..fa8905c2053d66cebfc8e8a4fad9d833b2ad05a3 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -3,6 +3,9 @@ package net.minecraft.server; @@ -194,7 +194,7 @@ index 721219807fd9abd12123cf0f3a0e3afd5839bf30..584dca7c8aa5fc3bc73101482acd6ad8 import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; -@@ -1430,7 +1433,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1424,7 +1427,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.hidesOnlinePlayers()) { return new ServerStatus.Players(i, list.size(), List.of()); } else { @@ -227,7 +227,7 @@ index 7dd3dfd2ccc820d45849a89707239b7dbcaf44c3..e5006e7672ba79ed4bcf2c4173c5a9ed } diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java -index bf368d3ab947f027eaffb5498c45429bf702788c..99c82b9c82770df22a043d1927a1ad820e95d724 100644 +index 0f391af1274926ef6316bd06458767a27640f54a..9c5c19ab9dc14d844631f47a93f3349409efdf43 100644 --- a/src/main/java/org/spigotmc/SpigotConfig.java +++ b/src/main/java/org/spigotmc/SpigotConfig.java @@ -289,7 +289,7 @@ public class SpigotConfig diff --git a/patches/server/0179-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch b/patches/server/0179-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch index 180f65b57e..d77acd59c5 100644 --- a/patches/server/0179-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch +++ b/patches/server/0179-Ability-to-change-PlayerProfile-in-AsyncPreLoginEven.patch @@ -6,24 +6,24 @@ Subject: [PATCH] Ability to change PlayerProfile in AsyncPreLoginEvent This will allow you to change the players name or skin on login. diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index b7ddb05d7b4ec66def973f15bb2408b0a4fc136a..827774b02136ec1862bc9ffabc76ba3a4eb87716 100644 +index 000e5e6085b95e4fc4995e53dc83d9075e27aa05..08a40d2418dc7e3f481a0a45e0c1845d68a74f07 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -288,8 +288,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - java.util.UUID uniqueId = gameprofile.getId(); - final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; +@@ -293,8 +293,16 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + java.util.UUID uniqueId = gameprofile.getId(); + final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; -- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); -+ // Paper start -+ com.destroystokyo.paper.profile.PlayerProfile profile = org.bukkit.Bukkit.createProfile(uniqueId, playerName); -+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); - server.getPluginManager().callEvent(asyncEvent); -+ profile = asyncEvent.getPlayerProfile(); -+ profile.complete(); -+ gameprofile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); -+ playerName = gameprofile.getName(); -+ uniqueId = gameprofile.getId(); -+ // Paper end +- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); ++ // Paper start ++ com.destroystokyo.paper.profile.PlayerProfile profile = org.bukkit.Bukkit.createProfile(uniqueId, playerName); ++ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); + server.getPluginManager().callEvent(asyncEvent); ++ profile = asyncEvent.getPlayerProfile(); ++ profile.complete(); ++ gameprofile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); ++ playerName = gameprofile.getName(); ++ uniqueId = gameprofile.getId(); ++ // Paper end - if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { - final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); + if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { + final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); diff --git a/patches/server/0180-Player.setPlayerProfile-API.patch b/patches/server/0180-Player.setPlayerProfile-API.patch index b8fe8842da..7608558483 100644 --- a/patches/server/0180-Player.setPlayerProfile-API.patch +++ b/patches/server/0180-Player.setPlayerProfile-API.patch @@ -9,7 +9,7 @@ This can be useful for changing name or skins after a player has logged in. public-f net.minecraft.world.entity.player.Player gameProfile diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index a128040002fd9f297b9ea501af357c598cbe7af2..1e7d74df49712a3c3e107026406718c16bc3d166 100644 +index 9c0440a6e3768ca6300e128da7f1b11a96f10f91..c1c9076be05cd4b0b19d16aabbf0320c2531cca1 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -1468,7 +1468,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -22,23 +22,23 @@ index a128040002fd9f297b9ea501af357c598cbe7af2..1e7d74df49712a3c3e107026406718c1 if (Float.isNaN(f)) { f = 0; diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 827774b02136ec1862bc9ffabc76ba3a4eb87716..96ae1fd95956f5e5a1542dcce3fbd9d4b83d49ba 100644 +index 08a40d2418dc7e3f481a0a45e0c1845d68a74f07..3a250865ed364cdcd6f75e874c218b259b1aaad5 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -289,11 +289,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; - - // Paper start -- com.destroystokyo.paper.profile.PlayerProfile profile = org.bukkit.Bukkit.createProfile(uniqueId, playerName); -+ com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); - server.getPluginManager().callEvent(asyncEvent); - profile = asyncEvent.getPlayerProfile(); -- profile.complete(); -+ profile.complete(true); // Paper - setPlayerProfileAPI - gameprofile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); - playerName = gameprofile.getName(); - uniqueId = gameprofile.getId(); +@@ -294,11 +294,11 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; + + // Paper start +- com.destroystokyo.paper.profile.PlayerProfile profile = org.bukkit.Bukkit.createProfile(uniqueId, playerName); ++ com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); + server.getPluginManager().callEvent(asyncEvent); + profile = asyncEvent.getPlayerProfile(); +- profile.complete(); ++ profile.complete(true); // Paper - setPlayerProfileAPI + gameprofile = com.destroystokyo.paper.profile.CraftPlayerProfile.asAuthlibCopy(profile); + playerName = gameprofile.getName(); + uniqueId = gameprofile.getId(); diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java index 6e0a21935f9d5f35cbce72b32e0a89bb636804e2..782cc6d910efe5bc5498d0083afab42fad6c4fa2 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java @@ -220,10 +220,10 @@ index 8dd7e875d0e2ac3c10cce9b7045b5dbc742e9fb7..d296e1687fd596d6674e18b316603d08 public void onEntityRemove(Entity entity) { this.invertedVisibilityEntities.remove(entity.getUUID()); diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 3720fa451cfd82d1df6461b88d12d2f53b364c92..afa93af41bf9b45dd7e49378b7fea088087993d5 100644 +index 457860fa9babe542347608a3fc11ad5d75e5d135..6a661bbae8bc35a4c3b4bb7e86dd77a7575fdd97 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -341,6 +341,12 @@ public class Commodore +@@ -277,6 +277,13 @@ public class Commodore { return; } @@ -233,6 +233,7 @@ index 3720fa451cfd82d1df6461b88d12d2f53b364c92..afa93af41bf9b45dd7e49378b7fea088 + return; + } + // Paper end - if ( modern ) - { - if ( owner.equals( "org/bukkit/Material" ) ) ++ + if (modern) { + if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) { + switch (name) { diff --git a/patches/server/0207-Implement-EntityKnockbackByEntityEvent-and-EntityPus.patch b/patches/server/0207-Implement-EntityKnockbackByEntityEvent-and-EntityPus.patch index 91f930c226..45c500df27 100644 --- a/patches/server/0207-Implement-EntityKnockbackByEntityEvent-and-EntityPus.patch +++ b/patches/server/0207-Implement-EntityKnockbackByEntityEvent-and-EntityPus.patch @@ -9,10 +9,10 @@ Co-authored-by: aerulion <[email protected]> This event is called when an entity receives knockback by another entity. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 451ba2db54dc1682924fa65283bc88687157322e..d47ada5544478dcfcb49f6b437e634105397fdfe 100644 +index d66d30a016ac04d5f051e59ca168a6c2bb8794ab..dd4afab77500277b7697ca988e34b526d28d97c0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1907,8 +1907,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1909,8 +1909,17 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void push(double deltaX, double deltaY, double deltaZ) { @@ -33,7 +33,7 @@ index 451ba2db54dc1682924fa65283bc88687157322e..d47ada5544478dcfcb49f6b437e63410 protected void markHurt() { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 2786b4322d32950153c489941e1aed7c4862e822..55a939c74dad301e866e0711d6ff8e0379bf73c6 100644 +index dff2427e32b92a6deca0df81d0820353c5fc242a..f17d6a208477daeb01b66b2894e871f4071cf3e8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1513,7 +1513,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -122,7 +122,7 @@ index 29cfd065f246bbd3d3c2a5bbd32c3f4813a02951..03ec02f9a2fb5abb5387cd0d83c9481d } } diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java -index 2d8a8a9c8acfcac13e5a82cda9d7be59138b6407..d4832067f87491b8273b7957ce3eec1ad3ba9830 100644 +index f5ce6423b8146cc741023e15004fe9814a035da8..de27517e13ecb15865aaa83257eaffb41c3eecfc 100644 --- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java +++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java @@ -458,7 +458,7 @@ public class EnderDragon extends Mob implements Enemy { diff --git a/patches/server/0210-RangedEntity-API.patch b/patches/server/0210-RangedEntity-API.patch index f20290a950..5383dfd935 100644 --- a/patches/server/0210-RangedEntity-API.patch +++ b/patches/server/0210-RangedEntity-API.patch @@ -96,10 +96,10 @@ index dfd4cf1e613b7ccf3ad986f8e0d783593a411194..9986ac517e11b076a29a8c8e3f480ec2 public CraftLlama(CraftServer server, net.minecraft.world.entity.animal.horse.Llama entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -index 83ab9f7c2bcd3e1bac0324030f182bc303e22cad..8b9695de6e3411cbcc2f97e4a4e243ec1d1dd076 100644 +index 9426395c17b6d2270f2227a8eaaee93d8f07cb2d..f5ecb8c1dc92e5a4b123effd2859123b17a586d3 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPiglin.java -@@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.util.CraftMagicNumbers; +@@ -12,7 +12,7 @@ import org.bukkit.craftbukkit.inventory.CraftItemType; import org.bukkit.entity.Piglin; import org.bukkit.inventory.Inventory; diff --git a/patches/server/0216-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch b/patches/server/0216-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch index 9d489a6dd0..50b3a6608f 100644 --- a/patches/server/0216-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch +++ b/patches/server/0216-Use-AsyncAppender-to-keep-logging-IO-off-main-thread.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use AsyncAppender to keep logging IO off main thread diff --git a/build.gradle.kts b/build.gradle.kts -index e2fec62f0da22fcae7533ede3a34f05807ded430..b2db0b51895200fc870e536ea97886db3d7a763c 100644 +index 38ded67b38bb5dc7c59eb610b81ac33d88d25dac..30edfbf16e7bed29b3261b51d9e4f3124beef026 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -37,6 +37,7 @@ dependencies { +@@ -36,6 +36,7 @@ dependencies { implementation("commons-lang:commons-lang:2.6") runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") runtimeOnly("com.mysql:mysql-connector-j:8.2.0") diff --git a/patches/server/0226-Don-t-call-getItemMeta-on-hasItemMeta.patch b/patches/server/0226-Don-t-call-getItemMeta-on-hasItemMeta.patch index 0bf50e2c9c..1c42edda64 100644 --- a/patches/server/0226-Don-t-call-getItemMeta-on-hasItemMeta.patch +++ b/patches/server/0226-Don-t-call-getItemMeta-on-hasItemMeta.patch @@ -11,7 +11,7 @@ Returns true if getDamage() == 0 or has damage tag or other tag is set. Check the `ItemMetaTest#testTaggedButNotMeta` method to see how this method behaves. diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index ae7c3ad0597e5115b43458a91765a176f2d80227..aab8eb7c96be6a2f157e971d9d494d2e01d3218c 100644 +index 07f011a968592ba5b38a0a2723189824ba5d0938..1478fb3e1f0f97423855db7e5c4618cc066efb6b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -670,7 +670,7 @@ public final class CraftItemStack extends ItemStack { @@ -24,10 +24,10 @@ index ae7c3ad0597e5115b43458a91765a176f2d80227..aab8eb7c96be6a2f157e971d9d494d2e static boolean hasItemMeta(net.minecraft.world.item.ItemStack item) { diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 3effe3c3b7ad949bc786e1b6e560553f2ca3f233..937ddd3a2b9e1df2c8835079923c339178f08459 100644 +index 652207b92ac20c1ba3d20939dc2bbee3c494bf5f..adb7c742e8fe3b8e0c2ecf63c627e7566285fd55 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -108,6 +108,34 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -107,6 +107,34 @@ public class ItemMetaTest extends AbstractTestingBase { assertThat(itemMeta.hasConflictingEnchant(null), is(false)); } diff --git a/patches/server/0233-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch b/patches/server/0233-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch index dea8d1cfca..67d0628018 100644 --- a/patches/server/0233-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch +++ b/patches/server/0233-Add-Debug-Entities-option-to-debug-dupe-uuid-issues.patch @@ -29,7 +29,7 @@ index c9e3e104cd051a38e367653dc6c4f969665fc250..45ee0cd242271883412284625230822d protected void tick() { diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index e91ce13c4dbea719e567018ace8908d2c7b51b30..ea3b3652a560318a581f251732f47ec0fceed693 100644 +index 536f1380ae3387ac4d062fe2f8b934a8d49905fb..1e10d55962a7221e197723eb42434be052a7661a 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -222,6 +222,9 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -72,10 +72,10 @@ index e91ce13c4dbea719e567018ace8908d2c7b51b30..ea3b3652a560318a581f251732f47ec0 return false; } else { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 112f1d81ae21a28befbd4e09a40127a193796013..58e16b14548d5a8a476d3d71229627a83c59420e 100644 +index bebbbf9a0bca8ab94dd269d19ebf55622a3c2ef8..6d04954493680bc4fbad67ff2e43411f970f78f5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -239,6 +239,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -241,6 +241,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; @@ -85,7 +85,7 @@ index 112f1d81ae21a28befbd4e09a40127a193796013..58e16b14548d5a8a476d3d71229627a8 if (this.bukkitEntity == null) { this.bukkitEntity = CraftEntity.getEntity(this.level.getCraftServer(), this); diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 7f7e28808aaf5b858415532d85c246999bc71ed0..b4f7e73fa673006ad0f8ea5a8de5a825aa75e41c 100644 +index 71c2f082091f452cfc74557cd599cf7f080b889b..14c963d507173dae6015a0c81e3a690768012bed 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -153,6 +153,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0242-Optimize-CraftBlockData-Creation.patch b/patches/server/0242-Optimize-CraftBlockData-Creation.patch index a9c505dbc8..d8b3ca0f4c 100644 --- a/patches/server/0242-Optimize-CraftBlockData-Creation.patch +++ b/patches/server/0242-Optimize-CraftBlockData-Creation.patch @@ -26,10 +26,10 @@ index a009fca54665cbc3f11cad776256fbf1fbbb18c7..2c7d025b2af3a66772c3f39462048304 private boolean calculateSolid() { if (((Block) this.owner).properties.forceSolidOn) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 02b10005e7c6ac735de932fd12cff5579939c4d7..cf379f7da8d8e6db0d74f1ca0e4b42e017a8191e 100644 +index 09b95423e66da487f48ee594ba682a4c92e347b5..85ee8a3d6db6610104f8a10d77d7cad5dc9b667e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -569,7 +569,17 @@ public class CraftBlockData implements BlockData { +@@ -570,7 +570,17 @@ public class CraftBlockData implements BlockData { return craft; } diff --git a/patches/server/0253-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch b/patches/server/0253-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch index 9db5e18488..d92ecbd08c 100644 --- a/patches/server/0253-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch +++ b/patches/server/0253-Implement-an-API-for-CanPlaceOn-and-CanDestroy-NBT-v.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement an API for CanPlaceOn and CanDestroy NBT values diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516fc370b97 100644 +index ff199678850d848c5d2ce76270d674738eec58f7..df7a93208a2a0720fc3cd33f84cace38814c18e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -84,6 +84,12 @@ import org.bukkit.persistence.PersistentDataContainer; +@@ -85,6 +85,12 @@ import org.bukkit.persistence.PersistentDataContainer; import static org.spigotmc.ValidateUtils.*; // Spigot end @@ -21,7 +21,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 /** * Children must include the following: * -@@ -272,6 +278,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -273,6 +279,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Specific(Specific.To.NBT) static final ItemMetaKey BLOCK_DATA = new ItemMetaKey("BlockStateTag"); static final ItemMetaKey BUKKIT_CUSTOM_TAG = new ItemMetaKey("PublicBukkitValues"); @@ -32,7 +32,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 // We store the raw original JSON representation of all text data. See SPIGOT-5063, SPIGOT-5656, SPIGOT-5304 private String displayName; -@@ -285,6 +295,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -286,6 +296,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private int hideFlag; private boolean unbreakable; private int damage; @@ -43,7 +43,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 private static final Set<String> HANDLED_TAGS = Sets.newHashSet(); private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); -@@ -322,6 +336,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -323,6 +337,15 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.hideFlag = meta.hideFlag; this.unbreakable = meta.unbreakable; this.damage = meta.damage; @@ -59,7 +59,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 this.unhandledTags.putAll(meta.unhandledTags); this.persistentDataContainer.putAll(meta.persistentDataContainer.getRaw()); -@@ -385,6 +408,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -386,6 +409,31 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.persistentDataContainer.put(key, compound.get(key).copy()); } } @@ -91,7 +91,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 Set<String> keys = tag.getAllKeys(); for (String key : keys) { -@@ -523,6 +571,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -524,6 +572,34 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.setDamage(damage); } @@ -126,7 +126,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 String internal = SerializableMeta.getString(map, "internal", true); if (internal != null) { ByteArrayInputStream buf = new ByteArrayInputStream(Base64.getDecoder().decode(internal)); -@@ -651,6 +727,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -652,6 +728,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasDamage()) { itemTag.putInt(CraftMetaItem.DAMAGE.NBT, this.damage); } @@ -150,7 +150,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 for (Map.Entry<String, Tag> e : this.unhandledTags.entrySet()) { itemTag.put(e.getKey(), e.getValue()); -@@ -667,6 +760,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -668,6 +761,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -172,7 +172,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 ListTag createStringList(List<String> list) { if (list == null) { return null; -@@ -750,7 +858,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -751,7 +859,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { @Overridden boolean isEmpty() { @@ -181,7 +181,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 } // Paper start -@@ -1180,7 +1288,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1181,7 +1289,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { && (this.hideFlag == that.hideFlag) && (this.isUnbreakable() == that.isUnbreakable()) && (this.hasDamage() ? that.hasDamage() && this.damage == that.damage : !that.hasDamage()) @@ -194,7 +194,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 } /** -@@ -1215,6 +1327,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1216,6 +1328,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { hash = 61 * hash + (this.hasDamage() ? this.damage : 0); hash = 61 * hash + (this.hasAttributeModifiers() ? this.attributeModifiers.hashCode() : 0); hash = 61 * hash + this.version; @@ -205,7 +205,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 return hash; } -@@ -1239,6 +1355,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1240,6 +1356,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { clone.unbreakable = this.unbreakable; clone.damage = this.damage; clone.version = this.version; @@ -220,7 +220,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 return clone; } catch (CloneNotSupportedException e) { throw new Error(e); -@@ -1296,6 +1420,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1297,6 +1421,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { builder.put(CraftMetaItem.DAMAGE.BUKKIT, this.damage); } @@ -244,7 +244,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 final Map<String, Tag> internalTags = new HashMap<String, Tag>(this.unhandledTags); this.serializeInternal(internalTags); if (!internalTags.isEmpty()) { -@@ -1468,6 +1609,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1469,6 +1610,8 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CraftMetaArmorStand.SHOW_ARMS.NBT, CraftMetaArmorStand.SMALL.NBT, CraftMetaArmorStand.MARKER.NBT, @@ -253,7 +253,7 @@ index 27b87d5bdbbbbcc24d4af52df664f51bd5c861ca..e333e2b5f098fb1f6b05c3ae132f6516 // Paper end CraftMetaCompass.LODESTONE_DIMENSION.NBT, CraftMetaCompass.LODESTONE_POS.NBT, -@@ -1497,4 +1640,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1498,4 +1641,146 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } // Paper end diff --git a/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch b/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch index 696f2a665f..4fa6f319b3 100644 --- a/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch +++ b/patches/server/0256-Implement-furnace-cook-speed-multiplier-API.patch @@ -11,10 +11,10 @@ to the nearest Integer when updating its current cook time. Modified by: Eric Su <[email protected]> diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc36369710 100644 +index 7a13042631bea761952490cfd14dc20147405161..939a192dd66d5fb8da5beada7c22eeca5a7589cd 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -77,11 +77,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -78,11 +78,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit protected NonNullList<ItemStack> items; public int litTime; int litDuration; @@ -28,7 +28,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc protected AbstractFurnaceBlockEntity(BlockEntityType<?> blockEntityType, BlockPos pos, BlockState state, RecipeType<? extends AbstractCookingRecipe> recipeType) { super(blockEntityType, pos, state); -@@ -128,6 +130,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -129,6 +131,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit }; this.recipesUsed = new Object2IntOpenHashMap(); this.quickCheck = RecipeManager.createCheck((RecipeType<AbstractCookingRecipe>) recipeType); // CraftBukkit - decompile error // Eclipse fail @@ -36,7 +36,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc } public static Map<Item, Integer> getFuel() { -@@ -280,6 +283,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -281,6 +284,11 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit this.recipesUsed.put(new ResourceLocation(s), nbttagcompound1.getInt(s)); } @@ -48,7 +48,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc } @Override -@@ -288,6 +296,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -289,6 +297,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit nbt.putShort("BurnTime", (short) this.litTime); nbt.putShort("CookTime", (short) this.cookingProgress); nbt.putShort("CookTimeTotal", (short) this.cookingTotalTime); @@ -56,7 +56,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc ContainerHelper.saveAllItems(nbt, this.items); CompoundTag nbttagcompound1 = new CompoundTag(); -@@ -359,7 +368,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -360,7 +369,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(blockEntity.items.get(0)); CookingRecipe<?> recipe = (CookingRecipe<?>) recipeholder.toBukkitRecipe(); @@ -65,7 +65,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc world.getCraftServer().getPluginManager().callEvent(event); blockEntity.cookingTotalTime = event.getTotalCookTime(); -@@ -367,9 +376,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -368,9 +377,9 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit // CraftBukkit end ++blockEntity.cookingProgress; @@ -77,7 +77,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc if (AbstractFurnaceBlockEntity.burn(blockEntity.level, blockEntity.worldPosition, world.registryAccess(), recipeholder, blockEntity.items, i)) { // CraftBukkit blockEntity.setRecipeUsed(recipeholder); } -@@ -469,11 +478,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -470,11 +479,12 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } } @@ -95,7 +95,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc } public static boolean isFuel(ItemStack stack) { -@@ -543,7 +553,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -544,7 +554,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit } if (slot == 0 && !flag) { diff --git a/patches/server/0260-Hook-into-CB-plugin-rewrites.patch b/patches/server/0260-Hook-into-CB-plugin-rewrites.patch index 4dec2033b4..b10040abad 100644 --- a/patches/server/0260-Hook-into-CB-plugin-rewrites.patch +++ b/patches/server/0260-Hook-into-CB-plugin-rewrites.patch @@ -8,21 +8,26 @@ our own relocation. Also lets us rewrite NMS calls for when we're debugging in an IDE pre-relocate. diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495dbedb176 100644 +index 6a661bbae8bc35a4c3b4bb7e86dd77a7575fdd97..31714ce05b1023b82e96b36ba52254b4e3e948f2 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -7,8 +7,10 @@ import java.io.InputStream; +@@ -7,6 +7,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; +import java.util.HashMap; import java.util.HashSet; import java.util.List; -+import java.util.Map; - import java.util.Set; - import java.util.jar.JarEntry; + import java.util.Map; +@@ -15,6 +16,7 @@ import java.util.jar.JarEntry; import java.util.jar.JarFile; -@@ -22,11 +24,15 @@ import org.bukkit.plugin.AuthorNagException; + import java.util.jar.JarOutputStream; + import java.util.zip.ZipEntry; ++import javax.annotation.Nonnull; + import joptsimple.OptionParser; + import joptsimple.OptionSet; + import joptsimple.OptionSpec; +@@ -23,7 +25,9 @@ import org.bukkit.plugin.AuthorNagException; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; @@ -32,30 +37,23 @@ index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495 import org.objectweb.asm.MethodVisitor; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; - -+import javax.annotation.Nonnull; -+ - /** - * This file is imported from Commodore. - * -@@ -49,6 +55,41 @@ public class Commodore - "org/bukkit/inventory/ItemStack (I)V setTypeId" - ) ); +@@ -51,6 +55,40 @@ public class Commodore { + "org/spigotmc/event/entity/EntityDismountEvent", "org/bukkit/event/entity/EntityDismountEvent" + ); + // Paper start - Plugin rewrites + private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); -+ private static Map<String, String> initReplacementsMap() -+ { ++ private static Map<String, String> initReplacementsMap() { + Map<String, String> getAndRemove = new HashMap<>(); + // Be wary of maven shade's relocations + + final java.util.jar.Manifest manifest = io.papermc.paper.util.JarManifests.manifest(Commodore.class); -+ if ( Boolean.getBoolean( "debug.rewriteForIde" ) && manifest != null) ++ if (Boolean.getBoolean( "debug.rewriteForIde") && manifest != null) + { + // unversion incoming calls for pre-relocate debug work + final String NMS_REVISION_PACKAGE = "v" + manifest.getMainAttributes().getValue("CraftBukkit-Package-Version") + "/"; + -+ getAndRemove.put( "org/bukkit/".concat( "craftbukkit/" + NMS_REVISION_PACKAGE ), NMS_REVISION_PACKAGE ); ++ getAndRemove.put("org/bukkit/".concat("craftbukkit/" + NMS_REVISION_PACKAGE), NMS_REVISION_PACKAGE); + } + + return getAndRemove; @@ -75,22 +73,23 @@ index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495 + + return rewrite != null ? rewrite : original; + } -+ // Paper end ++ // Paper end - Plugin rewrites + - public static void main(String[] args) - { + public static void main(String[] args) { OptionParser parser = new OptionParser(); -@@ -133,15 +174,72 @@ public class Commodore + OptionSpec<File> inputFlag = parser.acceptsAll(Arrays.asList("i", "input")).withRequiredArg().ofType(File.class).required(); +@@ -118,12 +156,67 @@ public class Commodore { + ClassWriter cw = new ClassWriter(cr, 0); - cr.accept( new ClassVisitor( Opcodes.ASM9, cw ) - { + cr.accept(new ClassRemapper(new ClassVisitor(Opcodes.ASM9, cw) { ++ + // Paper start - Rewrite plugins + @Override + public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) + { -+ desc = getOriginalOrRewrite( desc ); ++ desc = getOriginalOrRewrite(desc); + if ( signature != null ) { -+ signature = getOriginalOrRewrite( signature ); ++ signature = getOriginalOrRewrite(signature); + } + + return super.visitField( access, name, desc, signature, value) ; @@ -98,77 +97,70 @@ index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495 + // Paper end + @Override - public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) - { - return new MethodVisitor( this.api, super.visitMethod( access, name, desc, signature, exceptions ) ) - { + public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { + return new MethodVisitor(this.api, super.visitMethod(access, name, desc, signature, exceptions)) { + + // Paper start - Plugin rewrites + @Override -+ public void visitTypeInsn(int opcode, String type) -+ { -+ type = getOriginalOrRewrite( type ); ++ public void visitTypeInsn(int opcode, String type) { ++ type = getOriginalOrRewrite(type); + -+ super.visitTypeInsn( opcode, type ); ++ super.visitTypeInsn(opcode, type); + } + + @Override + public void visitFrame(int type, int nLocal, Object[] local, int nStack, Object[] stack) { -+ for ( int i = 0; i < local.length; i++ ) ++ for (int i = 0; i < local.length; i++) + { -+ if ( !( local[i] instanceof String ) ) { continue; } ++ if (!(local[i] instanceof String)) { continue; } + -+ local[i] = getOriginalOrRewrite( (String) local[i] ); ++ local[i] = getOriginalOrRewrite((String) local[i]); + } + -+ for ( int i = 0; i < stack.length; i++ ) ++ for (int i = 0; i < stack.length; i++) + { -+ if ( !( stack[i] instanceof String ) ) { continue; } ++ if (!(stack[i] instanceof String)) { continue; } + -+ stack[i] = getOriginalOrRewrite( (String) stack[i] ); ++ stack[i] = getOriginalOrRewrite((String) stack[i]); + } + -+ super.visitFrame( type, nLocal, local, nStack, stack ); ++ super.visitFrame(type, nLocal, local, nStack, stack); + } + + @Override -+ public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) -+ { -+ descriptor = getOriginalOrRewrite( descriptor ); ++ public void visitLocalVariable(String name, String descriptor, String signature, Label start, Label end, int index) { ++ descriptor = getOriginalOrRewrite(descriptor); + -+ super.visitLocalVariable( name, descriptor, signature, start, end, index ); ++ super.visitLocalVariable(name, descriptor, signature, start, end, index); + } + // Paper end - ++ @Override - public void visitFieldInsn(int opcode, String owner, String name, String desc) - { + public void visitFieldInsn(int opcode, String owner, String name, String desc) { + // Paper start - Rewrite plugins -+ owner = getOriginalOrRewrite( owner ); -+ if ( desc != null ) -+ { -+ desc = getOriginalOrRewrite( desc ); ++ owner = getOriginalOrRewrite(owner); ++ if (desc != null) { ++ desc = getOriginalOrRewrite(desc); + } + // Paper end -+ - if ( owner.equals( "org/bukkit/block/Biome" ) ) - { - switch ( name ) -@@ -342,6 +440,11 @@ public class Commodore + if (owner.equals("org/bukkit/block/Biome")) { + switch (name) { + case "NETHER": +@@ -278,6 +371,10 @@ public class Commodore { } // Paper start - Rewrite plugins -+ owner = getOriginalOrRewrite( owner) ; -+ if (desc != null) -+ { ++ owner = getOriginalOrRewrite(owner) ; ++ if (desc != null) { + desc = getOriginalOrRewrite(desc); + } if ((owner.equals("org/bukkit/OfflinePlayer") || owner.equals("org/bukkit/entity/Player")) && name.equals("getPlayerProfile") && desc.equals("()Lorg/bukkit/profile/PlayerProfile;")) { super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); return; -@@ -436,6 +539,13 @@ public class Commodore +@@ -374,6 +471,13 @@ public class Commodore { + @Override - public void visitLdcInsn(Object value) - { + public void visitLdcInsn(Object value) { + // Paper start + if (value instanceof Type type) { + if (type.getSort() == Type.OBJECT || type.getSort() == Type.ARRAY) { @@ -176,20 +168,30 @@ index afa93af41bf9b45dd7e49378b7fea088087993d5..128c9d81814ba1fb24895962e5f08495 + } + } + // Paper end - if ( value instanceof String && ( (String) value ).equals( "com.mysql.jdbc.Driver" ) ) - { - super.visitLdcInsn( "com.mysql.cj.jdbc.Driver" ); -@@ -448,6 +558,13 @@ public class Commodore + if (value instanceof String && ((String) value).equals("com.mysql.jdbc.Driver")) { + super.visitLdcInsn("com.mysql.cj.jdbc.Driver"); + return; +@@ -384,6 +488,14 @@ public class Commodore { + @Override - public void visitInvokeDynamicInsn( String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments ) - { + public void visitInvokeDynamicInsn(String name, String descriptor, Handle bootstrapMethodHandle, Object... bootstrapMethodArguments) { + // Paper start - Rewrite plugins -+ name = getOriginalOrRewrite( name ); -+ if ( descriptor != null ) -+ { -+ descriptor = getOriginalOrRewrite( descriptor ); ++ name = getOriginalOrRewrite(name); ++ if (descriptor != null) { ++ descriptor = getOriginalOrRewrite(descriptor); + } ++ final String fName = name; ++ final String fDescriptor = descriptor; + // Paper end - Rewrite plugins - if ( bootstrapMethodHandle.getOwner().equals( "java/lang/invoke/LambdaMetafactory" ) - && bootstrapMethodHandle.getName().equals( "metafactory" ) && bootstrapMethodArguments.length == 3 ) - { + if (bootstrapMethodHandle.getOwner().equals("java/lang/invoke/LambdaMetafactory") + && bootstrapMethodHandle.getName().equals("metafactory") && bootstrapMethodArguments.length == 3) { + Type samMethodType = (Type) bootstrapMethodArguments[0]; +@@ -400,7 +512,7 @@ public class Commodore { + methodArgs.add(new Handle(newOpcode, newOwner, newName, newDescription, newItf)); + methodArgs.add(newInstantiated); + +- super.visitInvokeDynamicInsn(name, descriptor, bootstrapMethodHandle, methodArgs.toArray(Object[]::new)); ++ super.visitInvokeDynamicInsn(fName, fDescriptor, bootstrapMethodHandle, methodArgs.toArray(Object[]::new)); // Paper - use final local vars + }, implMethod.getTag(), implMethod.getOwner(), implMethod.getName(), implMethod.getDesc(), implMethod.isInterface(), samMethodType, instantiatedMethodType); + return; + } diff --git a/patches/server/0273-Optimize-World-Time-Updates.patch b/patches/server/0273-Optimize-World-Time-Updates.patch index 26dc80001f..f555aa8216 100644 --- a/patches/server/0273-Optimize-World-Time-Updates.patch +++ b/patches/server/0273-Optimize-World-Time-Updates.patch @@ -8,10 +8,10 @@ the updates per world, so that we can re-use the same packet object for every player unless they have per-player time enabled. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index eac560bf8af3c7c28ed5eed61ef352f52d823cef..ab6402fbe9da82c13d3eb56d22d82d10825105e6 100644 +index 7a12c0f5a6cb205e8ae7667b9334efe1999e2a6a..420201b60be7d07fbbb75192f14e4222f4b386aa 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1475,12 +1475,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1469,12 +1469,24 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftTimings.timeUpdateTimer.startTiming(); // Spigot // Paper // Send time updates to everyone, it will get the right time from the world the player is in. diff --git a/patches/server/0277-Make-the-default-permission-message-configurable.patch b/patches/server/0277-Make-the-default-permission-message-configurable.patch index e1e9e00d2b..3165fc1ca9 100644 --- a/patches/server/0277-Make-the-default-permission-message-configurable.patch +++ b/patches/server/0277-Make-the-default-permission-message-configurable.patch @@ -18,10 +18,10 @@ index 0dd48e4098191c8b6e29945d62bc473e9f3a1e77..ae51993e0de706cb62c96795ca9de766 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 2f278d75eeacede5081bd7bbabf18ed3f2462f47..f8b947f1fa45d5669cabc71f4b1409a0945e6cc1 100644 +index ed5eafd7d555b4500c8dd70e17401e0f453266dd..04ff773b84eb8870d77b09e25ab72e5a887774d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2808,6 +2808,16 @@ public final class CraftServer implements Server { +@@ -2807,6 +2807,16 @@ public final class CraftServer implements Server { return io.papermc.paper.configuration.GlobalConfiguration.get().commands.suggestPlayerNamesWhenNullTabCompletions; } diff --git a/patches/server/0280-force-entity-dismount-during-teleportation.patch b/patches/server/0280-force-entity-dismount-during-teleportation.patch index b49a068454..b8260e7854 100644 --- a/patches/server/0280-force-entity-dismount-during-teleportation.patch +++ b/patches/server/0280-force-entity-dismount-during-teleportation.patch @@ -20,10 +20,10 @@ this is going to be the best soultion all around. Improvements/suggestions welcome! diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 7be66f8649d6f6cb67e3b42e8f4fe739f0ff9f9f..fa24d236ed330b417306f137d441bb08dc79a3f5 100644 +index 6d04954493680bc4fbad67ff2e43411f970f78f5..e44d983e7b44225bdd7395488d2b246761e8e02a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2605,11 +2605,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2606,11 +2606,16 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void removeVehicle() { @@ -41,7 +41,7 @@ index 7be66f8649d6f6cb67e3b42e8f4fe739f0ff9f9f..fa24d236ed330b417306f137d441bb08 } } -@@ -2640,7 +2645,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2641,7 +2646,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } @@ -53,7 +53,7 @@ index 7be66f8649d6f6cb67e3b42e8f4fe739f0ff9f9f..fa24d236ed330b417306f137d441bb08 if (entity.getVehicle() == this) { throw new IllegalStateException("Use x.stopRiding(y), not y.removePassenger(x)"); } else { -@@ -2650,7 +2658,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2651,7 +2659,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (this.getBukkitEntity() instanceof Vehicle && entity.getBukkitEntity() instanceof LivingEntity) { VehicleExitEvent event = new VehicleExitEvent( (Vehicle) this.getBukkitEntity(), @@ -63,16 +63,16 @@ index 7be66f8649d6f6cb67e3b42e8f4fe739f0ff9f9f..fa24d236ed330b417306f137d441bb08 // Suppress during worldgen if (this.valid) { @@ -2664,7 +2672,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + } } - // CraftBukkit end - // Spigot start -- org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()); -+ org.spigotmc.event.entity.EntityDismountEvent event = new org.spigotmc.event.entity.EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity(), !suppressCancellation); // Paper + +- EntityDismountEvent event = new EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity()); ++ EntityDismountEvent event = new EntityDismountEvent(entity.getBukkitEntity(), this.getBukkitEntity(), !suppressCancellation); // Paper // Suppress during worldgen if (this.valid) { Bukkit.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 40b8b863c4662d8a6aa228763be167317232b99f..d0482485b13346ac84bb52db30879519f7129091 100644 +index 0085d4727e9bd1c6f451666e6012b8abcd74d129..8e89eb11e8477c921b30840644b6c3ba9d18c3ef 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3471,9 +3471,15 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0295-Entity-getEntitySpawnReason.patch b/patches/server/0295-Entity-getEntitySpawnReason.patch index bbb7d00219..36fd542135 100644 --- a/patches/server/0295-Entity-getEntitySpawnReason.patch +++ b/patches/server/0295-Entity-getEntitySpawnReason.patch @@ -22,7 +22,7 @@ index 2eddeb8d5239bbfeefbf4d3bd363f1ad083299b6..a7c89cdf20cb63792c76de81c1ff9f2c }); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index ea3b3652a560318a581f251732f47ec0fceed693..9634efd5e5ef45c905de4af05ee341b6c88a879b 100644 +index 1e10d55962a7221e197723eb42434be052a7661a..43424a9d8e985f4965b4d101f7fee398e3d1f52c 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1454,6 +1454,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -59,10 +59,10 @@ index 18dc5ef7892c24f4071c8c0621ac412a5d8767bd..c98e4469fa8940762c26a8d787bfabe4 }); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index f0179182df5a716860c9d9f211415dccd6313b92..bbc16fbf403f7722c3d15eb8d63f9abd5e973bfd 100644 +index e44d983e7b44225bdd7395488d2b246761e8e02a..e1ad7394abdbf938841150e4f7092ac70181ddb0 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -235,6 +235,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -237,6 +237,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } // Paper end @@ -70,7 +70,7 @@ index f0179182df5a716860c9d9f211415dccd6313b92..bbc16fbf403f7722c3d15eb8d63f9abd public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper private CraftEntity bukkitEntity; -@@ -2212,6 +2213,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2214,6 +2215,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } nbttagcompound.put("Paper.Origin", this.newDoubleList(origin.getX(), origin.getY(), origin.getZ())); } @@ -80,7 +80,7 @@ index f0179182df5a716860c9d9f211415dccd6313b92..bbc16fbf403f7722c3d15eb8d63f9abd // Save entity's from mob spawner status if (spawnedViaMobSpawner) { nbttagcompound.putBoolean("Paper.FromMobSpawner", true); -@@ -2358,6 +2362,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2360,6 +2364,26 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/patches/server/0300-Server-Tick-Events.patch b/patches/server/0300-Server-Tick-Events.patch index cfb0af10e3..0c162e4b16 100644 --- a/patches/server/0300-Server-Tick-Events.patch +++ b/patches/server/0300-Server-Tick-Events.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Server Tick Events Fires event at start and end of a server tick diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index fc0ab6d0436aa6f79b13e0b755d445403fb81330..af90bb579429336cc4e99386fd620c898c23d274 100644 +index ce370cb1ed9ef67044c5ab448c52367779e5105f..cdff8dfc675328e559b7063c67dfe6300f458eb6 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1354,6 +1354,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1348,6 +1348,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa }); isOversleep = false;MinecraftTimings.serverOversleep.stopTiming(); // Paper end @@ -17,7 +17,7 @@ index fc0ab6d0436aa6f79b13e0b755d445403fb81330..af90bb579429336cc4e99386fd620c89 ++this.tickCount; this.tickRateManager.tick(); -@@ -1380,6 +1381,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1374,6 +1375,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.runAllTasks(); } // Paper end diff --git a/patches/server/0310-Expose-the-internal-current-tick.patch b/patches/server/0310-Expose-the-internal-current-tick.patch index e33e3bdd76..90e8f298e4 100644 --- a/patches/server/0310-Expose-the-internal-current-tick.patch +++ b/patches/server/0310-Expose-the-internal-current-tick.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expose the internal current tick diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index f8b947f1fa45d5669cabc71f4b1409a0945e6cc1..58eb725b4f41bad64b2e5f51e5008cf13f2eba15 100644 +index 04ff773b84eb8870d77b09e25ab72e5a887774d4..4b57573660f5d806973edb5a66a0ac183c40c19e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2854,5 +2854,10 @@ public final class CraftServer implements Server { +@@ -2853,5 +2853,10 @@ public final class CraftServer implements Server { profile.getProperties().putAll(((CraftPlayer) player).getHandle().getGameProfile().getProperties()); return new com.destroystokyo.paper.profile.CraftPlayerProfile(profile); } diff --git a/patches/server/0331-Entity-Activation-Range-2.0.patch b/patches/server/0331-Entity-Activation-Range-2.0.patch index ef278729b0..35f0e2536c 100644 --- a/patches/server/0331-Entity-Activation-Range-2.0.patch +++ b/patches/server/0331-Entity-Activation-Range-2.0.patch @@ -112,10 +112,10 @@ index b10097cd28f0dc360cda9b31e8184ed3a7003780..2d1aa3acd41615b1b2c9cf5751152a56 } else { passenger.stopRiding(); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bbc16fbf403f7722c3d15eb8d63f9abd5e973bfd..dfaba87aa2cfb7687acaa0472c2370a2c4cefbc5 100644 +index e1ad7394abdbf938841150e4f7092ac70181ddb0..26a611b8d75513690811fbbd15dc37e6f4a50dd4 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -395,6 +395,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -397,6 +397,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void inactiveTick() { } // Spigot end // Paper start @@ -124,7 +124,7 @@ index bbc16fbf403f7722c3d15eb8d63f9abd5e973bfd..dfaba87aa2cfb7687acaa0472c2370a2 protected int numCollisions = 0; // Paper public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one @javax.annotation.Nullable -@@ -967,6 +969,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -969,6 +971,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { this.wasOnFire = this.isOnFire(); if (movementType == MoverType.PISTON) { @@ -133,7 +133,7 @@ index bbc16fbf403f7722c3d15eb8d63f9abd5e973bfd..dfaba87aa2cfb7687acaa0472c2370a2 movement = this.limitPistonMovement(movement); if (movement.equals(Vec3.ZERO)) { return; -@@ -979,6 +983,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -981,6 +985,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.stuckSpeedMultiplier = Vec3.ZERO; this.setDeltaMovement(Vec3.ZERO); } diff --git a/patches/server/0337-Anti-Xray.patch b/patches/server/0337-Anti-Xray.patch index 84e0262d57..df43b53dfc 100644 --- a/patches/server/0337-Anti-Xray.patch +++ b/patches/server/0337-Anti-Xray.patch @@ -1558,10 +1558,10 @@ index 545b14f02ac72dda30891d681eba585d19fd5e1d..6dc7e23e96aaffb912611a9dbd41459c private static final byte[] EMPTY_LIGHT = new byte[2048]; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 71ea77e3a487bf7adfb5d430c3df0035abdd4f1c..51d4f3cbcc803f35ea16c1633e41c70a1d366fbf 100644 +index 4b57573660f5d806973edb5a66a0ac183c40c19e..0a9b61b3af57b098d17443d3f26237489fc11f0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2374,7 +2374,7 @@ public final class CraftServer implements Server { +@@ -2373,7 +2373,7 @@ public final class CraftServer implements Server { public ChunkGenerator.ChunkData createChunkData(World world) { Preconditions.checkArgument(world != null, "World cannot be null"); ServerLevel handle = ((CraftWorld) world).getHandle(); @@ -1571,7 +1571,7 @@ index 71ea77e3a487bf7adfb5d430c3df0035abdd4f1c..51d4f3cbcc803f35ea16c1633e41c70a @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 44ff199c5cd675cd795e89e0bee0d57f7dce958a..9e755de8e278f5dd20c9a2d8c8057c16ffe0e118 100644 +index bcd782f9b13c71f1a5bce4836463d0b57e5ada72..357b82e110b789b7a12735a844a9c7e720b4f479 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -421,11 +421,16 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -1594,10 +1594,10 @@ index 44ff199c5cd675cd795e89e0bee0d57f7dce958a..9e755de8e278f5dd20c9a2d8c8057c16 // Paper - rewrite player chunk loader diff --git a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -index a8b23d7eae867be95835bb76f9739a3d1d729973..5fbb9d2c4e419a3f31a8420437978606d75e5b62 100644 +index e7f7a246e9c03e676dadfee59de87b8b2ac55ba3..03eb35d5c67f125c44cf46595c93d124ac7892b8 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -@@ -26,8 +26,13 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { +@@ -27,8 +27,13 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { private final Registry<net.minecraft.world.level.biome.Biome> biomes; private Set<BlockPos> tiles; private final Set<BlockPos> lights = new HashSet<>(); @@ -1612,7 +1612,7 @@ index a8b23d7eae867be95835bb76f9739a3d1d729973..5fbb9d2c4e419a3f31a8420437978606 this.minHeight = minHeight; this.maxHeight = maxHeight; this.biomes = biomes; -@@ -175,7 +180,7 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { +@@ -176,7 +181,7 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { int offset = (y - this.minHeight) >> 4; LevelChunkSection section = this.sections[offset]; if (create && section == null) { diff --git a/patches/server/0345-Add-option-to-nerf-pigmen-from-nether-portals.patch b/patches/server/0345-Add-option-to-nerf-pigmen-from-nether-portals.patch index 35816f0167..dd18442fb9 100644 --- a/patches/server/0345-Add-option-to-nerf-pigmen-from-nether-portals.patch +++ b/patches/server/0345-Add-option-to-nerf-pigmen-from-nether-portals.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add option to nerf pigmen from nether portals diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index cf3742d3d771f6e0c71917bafda7027bd69b1aff..32558b5acfbc13f969d6d5c4e9a61d0beca6c41b 100644 +index 21eac12dcc3571e647b07b313015d809cb0fbcea..7f08a5a9c853c1f54e1d3b142c52cfa5dfb8c091 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -397,6 +397,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -399,6 +399,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Paper start public long activatedImmunityTick = Integer.MIN_VALUE; // Paper public boolean isTemporarilyActive = false; // Paper @@ -16,7 +16,7 @@ index cf3742d3d771f6e0c71917bafda7027bd69b1aff..32558b5acfbc13f969d6d5c4e9a61d0b protected int numCollisions = 0; // Paper public boolean spawnedViaMobSpawner; // Paper - Yes this name is similar to above, upstream took the better one @javax.annotation.Nullable -@@ -2231,6 +2232,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2233,6 +2234,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (spawnedViaMobSpawner) { nbttagcompound.putBoolean("Paper.FromMobSpawner", true); } @@ -26,7 +26,7 @@ index cf3742d3d771f6e0c71917bafda7027bd69b1aff..32558b5acfbc13f969d6d5c4e9a61d0b // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2373,6 +2377,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2375,6 +2379,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } spawnedViaMobSpawner = nbt.getBoolean("Paper.FromMobSpawner"); // Restore entity's from mob spawner status diff --git a/patches/server/0353-Add-tick-times-API-and-mspt-command.patch b/patches/server/0353-Add-tick-times-API-and-mspt-command.patch index b9e2f078c0..1e81ff988a 100644 --- a/patches/server/0353-Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/0353-Add-tick-times-API-and-mspt-command.patch @@ -125,7 +125,7 @@ index 72f2e81b9905a0d57ed8e2a88578f62d5235c456..7b58b2d6297800c2dcdbf7539e5ab8e7 public static void registerCommands(final MinecraftServer server) { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 96fd66ed2742a79064852af6e936830ddaf14f4c..2deb639d404943ef5b028c4ede59cab99b31a40f 100644 +index 6024a9e0dca38b1c21332f5c131d824190a2be90..ce113cc2bc52c1135799190a22e0be21744b58cc 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -252,6 +252,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -140,7 +140,7 @@ index 96fd66ed2742a79064852af6e936830ddaf14f4c..2deb639d404943ef5b028c4ede59cab9 @Nullable private KeyPair keyPair; @Nullable -@@ -1399,6 +1404,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1393,6 +1398,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.smoothedTickTimeMillis = this.smoothedTickTimeMillis * 0.8F + (float) j / (float) TimeUtil.NANOSECONDS_PER_MILLISECOND * 0.19999999F; long l = Util.getNanos(); @@ -152,7 +152,7 @@ index 96fd66ed2742a79064852af6e936830ddaf14f4c..2deb639d404943ef5b028c4ede59cab9 this.logTickTime(l - i); this.profiler.pop(); org.spigotmc.WatchdogThread.tick(); // Spigot -@@ -2682,4 +2692,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2669,4 +2679,30 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa public static record ServerResourcePackInfo(UUID id, String url, String hash, boolean isRequired, @Nullable Component prompt) { } @@ -184,10 +184,10 @@ index 96fd66ed2742a79064852af6e936830ddaf14f4c..2deb639d404943ef5b028c4ede59cab9 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 64d827c7e7f9cf76f9db900333b987a626ab53cc..0ace3d1efa29565d02602574347e24ed425c8f35 100644 +index 0a9b61b3af57b098d17443d3f26237489fc11f0e..1774a92b7772f02aad096ac98ff412373630905a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2629,6 +2629,16 @@ public final class CraftServer implements Server { +@@ -2628,6 +2628,16 @@ public final class CraftServer implements Server { net.minecraft.server.MinecraftServer.getServer().tps15.getAverage() }; } diff --git a/patches/server/0354-Expose-MinecraftServer-isRunning.patch b/patches/server/0354-Expose-MinecraftServer-isRunning.patch index 7d7c6af3d6..e15d9c827b 100644 --- a/patches/server/0354-Expose-MinecraftServer-isRunning.patch +++ b/patches/server/0354-Expose-MinecraftServer-isRunning.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose MinecraftServer#isRunning This allows for plugins to detect if the server is actually turning off in onDisable rather than just plugins reloading. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 4e01f9ef532e141a8b095b275fd4673db4886d36..bf51059e6afa67dae47f42952aaadd6e3db34159 100644 +index 1774a92b7772f02aad096ac98ff412373630905a..f820cebd30f747596eb3b442965381850376f9f6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2869,5 +2869,10 @@ public final class CraftServer implements Server { +@@ -2868,5 +2868,10 @@ public final class CraftServer implements Server { public int getCurrentTick() { return net.minecraft.server.MinecraftServer.currentTick; } diff --git a/patches/server/0362-Optimize-Collision-to-not-load-chunks.patch b/patches/server/0362-Optimize-Collision-to-not-load-chunks.patch index 3d509bf03c..9865b06b9e 100644 --- a/patches/server/0362-Optimize-Collision-to-not-load-chunks.patch +++ b/patches/server/0362-Optimize-Collision-to-not-load-chunks.patch @@ -14,7 +14,7 @@ movement will load only the chunk the player enters anyways and avoids loading massive amounts of surrounding chunks due to large AABB lookups. diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 68935845e9041706c2e203ff436f50d92c190a8f..d4734253bb5f45b62a31aa5c260a414ce9979736 100644 +index 77109036dccabe1af443956aa94123ec240b23ac..13fcc14905ade93494aa67fc53c952db7abcc7f7 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -822,6 +822,7 @@ public abstract class PlayerList { @@ -26,10 +26,10 @@ index 68935845e9041706c2e203ff436f50d92c190a8f..d4734253bb5f45b62a31aa5c260a414c // CraftBukkit end entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 32558b5acfbc13f969d6d5c4e9a61d0beca6c41b..2e45aef27d9a9f224779357c649df796ddc16b8e 100644 +index 7f08a5a9c853c1f54e1d3b142c52cfa5dfb8c091..04635faeb265852df7ec3ea9b04c8ae24c2fcd58 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -238,6 +238,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -240,6 +240,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason spawnReason; // Paper public com.destroystokyo.paper.loottable.PaperLootableInventoryData lootableData; // Paper diff --git a/patches/server/0365-Improved-Watchdog-Support.patch b/patches/server/0365-Improved-Watchdog-Support.patch index 89c7318629..243fe13fb0 100644 --- a/patches/server/0365-Improved-Watchdog-Support.patch +++ b/patches/server/0365-Improved-Watchdog-Support.patch @@ -71,7 +71,7 @@ index a9a0248b1bd1ac454064e977b61f9b7d80962ff8..059b1a0bf048af6a28c322f35da3d3cb cause = cause.getCause(); } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 961a4953be8561e31d8df3ce812d9ab6e3a573a5..011d9854731425cb5116db8cd726326c4a38fc06 100644 +index ce113cc2bc52c1135799190a22e0be21744b58cc..9a25d351df1141e9218d37c0f90e2d67f9c8c3ef 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -297,7 +297,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -180,9 +180,9 @@ index 961a4953be8561e31d8df3ce812d9ab6e3a573a5..011d9854731425cb5116db8cd726326c + } + // Paper end MinecraftServer.LOGGER.error("Encountered an unexpected exception", throwable); - // Spigot Start - if ( throwable.getCause() != null ) -@@ -1193,14 +1242,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa + CrashReport crashreport = MinecraftServer.constructOrExtractCrashReport(throwable); + +@@ -1187,14 +1236,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.services.profileCache().clearExecutor(); } @@ -200,7 +200,7 @@ index 961a4953be8561e31d8df3ce812d9ab6e3a573a5..011d9854731425cb5116db8cd726326c } } -@@ -1269,6 +1318,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1263,6 +1312,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @Override public TickTask wrapRunnable(Runnable runnable) { @@ -213,15 +213,7 @@ index 961a4953be8561e31d8df3ce812d9ab6e3a573a5..011d9854731425cb5116db8cd726326c return new TickTask(this.tickCount, runnable); } -@@ -1547,6 +1602,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa - try { - crashreport = CrashReport.forThrowable(throwable, "Exception ticking world"); - } catch (Throwable t) { -+ if (throwable instanceof ThreadDeath) { throw (ThreadDeath)throwable; } // Paper - throw new RuntimeException("Error generating crash report", t); - } - // Spigot End -@@ -2060,7 +2116,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2047,7 +2102,15 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.worldData.setDataConfiguration(worlddataconfiguration); this.resources.managers.updateRegistryTags(this.registryAccess()); diff --git a/patches/server/0374-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch b/patches/server/0374-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch index 7dc5f051b4..8fd7088476 100644 --- a/patches/server/0374-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch +++ b/patches/server/0374-Move-player-to-spawn-point-if-spawn-in-unloaded-worl.patch @@ -10,7 +10,7 @@ Co-authored-by: Wyatt Childers <[email protected]> Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java -index 3986d49b0e3405248913a685c44b27d091c4152e..6d61e70d1d5ad5bce6432f91d3b23c1734ad629c 100644 +index 569fa7caeffcda00ae6bf824af8b44b1d6862835..cb173f30bf5abd7c709d2186dd489e50c178b3cc 100644 --- a/src/main/java/net/minecraft/server/players/PlayerList.java +++ b/src/main/java/net/minecraft/server/players/PlayerList.java @@ -194,7 +194,7 @@ public abstract class PlayerList { @@ -87,10 +87,10 @@ index 3986d49b0e3405248913a685c44b27d091c4152e..6d61e70d1d5ad5bce6432f91d3b23c17 } // Paper end diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 2e45aef27d9a9f224779357c649df796ddc16b8e..88aa0ef38590c291d02b930e86d7e9f8e8958422 100644 +index 04635faeb265852df7ec3ea9b04c8ae24c2fcd58..b2dc3729a8312179d219bd93a755729c86f4dece 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2335,27 +2335,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2337,27 +2337,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } // CraftBukkit end diff --git a/patches/server/0378-Fix-numerous-item-duplication-issues-and-teleport-is.patch b/patches/server/0378-Fix-numerous-item-duplication-issues-and-teleport-is.patch index 83d62298fd..e18ab6411f 100644 --- a/patches/server/0378-Fix-numerous-item-duplication-issues-and-teleport-is.patch +++ b/patches/server/0378-Fix-numerous-item-duplication-issues-and-teleport-is.patch @@ -16,10 +16,10 @@ So even if something NEW comes up, it would be impossible to drop the same item twice because the source was destroyed. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 88aa0ef38590c291d02b930e86d7e9f8e8958422..5d56c6650ecac018e7404395fa75e80e19f070fb 100644 +index b2dc3729a8312179d219bd93a755729c86f4dece..88632cf1baea828f6442ac37b8c13a3356445fe3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2465,11 +2465,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2467,11 +2467,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { // CraftBukkit start - Capture drops for death event if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { @@ -80,7 +80,7 @@ index 88aa0ef38590c291d02b930e86d7e9f8e8958422..5d56c6650ecac018e7404395fa75e80e public float getBlockExplosionResistance(Explosion explosion, BlockGetter world, BlockPos pos, BlockState blockState, FluidState fluidState, float max) { diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 9eea89e4c3ec5f999ec7f5773f4c37209211c173..4b1366a456e7132d438fc99bd62e1dd77e35b35f 100644 +index a4b1066bbb36cce7505e5e6dc033b0266ce85974..2fa60d96da53ca954dc1421745fafaeb2e806ed0 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -1705,9 +1705,9 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -135,7 +135,7 @@ index 810bead2f19de70786027b190137f743a0c40ee7..4f9afae94a4cbf28a532e889d441c63d } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 6e1cff5713e8e0ed8dc481f9c91071eb4b722a49..73f11d9d8b23568478e9fca603cbde1a42f3963f 100644 +index 502196b8e97f3de3399f5542e76e6dbbd044d3fd..5d28312a03f1571bb44c31f82e27288d02776a5a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -893,6 +893,11 @@ public class CraftEventFactory { diff --git a/patches/server/0386-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0386-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 83fe8ede33..bb83e073cd 100644 --- a/patches/server/0386-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0386-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,18 +6,18 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index 6acb1f37f4c5cb1addd835626041cd3c28eb842f..7398b673f416fa2c05231f90a59600517a21c908 100644 +index eaaf9a9779f57ee048245899750bf7a1599b716f..450f7c03bdcc109938ba9b66328bdbb2c96c03c9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -36,6 +36,7 @@ dependencies { - implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation +@@ -35,6 +35,7 @@ dependencies { + implementation("org.ow2.asm:asm-commons:9.5") implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files implementation("commons-lang:commons-lang:2.6") + implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") runtimeOnly("com.mysql:mysql-connector-j:8.2.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper -@@ -125,6 +126,18 @@ tasks.check { +@@ -124,6 +125,18 @@ tasks.check { } // Paper end diff --git a/patches/server/0387-Implement-Mob-Goal-API.patch b/patches/server/0387-Implement-Mob-Goal-API.patch index 7e0cedac72..11aff4ed7a 100644 --- a/patches/server/0387-Implement-Mob-Goal-API.patch +++ b/patches/server/0387-Implement-Mob-Goal-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index 7398b673f416fa2c05231f90a59600517a21c908..3a3a6ce8833afca0caff2a3b92ad593bf75e951a 100644 +index 450f7c03bdcc109938ba9b66328bdbb2c96c03c9..c6241f858209ed662d8720217d143340916024e9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -45,6 +45,7 @@ dependencies { +@@ -44,6 +44,7 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") @@ -794,10 +794,10 @@ index 4379b9948f1eecfe6fd7dea98e298ad5f761019a..3f081183521603824430709886a9cc31 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index b6fb3f6c56d890f4a0b8bfdf691ace17e2e9fc67..b63cf735388872879e3e0641a13ebf8254490a8b 100644 +index 22886ae00f92824fc08018b9415537f1126920ee..1197e6f355f9b5a684024de31cddef11f945bcb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2882,5 +2882,11 @@ public final class CraftServer implements Server { +@@ -2881,5 +2881,11 @@ public final class CraftServer implements Server { public boolean isStopping() { return net.minecraft.server.MinecraftServer.getServer().hasStopped(); } diff --git a/patches/server/0409-Use-distance-map-to-optimise-entity-tracker.patch b/patches/server/0409-Use-distance-map-to-optimise-entity-tracker.patch index 8eefd5aa6a..18b0c6bf7d 100644 --- a/patches/server/0409-Use-distance-map-to-optimise-entity-tracker.patch +++ b/patches/server/0409-Use-distance-map-to-optimise-entity-tracker.patch @@ -236,7 +236,7 @@ index 2db3236bc9d676c86b0af38bd4bfaf9d3332c250..07abd089e5091d292d4542bbe0fbb416 return object instanceof ChunkMap.TrackedEntity ? ((ChunkMap.TrackedEntity) object).entity.getId() == this.entity.getId() : false; } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 5d56c6650ecac018e7404395fa75e80e19f070fb..5ffcb63bafc11cca5e04c85605cc71cf6c29e812 100644 +index 88632cf1baea828f6442ac37b8c13a3356445fe3..a1d990aa2e79af9e1ff078892cdb38a382f21da7 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java @@ -56,6 +56,7 @@ import net.minecraft.network.syncher.EntityDataSerializers; @@ -247,7 +247,7 @@ index 5d56c6650ecac018e7404395fa75e80e19f070fb..5ffcb63bafc11cca5e04c85605cc71cf import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; import net.minecraft.server.level.ServerPlayer; -@@ -486,6 +487,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -488,6 +489,38 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public boolean updatingSectionStatus = false; // Paper end diff --git a/patches/server/0412-Ensure-Entity-AABB-s-are-never-invalid.patch b/patches/server/0412-Ensure-Entity-AABB-s-are-never-invalid.patch index f436d1a9ab..416650b14e 100644 --- a/patches/server/0412-Ensure-Entity-AABB-s-are-never-invalid.patch +++ b/patches/server/0412-Ensure-Entity-AABB-s-are-never-invalid.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Ensure Entity AABB's are never invalid diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 5ffcb63bafc11cca5e04c85605cc71cf6c29e812..0924677535ba455a2118f7022bdd361c609022d4 100644 +index a1d990aa2e79af9e1ff078892cdb38a382f21da7..a1172531baf637915a65fbdee8ca08f08034811d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -726,8 +726,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -728,8 +728,8 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void setPos(double x, double y, double z) { diff --git a/patches/server/0413-Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/patches/server/0413-Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 6f47eef960..f36083c569 100644 --- a/patches/server/0413-Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/patches/server/0413-Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -8,7 +8,7 @@ makes it so that the server keeps the last difficulty used instead of restoring the server.properties every single load. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 81d4870060ea418fecfdd01f1357899038c95fe9..87e0cc467a2139e763130a375387b6df46336992 100644 +index 728858a2a52bd23c7b42d0e7340abf5f09d24fc5..8a037e12ba9419ec29c62799e30312c50b7ee4ad 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -828,7 +828,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -20,7 +20,7 @@ index 81d4870060ea418fecfdd01f1357899038c95fe9..87e0cc467a2139e763130a375387b6df this.forceTicks = false; // CraftBukkit end -@@ -1828,11 +1828,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1814,11 +1814,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } } @@ -40,7 +40,7 @@ index 81d4870060ea418fecfdd01f1357899038c95fe9..87e0cc467a2139e763130a375387b6df } } -@@ -1846,7 +1849,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1832,7 +1835,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -63,7 +63,7 @@ index 997a96a21440ae72696d68f8031ece4ba487d3ef..d0f851ca4d91791da26902d7d516b0fd return Component.translatable("commands.difficulty.success", difficulty.getDisplayName()); }, true); diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 7f5ecea0ee78a534d7c56fa9e3ad2117b5192c0a..ac918da8234553e4d88664b240feddc1fea8bd6b 100644 +index c7696765ff6b1e27c108d2668c32abbbab35896c..4d76d64fad92510de5098613aa0a04e1bbf7bca5 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -325,7 +325,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -76,7 +76,7 @@ index 7f5ecea0ee78a534d7c56fa9e3ad2117b5192c0a..ac918da8234553e4d88664b240feddc1 @Override diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java -index fc8f8bc0762288b04d895a767f4af7b3aa61c078..a86a5475d2e6e68d893878de168aefb6b42e8248 100644 +index 71068a285ff039b609f4551d522481f2dff8235e..d43bf7ff39e9424f5cdcc93d29779570c8735869 100644 --- a/src/main/java/net/minecraft/server/level/ServerPlayer.java +++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java @@ -1209,7 +1209,7 @@ public class ServerPlayer extends Player { @@ -89,7 +89,7 @@ index fc8f8bc0762288b04d895a767f4af7b3aa61c078..a86a5475d2e6e68d893878de168aefb6 playerlist.sendPlayerPermissionLevel(this); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 4876b0378641657ee4c3c08586337a952af01839..2a982ec37bfcd70698b6f7bff35e18d5ef932ac8 100644 +index 448cbe86cefdf779c7faae84748e04374f16162d..101871664077577c5cbe159d5d1a31b0e30ec68d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -3176,7 +3176,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -102,7 +102,7 @@ index 4876b0378641657ee4c3c08586337a952af01839..2a982ec37bfcd70698b6f7bff35e18d5 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 32482dc7bc10575ad43d668b4cac189e9a365911..2a05cb7f1e9304bb2ccd2bba3a46cfc02cc7f9a7 100644 +index dc1a494df0b4dc361e19c57b8e768ab873025956..f6608fb3b6f838479e67f411874c3db30c843af9 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -955,8 +955,8 @@ public final class CraftServer implements Server { @@ -117,7 +117,7 @@ index 32482dc7bc10575ad43d668b4cac189e9a365911..2a05cb7f1e9304bb2ccd2bba3a46cfc0 for (SpawnCategory spawnCategory : SpawnCategory.values()) { if (CraftSpawnCategory.isValidForLimits(spawnCategory)) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9e755de8e278f5dd20c9a2d8c8057c16ffe0e118..bf8a645d310a307e5ea7e93a00eb336481100768 100644 +index 357b82e110b789b7a12735a844a9c7e720b4f479..cb053e6c8f3cc1346a679354696e0fa0b6d3a150 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1158,7 +1158,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0417-Add-Plugin-Tickets-to-API-Chunk-Methods.patch b/patches/server/0417-Add-Plugin-Tickets-to-API-Chunk-Methods.patch index 44ef76e313..18a3bd5e9e 100644 --- a/patches/server/0417-Add-Plugin-Tickets-to-API-Chunk-Methods.patch +++ b/patches/server/0417-Add-Plugin-Tickets-to-API-Chunk-Methods.patch @@ -22,7 +22,7 @@ wants it to collect even faster, they can restore that setting back to 1 instead Not adding it to .getType() though to keep behavior consistent with vanilla for performance reasons. diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index e0a77a76a652e55539e97a58bfab5cd3b1fe6279..7f30a9b4d39e7547441af2f07b29aa0c62de9597 100644 +index f6608fb3b6f838479e67f411874c3db30c843af9..ea2ca7a37d0bdcc1ccc1627e4246a8290e32d16f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -377,7 +377,7 @@ public final class CraftServer implements Server { @@ -44,7 +44,7 @@ index e0a77a76a652e55539e97a58bfab5cd3b1fe6279..7f30a9b4d39e7547441af2f07b29aa0c this.printSaveWarning = false; this.console.autosavePeriod = this.configuration.getInt("ticks-per.autosave"); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index bf8a645d310a307e5ea7e93a00eb336481100768..8efc044e5a38766aa29cb62db553a8390de50139 100644 +index cb053e6c8f3cc1346a679354696e0fa0b6d3a150..36d7c41505d41443e6034dfc88ce177fe47d980f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -282,7 +282,13 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -116,7 +116,7 @@ index bf8a645d310a307e5ea7e93a00eb336481100768..8efc044e5a38766aa29cb62db553a839 world.getChunkSource().getChunk(x, z, ChunkStatus.FULL, true); return true; // Paper end -@@ -2269,6 +2284,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2260,6 +2275,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { io.papermc.paper.chunk.system.ChunkSystem.scheduleChunkLoad(this.getHandle(), x, z, gen, ChunkStatus.FULL, true, priority, (c) -> { net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> { net.minecraft.world.level.chunk.LevelChunk chunk = (net.minecraft.world.level.chunk.LevelChunk)c; diff --git a/patches/server/0418-incremental-chunk-and-player-saving.patch b/patches/server/0418-incremental-chunk-and-player-saving.patch index b80e5943e6..23a9674021 100644 --- a/patches/server/0418-incremental-chunk-and-player-saving.patch +++ b/patches/server/0418-incremental-chunk-and-player-saving.patch @@ -5,7 +5,7 @@ Subject: [PATCH] incremental chunk and player saving diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 87e0cc467a2139e763130a375387b6df46336992..a82f7dd2cbc2f6311b810f117f0970a47db85818 100644 +index 8a037e12ba9419ec29c62799e30312c50b7ee4ad..706e8a5e17ccd87266a5c154cd938974d380cb21 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -901,7 +901,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -17,7 +17,7 @@ index 87e0cc467a2139e763130a375387b6df46336992..a82f7dd2cbc2f6311b810f117f0970a4 flag3 = this.saveAllChunks(suppressLogs, flush, force); } finally { this.isSaving = false; -@@ -1433,16 +1433,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1427,16 +1427,28 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa } --this.ticksUntilAutosave; @@ -76,7 +76,7 @@ index 974b4970be214ca36a801d39932abcc751e540a5..63fad53a9184d7ab97f143b7d85ae9ef public void close() throws IOException { // CraftBukkit start diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 2e04cf910a520b92ac43a5ff2d06d9d61402c3cb..206aa969d1ea8831f4c30be11ab26ecd31fd433e 100644 +index 51379dc93af2eaa3294179debe067d62627b60e1..8a7dd236435b08e0857041641eec9edcef936503 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1306,6 +1306,37 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0420-Convert-legacy-attributes-in-Item-Meta.patch b/patches/server/0420-Convert-legacy-attributes-in-Item-Meta.patch index 60834c2184..c501b0e487 100644 --- a/patches/server/0420-Convert-legacy-attributes-in-Item-Meta.patch +++ b/patches/server/0420-Convert-legacy-attributes-in-Item-Meta.patch @@ -30,10 +30,10 @@ index d4dba8c733c7560e5108b8d239b52e593f8debec..ea48f1119a940056c37d1d203437bfbf public CraftAttributeMap(AttributeMap handle) { this.handle = handle; diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index e720778ccf009b0038aea72e06d91d5e5e061ecf..8548ed80555bc2b80f8fa1a699ab668307122b8e 100644 +index df7a93208a2a0720fc3cd33f84cace38814c18e1..8230eb49ae61e3b1e51db7a7734a35844673bb11 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -484,7 +484,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -485,7 +485,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier); diff --git a/patches/server/0423-Support-components-in-ItemMeta.patch b/patches/server/0423-Support-components-in-ItemMeta.patch index 0a8703c79b..1f59c07004 100644 --- a/patches/server/0423-Support-components-in-ItemMeta.patch +++ b/patches/server/0423-Support-components-in-ItemMeta.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Support components in ItemMeta diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 7cd7e275c997bbf0ad7aab87aabc27aa722b915c..b9eca4b39cc265cb2d9b9f20ee6f803bea748c7d 100644 +index 8230eb49ae61e3b1e51db7a7734a35844673bb11..59d42dc66f23fc354a7ae4232beee42f1831645f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -878,11 +878,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -879,11 +879,23 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return CraftChatMessage.fromJSONComponent(this.displayName); } @@ -32,7 +32,7 @@ index 7cd7e275c997bbf0ad7aab87aabc27aa722b915c..b9eca4b39cc265cb2d9b9f20ee6f803b @Override public boolean hasDisplayName() { return this.displayName != null; -@@ -1023,6 +1035,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1024,6 +1036,14 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { return this.lore == null ? null : new ArrayList<String>(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent)); } @@ -47,7 +47,7 @@ index 7cd7e275c997bbf0ad7aab87aabc27aa722b915c..b9eca4b39cc265cb2d9b9f20ee6f803b @Override public void setLore(List<String> lore) { if (lore == null || lore.isEmpty()) { -@@ -1037,6 +1057,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1038,6 +1058,21 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } @@ -69,7 +69,7 @@ index 7cd7e275c997bbf0ad7aab87aabc27aa722b915c..b9eca4b39cc265cb2d9b9f20ee6f803b @Override public boolean hasCustomModelData() { return this.customModelData != null; -@@ -1505,6 +1540,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1506,6 +1541,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } for (Object object : addFrom) { diff --git a/patches/server/0453-Create-HoverEvent-from-ItemStack-Entity.patch b/patches/server/0453-Create-HoverEvent-from-ItemStack-Entity.patch index b2004f6a12..9e6e476351 100644 --- a/patches/server/0453-Create-HoverEvent-from-ItemStack-Entity.patch +++ b/patches/server/0453-Create-HoverEvent-from-ItemStack-Entity.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Create HoverEvent from ItemStack Entity diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index b6f5e63c7e7e45dd3eb15bad5c6bee9d5417311e..866106d0d773e407a0cdd8614818cba4ab910040 100644 +index 71db89105c70cb70726fb6a732b899297aeee82a..12f90520e4d6d5fcea0c2f8e19dad9102970cd99 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -533,4 +533,41 @@ public final class CraftItemFactory implements ItemFactory { +@@ -527,4 +527,41 @@ public final class CraftItemFactory implements ItemFactory { return nms != null ? net.minecraft.locale.Language.getInstance().getOrDefault(nms.getItem().getDescriptionId(nms)) : null; } // Paper end - add getI18NDisplayName diff --git a/patches/server/0454-Cache-block-data-strings.patch b/patches/server/0454-Cache-block-data-strings.patch index c52e380c44..776d479b98 100644 --- a/patches/server/0454-Cache-block-data-strings.patch +++ b/patches/server/0454-Cache-block-data-strings.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache block data strings diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a82f7dd2cbc2f6311b810f117f0970a47db85818..2616d771a8a95dac4440b74933c8aa7b83a9bbd1 100644 +index 706e8a5e17ccd87266a5c154cd938974d380cb21..1eaf509c37c176ad94035d0612f69d6ef53b3626 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2148,6 +2148,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2134,6 +2134,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getPlayerList().reloadResources(); this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); @@ -17,10 +17,10 @@ index a82f7dd2cbc2f6311b810f117f0970a47db85818..2616d771a8a95dac4440b74933c8aa7b if (this.isSameThread()) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index cf379f7da8d8e6db0d74f1ca0e4b42e017a8191e..cab13044a3c827256967632a1769f4aec3b11839 100644 +index 85ee8a3d6db6610104f8a10d77d7cad5dc9b667e..bbf58089dd5de3e38a236bb662ea3e139d159161 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -153,7 +153,7 @@ public class CraftBlockData implements BlockData { +@@ -154,7 +154,7 @@ public class CraftBlockData implements BlockData { return exactMatch; } @@ -29,7 +29,7 @@ index cf379f7da8d8e6db0d74f1ca0e4b42e017a8191e..cab13044a3c827256967632a1769f4ae /** * Convert an NMS Enum (usually a BlockStateEnum) to its appropriate Bukkit -@@ -536,9 +536,39 @@ public class CraftBlockData implements BlockData { +@@ -537,9 +537,39 @@ public class CraftBlockData implements BlockData { Preconditions.checkState(CraftBlockData.MAP.put(nms, bukkit) == null, "Duplicate mapping %s->%s", nms, bukkit); } @@ -53,7 +53,7 @@ index cf379f7da8d8e6db0d74f1ca0e4b42e017a8191e..cab13044a3c827256967632a1769f4ae + // Paper start - cache block data strings + if (material != null) { -+ Block block = CraftMagicNumbers.getBlock(material); ++ Block block = CraftBlockType.bukkitToMinecraft(material); + if (block != null) { + net.minecraft.resources.ResourceLocation key = BuiltInRegistries.BLOCK.getKey(block); + data = data == null ? key.toString() : key + data; @@ -67,5 +67,5 @@ index cf379f7da8d8e6db0d74f1ca0e4b42e017a8191e..cab13044a3c827256967632a1769f4ae + private static CraftBlockData createNewData(Material material, String data) { + // Paper end - cache block data strings net.minecraft.world.level.block.state.BlockState blockData; - Block block = CraftMagicNumbers.getBlock(material); + Block block = CraftBlockType.bukkitToMinecraft(material); Map<Property<?>, Comparable<?>> parsed = null; diff --git a/patches/server/0455-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch b/patches/server/0455-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch index 1eda2d7a83..efbf40f12d 100644 --- a/patches/server/0455-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch +++ b/patches/server/0455-Fix-Entity-Teleportation-and-cancel-velocity-if-tele.patch @@ -9,7 +9,7 @@ as this is how Vanilla teleports entities. Cancel any pending motion when teleported. diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 9c0cc06f4ebbfbd7959f05cae12a9f9e7e622c04..0d4e641187b305c4b56782b4c70bca39efcaa69c 100644 +index 101871664077577c5cbe159d5d1a31b0e30ec68d..5550f60424d827616c935e3b0036f1b4f6144e5c 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -657,7 +657,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl @@ -31,10 +31,10 @@ index 9c0cc06f4ebbfbd7959f05cae12a9f9e7e622c04..0d4e641187b305c4b56782b4c70bca39 } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0924677535ba455a2118f7022bdd361c609022d4..452789dc47393580374bf438e6229b1e6cd3832b 100644 +index a1172531baf637915a65fbdee8ca08f08034811d..ec224193e9ca7734fe533d5cfc0e316d5eed2adb 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -160,6 +160,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -162,6 +162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit start private static final int CURRENT_LEVEL = 2; @@ -42,7 +42,7 @@ index 0924677535ba455a2118f7022bdd361c609022d4..452789dc47393580374bf438e6229b1e static boolean isLevelAtLeast(CompoundTag tag, int level) { return tag.contains("Bukkit.updateLevel") && tag.getInt("Bukkit.updateLevel") >= level; } -@@ -1869,6 +1870,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1871,6 +1872,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public void moveTo(double x, double y, double z, float yaw, float pitch) { @@ -57,7 +57,7 @@ index 0924677535ba455a2118f7022bdd361c609022d4..452789dc47393580374bf438e6229b1e this.setYRot(yaw); this.setXRot(pitch); diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java -index 41f549f16f69f9bc50a004096e6c3c0f6e4d4eaf..9ec83d6eeff22c2ce25374a83f581a675d4fd067 100644 +index 0578ac12d92f9af0b0113587db9351b4a41bedd5..9f677a695bdb8ebde457452e4b70c674e2016830 100644 --- a/src/main/java/net/minecraft/world/level/BaseSpawner.java +++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java @@ -169,6 +169,7 @@ public abstract class BaseSpawner { diff --git a/patches/server/0462-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch b/patches/server/0462-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch index 1749b211f0..1e991a4ab7 100644 --- a/patches/server/0462-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch +++ b/patches/server/0462-Fix-deop-kicking-non-whitelisted-player-when-white-l.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix deop kicking non-whitelisted player when white list is diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 2616d771a8a95dac4440b74933c8aa7b83a9bbd1..f73ad3b85ed46913c10891edd3a52b9ad694e5e2 100644 +index 1eaf509c37c176ad94035d0612f69d6ef53b3626..6a23b1ad4c7fd9deaff05e8d00ad6a77a6ed0cec 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2231,13 +2231,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2217,13 +2217,14 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa if (this.isEnforceWhitelist()) { PlayerList playerlist = source.getServer().getPlayerList(); UserWhiteList whitelist = playerlist.getWhiteList(); diff --git a/patches/server/0466-Optimise-getType-calls.patch b/patches/server/0466-Optimise-getType-calls.patch index a8e75fd419..af6462b4f4 100644 --- a/patches/server/0466-Optimise-getType-calls.patch +++ b/patches/server/0466-Optimise-getType-calls.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Optimise getType calls Remove the map lookup for converting from Block->Bukkit Material diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockState.java b/src/main/java/net/minecraft/world/level/block/state/BlockState.java -index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a9b0f5950b6f97ea4c2a1075946b92008b62c9d9 100644 +index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..e33a4ade1dd40ba482e2ca51c3b3ddad284106c3 100644 --- a/src/main/java/net/minecraft/world/level/block/state/BlockState.java +++ b/src/main/java/net/minecraft/world/level/block/state/BlockState.java -@@ -10,6 +10,17 @@ import net.minecraft.world.level.block.state.properties.Property; +@@ -10,6 +10,16 @@ import net.minecraft.world.level.block.state.properties.Property; public class BlockState extends BlockBehaviour.BlockStateBase { public static final Codec<BlockState> CODEC = codec(BuiltInRegistries.BLOCK.byNameCodec(), Block::defaultBlockState).stable(); @@ -18,9 +18,8 @@ index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a9b0f5950b6f97ea4c2a1075946b9200 + + public final org.bukkit.Material getBukkitMaterial() { + if (this.cachedMaterial == null) { -+ this.cachedMaterial = org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getBlock()); ++ this.cachedMaterial = org.bukkit.craftbukkit.block.CraftBlockType.minecraftToBukkit(this.getBlock()); + } -+ + return this.cachedMaterial; + } + // Paper end - optimise getType calls @@ -28,66 +27,66 @@ index da878e180c6b94f98dc82c6e8395f63ecc9b2c1e..a9b0f5950b6f97ea4c2a1075946b9200 super(block, propertyMap, codec); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -index 089f2a4780a0e3515c032d08a1bb2ea375ebdce1..30f6d74e867869b0070de83fe988672a74580043 100644 +index f2ce97e46cdbda0f8960eed9b601c797d8eaef48..85029f1acfdbb411d9ebdf95838d6db3898f4e58 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java -@@ -98,7 +98,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { +@@ -99,7 +99,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { public Material getBlockType(int x, int y, int z) { this.validateChunkCoordinates(x, y, z); -- return CraftMagicNumbers.getMaterial(this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBlock()); +- return CraftBlockType.minecraftToBukkit(this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBlock()); + return this.blockids[this.getSectionIndex(y)].get(x, y & 0xF, z).getBukkitMaterial(); // Paper - optimise getType calls } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java -index a7783474afef0a2bab7e99e475c6d130bb88b01c..aa644231425b9622437538b5c092d4064a40cced 100644 +index a586442422a2b2c06b785af0d261d3e19eb1d59b..aa644231425b9622437538b5c092d4064a40cced 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -220,7 +220,7 @@ public class CraftBlock implements Block { @Override public Material getType() { -- return CraftMagicNumbers.getMaterial(this.world.getBlockState(this.position).getBlock()); +- return CraftBlockType.minecraftToBukkit(this.world.getBlockState(this.position).getBlock()); + return this.world.getBlockState(this.position).getBukkitMaterial(); // Paper - optimise getType calls } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java -index a193583f596c0a587cd0c2d6eac994226ee4fde0..aca63719790429d3d7c7c59a1931a98221c70fc0 100644 +index 8e5279abccdd074d565f246420b2b12b81189b67..928a301627134b49915b0ceaeabb7dc350605dc2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -170,7 +170,7 @@ public class CraftBlockState implements BlockState { @Override public Material getType() { -- return CraftMagicNumbers.getMaterial(this.data.getBlock()); +- return CraftBlockType.minecraftToBukkit(this.data.getBlock()); + return this.data.getBukkitMaterial(); // Paper - optimise getType calls } public void setFlag(int flag) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index c1506afacb6a73ef4a4692c0ae0722b240f01606..89997c2a11b247d2a23dc7c176bce3231639e777 100644 +index bbf58089dd5de3e38a236bb662ea3e139d159161..5a18ca08fe9e2b26bc9e5a01c7afed365e02a1b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -60,7 +60,7 @@ public class CraftBlockData implements BlockData { +@@ -61,7 +61,7 @@ public class CraftBlockData implements BlockData { @Override public Material getMaterial() { -- return CraftMagicNumbers.getMaterial(this.state.getBlock()); +- return CraftBlockType.minecraftToBukkit(this.state.getBlock()); + return this.state.getBukkitMaterial(); // Paper - optimise getType calls } public net.minecraft.world.level.block.state.BlockState getState() { diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -index 35cf747196b43a0f1d9237fdc12424288962f8bd..54c7877f1da51ff8be467fac5e0a37b1fd573d37 100644 +index c96aaa185d9d929cb19f427be82053f0cfa13bad..0fb580530d0b6d4d63ea4b85fec9240eb5c74df4 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftChunkData.java -@@ -95,7 +95,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { +@@ -96,7 +96,7 @@ public final class CraftChunkData implements ChunkGenerator.ChunkData { @Override public Material getType(int x, int y, int z) { -- return CraftMagicNumbers.getMaterial(this.getTypeId(x, y, z).getBlock()); +- return CraftBlockType.minecraftToBukkit(this.getTypeId(x, y, z).getBlock()); + return this.getTypeId(x, y, z).getBukkitMaterial(); // Paper - optimise getType calls } diff --git a/patches/server/0473-Add-getOfflinePlayerIfCached-String.patch b/patches/server/0473-Add-getOfflinePlayerIfCached-String.patch index d91285ae46..d0ca1491c1 100644 --- a/patches/server/0473-Add-getOfflinePlayerIfCached-String.patch +++ b/patches/server/0473-Add-getOfflinePlayerIfCached-String.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add getOfflinePlayerIfCached(String) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 84ff901c4805516bbe438b4ad808e75cd2e15a9d..508ccf9685058674020c04914d8107e7fb1912ce 100644 +index ea2ca7a37d0bdcc1ccc1627e4246a8290e32d16f..95edbf365a916687d9a6a2e7598435fa1a32baf4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -1910,6 +1910,28 @@ public final class CraftServer implements Server { +@@ -1909,6 +1909,28 @@ public final class CraftServer implements Server { return result; } diff --git a/patches/server/0483-Add-Destroy-Speed-API.patch b/patches/server/0483-Add-Destroy-Speed-API.patch index 56532eca85..21dcb0d34a 100644 --- a/patches/server/0483-Add-Destroy-Speed-API.patch +++ b/patches/server/0483-Add-Destroy-Speed-API.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add Destroy Speed API Co-authored-by: Jake Potrebic <[email protected]> diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index 89997c2a11b247d2a23dc7c176bce3231639e777..f116f6997562a3ccb1a4830515ea6ee25ce29d77 100644 +index 5a18ca08fe9e2b26bc9e5a01c7afed365e02a1b7..f75455bf199258fa7097daf777d28ff672039fa2 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -702,4 +702,19 @@ public class CraftBlockData implements BlockData { +@@ -703,4 +703,19 @@ public class CraftBlockData implements BlockData { public BlockState createBlockState() { return CraftBlockStates.getBlockState(this.state, null); } diff --git a/patches/server/0489-Climbing-should-not-bypass-cramming-gamerule.patch b/patches/server/0489-Climbing-should-not-bypass-cramming-gamerule.patch index 18b9b50fa7..e3bd0d6040 100644 --- a/patches/server/0489-Climbing-should-not-bypass-cramming-gamerule.patch +++ b/patches/server/0489-Climbing-should-not-bypass-cramming-gamerule.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Climbing should not bypass cramming gamerule diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 46637e6913e5f2aae0be6aa67b95f1fe604b021e..28d12ffb79a29be67b6476ae7fa87b557f55839f 100644 +index 4a1245fb3ad821ee997b35f180390a07bc871982..82eb980dd463c423b2b30a3149166a227608bb96 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2062,6 +2062,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2064,6 +2064,12 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean isPushable() { @@ -44,7 +44,7 @@ index 68e4440765636295a74ea942862d772d47282ad6..93a41156a01a1638f3ef469b1518a07e } else if (entity.level().isClientSide && (!(entity1 instanceof Player) || !((Player) entity1).isLocalPlayer())) { return false; diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 90c66f87e721ef34bf3f47b601456fece3064225..bf617621c88c68198709d1ed238622c3fcec89bd 100644 +index 05fe4828af59e3cd894c9979ecb08ad0e1c6b2d3..7d72477cdeaa8238da1291c0a902d090463b95c8 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -3426,7 +3426,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/0505-Cache-burn-durations.patch b/patches/server/0505-Cache-burn-durations.patch index c4372f6401..153295f240 100644 --- a/patches/server/0505-Cache-burn-durations.patch +++ b/patches/server/0505-Cache-burn-durations.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Cache burn durations diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index d7a89c2b70de20f632ee210780ede0bc36369710..b6e31bede16f7dbc9abb6609f1c39b82883512b2 100644 +index 939a192dd66d5fb8da5beada7c22eeca5a7589cd..7bcc4ede30f9cd1af2b0560bd3eca18e11a5524c 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -133,7 +133,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -134,7 +134,13 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit this.recipeType = recipeType; // Paper } @@ -22,7 +22,7 @@ index d7a89c2b70de20f632ee210780ede0bc36369710..b6e31bede16f7dbc9abb6609f1c39b82 Map<Item, Integer> map = Maps.newLinkedHashMap(); AbstractFurnaceBlockEntity.add(map, (ItemLike) Items.LAVA_BUCKET, 20000); -@@ -195,7 +201,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -196,7 +202,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.AZALEA, 100); AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.FLOWERING_AZALEA, 100); AbstractFurnaceBlockEntity.add(map, (ItemLike) Blocks.MANGROVE_ROOTS, 300); diff --git a/patches/server/0514-Added-ServerResourcesReloadedEvent.patch b/patches/server/0514-Added-ServerResourcesReloadedEvent.patch index cb19b400e4..1bfd02f43f 100644 --- a/patches/server/0514-Added-ServerResourcesReloadedEvent.patch +++ b/patches/server/0514-Added-ServerResourcesReloadedEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Added ServerResourcesReloadedEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index f73ad3b85ed46913c10891edd3a52b9ad694e5e2..c063dece36e110691297b38635a9d14d70c4e391 100644 +index 6a23b1ad4c7fd9deaff05e8d00ad6a77a6ed0cec..a75c6825eaee07bbde9b7c81c4232bc982a98326 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2108,7 +2108,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2094,7 +2094,13 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return this.functionManager; } @@ -22,7 +22,7 @@ index f73ad3b85ed46913c10891edd3a52b9ad694e5e2..c063dece36e110691297b38635a9d14d RegistryAccess.Frozen iregistrycustom_dimension = this.registries.getAccessForLoading(RegistryLayer.RELOADABLE); CompletableFuture<Void> completablefuture = CompletableFuture.supplyAsync(() -> { Stream<String> stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2149,6 +2155,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2135,6 +2141,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary()); this.structureTemplateManager.onResourceManagerReload(this.resources.resourceManager); org.bukkit.craftbukkit.block.data.CraftBlockData.reloadCache(); // Paper - cache block data strings, they can be defined by datapacks so refresh it here diff --git a/patches/server/0526-Collision-option-for-requiring-a-player-participant.patch b/patches/server/0526-Collision-option-for-requiring-a-player-participant.patch index c2fd07edd8..c3fe393aff 100644 --- a/patches/server/0526-Collision-option-for-requiring-a-player-participant.patch +++ b/patches/server/0526-Collision-option-for-requiring-a-player-participant.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Collision option for requiring a player participant diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index a0c70b204007a906076d3a1f28c84521ad4471c4..3b2c100c678dab10f72483769fba6cbf3371d377 100644 +index 5436949cd928303cf80b606c747f386f0189f774..025ec74fe0ada57e1809d7e16c27b3a08007ad78 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1932,6 +1932,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1934,6 +1934,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void push(Entity entity) { if (!this.isPassengerOfSameVehicle(entity)) { if (!entity.noPhysics && !this.noPhysics) { diff --git a/patches/server/0538-EntityMoveEvent.patch b/patches/server/0538-EntityMoveEvent.patch index 293bf8e5a0..06c846fb45 100644 --- a/patches/server/0538-EntityMoveEvent.patch +++ b/patches/server/0538-EntityMoveEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] EntityMoveEvent diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index c063dece36e110691297b38635a9d14d70c4e391..5f440e3d3a750c65d0d13834eca553b8f5a521a6 100644 +index a75c6825eaee07bbde9b7c81c4232bc982a98326..f89d2dc9ec8bfe0b401b96bffd59502bf903a24d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1590,6 +1590,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1584,6 +1584,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper @@ -17,7 +17,7 @@ index c063dece36e110691297b38635a9d14d70c4e391..5f440e3d3a750c65d0d13834eca553b8 this.profiler.push(() -> { return worldserver + " " + worldserver.dimension().location(); diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 9ad59776ad035b8f6069f5df1fda174002ef58d1..c5fc4d510ebdc1308759be9f6ac79dfff9c69895 100644 +index efbdcaff160e1c8e666d54a9babe35ac325ec8a5..3396f940f5c7c4e7b77a4570c34fbe5ad2c7da01 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -221,6 +221,7 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/0553-Add-recipe-to-cook-events.patch b/patches/server/0553-Add-recipe-to-cook-events.patch index e7fabd3ae9..a2cd4180a6 100644 --- a/patches/server/0553-Add-recipe-to-cook-events.patch +++ b/patches/server/0553-Add-recipe-to-cook-events.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add recipe to cook events diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index b6e31bede16f7dbc9abb6609f1c39b82883512b2..37cdb835bdc665dc5858eb570cfd08e2cdd98eab 100644 +index 7bcc4ede30f9cd1af2b0560bd3eca18e11a5524c..97b8dc205fb22e17ab457e8d1f4d73a7b2f8cc47 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -437,7 +437,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -438,7 +438,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit CraftItemStack source = CraftItemStack.asCraftMirror(itemstack); org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack1); @@ -18,7 +18,7 @@ index b6e31bede16f7dbc9abb6609f1c39b82883512b2..37cdb835bdc665dc5858eb570cfd08e2 if (furnaceSmeltEvent.isCancelled()) { diff --git a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java -index 24e2063db933bfbc8fc1f34edb8106ae4d7c633c..04b2697ee857e714b1202d02d093b0c60f079a6f 100644 +index f706c787f7608f7440a5f5e05e7e9c4cb582368c..f776289eea00bd741ad55bb9bc338dd2c05c8b39 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/CampfireBlockEntity.java @@ -63,8 +63,10 @@ public class CampfireBlockEntity extends BlockEntity implements Clearable { diff --git a/patches/server/0560-forced-whitelist-use-configurable-kick-message.patch b/patches/server/0560-forced-whitelist-use-configurable-kick-message.patch index dfe9eda9fc..b9622a232c 100644 --- a/patches/server/0560-forced-whitelist-use-configurable-kick-message.patch +++ b/patches/server/0560-forced-whitelist-use-configurable-kick-message.patch @@ -5,10 +5,10 @@ Subject: [PATCH] forced whitelist: use configurable kick message diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 5f440e3d3a750c65d0d13834eca553b8f5a521a6..36ca381445102fee1960410aa56e8b2a28dca615 100644 +index f89d2dc9ec8bfe0b401b96bffd59502bf903a24d..fbfe5d18a004225396f2d33084fb5073af2d9731 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2247,7 +2247,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2233,7 +2233,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerPlayer entityplayer = (ServerPlayer) iterator.next(); if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) diff --git a/patches/server/0568-add-consumeFuel-to-FurnaceBurnEvent.patch b/patches/server/0568-add-consumeFuel-to-FurnaceBurnEvent.patch index 68c2cd3ffe..2876903f08 100644 --- a/patches/server/0568-add-consumeFuel-to-FurnaceBurnEvent.patch +++ b/patches/server/0568-add-consumeFuel-to-FurnaceBurnEvent.patch @@ -5,10 +5,10 @@ Subject: [PATCH] add consumeFuel to FurnaceBurnEvent diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 37cdb835bdc665dc5858eb570cfd08e2cdd98eab..3530040df9e4999ea4ccc96b5df5767fdb330fe5 100644 +index 97b8dc205fb22e17ab457e8d1f4d73a7b2f8cc47..11ee20c6dc87baa063e8293ebdd9d5247a3e932e 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -358,7 +358,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -359,7 +359,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit if (blockEntity.isLit() && furnaceBurnEvent.isBurning()) { // CraftBukkit end flag1 = true; diff --git a/patches/server/0573-More-World-API.patch b/patches/server/0573-More-World-API.patch index ce1ceead86..eb190ca0b7 100644 --- a/patches/server/0573-More-World-API.patch +++ b/patches/server/0573-More-World-API.patch @@ -5,7 +5,7 @@ Subject: [PATCH] More World API diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 3fbc0ea59ac2e56e3f024104c7904614827c8e04..6ab03cc55658789baedf5374ebb9c0a6c0187826 100644 +index b70239ff42f5c7f4754bae311385e4804891fd86..43d3c45cd7a178a4ca30e4c0c7fb1e7e21cd89f1 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -2176,6 +2176,53 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -50,7 +50,7 @@ index 3fbc0ea59ac2e56e3f024104c7904614827c8e04..6ab03cc55658789baedf5374ebb9c0a6 + + @Override + public Collection<org.bukkit.Material> getInfiniburn() { -+ return com.google.common.collect.Sets.newHashSet(com.google.common.collect.Iterators.transform(net.minecraft.core.registries.BuiltInRegistries.BLOCK.getTagOrEmpty(this.getHandle().dimensionType().infiniburn()).iterator(), blockHolder -> CraftMagicNumbers.getMaterial(blockHolder.value()))); ++ return com.google.common.collect.Sets.newHashSet(com.google.common.collect.Iterators.transform(net.minecraft.core.registries.BuiltInRegistries.BLOCK.getTagOrEmpty(this.getHandle().dimensionType().infiniburn()).iterator(), blockHolder -> CraftBlockType.minecraftToBukkit(blockHolder.value()))); + } + + @Override diff --git a/patches/server/0585-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0585-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch index 0846ef70e1..2a75ad4204 100644 --- a/patches/server/0585-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0585-Add-raw-address-to-AsyncPlayerPreLoginEvent.patch @@ -5,21 +5,21 @@ Subject: [PATCH] Add raw address to AsyncPlayerPreLoginEvent diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index c58fc7d950ea2aa136c3922fb14e4f183f45f2d3..833e17796a75c24eb4f2eb76ed00160229458e39 100644 +index 70e89b77e99846258aae59de6246f82cff312452..b1b778c534fae23294b95b084fac0f52f94c37c2 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -285,12 +285,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public void fireEvents(GameProfile gameprofile) throws Exception { - String playerName = gameprofile.getName(); - java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); -+ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper - java.util.UUID uniqueId = gameprofile.getId(); - final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; +@@ -290,12 +290,13 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + private void callPlayerPreLoginEvents(GameProfile gameprofile) throws Exception { + String playerName = gameprofile.getName(); + java.net.InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress(); ++ java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) this.connection.channel.remoteAddress()).getAddress(); // Paper + java.util.UUID uniqueId = gameprofile.getId(); + final org.bukkit.craftbukkit.CraftServer server = ServerLoginPacketListenerImpl.this.server.server; - // Paper start - com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); -- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); -+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress - server.getPluginManager().callEvent(asyncEvent); - profile = asyncEvent.getPlayerProfile(); - profile.complete(true); // Paper - setPlayerProfileAPI + // Paper start + com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); +- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId, profile); ++ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress + server.getPluginManager().callEvent(asyncEvent); + profile = asyncEvent.getPlayerProfile(); + profile.complete(true); // Paper - setPlayerProfileAPI diff --git a/patches/server/0588-Add-basic-Datapack-API.patch b/patches/server/0588-Add-basic-Datapack-API.patch index f0490f3fbd..6b29653667 100644 --- a/patches/server/0588-Add-basic-Datapack-API.patch +++ b/patches/server/0588-Add-basic-Datapack-API.patch @@ -92,7 +92,7 @@ index 0000000000000000000000000000000000000000..cf4374493c11057451a62a655514415c + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 354a8bfb7afc233b2bac6a4904ef6427ae0f7c41..d7fe701f3eb474895c8175c0539afd4875bd0092 100644 +index 346a4d7204e872f9a0e081b2afd4276b33d2cf20..1a4168073251e105c53dae2da040367294eb3787 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -301,6 +301,7 @@ public final class CraftServer implements Server { @@ -111,7 +111,7 @@ index 354a8bfb7afc233b2bac6a4904ef6427ae0f7c41..d7fe701f3eb474895c8175c0539afd48 } public boolean getCommandBlockOverride(String command) { -@@ -2950,5 +2952,11 @@ public final class CraftServer implements Server { +@@ -2949,5 +2951,11 @@ public final class CraftServer implements Server { public com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() { return mobGoals; } diff --git a/patches/server/0600-More-Lidded-Block-API.patch b/patches/server/0600-More-Lidded-Block-API.patch index e65c6a26cb..d36768f000 100644 --- a/patches/server/0600-More-Lidded-Block-API.patch +++ b/patches/server/0600-More-Lidded-Block-API.patch @@ -53,10 +53,10 @@ index 79fafa30e4f09dc375cc3fcb1d95a9ab6c8fb9f4..872a579460ebe8d6085188a6be9c9eb9 + // Paper end - More Lidded Block API } diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java -index e9c72d58596c528909bbfbccb97b85d36aca7703..3ccab14646c385b10dd310e2f7640fd2249f5371 100644 +index a8120eb14e111b134a1496b91f8341f8e14a2a9b..07c428e5b3673e4028fe303dde5f30040b5ec3d7 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftShulkerBox.java -@@ -59,7 +59,7 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem +@@ -58,7 +58,7 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem if (this.getTileEntity().opened && this.getWorldHandle() instanceof net.minecraft.world.level.Level) { net.minecraft.world.level.Level world = this.getTileEntity().getLevel(); world.blockEvent(this.getPosition(), this.getTileEntity().getBlockState().getBlock(), 1, 0); @@ -65,7 +65,7 @@ index e9c72d58596c528909bbfbccb97b85d36aca7703..3ccab14646c385b10dd310e2f7640fd2 } this.getTileEntity().opened = false; } -@@ -68,4 +68,11 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem +@@ -67,4 +67,11 @@ public class CraftShulkerBox extends CraftLootable<ShulkerBoxBlockEntity> implem public CraftShulkerBox copy() { return new CraftShulkerBox(this); } diff --git a/patches/server/0602-Add-PlayerKickEvent-causes.patch b/patches/server/0602-Add-PlayerKickEvent-causes.patch index 01c6b098f8..d5911f6435 100644 --- a/patches/server/0602-Add-PlayerKickEvent-causes.patch +++ b/patches/server/0602-Add-PlayerKickEvent-causes.patch @@ -48,10 +48,10 @@ index 96814e626a95e4e3c2f4df1a0339d37bb02f2e61..85a8a687b1568a56e3e646b37ef78b56 public boolean shouldDisconnect() { diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 8937b71511bc1dce082683b4107d52e0e632e7a2..6f17e5631aace53f75e6badf514dbb77c50065b9 100644 +index 2acd875f34c367f9b9db85dee5052140c05d0add..26f4516f20336ddfaf868337cab3a05166f01b8d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2250,7 +2250,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2236,7 +2236,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerPlayer entityplayer = (ServerPlayer) iterator.next(); if (!whitelist.isWhiteListed(entityplayer.getGameProfile()) && !this.getPlayerList().isOp(entityplayer.getGameProfile())) { // Paper - Fix kicking ops when whitelist is reloaded (MC-171420) @@ -209,7 +209,7 @@ index 0616a8e89931680602da2dbc640906708aebd5ca..70458ff8c9bf6f3263868b0f5570840f if (this.cserver.getServer().isRunning()) { this.cserver.getPluginManager().callEvent(event); diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java -index 294074cb4cac5089b57f3629f46d71175911a906..dc9b2fb7555d37532569f60fae49091ce2e6c98c 100644 +index 4d23d019173d0921145338544e190bc34f9f45c2..1a85755ad62498c263783d1d54130d023105ec8d 100644 --- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java @@ -342,7 +342,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl diff --git a/patches/server/0610-Fix-dangerous-end-portal-logic.patch b/patches/server/0610-Fix-dangerous-end-portal-logic.patch index 57f7231a1d..cfe7d2c110 100644 --- a/patches/server/0610-Fix-dangerous-end-portal-logic.patch +++ b/patches/server/0610-Fix-dangerous-end-portal-logic.patch @@ -11,10 +11,10 @@ Move the tick logic into the post tick, where portaling was designed to happen in the first place. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 3b2c100c678dab10f72483769fba6cbf3371d377..229ed03a59c77d37242b44edabc2ddb843037fa6 100644 +index 025ec74fe0ada57e1809d7e16c27b3a08007ad78..486a4d9e5cd421e2444327e2c28e4f674c98894a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -490,6 +490,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -492,6 +492,36 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // Paper end // Paper start - optimise entity tracking final org.spigotmc.TrackingRange.TrackingRangeType trackingRangeType = org.spigotmc.TrackingRange.getTrackingRangeType(this); diff --git a/patches/server/0612-Make-item-validations-configurable.patch b/patches/server/0612-Make-item-validations-configurable.patch index 37706dc367..29c71c0040 100644 --- a/patches/server/0612-Make-item-validations-configurable.patch +++ b/patches/server/0612-Make-item-validations-configurable.patch @@ -32,10 +32,10 @@ index 5e01357208fe52c1d270c68cb19029ea0f4057bb..6d85237b21650edf1d2dc71abaf0edbe } } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index a93847d69729fade6b81efb41627026ae4aec282..ece1ef7285c1859b4e90aa4f77453827f52521cb 100644 +index 59d42dc66f23fc354a7ae4232beee42f1831645f..b7c0c9a40dac3e828f880ef928ca34206a898cb9 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -361,7 +361,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -362,7 +362,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { CompoundTag display = tag.getCompound(CraftMetaItem.DISPLAY.NBT); if (display.contains(CraftMetaItem.NAME.NBT)) { @@ -44,7 +44,7 @@ index a93847d69729fade6b81efb41627026ae4aec282..ece1ef7285c1859b4e90aa4f77453827 } if (display.contains(CraftMetaItem.LOCNAME.NBT)) { -@@ -372,7 +372,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -373,7 +373,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { ListTag list = display.getList(CraftMetaItem.LORE.NBT, CraftMagicNumbers.NBT.TAG_STRING); this.lore = new ArrayList<String>(list.size()); for (int index = 0; index < list.size(); index++) { diff --git a/patches/server/0649-Add-missing-team-sidebar-display-slots.patch b/patches/server/0649-Add-missing-team-sidebar-display-slots.patch index 0d7e79e26d..2a080ce725 100644 --- a/patches/server/0649-Add-missing-team-sidebar-display-slots.patch +++ b/patches/server/0649-Add-missing-team-sidebar-display-slots.patch @@ -52,13 +52,14 @@ index 73c5ffff70605b32188a9bb5fb6c0ee04cb66efe..711d227f5ee6d63356a94a0567968da4 } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 128c9d81814ba1fb24895962e5f08495dbedb176..812819e814cfbdb542051a7dbfe123d3c59e66bd 100644 +index 31714ce05b1023b82e96b36ba52254b4e3e948f2..a06352499b9f2c6fb84e585459077b4aa1886d6f 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -239,6 +239,14 @@ public class Commodore - desc = getOriginalOrRewrite( desc ); +@@ -217,6 +217,15 @@ public class Commodore { + desc = getOriginalOrRewrite(desc); } // Paper end ++ + // Paper start - DisplaySlot + if (owner.equals("org/bukkit/scoreboard/DisplaySlot")) { + if (name.startsWith("SIDEBAR_") && !name.startsWith("SIDEBAR_TEAM_")) { @@ -67,9 +68,9 @@ index 128c9d81814ba1fb24895962e5f08495dbedb176..812819e814cfbdb542051a7dbfe123d3 + } + } + // Paper end - DisplaySlot - - if ( owner.equals( "org/bukkit/block/Biome" ) ) - { + if (owner.equals("org/bukkit/block/Biome")) { + switch (name) { + case "NETHER": diff --git a/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java b/src/test/java/io/papermc/paper/scoreboard/DisplaySlotTest.java new file mode 100644 index 0000000000000000000000000000000000000000..69c9678f8218c240be1044eeabe1c6bef7747b1e diff --git a/patches/server/0654-Add-more-advancement-API.patch b/patches/server/0654-Add-more-advancement-API.patch index 898749f4af..9504a69ec5 100644 --- a/patches/server/0654-Add-more-advancement-API.patch +++ b/patches/server/0654-Add-more-advancement-API.patch @@ -164,18 +164,18 @@ index 8ca86852319d7463f60832bc98b825b0b4325995..62ada73302c6b3ce3fb2dcc8c31a1d9c private final DisplayInfo handle; diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 812819e814cfbdb542051a7dbfe123d3c59e66bd..61d00421b295103a6964b22fe0dfaf097bd7a671 100644 +index a06352499b9f2c6fb84e585459077b4aa1886d6f..6d6a7abe1aa39a2e4ecf3ac5f55b1f227e1a9db9 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -56,6 +56,7 @@ public class Commodore - ) ); +@@ -56,6 +56,7 @@ public class Commodore { + ); // Paper start - Plugin rewrites + private static final String CB_PACKAGE = org.bukkit.Bukkit.getServer().getClass().getPackageName().replace('.', '/'); private static final Map<String, String> SEARCH_AND_REMOVE = initReplacementsMap(); - private static Map<String, String> initReplacementsMap() - { -@@ -457,6 +458,11 @@ public class Commodore + private static Map<String, String> initReplacementsMap() { + Map<String, String> getAndRemove = new HashMap<>(); +@@ -388,6 +389,11 @@ public class Commodore { super.visitMethodInsn(opcode, owner, name, "()Lcom/destroystokyo/paper/profile/PlayerProfile;", itf); return; } @@ -185,8 +185,8 @@ index 812819e814cfbdb542051a7dbfe123d3c59e66bd..61d00421b295103a6964b22fe0dfaf09 + return; + } // Paper end - if ( modern ) - { + + if (modern) { diff --git a/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java b/src/test/java/io/papermc/paper/advancement/AdvancementFrameTest.java new file mode 100644 index 0000000000000000000000000000000000000000..47535c27d7cffc4b5ee6cc9e145b1087477eef79 diff --git a/patches/server/0655-Add-ItemFactory-getSpawnEgg-API.patch b/patches/server/0655-Add-ItemFactory-getSpawnEgg-API.patch index 0c570a0951..1876c86ea1 100644 --- a/patches/server/0655-Add-ItemFactory-getSpawnEgg-API.patch +++ b/patches/server/0655-Add-ItemFactory-getSpawnEgg-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add ItemFactory#getSpawnEgg API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 866106d0d773e407a0cdd8614818cba4ab910040..259489c7d0f4b5ce3e8f4294f4f853e9b51ded0b 100644 +index 12f90520e4d6d5fcea0c2f8e19dad9102970cd99..2dc5cdf72034f27cf9c61ce979a7018f169bb786 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -570,4 +570,19 @@ public final class CraftItemFactory implements ItemFactory { +@@ -564,4 +564,19 @@ public final class CraftItemFactory implements ItemFactory { new net.md_5.bungee.api.chat.TextComponent(customName)); } // Paper end - bungee hover events @@ -29,14 +29,13 @@ index 866106d0d773e407a0cdd8614818cba4ab910040..259489c7d0f4b5ce3e8f4294f4f853e9 + // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 61d00421b295103a6964b22fe0dfaf097bd7a671..2a75bd263dce91bc64601f96b622ed6d4fb18fe6 100644 +index 6d6a7abe1aa39a2e4ecf3ac5f55b1f227e1a9db9..010014c06fcea7d603160928f124f54d6e5e63d8 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -464,6 +464,16 @@ public class Commodore - return; +@@ -396,6 +396,15 @@ public class Commodore { } // Paper end -+ + + // Paper start - ItemFactory#getSpawnEgg (paper had original method that returned ItemStack, upstream added identical but returned Material) + if (owner.equals("org/bukkit/inventory/ItemFactory") && name.equals("getSpawnEgg") && desc.equals("(Lorg/bukkit/entity/EntityType;)Lorg/bukkit/inventory/ItemStack;")) { + super.visitInsn(Opcodes.SWAP); // has 1 param, this moves the owner instance to the top for the checkcast @@ -46,6 +45,6 @@ index 61d00421b295103a6964b22fe0dfaf097bd7a671..2a75bd263dce91bc64601f96b622ed6d + return; + } + // Paper end - ItemFactory#getSpawnEgg - if ( modern ) - { - if ( owner.equals( "org/bukkit/Material" ) ) + if (modern) { + if (owner.equals("org/bukkit/Material") || (instantiatedMethodType != null && instantiatedMethodType.getDescriptor().startsWith("(Lorg/bukkit/Material;)"))) { + switch (name) { diff --git a/patches/server/0660-Add-API-for-resetting-a-single-score.patch b/patches/server/0660-Add-API-for-resetting-a-single-score.patch index 0fc3bdf5fe..b9dd1c2be3 100644 --- a/patches/server/0660-Add-API-for-resetting-a-single-score.patch +++ b/patches/server/0660-Add-API-for-resetting-a-single-score.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add API for resetting a single score It was only possible to reset all scores for a specific entry, instead of resetting only specific scores. diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -index a7f53c135bae2a464e7cd28bf8e990d692c63d63..be020d6b686c1ad5bd8b7cee0b6050304d434022 100644 +index 29e24461e29e4cf3d31497198debcde18761ad73..ceb1a39c02c3cfa7632a0fdca414c7046888fcb1 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -@@ -68,4 +68,12 @@ final class CraftScore implements Score { +@@ -66,4 +66,12 @@ final class CraftScore implements Score { public CraftScoreboard getScoreboard() { return this.objective.getScoreboard(); } diff --git a/patches/server/0661-Add-Raw-Byte-Entity-Serialization.patch b/patches/server/0661-Add-Raw-Byte-Entity-Serialization.patch index 157a4fccf8..4479e72d21 100644 --- a/patches/server/0661-Add-Raw-Byte-Entity-Serialization.patch +++ b/patches/server/0661-Add-Raw-Byte-Entity-Serialization.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Add Raw Byte Entity Serialization public net.minecraft.world.entity.Entity setLevel(Lnet/minecraft/world/level/Level;)V diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 6f023b22a1051baaa5310d8c5a1aa6d8b76d8992..65ab99c3f3f1478db6e14d713e82346d3ecc06a5 100644 +index 8db434d01f2771a94cd4c4a662ea0482b2a02307..58aa16888666f81ba688037bff61d149a03767af 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2157,6 +2157,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2159,6 +2159,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } } diff --git a/patches/server/0666-Add-paper-mobcaps-and-paper-playermobcaps.patch b/patches/server/0666-Add-paper-mobcaps-and-paper-playermobcaps.patch index b0aa5c9060..9fcd87b772 100644 --- a/patches/server/0666-Add-paper-mobcaps-and-paper-playermobcaps.patch +++ b/patches/server/0666-Add-paper-mobcaps-and-paper-playermobcaps.patch @@ -278,10 +278,10 @@ index 9df761f5cf043e8d2dffa711c20ab32fe2992331..d08c7b0b52065980f1f13c5533ff6355 // Paper start - add parameters and int ret type spawnCategoryForChunk(group, world, chunk, checker, runner, Integer.MAX_VALUE, null); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 21dfa2d10e1c67c968b59eb11132ab1ff46ba2d7..ca605b33c57159add46f6b84c975c25c678fdf17 100644 +index 7621b77d49330e462c4857f2033d74723eee4281..e7e29ee51247fd7d5749d72d34a39d210e0c83ff 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2280,6 +2280,11 @@ public final class CraftServer implements Server { +@@ -2279,6 +2279,11 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { @@ -294,7 +294,7 @@ index 21dfa2d10e1c67c968b59eb11132ab1ff46ba2d7..ca605b33c57159add46f6b84c975c25c } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 04c6d7c60123e6020c78eeb9a4712ead71e64871..ed0f6e460254a439edf15cca5458101b7146d391 100644 +index b52d3413cfe725ff5778c897a0ba06ca834e533f..24156bd9d964e2c32bc758dd9e099744cf8ac647 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1761,9 +1761,14 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0678-Execute-chunk-tasks-mid-tick.patch b/patches/server/0678-Execute-chunk-tasks-mid-tick.patch index 7fda5bbc5f..44b55eed83 100644 --- a/patches/server/0678-Execute-chunk-tasks-mid-tick.patch +++ b/patches/server/0678-Execute-chunk-tasks-mid-tick.patch @@ -19,10 +19,10 @@ index 6b3cde6d4d1e63bec01f502f2027ee9fddac08aa..46449728f69ee7d4f78470f8da23c055 private MinecraftTimings() {} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 6f17e5631aace53f75e6badf514dbb77c50065b9..0a23cfeaba071c2179de1931caa86bc46462c338 100644 +index 26f4516f20336ddfaf868337cab3a05166f01b8d..6873036e7d24a2b8e85ab7ae270eec63bd7e7b5b 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1347,8 +1347,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1341,8 +1341,79 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa return flag; } @@ -123,7 +123,7 @@ index 63fad53a9184d7ab97f143b7d85ae9ef2ca9f8bc..1483007b79e18107e41037c279e048f0 } } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 5329fe64b64fab73d3bda02c700a6f01aa2d9637..4df6c879aae57cb85c67a0c7342fc33db6f180dc 100644 +index ce74bfb123427c5459c03c3c8f85445077c329c7..6b999e05f93b0da1a3cc9a679a3a88b89df4aab5 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -216,6 +216,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -151,7 +151,7 @@ index 5329fe64b64fab73d3bda02c700a6f01aa2d9637..4df6c879aae57cb85c67a0c7342fc33d } diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index b0a05a1a5129af0f5c11139a6fb7acd08ee3eb0e..43f43c59138b661299f20cba89d91aa5585cdf32 100644 +index e297be9cf8c59b6b8d051d5db70c3bebcd235a2d..02dfea10b27c6f932bc5742f6c577e30c155b3fe 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -927,6 +927,11 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0683-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/0683-Use-Velocity-compression-and-cipher-natives.patch index d264e5b26a..d1fecc8c75 100644 --- a/patches/server/0683-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/0683-Use-Velocity-compression-and-cipher-natives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index 3a3a6ce8833afca0caff2a3b92ad593bf75e951a..ed352bcf238199534720b17ab94401153eeeed1b 100644 +index c6241f858209ed662d8720217d143340916024e9..517920023bc28fea04eeb709364d5a7292adcc5e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -40,6 +40,11 @@ dependencies { +@@ -39,6 +39,11 @@ dependencies { runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1") runtimeOnly("com.mysql:mysql-connector-j:8.2.0") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper @@ -337,10 +337,10 @@ index 5f625acf04ddb56e3596d086252f9bfccfdb95f2..54c7f34ba3dc8466223e589702d0c93a protected void initChannel(Channel channel) { Connection.setInitialProtocolAttributes(channel); diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index 833e17796a75c24eb4f2eb76ed00160229458e39..0c4fb4a7d4fcdc6d724beb13a16bd729a3c525cd 100644 +index 8f60341a3f17fa4553a22e4a98699e0855c54e06..7da7571eef2a90d039da3a3ec122398b523b6730 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -218,12 +218,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -223,12 +223,14 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, } SecretKey secretkey = packet.getSecretKey(privatekey); diff --git a/patches/server/0684-Detail-more-information-in-watchdog-dumps.patch b/patches/server/0684-Detail-more-information-in-watchdog-dumps.patch index bb2af55f79..3e22a49852 100644 --- a/patches/server/0684-Detail-more-information-in-watchdog-dumps.patch +++ b/patches/server/0684-Detail-more-information-in-watchdog-dumps.patch @@ -76,7 +76,7 @@ index 7de24c39b460e43d27839b3821e67213508ece81..7297bca9224c12d7ace0e1967340d994 }); throw RunningOnDifferentThreadException.RUNNING_ON_DIFFERENT_THREAD; diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index bc826660514a76738f5256bf571eb2abf8bf85ef..53ab0a55cef95bf7660ccf68558967ce9b63c741 100644 +index a9f336ed75ef406c1179bdc6e63e6fd944470534..56c999c7f80b280966e81a0b1ca4929f034edb20 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1244,7 +1244,26 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -122,10 +122,10 @@ index bc826660514a76738f5256bf571eb2abf8bf85ef..53ab0a55cef95bf7660ccf68558967ce private void tickPassenger(Entity vehicle, Entity passenger) { diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 70f3def7c659ff2b44ddcbdccfba8bbdf835c160..bcc6d2cf3300d2e6eadadbcc03dc5aaaf2b5d7e3 100644 +index 58aa16888666f81ba688037bff61d149a03767af..0710061e41d6d6e5b38e62212bbd04e9ada0ec68 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1029,7 +1029,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1031,7 +1031,42 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S return this.onGround; } @@ -168,7 +168,7 @@ index 70f3def7c659ff2b44ddcbdccfba8bbdf835c160..bcc6d2cf3300d2e6eadadbcc03dc5aaa if (this.noPhysics) { this.setPos(this.getX() + movement.x, this.getY() + movement.y, this.getZ() + movement.z); } else { -@@ -1199,6 +1234,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1201,6 +1236,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.level().getProfiler().pop(); } } diff --git a/patches/server/0698-Update-head-rotation-in-missing-places.patch b/patches/server/0698-Update-head-rotation-in-missing-places.patch index b0b48b12d9..e22e6f7281 100644 --- a/patches/server/0698-Update-head-rotation-in-missing-places.patch +++ b/patches/server/0698-Update-head-rotation-in-missing-places.patch @@ -8,10 +8,10 @@ This is because bukkit uses a separate head rotation field for yaw. This issue only applies to players. diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bcc6d2cf3300d2e6eadadbcc03dc5aaaf2b5d7e3..61a25a5557309d8640795322d77bc61ca5a91f10 100644 +index 0710061e41d6d6e5b38e62212bbd04e9ada0ec68..b01f722e9d52254e68634dbdf0749fa0fcc81da8 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1916,6 +1916,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1918,6 +1918,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(Mth.clamp(pitch, -90.0F, 90.0F) % 360.0F); this.yRotO = this.getYRot(); this.xRotO = this.getXRot(); @@ -19,7 +19,7 @@ index bcc6d2cf3300d2e6eadadbcc03dc5aaaf2b5d7e3..61a25a5557309d8640795322d77bc61c } public void absMoveTo(double x, double y, double z) { -@@ -1954,6 +1955,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1956,6 +1957,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setXRot(pitch); this.setOldPosAndRot(); this.reapplyPosition(); diff --git a/patches/server/0701-Fix-upstreams-block-state-factories.patch b/patches/server/0701-Fix-upstreams-block-state-factories.patch index 002fba7d2b..2d18a1e309 100644 --- a/patches/server/0701-Fix-upstreams-block-state-factories.patch +++ b/patches/server/0701-Fix-upstreams-block-state-factories.patch @@ -50,7 +50,7 @@ index f7f211b4f08a7f21a183078affd6f875aa30dd50..a8290624d8c5b19506f628d049984d2e // Paper start @Override diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee14454c53 100644 +index 76a3f4ad26718f95f4cf64206efe16e598fa2285..f81c0d07a5efc92942d8ab5c50a8260db033307d 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java @@ -19,6 +19,7 @@ import net.minecraft.world.level.block.entity.BeehiveBlockEntity; @@ -61,7 +61,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee import net.minecraft.world.level.block.entity.BrewingStandBlockEntity; import net.minecraft.world.level.block.entity.BrushableBlockEntity; import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity; -@@ -115,227 +116,64 @@ public final class CraftBlockStates { +@@ -114,227 +115,64 @@ public final class CraftBlockStates { private static final BlockStateFactory<?> DEFAULT_FACTORY = new BlockStateFactory<CraftBlockState>(CraftBlockState.class) { @Override public CraftBlockState createBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { @@ -71,7 +71,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee - return new CraftBlockEntityState<>(world, tileEntity); - } + // Paper - revert upstream's revert of the block state changes. Block entities that have already had the block type set to AIR are still valid, upstream decided to ignore them - Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftMagicNumbers.getMaterial(blockData.getBlock())); + Preconditions.checkState(tileEntity == null, "Unexpected BlockState for %s", CraftBlockType.minecraftToBukkit(blockData.getBlock())); return new CraftBlockState(world, blockPosition, blockData); } }; @@ -341,7 +341,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee } private static void register(Material blockType, BlockStateFactory<?> factory) { -@@ -343,30 +181,33 @@ public final class CraftBlockStates { +@@ -342,30 +180,33 @@ public final class CraftBlockStates { } private static <T extends BlockEntity, B extends CraftBlockEntityState<T>> void register( @@ -367,7 +367,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee + // Paper start + BlockStateFactory<B> factory = new BlockEntityStateFactory<>(blockStateType, blockStateConstructor, blockEntityType::create); + for (net.minecraft.world.level.block.Block block : blockEntityType.validBlocks) { -+ CraftBlockStates.register(CraftMagicNumbers.getMaterial(block), factory); ++ CraftBlockStates.register(CraftBlockType.minecraftToBukkit(block), factory); } + CraftBlockStates.register(blockEntityType, factory); + // Paper end @@ -390,7 +390,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee public static Class<? extends CraftBlockState> getBlockStateType(Material material) { Preconditions.checkNotNull(material, "material is null"); return CraftBlockStates.getFactory(material).blockStateType; -@@ -382,6 +223,13 @@ public final class CraftBlockStates { +@@ -381,6 +222,13 @@ public final class CraftBlockStates { return null; } @@ -404,7 +404,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee public static BlockState getBlockState(Block block) { // Paper start return CraftBlockStates.getBlockState(block, true); -@@ -439,7 +287,7 @@ public final class CraftBlockStates { +@@ -438,7 +286,7 @@ public final class CraftBlockStates { if (world != null && tileEntity == null && CraftBlockStates.isTileEntityOptional(material)) { factory = CraftBlockStates.DEFAULT_FACTORY; } else { @@ -414,7 +414,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee return factory.createBlockState(world, blockPosition, blockData, tileEntity); } diff --git a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java -index e31689815b562c8b0644294b00502f7a1dc9911c..cdb05c98836e07548c993b9b8a588e8000190d21 100644 +index 81d4c8867ebcba1b805be1828e0a6a476963a855..9ff1a8068533ba5fc2fb43188d9a5c544a907618 100644 --- a/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java +++ b/src/test/java/org/bukkit/craftbukkit/block/BlockStateTest.java @@ -7,6 +7,7 @@ import net.minecraft.core.registries.BuiltInRegistries; @@ -423,9 +423,9 @@ index e31689815b562c8b0644294b00502f7a1dc9911c..cdb05c98836e07548c993b9b8a588e80 import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; import org.bukkit.Material; - import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.support.AbstractTestingBase; -@@ -42,4 +43,13 @@ public class BlockStateTest extends AbstractTestingBase { + import org.junit.jupiter.api.Test; +@@ -41,4 +42,13 @@ public class BlockStateTest extends AbstractTestingBase { } } } diff --git a/patches/server/0705-don-t-attempt-to-teleport-dead-entities.patch b/patches/server/0705-don-t-attempt-to-teleport-dead-entities.patch index d31fabaa97..88f7c42f4d 100644 --- a/patches/server/0705-don-t-attempt-to-teleport-dead-entities.patch +++ b/patches/server/0705-don-t-attempt-to-teleport-dead-entities.patch @@ -5,10 +5,10 @@ Subject: [PATCH] don't attempt to teleport dead entities diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 61a25a5557309d8640795322d77bc61ca5a91f10..d419ccff995a7d7bd83f31fd961e06899881b254 100644 +index b01f722e9d52254e68634dbdf0749fa0fcc81da8..9e617eb10380525f1aa7aa9cd7096aa133fe5920 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -792,7 +792,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -794,7 +794,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S // CraftBukkit start public void postTick() { // No clean way to break out of ticking once the entity has been copied to a new world, so instead we move the portalling later in the tick cycle diff --git a/patches/server/0715-Allow-delegation-to-vanilla-chunk-gen.patch b/patches/server/0715-Allow-delegation-to-vanilla-chunk-gen.patch index 5439e3d13f..001dcd4eed 100644 --- a/patches/server/0715-Allow-delegation-to-vanilla-chunk-gen.patch +++ b/patches/server/0715-Allow-delegation-to-vanilla-chunk-gen.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Allow delegation to vanilla chunk gen diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d20ff695dd77e3d8f775db917f0a6056a266d670..23124f8b302e3ac5751c03e3839d2c35e24e5b30 100644 +index e7e29ee51247fd7d5749d72d34a39d210e0c83ff..ea5147262daade44265af7aa029d02f8314673ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2460,6 +2460,88 @@ public final class CraftServer implements Server { +@@ -2459,6 +2459,88 @@ public final class CraftServer implements Server { return new OldCraftChunkData(world.getMinHeight(), world.getMaxHeight(), handle.registryAccess().registryOrThrow(Registries.BIOME), world); // Paper - Anti-Xray - Add parameters } @@ -98,10 +98,10 @@ index d20ff695dd77e3d8f775db917f0a6056a266d670..23124f8b302e3ac5751c03e3839d2c35 public BossBar createBossBar(String title, BarColor color, BarStyle style, BarFlag... flags) { return new CraftBossBar(title, color, style, flags); diff --git a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -index 5fbb9d2c4e419a3f31a8420437978606d75e5b62..5e73bd943231fd7f9ab1c850706cfde8cddc92c5 100644 +index 03eb35d5c67f125c44cf46595c93d124ac7892b8..f9f5fd5087a2e335384aa18b226b1f8d8a6748ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java +++ b/src/main/java/org/bukkit/craftbukkit/generator/OldCraftChunkData.java -@@ -22,7 +22,7 @@ import org.bukkit.material.MaterialData; +@@ -23,7 +23,7 @@ import org.bukkit.material.MaterialData; public final class OldCraftChunkData implements ChunkGenerator.ChunkData { private final int minHeight; private final int maxHeight; @@ -110,7 +110,7 @@ index 5fbb9d2c4e419a3f31a8420437978606d75e5b62..5e73bd943231fd7f9ab1c850706cfde8 private final Registry<net.minecraft.world.level.biome.Biome> biomes; private Set<BlockPos> tiles; private final Set<BlockPos> lights = new HashSet<>(); -@@ -193,7 +193,13 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { +@@ -194,7 +194,13 @@ public final class OldCraftChunkData implements ChunkGenerator.ChunkData { return this.tiles; } diff --git a/patches/server/0716-Collision-optimisations.patch b/patches/server/0716-Collision-optimisations.patch index afae575832..5a9ed29a4d 100644 --- a/patches/server/0716-Collision-optimisations.patch +++ b/patches/server/0716-Collision-optimisations.patch @@ -2214,10 +2214,10 @@ index 159932e2807c8d51fbf141c2145a138a39ea8abe..41a5d509a398972db910d32babb70e9b entityplayer1.setPos(entityplayer1.getX(), entityplayer1.getY() + 1.0D, entityplayer1.getZ()); } diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d419ccff995a7d7bd83f31fd961e06899881b254..4903c0ddff7a7fcfdadb62e92ff285b77bd8eacf 100644 +index 9e617eb10380525f1aa7aa9cd7096aa133fe5920..519e3f0e376198fb399819f4587ccf935b93ea1a 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1215,9 +1215,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1217,9 +1217,44 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S float f = this.getBlockSpeedFactor(); this.setDeltaMovement(this.getDeltaMovement().multiply((double) f, 1.0D, (double) f)); @@ -2265,7 +2265,7 @@ index d419ccff995a7d7bd83f31fd961e06899881b254..4903c0ddff7a7fcfdadb62e92ff285b7 if (this.remainingFireTicks <= 0) { this.setRemainingFireTicks(-this.getFireImmuneTicks()); } -@@ -1397,32 +1432,82 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1399,32 +1434,82 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } private Vec3 collide(Vec3 movement) { @@ -2364,7 +2364,7 @@ index d419ccff995a7d7bd83f31fd961e06899881b254..4903c0ddff7a7fcfdadb62e92ff285b7 } public static Vec3 collideBoundingBox(@Nullable Entity entity, Vec3 movement, AABB entityBoundingBox, Level world, List<VoxelShape> collisions) { -@@ -2627,11 +2712,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2629,11 +2714,70 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S float f = this.dimensions.width * 0.8F; AABB axisalignedbb = AABB.ofSize(this.getEyePosition(), (double) f, 1.0E-6D, (double) f); @@ -2600,7 +2600,7 @@ index a25497eec004add7408a63b1a0f09e3fa443b324..9f892de55ab03367daed4c30cc44c9dd // Paper start diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index 3b13a13c4e7de12ed0cac354701bf3502d788b59..3f196645f2259ed468e0dc3a05ecbd84d3792af0 100644 +index 94a4ceeea167164fb589518881952dd5e082f8c2..2287987d5bb0e6c4cb6153f04c420fe5ec7c8089 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -300,6 +300,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/0737-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch b/patches/server/0737-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch index 08a8876b57..be0eedab93 100644 --- a/patches/server/0737-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch +++ b/patches/server/0737-Add-missing-IAE-check-for-PersistentDataContainer-ha.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add missing IAE check for PersistentDataContainer#has diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -index 268563389077f92921411e866ec26e312e33ee23..43545bac94fbf118a982b654fbe0d6afc6e25897 100644 +index 3001bb0e3d4af9b16645a0136093db594b89ab01..984e988a47aa55a3fd92198e379d0f92f511daef 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -@@ -56,6 +56,7 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { +@@ -57,6 +57,7 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { @Override public boolean has(NamespacedKey key) { diff --git a/patches/server/0741-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch b/patches/server/0741-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch index acc689b55b..ad459f5555 100644 --- a/patches/server/0741-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch +++ b/patches/server/0741-Added-getHostname-to-AsyncPlayerPreLoginEvent.patch @@ -5,15 +5,15 @@ Subject: [PATCH] Added getHostname to AsyncPlayerPreLoginEvent diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index a7a6d3d243bb11101cfe6fce97dad74242597121..ec6a56e298872a403e0451944f7139256eab31d6 100644 +index 856699cd8976bca49bb4f7cae424bad606166b9d..12dc053af430218fae9ec30d3e793e0323ca1137 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -@@ -294,7 +294,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -299,7 +299,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - // Paper start - com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); -- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress -+ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile, ServerLoginPacketListenerImpl.this.connection.hostname); // Paper - add rawAddress & hostname - server.getPluginManager().callEvent(asyncEvent); - profile = asyncEvent.getPlayerProfile(); - profile.complete(true); // Paper - setPlayerProfileAPI + // Paper start + com.destroystokyo.paper.profile.PlayerProfile profile = com.destroystokyo.paper.profile.CraftPlayerProfile.asBukkitMirror(gameprofile); +- AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile); // Paper - add rawAddress ++ AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, rawAddress, uniqueId, profile, ServerLoginPacketListenerImpl.this.connection.hostname); // Paper - add rawAddress & hostname + server.getPluginManager().callEvent(asyncEvent); + profile = asyncEvent.getPlayerProfile(); + profile.complete(true); // Paper - setPlayerProfileAPI diff --git a/patches/server/0745-Freeze-Tick-Lock-API.patch b/patches/server/0745-Freeze-Tick-Lock-API.patch index 989b718a9b..b8278a2f4b 100644 --- a/patches/server/0745-Freeze-Tick-Lock-API.patch +++ b/patches/server/0745-Freeze-Tick-Lock-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Freeze Tick Lock API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 0d561537ab767e357c2e4385d0d87f8e3db022d8..1fd71bd27f601312f6ff00fbcb9b6687af284001 100644 +index 4ffd551e6ea540cff14eaba0e95ed2c7c0bca513..2f0c5e1b4b2dfb8006447c296170e80a97b36562 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -407,6 +407,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -409,6 +409,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S private org.bukkit.util.Vector origin; @javax.annotation.Nullable private UUID originWorld; @@ -16,7 +16,7 @@ index 0d561537ab767e357c2e4385d0d87f8e3db022d8..1fd71bd27f601312f6ff00fbcb9b6687 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -838,7 +839,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -840,7 +841,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S this.setRemainingFireTicks(this.remainingFireTicks - 1); } @@ -25,7 +25,7 @@ index 0d561537ab767e357c2e4385d0d87f8e3db022d8..1fd71bd27f601312f6ff00fbcb9b6687 this.setTicksFrozen(0); this.level().levelEvent((Player) null, 1009, this.blockPosition, 1); } -@@ -2452,6 +2453,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2454,6 +2455,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (fromNetherPortal) { nbttagcompound.putBoolean("Paper.FromNetherPortal", true); } @@ -35,7 +35,7 @@ index 0d561537ab767e357c2e4385d0d87f8e3db022d8..1fd71bd27f601312f6ff00fbcb9b6687 // Paper end return nbttagcompound; } catch (Throwable throwable) { -@@ -2596,6 +2600,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2598,6 +2602,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (spawnReason == null) { spawnReason = org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.DEFAULT; } diff --git a/patches/server/0749-API-for-creating-command-sender-which-forwards-feedb.patch b/patches/server/0749-API-for-creating-command-sender-which-forwards-feedb.patch index 63a71e24ba..fcd9ab105a 100644 --- a/patches/server/0749-API-for-creating-command-sender-which-forwards-feedb.patch +++ b/patches/server/0749-API-for-creating-command-sender-which-forwards-feedb.patch @@ -122,10 +122,10 @@ index 0000000000000000000000000000000000000000..e3a5f1ec376319bdfda87fa27ae217bf + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index be83340a6b2e64883c04a3593199179b856c5722..7aed22672cc9799fd577f225c350f6a6649b7f48 100644 +index c5aa5bd2a9372d9d21ac600fdf4041d78186c002..44faa651250397ab5ceef0cd905bd4984b246a33 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2111,6 +2111,13 @@ public final class CraftServer implements Server { +@@ -2110,6 +2110,13 @@ public final class CraftServer implements Server { return this.console.console; } diff --git a/patches/server/0753-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch b/patches/server/0753-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch index dc352a98f2..56a4a21224 100644 --- a/patches/server/0753-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch +++ b/patches/server/0753-Add-missing-Validate-calls-to-CraftServer-getSpawnLi.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add missing Validate calls to CraftServer#getSpawnLimit Copies appropriate checks from CraftWorld#getSpawnLimit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7aed22672cc9799fd577f225c350f6a6649b7f48..d1570b795894cda203154b9efc6f1f23759eab74 100644 +index 44faa651250397ab5ceef0cd905bd4984b246a33..bd452d9200179d9e385ff415822d8e810a8da30c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2288,6 +2288,8 @@ public final class CraftServer implements Server { +@@ -2287,6 +2287,8 @@ public final class CraftServer implements Server { @Override public int getSpawnLimit(SpawnCategory spawnCategory) { // Paper start diff --git a/patches/server/0754-Add-GameEvent-tags.patch b/patches/server/0754-Add-GameEvent-tags.patch index f201a89aba..2ad5887d87 100644 --- a/patches/server/0754-Add-GameEvent-tags.patch +++ b/patches/server/0754-Add-GameEvent-tags.patch @@ -46,10 +46,10 @@ index 0000000000000000000000000000000000000000..e7d9fd2702a1ce96596580fff8f5ee4f + } +} diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d1570b795894cda203154b9efc6f1f23759eab74..e28cb2db9b93bf3c045563a8df9d1c819f054851 100644 +index bd452d9200179d9e385ff415822d8e810a8da30c..48961913ed0a437129432cfa5fa707904d5bcdb2 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -@@ -2709,6 +2709,15 @@ public final class CraftServer implements Server { +@@ -2708,6 +2708,15 @@ public final class CraftServer implements Server { return (org.bukkit.Tag<T>) new CraftEntityTag(BuiltInRegistries.ENTITY_TYPE, entityTagKey); } } @@ -65,7 +65,7 @@ index d1570b795894cda203154b9efc6f1f23759eab74..e28cb2db9b93bf3c045563a8df9d1c81 default -> throw new IllegalArgumentException(); } -@@ -2741,6 +2750,13 @@ public final class CraftServer implements Server { +@@ -2740,6 +2749,13 @@ public final class CraftServer implements Server { net.minecraft.core.Registry<EntityType<?>> entityTags = BuiltInRegistries.ENTITY_TYPE; return entityTags.getTags().map(pair -> (org.bukkit.Tag<T>) new CraftEntityTag(entityTags, pair.getFirst())).collect(ImmutableList.toImmutableList()); } diff --git a/patches/server/0755-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch b/patches/server/0755-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch index d4ee6e925e..17138e0a46 100644 --- a/patches/server/0755-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch +++ b/patches/server/0755-Execute-chunk-tasks-fairly-for-worlds-while-waiting-.patch @@ -9,10 +9,10 @@ This might result in chunks loading far slower in the nether, for example. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index bc181f3f59eef3f2f3645e3facb37d5e4a605d34..8f375cc054f6c15537eca4927ea5cb0eb6a93b67 100644 +index ac4d96345c985284a1306055b164a74a483cb444..396cbd1a0a94e913475bad65faf8e871b7105895 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1422,6 +1422,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1416,6 +1416,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.executeMidTickTasks(); // Paper - execute chunk tasks mid tick return true; } else { @@ -20,7 +20,7 @@ index bc181f3f59eef3f2f3645e3facb37d5e4a605d34..8f375cc054f6c15537eca4927ea5cb0e if (this.tickRateManager.isSprinting() || this.haveTime()) { Iterator iterator = this.getAllLevels().iterator(); -@@ -1429,12 +1430,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1423,12 +1424,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa ServerLevel worldserver = (ServerLevel) iterator.next(); if (worldserver.getChunkSource().pollTask()) { diff --git a/patches/server/0762-Custom-Potion-Mixes.patch b/patches/server/0762-Custom-Potion-Mixes.patch index df08adbdbe..9a12914604 100644 --- a/patches/server/0762-Custom-Potion-Mixes.patch +++ b/patches/server/0762-Custom-Potion-Mixes.patch @@ -32,10 +32,10 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 330a7921849a4b3ab0d7ef156af4880ef602d5eb..3da647154516ded20fd18ee4baa7242e73ab91e8 100644 +index 4f43e306d70bc733ceba2b375c8732f330abc0e4..d8eb1dbc1601c1f76183ddd78b88d0ee6df68bed 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -2227,6 +2227,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -2213,6 +2213,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.worldData.setDataConfiguration(worlddataconfiguration); this.resources.managers.updateRegistryTags(this.registryAccess()); @@ -172,7 +172,7 @@ index 424406d2692856cfd82b6f3b7b6228fa3bd20c2f..c57efcb9a79337ec791e4e8f6671612f @Override diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 7efd9766fa1e78127e9f02d8f29da435c7f27e0a..8750983a05da55b0f491a5267965fe939e771c0e 100644 +index 4ffb0a342a553b714a0807591a3d21d7a6b08959..4af7f37e12104f6a493c08aff2968762bbdc4811 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -304,6 +304,7 @@ public final class CraftServer implements Server { @@ -192,7 +192,7 @@ index 7efd9766fa1e78127e9f02d8f29da435c7f27e0a..8750983a05da55b0f491a5267965fe93 // Ugly hack :( if (!Main.useConsole) { -@@ -3077,5 +3078,10 @@ public final class CraftServer implements Server { +@@ -3076,5 +3077,10 @@ public final class CraftServer implements Server { return datapackManager; } @@ -204,10 +204,10 @@ index 7efd9766fa1e78127e9f02d8f29da435c7f27e0a..8750983a05da55b0f491a5267965fe93 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -index 28fac26aa8e4da52f3e5d8e5e0d2e2731bcf74e1..13d25d118eb4d3ef35a4cdfb9bbde9ed83f6c04b 100644 +index 139dff90561ac6c51954c6289918a07aeea13a1b..6ba29875d78ede4aa7978ff689e588f7fed11528 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftRecipe.java -@@ -16,6 +16,11 @@ public interface CraftRecipe extends Recipe { +@@ -15,6 +15,11 @@ public interface CraftRecipe extends Recipe { void addToCraftingManager(); default Ingredient toNMS(RecipeChoice bukkit, boolean requireNotEmpty) { diff --git a/patches/server/0764-Fix-falling-block-spawn-methods.patch b/patches/server/0764-Fix-falling-block-spawn-methods.patch index b889a95777..61dad3fbfe 100644 --- a/patches/server/0764-Fix-falling-block-spawn-methods.patch +++ b/patches/server/0764-Fix-falling-block-spawn-methods.patch @@ -11,16 +11,16 @@ Restores the API behavior from previous versions of the server public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index e709b6fda1703c0787ddeedec9b7cc09f440d652..6dbd45103571f033daafe085c5ccb962e5d9a17a 100644 +index d41cd3075a5f59f271ddee7009a3ed26a34d3041..719d2ac5907b4c96828460daae9f254c2cd3e840 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1453,7 +1453,12 @@ public class CraftWorld extends CraftRegionAccessor implements World { Preconditions.checkArgument(material != null, "Material cannot be null"); Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material); -- FallingBlockEntity entity = FallingBlockEntity.fall(this.world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).defaultBlockState(), SpawnReason.CUSTOM); +- FallingBlockEntity entity = FallingBlockEntity.fall(this.world, BlockPos.containing(location.getX(), location.getY(), location.getZ()), CraftBlockType.bukkitToMinecraft(material).defaultBlockState(), SpawnReason.CUSTOM); + // Paper start - restore API behavior for spawning falling blocks -+ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).defaultBlockState()); // Paper ++ FallingBlockEntity entity = new FallingBlockEntity(this.world, location.getX(), location.getY(), location.getZ(), CraftBlockType.bukkitToMinecraft(material).defaultBlockState()); // Paper + entity.time = 1; + + this.world.addFreshEntity(entity, SpawnReason.CUSTOM); diff --git a/patches/server/0772-Implement-enchantWithLevels-API.patch b/patches/server/0772-Implement-enchantWithLevels-API.patch index b5459454d4..7267b72677 100644 --- a/patches/server/0772-Implement-enchantWithLevels-API.patch +++ b/patches/server/0772-Implement-enchantWithLevels-API.patch @@ -5,20 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 259489c7d0f4b5ce3e8f4294f4f853e9b51ded0b..5f6b93be9e81df8fae9a5ab160a232b65ce7b8bc 100644 +index 2dc5cdf72034f27cf9c61ce979a7018f169bb786..5df92d21e1e1827c59352d9f89dbfb23af7c0d7b 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -495,8 +495,7 @@ public final class CraftItemFactory implements ItemFactory { - } - - CraftItemStack craft = (CraftItemStack) itemStack; -- EnchantmentHelper.enchantItem(source, craft.handle, level, allowTreasures); -- return craft; -+ return EnchantmentHelper.enchantItem(source, craft.handle, level, allowTreasures).asBukkitCopy(); // Paper - fix broken implementation - } - - // Paper start - Adventure -@@ -585,4 +584,21 @@ public final class CraftItemFactory implements ItemFactory { +@@ -579,4 +579,21 @@ public final class CraftItemFactory implements ItemFactory { return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror(); } // Paper end diff --git a/patches/server/0778-Ensure-entity-passenger-world-matches-ridden-entity.patch b/patches/server/0778-Ensure-entity-passenger-world-matches-ridden-entity.patch index aaf6373899..8bc434041e 100644 --- a/patches/server/0778-Ensure-entity-passenger-world-matches-ridden-entity.patch +++ b/patches/server/0778-Ensure-entity-passenger-world-matches-ridden-entity.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity Bad plugins doing this would cause some obvious problems... diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 1fd71bd27f601312f6ff00fbcb9b6687af284001..624e0b1af20a3595734bc3d59a674e902698b6d6 100644 +index 2f0c5e1b4b2dfb8006447c296170e80a97b36562..8284b150bbca66fc536418ec66bf93fb205cdcc5 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2845,7 +2845,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2847,7 +2847,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } public boolean startRiding(Entity entity, boolean force) { diff --git a/patches/server/0789-Fix-CME-in-CraftPersistentDataTypeRegistry.patch b/patches/server/0789-Fix-CME-in-CraftPersistentDataTypeRegistry.patch index 0510692ca9..feadff040a 100644 --- a/patches/server/0789-Fix-CME-in-CraftPersistentDataTypeRegistry.patch +++ b/patches/server/0789-Fix-CME-in-CraftPersistentDataTypeRegistry.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CME in CraftPersistentDataTypeRegistry diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java -index 36b69553eaf94df9230b8d57e014be0dcc56cdba..b074d9692a3194a0703a4aceb6800dd5624d1fbc 100644 +index f83fbad4b579726ba5f759de3aa752caaf0aa79c..e0ef6964934ca0b280eded00b38220e3c3a0f035 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataTypeRegistry.java -@@ -89,7 +89,7 @@ public final class CraftPersistentDataTypeRegistry { +@@ -121,7 +121,7 @@ public final class CraftPersistentDataTypeRegistry { } } @@ -16,4 +16,4 @@ index 36b69553eaf94df9230b8d57e014be0dcc56cdba..b074d9692a3194a0703a4aceb6800dd5 + private final Map<Class, TagAdapter> adapters = new java.util.concurrent.ConcurrentHashMap<>(); // Paper - Replace HashMap with ConcurrentHashMap to avoid CME /** - * Creates a suitable adapter instance for the primitive class type + * Creates a suitable adapter instance for the primitive class type. diff --git a/patches/server/0798-Add-support-for-Proxy-Protocol.patch b/patches/server/0798-Add-support-for-Proxy-Protocol.patch index 11d3dea224..6fd4cd5598 100644 --- a/patches/server/0798-Add-support-for-Proxy-Protocol.patch +++ b/patches/server/0798-Add-support-for-Proxy-Protocol.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Add support for Proxy Protocol diff --git a/build.gradle.kts b/build.gradle.kts -index ed352bcf238199534720b17ab94401153eeeed1b..58da26ad2f128ba0b66f86820f60853f4be352f0 100644 +index 517920023bc28fea04eeb709364d5a7292adcc5e..444ff797c70b0e285d4272ea2ce3d72453c9bda5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,6 +30,7 @@ dependencies { @@ -15,7 +15,7 @@ index ed352bcf238199534720b17ab94401153eeeed1b..58da26ad2f128ba0b66f86820f60853f + implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol // Paper end implementation("org.apache.logging.log4j:log4j-iostreams:2.19.0") // Paper - remove exclusion - implementation("org.ow2.asm:asm:9.5") + implementation("org.ow2.asm:asm-commons:9.5") diff --git a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java b/src/main/java/net/minecraft/server/network/ServerConnectionListener.java index 54c7f34ba3dc8466223e589702d0c93af8cf52a0..79326308f6126f84a3cbb3d5a33302de048d8a50 100644 --- a/src/main/java/net/minecraft/server/network/ServerConnectionListener.java diff --git a/patches/server/0803-Prevent-entity-loading-causing-async-lookups.patch b/patches/server/0803-Prevent-entity-loading-causing-async-lookups.patch index 25f15dd7a4..2db3ffafcf 100644 --- a/patches/server/0803-Prevent-entity-loading-causing-async-lookups.patch +++ b/patches/server/0803-Prevent-entity-loading-causing-async-lookups.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Prevent entity loading causing async lookups diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index bc1b08f778537f7973ed1249dee63d9d12735dd1..607bcd2ef45f6d77b43e38211e3fe0b3070504a6 100644 +index 2c3193fdfb0e4b4a47cceb2da8b3fe85bd1e6848..edea89eebb9a99e41dc2bcbabc94b6775f5470df 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -801,6 +801,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -803,6 +803,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void baseTick() { this.level().getProfiler().push("entityBaseTick"); diff --git a/patches/server/0804-Throw-exception-on-world-create-while-being-ticked.patch b/patches/server/0804-Throw-exception-on-world-create-while-being-ticked.patch index 744561858b..7c6b011e73 100644 --- a/patches/server/0804-Throw-exception-on-world-create-while-being-ticked.patch +++ b/patches/server/0804-Throw-exception-on-world-create-while-being-ticked.patch @@ -7,7 +7,7 @@ There are no plans to support creating worlds while worlds are being ticked themselvess. diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 3da647154516ded20fd18ee4baa7242e73ab91e8..5b39e4a6b39e73cfe5645d80cd823e582ade6bc2 100644 +index d8eb1dbc1601c1f76183ddd78b88d0ee6df68bed..002511a54565aab9eb4552fecdf974fe0eab9122 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -310,6 +310,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -18,7 +18,7 @@ index 3da647154516ded20fd18ee4baa7242e73ab91e8..5b39e4a6b39e73cfe5645d80cd823e58 public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -1639,7 +1640,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1633,7 +1634,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.getFunctions().tick(); MinecraftTimings.commandFunctionsTimer.stopTiming(); // Spigot // Paper this.profiler.popPush("levels"); @@ -27,7 +27,7 @@ index 3da647154516ded20fd18ee4baa7242e73ab91e8..5b39e4a6b39e73cfe5645d80cd823e58 // CraftBukkit start // Run tasks that are waiting on processing -@@ -1671,6 +1672,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1665,6 +1666,8 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa // Paper end MinecraftTimings.timeUpdateTimer.stopTiming(); // Spigot // Paper @@ -36,7 +36,7 @@ index 3da647154516ded20fd18ee4baa7242e73ab91e8..5b39e4a6b39e73cfe5645d80cd823e58 while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper -@@ -1717,6 +1720,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1703,6 +1706,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa this.profiler.pop(); worldserver.explosionDensityCache.clear(); // Paper - Optimize explosions } @@ -45,7 +45,7 @@ index 3da647154516ded20fd18ee4baa7242e73ab91e8..5b39e4a6b39e73cfe5645d80cd823e58 this.profiler.popPush("connection"); MinecraftTimings.connectionTimer.startTiming(); // Spigot // Paper diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 90602c2201b50e8b5d300193aef962a70c52625f..4b0ef3a7fbf68fc7687f76350088c129628bb505 100644 +index 4642cfb862549c4b3d7e64ac6f040b7cf54d3793..de2cd044c5aaf8aca922443374b7a10aafd6f03e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -874,6 +874,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0816-Add-various-missing-EntityDropItemEvent-calls.patch b/patches/server/0816-Add-various-missing-EntityDropItemEvent-calls.patch index 8c006b9875..dc07be1c23 100644 --- a/patches/server/0816-Add-various-missing-EntityDropItemEvent-calls.patch +++ b/patches/server/0816-Add-various-missing-EntityDropItemEvent-calls.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add various missing EntityDropItemEvent calls diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 607bcd2ef45f6d77b43e38211e3fe0b3070504a6..9de9a7c204b241e92ab940723a160ede1e2dc97b 100644 +index edea89eebb9a99e41dc2bcbabc94b6775f5470df..b0a7c41372609de260298d40490781bb63b0fa1d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2697,6 +2697,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2699,6 +2699,14 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe entityitem.setDefaultPickUpDelay(); diff --git a/patches/server/0823-Warn-on-plugins-accessing-faraway-chunks.patch b/patches/server/0823-Warn-on-plugins-accessing-faraway-chunks.patch index 19bebe9530..aa1e889ad2 100644 --- a/patches/server/0823-Warn-on-plugins-accessing-faraway-chunks.patch +++ b/patches/server/0823-Warn-on-plugins-accessing-faraway-chunks.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Warn on plugins accessing faraway chunks diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index dfb2decd624c29c7ef88bccf2b5431eb471a25e5..e6c49b780b802fce13451e71be0b36160fabbef7 100644 +index 8200844b73dc7181d5867aafa83087e09ff2df76..28ed2605bc3f4d657f6f58729134aeb81a98dac4 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -813,7 +813,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -18,7 +18,7 @@ index dfb2decd624c29c7ef88bccf2b5431eb471a25e5..e6c49b780b802fce13451e71be0b3616 private static boolean isOutsideSpawnableHeight(int y) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 9ced82941e051a77a4832929f10d28f7bce82b0d..4c5d7988e3feea1b8f50d8c1795a4c4301fe2ecb 100644 +index 388ce676487dc094cf78ce7bd3c50942b3ec5e29..e3a1a1ed5f165d7d37a4f760e5ab7ecbea993a0e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -312,9 +312,24 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -86,7 +86,7 @@ index 9ced82941e051a77a4832929f10d28f7bce82b0d..4c5d7988e3feea1b8f50d8c1795a4c43 // Transient load for this tick return this.world.getChunk(x >> 4, z >> 4).getHeight(CraftHeightMap.toNMS(heightMap), x, z); } -@@ -2424,6 +2444,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { +@@ -2415,6 +2435,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { // Spigot end // Paper start public java.util.concurrent.CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) { diff --git a/patches/server/0828-Block-Ticking-API.patch b/patches/server/0828-Block-Ticking-API.patch index 45523d4df5..1e3e4cefc2 100644 --- a/patches/server/0828-Block-Ticking-API.patch +++ b/patches/server/0828-Block-Ticking-API.patch @@ -31,10 +31,10 @@ index 6d10396347b69d9243ab902ecc68ede93fa17b7d..0a96b00a98227714ef99005e0a223765 // Paper end } diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index f116f6997562a3ccb1a4830515ea6ee25ce29d77..c6a0fac2ee35056f31b60eebc364c7bda8252d74 100644 +index f75455bf199258fa7097daf777d28ff672039fa2..ef4d45ebfe84467454a209501dad7db7fb316416 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -717,4 +717,11 @@ public class CraftBlockData implements BlockData { +@@ -718,4 +718,11 @@ public class CraftBlockData implements BlockData { return speed; } // Paper end - destroy speed API diff --git a/patches/server/0829-Add-Velocity-IP-Forwarding-Support.patch b/patches/server/0829-Add-Velocity-IP-Forwarding-Support.patch index f101876256..3b7f3b1ad8 100644 --- a/patches/server/0829-Add-Velocity-IP-Forwarding-Support.patch +++ b/patches/server/0829-Add-Velocity-IP-Forwarding-Support.patch @@ -95,7 +95,7 @@ index 0000000000000000000000000000000000000000..a34381122de53123169927e181df6628 + } +} diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java -index 5264235c1547c78b8123e2efb07dcb77486cc5bf..db363bca264e37c29fda58291246aba0d3759de0 100644 +index 62c66bb3bcb1cb0a09011aa81bbb39f23623506f..5969f45d479188aceedfbe7931c69c36de78a705 100644 --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java @@ -274,13 +274,20 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -123,7 +123,7 @@ index 5264235c1547c78b8123e2efb07dcb77486cc5bf..db363bca264e37c29fda58291246aba0 DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose."); } diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java -index ec6a56e298872a403e0451944f7139256eab31d6..8ce2fd887d9c2cf86fa4ec0332b70681f1572911 100644 +index 82554ec47cd10f4bd27149acb9916249ff55ed3a..b8d9ee1920ce1aa2f881c12e5c8c669287ad677f 100644 --- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java +++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java @@ -64,6 +64,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @@ -148,23 +148,23 @@ index ec6a56e298872a403e0451944f7139256eab31d6..8ce2fd887d9c2cf86fa4ec0332b70681 + return; + } + // Paper end - // Spigot start - // Paper start - Cache authenticator threads - authenticatorPool.execute(new Runnable() { -@@ -286,6 +297,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public class LoginHandler { + // CraftBukkit start + // Paper start - Cache authenticator threads + authenticatorPool.execute(new Runnable() { +@@ -291,6 +302,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, - public void fireEvents(GameProfile gameprofile) throws Exception { -+ // Paper start - Velocity support -+ if (ServerLoginPacketListenerImpl.this.velocityLoginMessageId == -1 && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) { -+ disconnect("This server requires you to connect with Velocity."); -+ return; -+ } -+ // Paper end - String playerName = gameprofile.getName(); - java.net.InetAddress address = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.getRemoteAddress()).getAddress(); - java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) ServerLoginPacketListenerImpl.this.connection.channel.remoteAddress()).getAddress(); // Paper -@@ -335,6 +352,49 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, + // CraftBukkit start + private void callPlayerPreLoginEvents(GameProfile gameprofile) throws Exception { ++ // Paper start - Velocity support ++ if (ServerLoginPacketListenerImpl.this.velocityLoginMessageId == -1 && io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) { ++ disconnect("This server requires you to connect with Velocity."); ++ return; ++ } ++ // Paper end + String playerName = gameprofile.getName(); + java.net.InetAddress address = ((java.net.InetSocketAddress) this.connection.getRemoteAddress()).getAddress(); + java.net.InetAddress rawAddress = ((java.net.InetSocketAddress) this.connection.channel.remoteAddress()).getAddress(); // Paper +@@ -337,6 +354,49 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, @Override public void handleCustomQueryPacket(ServerboundCustomQueryAnswerPacket packet) { @@ -202,7 +202,7 @@ index ec6a56e298872a403e0451944f7139256eab31d6..8ce2fd887d9c2cf86fa4ec0332b70681 + // Proceed with login + authenticatorPool.execute(() -> { + try { -+ new LoginHandler().fireEvents(this.authenticatedProfile); ++ this.callPlayerPreLoginEvents(this.authenticatedProfile); + } catch (Exception ex) { + disconnect("Failed to verify username!"); + server.server.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + this.authenticatedProfile.getName(), ex); @@ -215,7 +215,7 @@ index ec6a56e298872a403e0451944f7139256eab31d6..8ce2fd887d9c2cf86fa4ec0332b70681 } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 90eca456db0545de8a8247f7638d2e990fdfd246..2836eb1edefc46556d71a23ddbb50cb495b44021 100644 +index 2d12d59974224d1adaf862e5a9bbffe804bd07ce..0b4639e56b87319e78c1b46fb581d8bb74ead2e4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -803,7 +803,7 @@ public final class CraftServer implements Server { diff --git a/patches/server/0833-Fire-EntityChangeBlockEvent-in-more-places.patch b/patches/server/0833-Fire-EntityChangeBlockEvent-in-more-places.patch index e56134f667..dacb1abbfc 100644 --- a/patches/server/0833-Fire-EntityChangeBlockEvent-in-more-places.patch +++ b/patches/server/0833-Fire-EntityChangeBlockEvent-in-more-places.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fire EntityChangeBlockEvent in more places Co-authored-by: ChristopheG <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java -index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db52a58387 100644 +index 09c981e2573305bd7f5c3cbcc8f240fa8705a9f2..17f664f75aaaea042477e4b467c17c17d1024e3d 100644 --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java -@@ -98,7 +98,7 @@ public class LightningBolt extends Entity { +@@ -97,7 +97,7 @@ public class LightningBolt extends Entity { } this.powerLightningRod(); @@ -18,7 +18,7 @@ index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db this.gameEvent(GameEvent.LIGHTNING_STRIKE); } } -@@ -192,7 +192,7 @@ public class LightningBolt extends Entity { +@@ -191,7 +191,7 @@ public class LightningBolt extends Entity { } } @@ -27,7 +27,7 @@ index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db BlockState iblockdata = world.getBlockState(pos); BlockPos blockposition1; BlockState iblockdata1; -@@ -206,24 +206,29 @@ public class LightningBolt extends Entity { +@@ -205,24 +205,29 @@ public class LightningBolt extends Entity { } if (iblockdata1.getBlock() instanceof WeatheringCopper) { @@ -61,7 +61,7 @@ index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db if (optional.isEmpty()) { break; -@@ -234,7 +239,7 @@ public class LightningBolt extends Entity { +@@ -233,7 +238,7 @@ public class LightningBolt extends Entity { } @@ -70,7 +70,7 @@ index 80740ca823915fb2c854f13445d81964e0e971e5..255fb5e922c63130708e4bcab208b4db Iterator iterator = BlockPos.randomInCube(world.random, 10, pos, 1).iterator(); BlockPos blockposition1; -@@ -251,6 +256,7 @@ public class LightningBolt extends Entity { +@@ -250,6 +255,7 @@ public class LightningBolt extends Entity { BlockPos blockposition1Final = blockposition1; // CraftBukkit - decompile error WeatheringCopper.getPrevious(iblockdata).ifPresent((iblockdata1) -> { diff --git a/patches/server/0836-Added-byte-array-serialization-deserialization-for-P.patch b/patches/server/0836-Added-byte-array-serialization-deserialization-for-P.patch index 03ee249744..f2a4d437f0 100644 --- a/patches/server/0836-Added-byte-array-serialization-deserialization-for-P.patch +++ b/patches/server/0836-Added-byte-array-serialization-deserialization-for-P.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Added byte array serialization/deserialization for diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -index 43545bac94fbf118a982b654fbe0d6afc6e25897..416d2ca909d30e267fb97082a0aaac90444510de 100644 +index 984e988a47aa55a3fd92198e379d0f92f511daef..5a4e7e7150b7c137b077e0b393f17ed35b5aec34 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -@@ -180,4 +180,27 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { +@@ -184,4 +184,27 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { this.customDataTags.clear(); } // Paper end diff --git a/patches/server/0840-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch b/patches/server/0840-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch index 5601e80875..ffb644e841 100644 --- a/patches/server/0840-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch +++ b/patches/server/0840-Mitigate-effects-of-WorldCreator-keepSpawnLoaded-ret.patch @@ -7,10 +7,10 @@ Subject: [PATCH] Mitigate effects of WorldCreator#keepSpawnLoaded ret type TODO: Remove in 1.21? diff --git a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -index 2a75bd263dce91bc64601f96b622ed6d4fb18fe6..15c5d1c048bf2780e963a1055f0a6dd77b31ff45 100644 +index 010014c06fcea7d603160928f124f54d6e5e63d8..bc008773f8cf0d416182152ecfc5a64b70744009 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/Commodore.java +++ b/src/main/java/org/bukkit/craftbukkit/util/Commodore.java -@@ -463,6 +463,12 @@ public class Commodore +@@ -394,6 +394,12 @@ public class Commodore { super.visitMethodInsn(Opcodes.INVOKEVIRTUAL, CB_PACKAGE + "/advancement/CraftAdvancement", "getDisplay0", desc, false); return; } diff --git a/patches/server/0844-Fix-a-bunch-of-vanilla-bugs.patch b/patches/server/0844-Fix-a-bunch-of-vanilla-bugs.patch index 7ce4f01262..fd7ad3339c 100644 --- a/patches/server/0844-Fix-a-bunch-of-vanilla-bugs.patch +++ b/patches/server/0844-Fix-a-bunch-of-vanilla-bugs.patch @@ -124,7 +124,7 @@ index a0603e567deeede8b4cd2ba57ded44f29239d78d..982750fd4f3f474514194df9b7638831 return this.anyPlayerCloseEnoughForSpawning(pos, false); } diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index d23c376b2421c8f94e5729d62beff93ce9c3b53c..742d7146c2a6d364de15b18caacc2ca6a4355f9b 100644 +index 2bfa9d1abf7a777b588314d314d06be3b4d2c6a5..0a4586d1b847de49d9e6faa16dba6de4a6a7cca6 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1032,7 +1032,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -433,10 +433,10 @@ index 93f5e583635a2addeabf2adff9374dcec0b66ee4..843926beb1edd897724b512ad915894f return; } diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 3530040df9e4999ea4ccc96b5df5767fdb330fe5..1a949a682a8f18ec0e5e5a60e83315441b935416 100644 +index 11ee20c6dc87baa063e8293ebdd9d5247a3e932e..712382f800fbafa5386205e97cb76dfceaba15a3 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -674,13 +674,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -675,13 +675,10 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit @Override public void fillStackedContents(StackedContents finder) { diff --git a/patches/server/0880-Fixes-and-additions-to-the-SpawnReason-API.patch b/patches/server/0880-Fixes-and-additions-to-the-SpawnReason-API.patch index 4bdb479cd7..6b49deaebe 100644 --- a/patches/server/0880-Fixes-and-additions-to-the-SpawnReason-API.patch +++ b/patches/server/0880-Fixes-and-additions-to-the-SpawnReason-API.patch @@ -33,29 +33,6 @@ index 9652e3385ad10e5d825dd141f6be3522c596916d..6256ce68d6ecada66745fb09360cba2b } else areaEffectCloud.discard(); // Paper this.discard(); } -diff --git a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -index 8f38965b42a20ac39cb1170278562070ebf2f958..a63733fa01dc58b3c0abb28c1cd88c8b0a456083 100644 ---- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -+++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java -@@ -92,7 +92,17 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock { - // clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down - entity.moveTo((double) pos.getX() + 0.5D, (double) pos.getY() + 0.05D, (double) pos.getZ() + 0.5D, 0.0F, 0.0F); - // CraftBukkit start -- if (!world.addFreshEntity(entity, SpawnReason.BUILD_IRONGOLEM)) { -+ // Paper start - correct spawn reason -+ final SpawnReason spawnReason; -+ if (entity.getType() == EntityType.SNOW_GOLEM) { -+ spawnReason = SpawnReason.BUILD_SNOWMAN; -+ } else if (entity.getType() == EntityType.IRON_GOLEM) { -+ spawnReason = SpawnReason.BUILD_IRONGOLEM; -+ } else { -+ spawnReason = SpawnReason.DEFAULT; -+ } -+ if (!world.addFreshEntity(entity, spawnReason)) { -+ // Paper end - return; - } - CarvedPumpkinBlock.clearPatternBlocks(world, patternResult); // CraftBukkit - from above diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java index 0a2de99c22cfcc96a664dc2afe7379987ea815db..6fc8d7f93141d85d8aecc97314e747624beb5e6c 100644 --- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java diff --git a/patches/server/0892-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch b/patches/server/0892-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch index e9c31357c4..814dcb6bbe 100644 --- a/patches/server/0892-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch +++ b/patches/server/0892-Add-exploded-block-state-to-BlockExplodeEvent-and-En.patch @@ -113,10 +113,10 @@ index c83ffba568f33323b0f8b9a03fa0b7bbbfed4355..797ece59c10bdb60a86f71ca3b7bb95d public static boolean canSetSpawn(Level world) { diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -index 000724a070f7f053c14cb53ecc45f0ee14454c53..9271ff2a9ea05569e3c81886399aa7ab47efb05d 100644 +index f81c0d07a5efc92942d8ab5c50a8260db033307d..d3dd58ccb350d849f1d169e015369c183625c0b6 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockStates.java -@@ -277,6 +277,12 @@ public final class CraftBlockStates { +@@ -276,6 +276,12 @@ public final class CraftBlockStates { BlockEntity tileEntity = (blockEntityTag == null) ? null : BlockEntity.loadStatic(blockPosition, blockData, blockEntityTag); return CraftBlockStates.getBlockState(null, blockPosition, blockData, tileEntity); } @@ -130,7 +130,7 @@ index 000724a070f7f053c14cb53ecc45f0ee14454c53..9271ff2a9ea05569e3c81886399aa7ab // See BlockStateFactory#createBlockState(World, BlockPosition, IBlockData, TileEntity) private static CraftBlockState getBlockState(World world, BlockPos blockPosition, net.minecraft.world.level.block.state.BlockState blockData, BlockEntity tileEntity) { diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index d51bcd5ccda9e923f0e259c187b9f349df974dfb..a6ccc177a3435d807dd6be3bdfca7f016c094158 100644 +index 38fc706dabbeb93959638deb22311e226a48a6ee..ef7d6f898c2c94d0697e38230564e110948b0460 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1045,7 +1045,7 @@ public class CraftEventFactory { diff --git a/patches/server/0893-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch b/patches/server/0893-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch index 35454f2b1b..a0328af938 100644 --- a/patches/server/0893-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch +++ b/patches/server/0893-Expose-pre-collision-moving-velocity-to-VehicleBlock.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Expose pre-collision moving velocity to diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 250a0ade29d4cf619d99a1c052e521e94482a213..93f0ecc2eb57d4c999babb838fa2d7575f1326cf 100644 +index 04ca1f84c68a73addd2177256268bb9b444f72da..2d8223ff9e3f51e43946cfcc1bd638235c48ec11 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1160,7 +1160,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1162,7 +1162,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } if (!bl.getType().isAir()) { diff --git a/patches/server/0912-Optimize-Hoppers.patch b/patches/server/0912-Optimize-Hoppers.patch index de61e1b173..33fd16b6e3 100644 --- a/patches/server/0912-Optimize-Hoppers.patch +++ b/patches/server/0912-Optimize-Hoppers.patch @@ -50,10 +50,10 @@ index 0000000000000000000000000000000000000000..5c42823726e70ce6c9d0121d07431548 + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a2961f1453e3805879941c709ab74a608285db42..50316da08ae259dcc0d02c28081a352f09d1a19a 100644 +index 7c9f7aefc59ae1a785b261f80f25d3304f3bdd22..c9e1ded332fc320e87e0b4b95b97905ea0c91803 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1678,6 +1678,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1672,6 +1672,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); worldserver.hasPhysicsEvent = org.bukkit.event.block.BlockPhysicsEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper diff --git a/patches/server/0914-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch b/patches/server/0914-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch index 6bd28ec0d8..e5cc265ab4 100644 --- a/patches/server/0914-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch +++ b/patches/server/0914-Fix-crash-relating-to-bad-recipes-in-furnace-like-ti.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Fix crash relating to bad recipes in furnace-like tile diff --git a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -index 1a949a682a8f18ec0e5e5a60e83315441b935416..a18aadbf7ae83713e1f2b21553185d8000bc7699 100644 +index 712382f800fbafa5386205e97cb76dfceaba15a3..5eaab97a0c3b93a44a45e2ed11033fe01c0c95c2 100644 --- a/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java +++ b/src/main/java/net/minecraft/world/level/block/entity/AbstractFurnaceBlockEntity.java -@@ -642,6 +642,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit +@@ -643,6 +643,7 @@ public abstract class AbstractFurnaceBlockEntity extends BaseContainerBlockEntit Entry<ResourceLocation> entry = (Entry) objectiterator.next(); worldserver.getRecipeManager().byKey((ResourceLocation) entry.getKey()).ifPresent((recipeholder) -> { diff --git a/patches/server/0930-Refresh-ProjectileSource-for-projectiles.patch b/patches/server/0930-Refresh-ProjectileSource-for-projectiles.patch index 03a90a486e..a29b7a8db9 100644 --- a/patches/server/0930-Refresh-ProjectileSource-for-projectiles.patch +++ b/patches/server/0930-Refresh-ProjectileSource-for-projectiles.patch @@ -14,10 +14,10 @@ clearing the owner. Co-authored-by: Warrior <[email protected]> diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 93f0ecc2eb57d4c999babb838fa2d7575f1326cf..9357bedf69bc9709b74e05ca7514c6802757059d 100644 +index 2d8223ff9e3f51e43946cfcc1bd638235c48ec11..f5df304943abd40d2c9fee2f4d84fa1374eba387 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -384,6 +384,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -386,6 +386,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public boolean inWorld = false; public boolean generation; public int maxAirTicks = this.getDefaultMaxAirSupply(); // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir() diff --git a/patches/server/0947-Don-t-load-chunks-for-supporting-block-checks.patch b/patches/server/0947-Don-t-load-chunks-for-supporting-block-checks.patch index 70fca1ce10..e4c46db9bd 100644 --- a/patches/server/0947-Don-t-load-chunks-for-supporting-block-checks.patch +++ b/patches/server/0947-Don-t-load-chunks-for-supporting-block-checks.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Don't load chunks for supporting block checks diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 9357bedf69bc9709b74e05ca7514c6802757059d..184267a5a64423e73682bdda22690eaa12c4ae79 100644 +index f5df304943abd40d2c9fee2f4d84fa1374eba387..a2607d0782e8d72d7e531a2b078674bc78daa5e3 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -1360,7 +1360,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -1362,7 +1362,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } protected BlockPos getOnPos(float offset) { diff --git a/patches/server/0951-fix-item-meta-for-tadpole-buckets.patch b/patches/server/0951-fix-item-meta-for-tadpole-buckets.patch index 4d1c012286..472ece5bf8 100644 --- a/patches/server/0951-fix-item-meta-for-tadpole-buckets.patch +++ b/patches/server/0951-fix-item-meta-for-tadpole-buckets.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix item meta for tadpole buckets diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -index 5f6b93be9e81df8fae9a5ab160a232b65ce7b8bc..c77634ec9c4e7a9eaacc81de7f95e9452b393a52 100644 +index 5df92d21e1e1827c59352d9f89dbfb23af7c0d7b..090ba0b85fe72419c419cc72b5584ec391c0cfa1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java -@@ -358,6 +358,7 @@ public final class CraftItemFactory implements ItemFactory { +@@ -357,6 +357,7 @@ public final class CraftItemFactory implements ItemFactory { case COD_BUCKET: case PUFFERFISH_BUCKET: case SALMON_BUCKET: @@ -17,7 +17,7 @@ index 5f6b93be9e81df8fae9a5ab160a232b65ce7b8bc..c77634ec9c4e7a9eaacc81de7f95e945 case GLOW_ITEM_FRAME: case PAINTING: diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 7081aebf67cc3d8deb27dfc508970f0fa5e9d1b6..9ce03abd24ae8c2f156ade360094157e20f63666 100644 +index 749bf6a897b053197988112551192abe6af2f186..d1604c52784c1bf94e797ca1f5d8146c19314c11 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -592,6 +592,7 @@ public final class CraftItemStack extends ItemStack { @@ -41,10 +41,10 @@ index 6aa64334943a22da8cfcac88d48ae8156ad7a9b4..630e16403cb1fc0f4ba798993bb0c313 Material.GLOW_ITEM_FRAME, Material.PAINTING diff --git a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -index 937ddd3a2b9e1df2c8835079923c339178f08459..ceca8b6a4a11753bef7ad341c34ccda60114c6b5 100644 +index adb7c742e8fe3b8e0c2ecf63c627e7566285fd55..9f96ee1ac21f44ca7a41122353f72339b148f036 100644 --- a/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java +++ b/src/test/java/org/bukkit/craftbukkit/inventory/ItemMetaTest.java -@@ -236,6 +236,27 @@ public class ItemMetaTest extends AbstractTestingBase { +@@ -235,6 +235,27 @@ public class ItemMetaTest extends AbstractTestingBase { } } @@ -58,11 +58,11 @@ index 937ddd3a2b9e1df2c8835079923c339178f08459..ceca8b6a4a11753bef7ad341c34ccda6 + public void testEntityTagMeta() { + for (final Item item : BuiltInRegistries.ITEM) { + if (item instanceof net.minecraft.world.item.HangingEntityItem || item instanceof net.minecraft.world.item.MobBucketItem) { -+ ItemStack stack = new ItemStack(CraftMagicNumbers.getMaterial(item)); ++ ItemStack stack = new ItemStack(CraftItemType.minecraftToBukkit(item)); + assertTrue(ENTITY_TAG_METAS.contains(stack.getItemMeta().getClass()), "missing entity tag meta handling for " + item); + stack = CraftItemStack.asNewCraftStack(net.minecraft.world.item.Items.STONE); + stack.editMeta(meta -> meta.displayName(net.kyori.adventure.text.Component.text("hello"))); -+ stack.setType(CraftMagicNumbers.getMaterial(item)); ++ stack.setType(CraftItemType.minecraftToBukkit(item)); + assertTrue(ENTITY_TAG_METAS.contains(stack.getItemMeta().getClass()), "missing entity tag meta handling for " + item); + } + } diff --git a/patches/server/0960-Folia-scheduler-and-owned-region-API.patch b/patches/server/0960-Folia-scheduler-and-owned-region-API.patch index ed5d2fc165..ca3ecfa30b 100644 --- a/patches/server/0960-Folia-scheduler-and-owned-region-API.patch +++ b/patches/server/0960-Folia-scheduler-and-owned-region-API.patch @@ -1148,10 +1148,10 @@ index 0000000000000000000000000000000000000000..d306f911757a4d556c82c0070d4837db + } +} diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index 50316da08ae259dcc0d02c28081a352f09d1a19a..a8f9f4e23575cb58045f9d8efe011a60a51dbd7a 100644 +index c9e1ded332fc320e87e0b4b95b97905ea0c91803..9a3ee0a2b2b41baea6988ee0ad64ff5cf61dde9f 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java -@@ -1635,6 +1635,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1629,6 +1629,20 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa MinecraftTimings.bukkitSchedulerTimer.startTiming(); // Spigot // Paper this.server.getScheduler().mainThreadHeartbeat(this.tickCount); // CraftBukkit MinecraftTimings.bukkitSchedulerTimer.stopTiming(); // Spigot // Paper @@ -1185,10 +1185,10 @@ index a9cc3d7213f51a2a2cdc915fd9ab3cf97767b698..69e75aec30e8c25f621c8e7d024abe67 this.players.remove(entityplayer); this.playersByName.remove(entityplayer.getScoreboardName().toLowerCase(java.util.Locale.ROOT)); // Spigot diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index 184267a5a64423e73682bdda22690eaa12c4ae79..d10c3c7e50a8972126e72a482c56394e11ed7d9f 100644 +index a2607d0782e8d72d7e531a2b078674bc78daa5e3..687f7358466302195ec564ca5c817b13d2ce3f16 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -247,11 +247,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -249,11 +249,23 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public @Nullable Throwable addedToWorldStack; // Paper - entity debug public CraftEntity getBukkitEntity() { if (this.bukkitEntity == null) { @@ -1251,7 +1251,7 @@ index 184267a5a64423e73682bdda22690eaa12c4ae79..d10c3c7e50a8972126e72a482c56394e public void setLevelCallback(EntityInLevelCallback changeListener) { this.levelCallback = changeListener; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 036d1d133dbe39194ba8bc5201bdae1a3bdae56c..81afb0d5349102025a96610098676e21647f85da 100644 +index 4310134fe9cb74cb11591d52562bc35039130d19..8d92fe2b91bc1a68df05c0833acd964dbfbcc312 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -306,6 +306,76 @@ public final class CraftServer implements Server { diff --git a/patches/server/0971-Bandaid-fix-for-Effect.patch b/patches/server/0971-Bandaid-fix-for-Effect.patch index 5691a64aa7..61448caca1 100644 --- a/patches/server/0971-Bandaid-fix-for-Effect.patch +++ b/patches/server/0971-Bandaid-fix-for-Effect.patch @@ -9,10 +9,10 @@ upstream. Until then, this test and these fixes should address all the known issues with them diff --git a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java -index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..4ce0e1e557a844fb3add866a257a8424885f7d43 100644 +index a4519762175c68256b1f303daca8b9408ac182bb..457e9093adb99d31ffc7f061d8c858f98c5d0572 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftEffect.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftEffect.java -@@ -15,12 +15,16 @@ public class CraftEffect { +@@ -16,12 +16,16 @@ public class CraftEffect { public static <T> int getDataValue(Effect effect, T data) { int datavalue; switch (effect) { @@ -29,9 +29,9 @@ index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..4ce0e1e557a844fb3add866a257a8424 case INSTANT_POTION_BREAK: datavalue = ((Color) data).asRGB(); break; -@@ -28,6 +32,13 @@ public class CraftEffect { +@@ -29,6 +33,13 @@ public class CraftEffect { Preconditions.checkArgument(data == Material.AIR || ((Material) data).isRecord(), "Invalid record type for Material %s!", data); - datavalue = Item.getId(CraftMagicNumbers.getItem((Material) data)); + datavalue = Item.getId(CraftItemType.bukkitToMinecraft((Material) data)); break; + // Paper start - handle shoot white smoke event + case SHOOT_WHITE_SMOKE: @@ -43,13 +43,13 @@ index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..4ce0e1e557a844fb3add866a257a8424 case SMOKE: switch ((BlockFace) data) { case DOWN: -@@ -59,8 +70,15 @@ public class CraftEffect { +@@ -60,8 +71,15 @@ public class CraftEffect { } break; case STEP_SOUND: + if (data instanceof Material) { // Paper - support BlockData Preconditions.checkArgument(((Material) data).isBlock(), "Material %s is not a block!", data); - datavalue = Block.getId(CraftMagicNumbers.getBlock((Material) data).defaultBlockState()); + datavalue = Block.getId(CraftBlockType.bukkitToMinecraft((Material) data).defaultBlockState()); + // Paper start - support BlockData + break; + } @@ -60,7 +60,7 @@ index 5a5a8945c786e16ff0df62494ddd1ac85c42b53f..4ce0e1e557a844fb3add866a257a8424 case COMPOSTER_FILL_ATTEMPT: datavalue = ((Boolean) data) ? 1 : 0; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 4c5d7988e3feea1b8f50d8c1795a4c4301fe2ecb..4f89f38e1d2d9cdb34af8d1d217577e9a437eea5 100644 +index e3a1a1ed5f165d7d37a4f760e5ab7ecbea993a0e..6bd86a7183042f9023b9e8cf6423e0a1cbfde97a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1430,7 +1430,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { diff --git a/patches/server/0984-Expand-Pose-API.patch b/patches/server/0984-Expand-Pose-API.patch index 94ef30e156..1acea775aa 100644 --- a/patches/server/0984-Expand-Pose-API.patch +++ b/patches/server/0984-Expand-Pose-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Expand Pose API diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index d10c3c7e50a8972126e72a482c56394e11ed7d9f..c4d7d668bab1546c8196b2c570298038d767220a 100644 +index 687f7358466302195ec564ca5c817b13d2ce3f16..a152716a0dedc39d6d606476d8e3ba542f773d56 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -421,6 +421,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -423,6 +423,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @javax.annotation.Nullable private UUID originWorld; public boolean freezeLocked = false; // Paper - Freeze Tick Lock API @@ -16,7 +16,7 @@ index d10c3c7e50a8972126e72a482c56394e11ed7d9f..c4d7d668bab1546c8196b2c570298038 public void setOrigin(@javax.annotation.Nonnull Location location) { this.origin = location.toVector(); -@@ -705,6 +706,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -707,6 +708,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S public void onClientRemoval() {} public void setPose(net.minecraft.world.entity.Pose pose) { diff --git a/patches/server/0986-Deep-clone-unhandled-nbt-tags.patch b/patches/server/0986-Deep-clone-unhandled-nbt-tags.patch index 5dcf7cc634..d08974665d 100644 --- a/patches/server/0986-Deep-clone-unhandled-nbt-tags.patch +++ b/patches/server/0986-Deep-clone-unhandled-nbt-tags.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Deep clone unhandled nbt tags diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 31880b9e82824a184a52b7fac93197f442ff5d34..49da00feb8dfab26483b36c830b880b38ca57eb9 100644 +index b7c0c9a40dac3e828f880ef928ca34206a898cb9..ba2da16e1e17d9544535511939302da633e8ebcc 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -304,7 +304,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -305,7 +305,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { private static final CraftPersistentDataTypeRegistry DATA_TYPE_REGISTRY = new CraftPersistentDataTypeRegistry(); private CompoundTag internalTag; @@ -17,7 +17,7 @@ index 31880b9e82824a184a52b7fac93197f442ff5d34..49da00feb8dfab26483b36c830b880b3 private CraftPersistentDataContainer persistentDataContainer = new CraftPersistentDataContainer(CraftMetaItem.DATA_TYPE_REGISTRY); private int version = CraftMagicNumbers.INSTANCE.getDataVersion(); // Internal use only -@@ -345,8 +345,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -346,8 +346,10 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { this.destroyableKeys = new java.util.HashSet<>(meta.destroyableKeys); } // Paper end @@ -30,7 +30,7 @@ index 31880b9e82824a184a52b7fac93197f442ff5d34..49da00feb8dfab26483b36c830b880b3 this.internalTag = meta.internalTag; if (this.internalTag != null) { -@@ -1385,7 +1387,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1386,7 +1388,11 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { if (this.hasAttributeModifiers()) { clone.attributeModifiers = LinkedHashMultimap.create(this.attributeModifiers); } @@ -44,10 +44,10 @@ index 31880b9e82824a184a52b7fac93197f442ff5d34..49da00feb8dfab26483b36c830b880b3 clone.unbreakable = this.unbreakable; clone.damage = this.damage; diff --git a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -index 416d2ca909d30e267fb97082a0aaac90444510de..9d61756689d1f5a71bcdb3ae4859cb0a60e7d850 100644 +index 5a4e7e7150b7c137b077e0b393f17ed35b5aec34..f55fdd57ced259ad5a95878840e98ffaa3db2e05 100644 --- a/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/persistence/CraftPersistentDataContainer.java -@@ -203,4 +203,12 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { +@@ -207,4 +207,12 @@ public class CraftPersistentDataContainer implements PersistentDataContainer { } } // Paper end - byte array serialization diff --git a/patches/server/1010-Lag-compensation-ticks.patch b/patches/server/1010-Lag-compensation-ticks.patch index 361e238553..826376376b 100644 --- a/patches/server/1010-Lag-compensation-ticks.patch +++ b/patches/server/1010-Lag-compensation-ticks.patch @@ -8,7 +8,7 @@ Areas affected by lag comepnsation: - Eating food items diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java -index a8f9f4e23575cb58045f9d8efe011a60a51dbd7a..34f19ac897a30c0c4e3ab406013fcca1c8b7db93 100644 +index 9a3ee0a2b2b41baea6988ee0ad64ff5cf61dde9f..2ea52c9aad51967bfefc3fe08073a004f65a9451 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -311,6 +311,9 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -21,7 +21,7 @@ index a8f9f4e23575cb58045f9d8efe011a60a51dbd7a..34f19ac897a30c0c4e3ab406013fcca1 public static <S extends MinecraftServer> S spin(Function<Thread, S> serverFactory) { AtomicReference<S> atomicreference = new AtomicReference(); -@@ -1691,6 +1694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa +@@ -1685,6 +1688,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa Iterator iterator = this.getAllLevels().iterator(); // Paper - move down while (iterator.hasNext()) { ServerLevel worldserver = (ServerLevel) iterator.next(); @@ -30,7 +30,7 @@ index a8f9f4e23575cb58045f9d8efe011a60a51dbd7a..34f19ac897a30c0c4e3ab406013fcca1 net.minecraft.world.level.block.entity.HopperBlockEntity.skipHopperEvents = worldserver.paperConfig().hopper.disableMoveEvent || org.bukkit.event.inventory.InventoryMoveItemEvent.getHandlerList().getRegisteredListeners().length == 0; // Paper worldserver.hasEntityMoveEvent = io.papermc.paper.event.entity.EntityMoveEvent.getHandlerList().getRegisteredListeners().length > 0; // Paper diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index abef96d4c0ee22d05fc8b462811189128900fb8d..b4a77d66e84e335cecf7e3290aa36d17ac600033 100644 +index a7f2e8755af41abc66070f1971e526b4f05bc710..9a7d5aa722eb1e56da8e9e11b46179c9f9ab716f 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -570,6 +570,17 @@ public class ServerLevel extends Level implements WorldGenLevel { diff --git a/patches/server/1026-Add-API-to-get-the-collision-shape-of-a-block-before.patch b/patches/server/1026-Add-API-to-get-the-collision-shape-of-a-block-before.patch index bed6750ecf..b12610027d 100644 --- a/patches/server/1026-Add-API-to-get-the-collision-shape-of-a-block-before.patch +++ b/patches/server/1026-Add-API-to-get-the-collision-shape-of-a-block-before.patch @@ -6,10 +6,10 @@ Subject: [PATCH] Add API to get the collision shape of a block before it's diff --git a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -index c6a0fac2ee35056f31b60eebc364c7bda8252d74..c7b93b8d4ed15db0803e2304e2da70ed3624f13f 100644 +index ef4d45ebfe84467454a209501dad7db7fb316416..9cf4ec4e1610d5f7cafbb90ef0310034cc818549 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java +++ b/src/main/java/org/bukkit/craftbukkit/block/data/CraftBlockData.java -@@ -677,6 +677,20 @@ public class CraftBlockData implements BlockData { +@@ -678,6 +678,20 @@ public class CraftBlockData implements BlockData { return this.state.isFaceSturdy(EmptyBlockGetter.INSTANCE, BlockPos.ZERO, CraftBlock.blockFaceToNotch(face), CraftBlockSupport.toNMS(support)); } diff --git a/patches/server/1032-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch b/patches/server/1032-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch index d956249900..7fb5a2b316 100644 --- a/patches/server/1032-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch +++ b/patches/server/1032-Fix-strikeLightningEffect-powers-lightning-rods-and-.patch @@ -6,28 +6,27 @@ Subject: [PATCH] Fix strikeLightningEffect powers lightning rods and clears diff --git a/src/main/java/net/minecraft/world/entity/LightningBolt.java b/src/main/java/net/minecraft/world/entity/LightningBolt.java -index 255fb5e922c63130708e4bcab208b4db52a58387..21f0c986ac3237a2ab560dc545392f04a8bb4ef3 100644 +index 17f664f75aaaea042477e4b467c17c17d1024e3d..da4297f756e389deacda6c06afeb39f1ee204aab 100644 --- a/src/main/java/net/minecraft/world/entity/LightningBolt.java +++ b/src/main/java/net/minecraft/world/entity/LightningBolt.java -@@ -45,7 +45,7 @@ public class LightningBolt extends Entity { +@@ -45,6 +45,7 @@ public class LightningBolt extends Entity { private ServerPlayer cause; private final Set<Entity> hitEntities = Sets.newHashSet(); private int blocksSetOnFire; -- public boolean isSilent = false; // Spigot + public boolean isEffect; // Paper - Properly handle lightning effects api public LightningBolt(EntityType<? extends LightningBolt> type, Level world) { super(type, world); -@@ -86,7 +86,7 @@ public class LightningBolt extends Entity { +@@ -85,7 +86,7 @@ public class LightningBolt extends Entity { @Override public void tick() { super.tick(); -- if (!this.isSilent && this.life == 2) { // Spigot -+ if (!this.isEffect && this.life == 2) { // Spigot // Paper - Properly handle lightning effects api +- if (this.life == 2) { ++ if (!this.isEffect && this.life == 2) { // Paper - Properly handle lightning effects api if (this.level().isClientSide()) { this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.LIGHTNING_BOLT_THUNDER, SoundSource.WEATHER, 10000.0F, 0.8F + this.random.nextFloat() * 0.2F, false); this.level().playLocalSound(this.getX(), this.getY(), this.getZ(), SoundEvents.LIGHTNING_BOLT_IMPACT, SoundSource.WEATHER, 2.0F, 0.5F + this.random.nextFloat() * 0.2F, false); -@@ -133,7 +133,7 @@ public class LightningBolt extends Entity { +@@ -132,7 +133,7 @@ public class LightningBolt extends Entity { } } @@ -36,7 +35,7 @@ index 255fb5e922c63130708e4bcab208b4db52a58387..21f0c986ac3237a2ab560dc545392f04 if (!(this.level() instanceof ServerLevel)) { this.level().setSkyFlashTime(2); } else if (!this.visualOnly) { -@@ -162,7 +162,7 @@ public class LightningBolt extends Entity { +@@ -161,7 +162,7 @@ public class LightningBolt extends Entity { } private void spawnFire(int spreadAttempts) { @@ -46,7 +45,7 @@ index 255fb5e922c63130708e4bcab208b4db52a58387..21f0c986ac3237a2ab560dc545392f04 BlockState iblockdata = BaseFireBlock.getState(this.level(), blockposition); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index 56ff02ebe9da504f2aa955430ac13b3dba4211f7..f9be183b5971801fbb55db17fcc2fa9d0701daf5 100644 +index ed2a02514b7a6b67d45890fedb9bb9f4b10846d3..e7d503366c58e567c392b040e46a14457d86ad8d 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -773,7 +773,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -58,26 +57,8 @@ index 56ff02ebe9da504f2aa955430ac13b3dba4211f7..f9be183b5971801fbb55db17fcc2fa9d this.world.strikeLightning(lightning, LightningStrikeEvent.Cause.CUSTOM); return (LightningStrike) lightning.getBukkitEntity(); } -@@ -2440,7 +2440,6 @@ public class CraftWorld extends CraftRegionAccessor implements World { - { - LightningBolt lightning = EntityType.LIGHTNING_BOLT.create( CraftWorld.this.world ); - lightning.moveTo( loc.getX(), loc.getY(), loc.getZ() ); -- lightning.isSilent = isSilent; - CraftWorld.this.world.strikeLightning( lightning, LightningStrikeEvent.Cause.CUSTOM ); - return (LightningStrike) lightning.getBukkitEntity(); - } -@@ -2450,8 +2449,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { - { - LightningBolt lightning = EntityType.LIGHTNING_BOLT.create( CraftWorld.this.world ); - lightning.moveTo( loc.getX(), loc.getY(), loc.getZ() ); -- lightning.visualOnly = true; -- lightning.isSilent = isSilent; -+ lightning.isEffect = true; // Paper - Properly handle lightning effects api - CraftWorld.this.world.strikeLightning( lightning, LightningStrikeEvent.Cause.CUSTOM ); - return (LightningStrike) lightning.getBukkitEntity(); - } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java -index cd9bd7f06e55e970b7791e635610bb5e7491d102..4fd1a856cd2e8ebcce0a14e3244108e8344691cf 100644 +index 6fed8075aa75e3852dc826a45ca44603c0446a56..e9f471e60af0725ec34e2985d63ae9ea9f88590a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLightningStrike.java @@ -13,7 +13,7 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike @@ -89,12 +70,3 @@ index cd9bd7f06e55e970b7791e635610bb5e7491d102..4fd1a856cd2e8ebcce0a14e3244108e8 } public int getFlashes() { -@@ -57,7 +57,7 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike - @Override - public boolean isSilent() - { -- return CraftLightningStrike.this.getHandle().isSilent; -+ return false; // Paper - Properly handle lightning effects api; the concept of isSilent doesn't exist as sound is controlled by the client - } - }; - diff --git a/patches/server/1038-Don-t-fire-sync-events-during-worldgen.patch b/patches/server/1038-Don-t-fire-sync-events-during-worldgen.patch index 2baaa6e133..22efdd7203 100644 --- a/patches/server/1038-Don-t-fire-sync-events-during-worldgen.patch +++ b/patches/server/1038-Don-t-fire-sync-events-during-worldgen.patch @@ -19,7 +19,7 @@ where generation happened directly to a ServerLevel and the entity still has the flag set. diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java -index 6ff5898846ef2d985f5ce630db9a31c4ad75ca66..2afc66b83d21a16be3fbe78476e532fc95582db9 100644 +index 79b6602570de0e213faef04f9605f206aa5b7840..0567fbf194d3dfef3f2348c4b1f69ac857dc5648 100644 --- a/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java @@ -1681,6 +1681,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -31,10 +31,10 @@ index 6ff5898846ef2d985f5ce630db9a31c4ad75ca66..2afc66b83d21a16be3fbe78476e532fc if (entity.valid) { MinecraftServer.LOGGER.error("Attempted Double World add on " + entity, new Throwable()); diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index c4d7d668bab1546c8196b2c570298038d767220a..64ee22fe8ec64e9e942471d2c114554e241f5708 100644 +index a152716a0dedc39d6d606476d8e3ba542f773d56..c80a7a476c6363e526f26a3c7a5ed0a277ca0394 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -711,7 +711,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -713,7 +713,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S if (pose == this.getPose()) { return; } diff --git a/patches/server/1039-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch b/patches/server/1039-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch index ed7402be07..2a28b856f5 100644 --- a/patches/server/1039-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch +++ b/patches/server/1039-Fix-CraftMetaItem-getAttributeModifier-duplication-c.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Fix CraftMetaItem#getAttributeModifier duplication check diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 49da00feb8dfab26483b36c830b880b38ca57eb9..d4eb344c3609f3902531c15e9c7444c0930a908e 100644 +index ba2da16e1e17d9544535511939302da633e8ebcc..d8ac86c3a89e29696e23b8ee6fddb84eb0313ea6 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -1166,7 +1166,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -1167,7 +1167,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { Preconditions.checkNotNull(modifier, "AttributeModifier cannot be null"); this.checkAttributeList(); for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) { diff --git a/patches/server/1040-Restore-vanilla-entity-drops-behavior.patch b/patches/server/1040-Restore-vanilla-entity-drops-behavior.patch index b716c1fd3d..c24ef852cb 100644 --- a/patches/server/1040-Restore-vanilla-entity-drops-behavior.patch +++ b/patches/server/1040-Restore-vanilla-entity-drops-behavior.patch @@ -50,10 +50,10 @@ index 3ca06c5dfed3bc2006bf2f42444353bfab14096d..a3037dccab32597aa99e1590e1ea42fc if (entityitem == null) { return null; diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java -index cc86993aa7bf95ed5ae861feedc7e1049f12e210..82c5868222d22a5c5dc508c516d67bdcfa56d84b 100644 +index c80a7a476c6363e526f26a3c7a5ed0a277ca0394..26ee8f19a3f7d722060170c4e2c5c1aa8c03d28d 100644 --- a/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java -@@ -2701,6 +2701,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2703,6 +2703,25 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S @Nullable public ItemEntity spawnAtLocation(ItemStack stack, float yOffset) { @@ -79,7 +79,7 @@ index cc86993aa7bf95ed5ae861feedc7e1049f12e210..82c5868222d22a5c5dc508c516d67bdc if (stack.isEmpty()) { return null; } else if (this.level().isClientSide) { -@@ -2708,14 +2727,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S +@@ -2710,14 +2729,21 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S } else { // CraftBukkit start - Capture drops for death event if (this instanceof net.minecraft.world.entity.LivingEntity && !((net.minecraft.world.entity.LivingEntity) this).forceDrops) { @@ -104,7 +104,7 @@ index cc86993aa7bf95ed5ae861feedc7e1049f12e210..82c5868222d22a5c5dc508c516d67bdc return this.spawnAtLocation(entityitem); } diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index bc45bd5816b1b62cdd6011f2372702451b83f22b..42feb50674cba50fb7c5883f679e111c5412fb9b 100644 +index f242b2c56bfc2f17e87125e642538d58feb253e0..4cbdc1c36b1afb93f7c261b4ecbc5a766a00a288 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -254,7 +254,7 @@ public abstract class LivingEntity extends Entity implements Attackable { @@ -165,7 +165,7 @@ index ab708b256183fc54fe8e13f341d8a38acf611739..a9c1f99ba2461333bd154ac16e812031 } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index e15e60b67c17a0ea4fedb4882ea839e1b9b1ae60..66a05f9a5d114c7f39c3a88b7835e2a45f7db16f 100644 +index 93bf055d1b050c58677e8cec39e95b53b879ec1d..2fba13f4355fc7c32fa80935416014b292a6beeb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -939,17 +939,21 @@ public class CraftEventFactory { @@ -184,7 +184,7 @@ index e15e60b67c17a0ea4fedb4882ea839e1b9b1ae60..66a05f9a5d114c7f39c3a88b7835e2a4 - public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<org.bukkit.inventory.ItemStack> drops, Runnable lootCheck) { + private static java.util.function.Function<org.bukkit.inventory.ItemStack, Entity.DefaultDrop> FROM_FUNCTION = stack -> { + if (stack == null) return null; -+ return new Entity.DefaultDrop(CraftMagicNumbers.getItem(stack.getType()), stack, null); ++ return new Entity.DefaultDrop(CraftItemType.bukkitToMinecraft(stack.getType()), stack, null); + }; + public static EntityDeathEvent callEntityDeathEvent(net.minecraft.world.entity.LivingEntity victim, List<Entity.DefaultDrop> drops, Runnable lootCheck) { // Paper // Paper end diff --git a/patches/server/1046-Fix-scoreboard-entries.patch b/patches/server/1046-Fix-scoreboard-entries.patch deleted file mode 100644 index 9af3a73f36..0000000000 --- a/patches/server/1046-Fix-scoreboard-entries.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jake Potrebic <[email protected]> -Date: Sat, 16 Dec 2023 13:06:20 -0800 -Subject: [PATCH] Fix scoreboard entries - -1.20.3/4 introduced ScoreHolder which broke a lot of existing -logic that just assumed score entries were strings. - -diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -index be020d6b686c1ad5bd8b7cee0b6050304d434022..d3d0d71b6fbacc30917682fcc1aace1902a64248 100644 ---- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -+++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -@@ -42,12 +42,12 @@ final class CraftScore implements Score { - public int getScore() { - Scoreboard board = this.objective.checkState().board; - -- if (board.getTrackedPlayers().contains(this.entry)) { // Lazy -+ // if (board.getTrackedPlayers().contains(this.entry)) { // Lazy // Paper - just use the null check - ReadOnlyScoreInfo score = board.getPlayerScoreInfo(this.entry, this.objective.getHandle()); - if (score != null) { // Lazy - return score.value(); - } -- } -+ // } // Paper - just use the null check above - - return 0; // Lazy - } -@@ -61,7 +61,7 @@ final class CraftScore implements Score { - public boolean isScoreSet() { - Scoreboard board = this.objective.checkState().board; - -- return board.getTrackedPlayers().contains(this.entry) && board.getPlayerScoreInfo(this.entry, this.objective.getHandle()) != null; -+ return /*board.getTrackedPlayers().contains(this.entry) && */board.getPlayerScoreInfo(this.entry, this.objective.getHandle()) != null; // Paper - just check if the player score info exists - } - - @Override diff --git a/patches/server/1047-add-more-scoreboard-API.patch b/patches/server/1046-add-more-scoreboard-API.patch index bb2c0c4a40..3365b53a36 100644 --- a/patches/server/1047-add-more-scoreboard-API.patch +++ b/patches/server/1046-add-more-scoreboard-API.patch @@ -29,10 +29,10 @@ index b36e5574c10e6d70a399e2ac0704fd4f43dbb444..2d3abf2a1da487ead74d698cc5ea4eb7 } diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -index d3d0d71b6fbacc30917682fcc1aace1902a64248..ae57f91a4f604fdc6946c9a032e59a3ea3254fe7 100644 +index ceb1a39c02c3cfa7632a0fdca414c7046888fcb1..74d9c407e971804bed420370f7b684d8658eb5aa 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScore.java -@@ -76,4 +76,44 @@ final class CraftScore implements Score { +@@ -74,4 +74,44 @@ final class CraftScore implements Score { board.resetSinglePlayerScore(entry, this.objective.getHandle()); } // Paper end diff --git a/patches/server/1048-Improve-Registry.patch b/patches/server/1047-Improve-Registry.patch index 162949848b..162949848b 100644 --- a/patches/server/1048-Improve-Registry.patch +++ b/patches/server/1047-Improve-Registry.patch diff --git a/patches/server/1049-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch b/patches/server/1048-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch index dbb3cd64d0..f0ca125467 100644 --- a/patches/server/1049-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch +++ b/patches/server/1048-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch @@ -26,7 +26,7 @@ index 3fec07b250a8f145e30c8c41888e47d2a3c902e1..2ddd033e1c3a2e5c8950b93c83849192 x = to.getX(); y = to.getY(); diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java -index 96885946be3b8e129984353f3dfe4330e73ad84a..bc908b75cb99536df658281ae7f8b4eeedbbedc9 100644 +index 4cbdc1c36b1afb93f7c261b4ecbc5a766a00a288..8ac9c65caab86d30c31be0b713a7896a24637457 100644 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -4204,7 +4204,7 @@ public abstract class LivingEntity extends Entity implements Attackable { diff --git a/patches/server/1050-Add-experience-points-API.patch b/patches/server/1049-Add-experience-points-API.patch index a14d0455bf..a14d0455bf 100644 --- a/patches/server/1050-Add-experience-points-API.patch +++ b/patches/server/1049-Add-experience-points-API.patch diff --git a/patches/server/1051-Add-missing-InventoryType.patch b/patches/server/1050-Add-missing-InventoryType.patch index a49bdf073d..a49bdf073d 100644 --- a/patches/server/1051-Add-missing-InventoryType.patch +++ b/patches/server/1050-Add-missing-InventoryType.patch diff --git a/patches/server/1052-Add-drops-to-shear-events.patch b/patches/server/1051-Add-drops-to-shear-events.patch index 27f673cd52..74fd1a217b 100644 --- a/patches/server/1052-Add-drops-to-shear-events.patch +++ b/patches/server/1051-Add-drops-to-shear-events.patch @@ -233,7 +233,7 @@ index 8adcfc8f6772a32b5915e4a07100e8eb735f907a..b5d6857eaf2bed14adcb5f5e80d91b44 } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 66a05f9a5d114c7f39c3a88b7835e2a45f7db16f..cbaaa7d54e70bf4e0604d1716d253453bab03744 100644 +index 2fba13f4355fc7c32fa80935416014b292a6beeb..92aff5734425f7b5765687d892d4db4af806a1ba 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1718,20 +1718,20 @@ public class CraftEventFactory { @@ -264,7 +264,7 @@ index 66a05f9a5d114c7f39c3a88b7835e2a45f7db16f..cbaaa7d54e70bf4e0604d1716d253453 public static Cancellable handleStatisticsIncrease(net.minecraft.world.entity.player.Player entityHuman, net.minecraft.stats.Stat<?> statistic, int current, int newValue) { diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java -index 32da455eb46d09a846bae5270b32a6d6d6b962fd..c1d902c8dd2ec23240ee60ca9e9eaf7c839baed5 100644 +index 414a67096478ca57be54bd2ce565e7d50c8dd100..9dac41e4a93911f920204ed72ce9fe419b5bf696 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java @@ -61,6 +61,15 @@ public final class CraftItemStack extends ItemStack { diff --git a/patches/server/1053-Add-PlayerShieldDisableEvent.patch b/patches/server/1052-Add-PlayerShieldDisableEvent.patch index dfb7f5fbe9..c8ae6cd662 100644 --- a/patches/server/1053-Add-PlayerShieldDisableEvent.patch +++ b/patches/server/1052-Add-PlayerShieldDisableEvent.patch @@ -16,7 +16,7 @@ sideeffects, meaning the disable event cannot share a handlerlist with the cooldown event diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 5af48151159135b869ec4753bbcf79dd257c1570..538eaf327bdae975ce854871189990fbfe17b918 100644 +index c81c72bf1027fcbaac67808fbcf6e0af112176bc..42e2be9286b75a1d34845f303ffc65e96fdd5416 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -1703,7 +1703,11 @@ public abstract class Mob extends LivingEntity implements Targeting { diff --git a/patches/server/1054-Add-HiddenPotionEffect-API.patch b/patches/server/1053-Add-HiddenPotionEffect-API.patch index 5f9960d071..5f9960d071 100644 --- a/patches/server/1054-Add-HiddenPotionEffect-API.patch +++ b/patches/server/1053-Add-HiddenPotionEffect-API.patch diff --git a/patches/server/1055-Correctly-check-if-bucket-dispenses-will-succeed-for.patch b/patches/server/1054-Correctly-check-if-bucket-dispenses-will-succeed-for.patch index 761c0530e9..761c0530e9 100644 --- a/patches/server/1055-Correctly-check-if-bucket-dispenses-will-succeed-for.patch +++ b/patches/server/1054-Correctly-check-if-bucket-dispenses-will-succeed-for.patch diff --git a/patches/server/1056-fix-ItemMeta-removing-CustomModelData.patch b/patches/server/1055-fix-ItemMeta-removing-CustomModelData.patch index 66b19df19b..4beeab274c 100644 --- a/patches/server/1056-fix-ItemMeta-removing-CustomModelData.patch +++ b/patches/server/1055-fix-ItemMeta-removing-CustomModelData.patch @@ -5,10 +5,10 @@ Subject: [PATCH] fix ItemMeta removing CustomModelData diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index d4eb344c3609f3902531c15e9c7444c0930a908e..91bbea5cb169f96910cc8661151c04dbff057091 100644 +index d8ac86c3a89e29696e23b8ee6fddb84eb0313ea6..8eae41077dc370e2286efaad4b9878c8ec04460e 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -@@ -380,7 +380,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { +@@ -381,7 +381,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { } } diff --git a/patches/server/1057-Validate-ResourceLocation-in-NBT-reading.patch b/patches/server/1056-Validate-ResourceLocation-in-NBT-reading.patch index 7a3aab0179..9151c477c8 100644 --- a/patches/server/1057-Validate-ResourceLocation-in-NBT-reading.patch +++ b/patches/server/1056-Validate-ResourceLocation-in-NBT-reading.patch @@ -40,7 +40,7 @@ index 38e2a8cec48bc779b8154d6d719031f457a2403e..4379090b74d156b62b88163a234c22e7 this.path = path; } diff --git a/src/main/java/net/minecraft/world/entity/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java -index 00389d7ec3e8b059d5591a2019ba240fda2901fe..6cfce9755dd464a7afb01f9032e567ce3bcd5bc5 100644 +index abb2a02e0fc1deedb0ad76aec64f74ce355129cc..4bede2ca556a3bbcfbde9709c8415c9ea94383de 100644 --- a/src/main/java/net/minecraft/world/entity/EntityType.java +++ b/src/main/java/net/minecraft/world/entity/EntityType.java @@ -618,7 +618,7 @@ public class EntityType<T extends Entity> implements FeatureElement, EntityTypeT @@ -53,7 +53,7 @@ index 00389d7ec3e8b059d5591a2019ba240fda2901fe..6cfce9755dd464a7afb01f9032e567ce @Nullable diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java -index 538eaf327bdae975ce854871189990fbfe17b918..a31e8bb38b29a7c30cecb762d3ffec700e2186b8 100644 +index 42e2be9286b75a1d34845f303ffc65e96fdd5416..0b5334004b9d0489e8465824870662b467ce321b 100644 --- a/src/main/java/net/minecraft/world/entity/Mob.java +++ b/src/main/java/net/minecraft/world/entity/Mob.java @@ -620,7 +620,7 @@ public abstract class Mob extends LivingEntity implements Targeting { diff --git a/patches/server/1058-Properly-handle-experience-dropping-on-block-break.patch b/patches/server/1057-Properly-handle-experience-dropping-on-block-break.patch index 0c486af78b..275d1e2c27 100644 --- a/patches/server/1058-Properly-handle-experience-dropping-on-block-break.patch +++ b/patches/server/1057-Properly-handle-experience-dropping-on-block-break.patch @@ -7,7 +7,7 @@ This causes spawnAfterBreak to spawn xp by default, removing the need to manuall For classes that use custom xp amounts, they can drop the resources with disabling diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java -index a7d40d41a332f0612a2f1ff60c7082e4a8825ba1..e0b70ae59ed7ea0543c8cb87b0e7e5f0bc9385b1 100644 +index b8bf9eaae60040a3ba3d395712aa91940a71bea2..afd2e9bcdf94f3511bcd68cab5e72284f07fd016 100644 --- a/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java @@ -1103,7 +1103,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable { diff --git a/patches/server/1059-Fixup-NamespacedKey-handling.patch b/patches/server/1058-Fixup-NamespacedKey-handling.patch index 14ddcf111d..14ddcf111d 100644 --- a/patches/server/1059-Fixup-NamespacedKey-handling.patch +++ b/patches/server/1058-Fixup-NamespacedKey-handling.patch diff --git a/work/Bukkit b/work/Bukkit -Subproject 0c7aedbceabcf05dde0a483001acd3d957e06c0 +Subproject 63c208dd3f16a0874b5e21348c35ce9e5c829d0 diff --git a/work/CraftBukkit b/work/CraftBukkit -Subproject 53ebb05e3951a1a05e4efb8a739d9bf31d21385 +Subproject 771182f70cd789f3d220cfef80876845a48ebec diff --git a/work/Spigot b/work/Spigot -Subproject e7ce55a3b93404a86c248a3d749e5219adda4ca +Subproject 864e4acc0db6ad9899f269740823a23d082d18d |