aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
diff options
context:
space:
mode:
authorNewwind <[email protected]>2024-08-31 19:29:50 +0100
committerGitHub <[email protected]>2024-08-31 20:29:50 +0200
commit509ea2fd17fa03ce04f86046098607733b8767ba (patch)
tree3f7c9a29481fafbb6ad9f846839ec8f4863d2363 /patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
parente01ddf46279fbb68d157749a906b7a2ecc60da1a (diff)
downloadPaper-509ea2fd17fa03ce04f86046098607733b8767ba.tar.gz
Paper-509ea2fd17fa03ce04f86046098607733b8767ba.zip
Fix horse armor desync (#11341)
Diffstat (limited to 'patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch')
-rw-r--r--patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch b/patches/server/0448-Fix-crash-from-invalid-ingredient-lists-in-VillagerA.patch
new file mode 100644
index 0000000000..4186b39237
--- /dev/null
+++ b/patches/server/0448-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 80fe2e3e5b97e9b6af98b73f19f8c2f5fca279fe..6139361c0e733f981506abdd7101e5ca20eeb88f 100644
+--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
++++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
+@@ -275,7 +275,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;