2020-12-27 11:31:49 +00: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
|
|
|
|
Subject: [PATCH] Do not crash from invalid ingredient lists in
|
|
|
|
VillagerAcquireTradeEvent
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
2021-03-08 23:12:31 +00:00
|
|
|
index 790df2be9cbbc359ba354ed272dbf6dda71951f0..4620c36d568da12092a2f7cb067cbf7fd20bee94 100644
|
2020-12-27 11:31:49 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillagerAbstract.java
|
2021-03-08 23:12:31 +00:00
|
|
|
@@ -246,7 +246,11 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
2020-12-27 11:31:49 +00:00
|
|
|
Bukkit.getPluginManager().callEvent(event);
|
|
|
|
}
|
|
|
|
if (!event.isCancelled()) {
|
|
|
|
- merchantrecipelist.add(CraftMerchantRecipe.fromBukkit(event.getRecipe()).toMinecraft());
|
|
|
|
+ // Paper start
|
|
|
|
+ final CraftMerchantRecipe craftMerchantRecipe = CraftMerchantRecipe.fromBukkit(event.getRecipe());
|
|
|
|
+ if (craftMerchantRecipe.getIngredients().isEmpty()) return;
|
|
|
|
+ merchantrecipelist.add(craftMerchantRecipe.toMinecraft());
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
}
|