Skip to content

Commit e5bd1a3

Browse files
authored
Merge pull request #2139 from Saereth/logspam
Fixed curio related logspam in certain edge-cases
2 parents f3e4a24 + 3fea3f8 commit e5bd1a3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/main/java/wayoftime/bloodmagic/compat/CuriosCompat.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ public NonNullList<ItemStack> getCuriosInventory(Player player)
4040

4141
public int recalculateCuriosSlots(Player player)
4242
{
43-
ICurioStacksHandler livingArmourSockets = CuriosApi.getCuriosInventory(player).resolve().get().getCurios().get("living_armour_socket");
43+
Optional<ICuriosItemHandler> curioInv = CuriosApi.getCuriosInventory(player).resolve();
44+
if (curioInv.isEmpty()) {
45+
return 0;
46+
}
47+
ICurioStacksHandler livingArmourSockets = curioInv.get().getCurios().get("living_armour_socket");
48+
if (livingArmourSockets == null) {
49+
return 0;
50+
}
4451
if (LivingUtil.hasFullSet(player))
4552
{
4653
LivingStats stats = LivingStats.fromPlayer(player);

0 commit comments

Comments
 (0)