diff --git a/paper-server/patches/sources/net/minecraft/world/entity/npc/AbstractVillager.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/npc/AbstractVillager.java.patch index 2ee4a021d8..37321c76f6 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/npc/AbstractVillager.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/npc/AbstractVillager.java.patch @@ -54,7 +54,7 @@ Logger logger = AbstractVillager.LOGGER; Objects.requireNonNull(logger); -@@ -246,7 +266,16 @@ +@@ -246,7 +266,20 @@ MerchantOffer merchantrecipe = ((VillagerTrades.ItemListing) arraylist.remove(this.random.nextInt(arraylist.size()))).getOffer(this, this.random); if (merchantrecipe != null) { @@ -66,7 +66,11 @@ + 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;