2020-12-27 12:31:49 +01: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
|
|
|
|
|
|
|
|
|
2021-03-16 08:19:45 +01:00
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java
|
2020-12-27 12:31:49 +01:00
|
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
2021-03-16 08:19:45 +01:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/npc/EntityVillagerAbstract.java
|
2020-12-27 12:31:49 +01:00
|
|
|
@@ -0,0 +0,0 @@ public abstract class EntityVillagerAbstract extends EntityAgeable implements NP
|
|
|
|
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
|
|
|
|
}
|