Simplify when expression

This commit is contained in:
DBotThePony 2022-10-03 00:27:07 +07:00
parent 1c479f3d86
commit 246d01466d
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -20,23 +20,21 @@ import java.util.function.Consumer
private object TritaniumArmorMaterial : ArmorMaterial { private object TritaniumArmorMaterial : ArmorMaterial {
override fun getDurabilityForSlot(p_40410_: EquipmentSlot): Int { override fun getDurabilityForSlot(p_40410_: EquipmentSlot): Int {
return when (p_40410_) { return when (p_40410_) {
EquipmentSlot.MAINHAND -> throw IllegalArgumentException("yo dude what the fuck")
EquipmentSlot.OFFHAND -> throw IllegalArgumentException("yo dude what the fuck")
EquipmentSlot.FEET -> 470 EquipmentSlot.FEET -> 470
EquipmentSlot.LEGS -> 540 EquipmentSlot.LEGS -> 540
EquipmentSlot.CHEST -> 820 EquipmentSlot.CHEST -> 820
EquipmentSlot.HEAD -> 520 EquipmentSlot.HEAD -> 520
else -> throw IllegalArgumentException("yo dude what the fuck")
} }
} }
override fun getDefenseForSlot(p_40411_: EquipmentSlot): Int { override fun getDefenseForSlot(p_40411_: EquipmentSlot): Int {
return when (p_40411_) { return when (p_40411_) {
EquipmentSlot.MAINHAND -> throw IllegalArgumentException("yo dude what the fuck")
EquipmentSlot.OFFHAND -> throw IllegalArgumentException("yo dude what the fuck")
EquipmentSlot.FEET -> 4 EquipmentSlot.FEET -> 4
EquipmentSlot.LEGS -> 7 EquipmentSlot.LEGS -> 7
EquipmentSlot.CHEST -> 12 EquipmentSlot.CHEST -> 12
EquipmentSlot.HEAD -> 5 EquipmentSlot.HEAD -> 5
else -> throw IllegalArgumentException("yo dude what the fuck")
} }
} }