2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Shane Freeder <theboyetronic@gmail.com>
|
|
|
|
Date: Sun, 27 Dec 2020 11:31:06 +0000
|
2024-01-20 12:50:16 +01:00
|
|
|
Subject: [PATCH] Fix crash from invalid ingredient lists in
|
2021-06-11 14:02:28 +02:00
|
|
|
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
|
2024-04-24 15:46:45 +02:00
|
|
|
index 79e81fd5490a493b595dc1034641e13451e5a61a..6e29b5729b8184d13065c9c4e18f6e450c9d88a6 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/AbstractVillager.java
|
2024-04-24 15:46:45 +02:00
|
|
|
@@ -269,7 +269,11 @@ public abstract class AbstractVillager extends AgeableMob implements InventoryCa
|
2021-06-11 14:02:28 +02:00
|
|
|
Bukkit.getPluginManager().callEvent(event);
|
|
|
|
}
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
- recipeList.add(CraftMerchantRecipe.fromBukkit(event.getRecipe()).toMinecraft());
|
2024-01-20 12:50:16 +01:00
|
|
|
+ // Paper start - Fix crash from invalid ingredient list
|
2021-06-11 14:02:28 +02:00
|
|
|
+ final CraftMerchantRecipe craftMerchantRecipe = CraftMerchantRecipe.fromBukkit(event.getRecipe());
|
|
|
|
+ if (craftMerchantRecipe.getIngredients().isEmpty()) return;
|
|
|
|
+ recipeList.add(craftMerchantRecipe.toMinecraft());
|
2024-01-20 12:50:16 +01:00
|
|
|
+ // Paper end - Fix crash from invalid ingredient list
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
2023-09-22 06:40:51 +02:00
|
|
|
++j;
|