Guard against IOOBEs when rendering the new spell trade icon, fixes #565

This commit is contained in:
Electroblob77
2020-12-20 00:16:17 +00:00
parent d23c15476a
commit ddfffd3d31
@@ -90,6 +90,8 @@ public class WizardTradeTweaksHandler {
// New spell indicator // New spell indicator
if(gui.inventorySlots instanceof ContainerMerchant){ if(gui.inventorySlots instanceof ContainerMerchant){
if(tradeIndex < trades.size()){ // Seems to happen with certain mods' GUIs
// Can't use getCurrentRecipe because that only gets updated when the correct items are given // Can't use getCurrentRecipe because that only gets updated when the correct items are given
MerchantRecipe recipe = trades.get(tradeIndex); MerchantRecipe recipe = trades.get(tradeIndex);
@@ -125,5 +127,6 @@ public class WizardTradeTweaksHandler {
} }
} }
} }
}
} }