diff options
author | maxcom1 <[email protected]> | 2024-03-23 22:26:17 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-23 17:26:17 -0400 |
commit | b6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch) | |
tree | a8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch | |
parent | 9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff) | |
download | Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip |
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch')
-rw-r--r-- | patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch b/patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch new file mode 100644 index 0000000000..50044a8342 --- /dev/null +++ b/patches/server/0469-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch @@ -0,0 +1,24 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Shane Freeder <[email protected]> +Date: Sun, 27 Dec 2020 11:31:06 +0000 +Subject: [PATCH] Fix crash from invalid ingredient lists in + VillagerAcquireTradeEvent + + +diff --git a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +index ddc002f269527201724457c0b820788200441e0c..9bc5a9592cabe087effc03e5347ea1d75794960b 100644 +--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java ++++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java +@@ -261,7 +261,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa + Bukkit.getPluginManager().callEvent(event); + } + if (!event.isCancelled()) { +- recipeList.add(CraftMerchantRecipe.fromBukkit(event.getRecipe()).toMinecraft()); ++ // Paper start - Fix crash from invalid ingredient list ++ final CraftMerchantRecipe craftMerchantRecipe = CraftMerchantRecipe.fromBukkit(event.getRecipe()); ++ if (craftMerchantRecipe.getIngredients().isEmpty()) return; ++ recipeList.add(craftMerchantRecipe.toMinecraft()); ++ // Paper end - Fix crash from invalid ingredient list + } + // CraftBukkit end + ++j; |