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 ++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 @@ ++ 2.19.0 ++ compile ++ +++ +++ org.ow2.asm +++ asm +++ 9.5 +++ compile +++ ++ ++ org.ow2.asm ++ asm-commons ++-- ++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 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, 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). - *
- * Only valid for shaped recipes */ 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 @@ - - 4.0.0 @@ -244,6 +244,12 @@ index 123a4526359c53823898b743d9233c22ce6a8989..00000000000000000000000000000000 - 9.5 - compile -
+- +- org.ow2.asm +- asm-commons +- 9.5 +- compile +- - - - com.github.oshi 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 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("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 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> 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 waitable = new Waitable() { - @Override -@@ -296,12 +296,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener, +@@ -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 waitable = new Waitable() { + @Override +@@ -304,12 +304,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; - } - } + 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> gamerules; public static synchronized Map> 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 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 { 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 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 List getEntities(EntityTypeTest filter, AABB box, Predicate 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 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 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 lore; // null and empty are two different states internally private Integer customModelData; private CompoundTag blockData; @@ -204,7 +204,7 @@ index fbde42a814f846ce8c9df6ea621f10610d9322b3..2a63d2af178f8e8f12d6a57226257da4 private Multimap 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 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 { 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 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 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 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 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 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 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 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 internalTags = new HashMap(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 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 items; public int litTime; int litDuration; @@ -28,7 +28,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc protected AbstractFurnaceBlockEntity(BlockEntityType blockEntityType, BlockPos pos, BlockState state, RecipeType 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) recipeType); // CraftBukkit - decompile error // Eclipse fail @@ -36,7 +36,7 @@ index 2f628f36c32752d1bac910e180b90639c1ae2c9d..d7a89c2b70de20f632ee210780ede0bc } public static Map 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 SEARCH_AND_REMOVE = initReplacementsMap(); -+ private static Map initReplacementsMap() -+ { ++ private static Map initReplacementsMap() { + Map 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 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 biomes; private Set tiles; private final Set 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 Co-authored-by: Jake Potrebic 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 { 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(Lists.transform(this.lore, CraftChatMessage::fromJSONComponent)); } @@ -47,7 +47,7 @@ index 7cd7e275c997bbf0ad7aab87aabc27aa722b915c..b9eca4b39cc265cb2d9b9f20ee6f803b @Override public void setLore(List 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%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, 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 ReentrantBlockableEventLoopBukkit 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 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 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 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 completablefuture = CompletableFuture.supplyAsync(() -> { Stream stream = dataPacks.stream(); // CraftBukkit - decompile error -@@ -2149,6 +2155,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 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 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 implem +@@ -58,7 +58,7 @@ public class CraftShulkerBox extends CraftLootable 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 implem +@@ -67,4 +67,11 @@ public class CraftShulkerBox extends CraftLootable 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(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 SEARCH_AND_REMOVE = initReplacementsMap(); - private static Map initReplacementsMap() - { -@@ -457,6 +458,11 @@ public class Commodore + private static Map initReplacementsMap() { + Map 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 DEFAULT_FACTORY = new BlockStateFactory(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 > void register( @@ -367,7 +367,7 @@ index 2fe8f7dfefd6e1f9b06f1d4821894091a8e6400e..000724a070f7f053c14cb53ecc45f0ee + // Paper start + BlockStateFactory 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 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 biomes; private Set tiles; private final Set 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 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) 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> entityTags = BuiltInRegistries.ENTITY_TYPE; return entityTags.getTags().map(pair -> (org.bukkit.Tag) 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(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 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 S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1639,7 +1640,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 0; // Paper -@@ -1717,6 +1720,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop> 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 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 <61288881+chrisgdt@users.noreply.github.com> 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 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 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 <50800980+Warriorrrr@users.noreply.github.com> 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 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 S spin(Function serverFactory) { AtomicReference atomicreference = new AtomicReference(); -@@ -1691,6 +1694,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop 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 hitEntities = Sets.newHashSet(); private int blocksSetOnFire; -- public boolean isSilent = false; // Spigot + public boolean isEffect; // Paper - Properly handle lightning effects api public LightningBolt(EntityType 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 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 drops, Runnable lootCheck) { + private static java.util.function.Function 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 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 -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 similarity index 95% rename from patches/server/1047-add-more-scoreboard-API.patch rename to 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 similarity index 100% rename from patches/server/1048-Improve-Registry.patch rename to 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 similarity index 97% rename from patches/server/1049-Fix-NPE-on-null-loc-for-EntityTeleportEvent.patch rename to 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 similarity index 100% rename from patches/server/1050-Add-experience-points-API.patch rename to 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 similarity index 100% rename from patches/server/1051-Add-missing-InventoryType.patch rename to 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 similarity index 98% rename from patches/server/1052-Add-drops-to-shear-events.patch rename to 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 similarity index 97% rename from patches/server/1053-Add-PlayerShieldDisableEvent.patch rename to 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 similarity index 100% rename from patches/server/1054-Add-HiddenPotionEffect-API.patch rename to 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 similarity index 100% rename from patches/server/1055-Correctly-check-if-bucket-dispenses-will-succeed-for.patch rename to 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 similarity index 86% rename from patches/server/1056-fix-ItemMeta-removing-CustomModelData.patch rename to 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 similarity index 96% rename from patches/server/1057-Validate-ResourceLocation-in-NBT-reading.patch rename to 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 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 similarity index 98% rename from patches/server/1058-Properly-handle-experience-dropping-on-block-break.patch rename to 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 similarity index 100% rename from patches/server/1059-Fixup-NamespacedKey-handling.patch rename to patches/server/1058-Fixup-NamespacedKey-handling.patch diff --git a/work/Bukkit b/work/Bukkit index 0c7aedbcea..63c208dd3f 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit 0c7aedbceabcf05dde0a483001acd3d957e06c03 +Subproject commit 63c208dd3f16a0874b5e21348c35ce9e5c829d03 diff --git a/work/CraftBukkit b/work/CraftBukkit index 53ebb05e39..771182f70c 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 53ebb05e3951a1a05e4efb8a739d9bf31d21385e +Subproject commit 771182f70cd789f3d220cfef80876845a48ebec5 diff --git a/work/Spigot b/work/Spigot index e7ce55a3b9..864e4acc0d 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit e7ce55a3b93404a86c248a3d749e5219adda4ca0 +Subproject commit 864e4acc0db6ad9899f269740823a23d082d18d0