ArmorComparator

class ArmorComparator(expectedDamage: Float, armorKitParametersForSlot: ArmorKitParameters, durabilityThreshold: Int = Int.MIN_VALUE, mode: ArmorComparatorMode = ArmorComparatorMode.SMART, considerProjectileProtection: Boolean = true) : Comparator<ArmorPiece>

Compares armor pieces by their damage reduction.

Constructors

Link copied to clipboard
constructor(expectedDamage: Float, armorKitParametersForSlot: ArmorKitParameters, durabilityThreshold: Int = Int.MIN_VALUE, mode: ArmorComparatorMode = ArmorComparatorMode.SMART, considerProjectileProtection: Boolean = true)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
Link copied to clipboard
open override fun compare(o1: ArmorPiece, o2: ArmorPiece): Int
Link copied to clipboard
fun getDamageFactor(damage: Float, defensePoints: Float, toughness: Float): Float

Calculates the base damage factor (totalDamage = damage x damageFactor).

Link copied to clipboard
fun getLegacyDamageReduction(itemStack: ItemStack): Float

Damage reduction this piece contributes under the legacy (1.8) armor model: its own armor points on top of the rest of the kit, plus its own protection enchantments.

Link copied to clipboard
Link copied to clipboard
open fun <U : Comparable<in U?>?> thenComparing(keyExtractor: Function<in ArmorPiece?, out U?>?): Comparator<ArmorPiece?>?
open fun <U : Any?> thenComparing(keyExtractor: Function<in ArmorPiece?, out U?>?, keyComparator: Comparator<in U?>?): Comparator<ArmorPiece?>?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard