Skip to content

Commit

Permalink
better null defence (#10152)
Browse files Browse the repository at this point in the history
defend against silly mods putting nulls in their armour defense maps
  • Loading branch information
uecasm authored Aug 24, 2024
1 parent 9e90220 commit 94d9479
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/main/java/com/minecolonies/api/util/ItemStackUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,7 @@ private static float getArmorValue(final ArmorMaterial material)
int value = 0;
for (final ArmorItem.Type type : ArmorItem.Type.values())
{
if (material.defense().containsKey(type))
{
value += material.defense().get(type);
}
value += material.defense().getOrDefault(type, 0);
}
return value + material.toughness() * 4;
}
Expand Down

0 comments on commit 94d9479

Please sign in to comment.