Skip to content

Commit b2921f6

Browse files
BaitinqAvanatiker
andauthored
AutoArmor: Add "Allow Elytra" setting (#460)
* AutoArmor: Add "Allow Elytra" setting This patch introduces the "Allow Elytra" setting in the AutoArmor module, which lets the user chose whether AutoArmor will replace their equipped elytra with a chestplate (allowElytra = false) or not (allowElytra = true) :^) * Fix grammar Co-authored-by: Constructor <fractalminds@protonmail.com>
1 parent b9220e7 commit b2921f6

File tree

1 file changed

+5
-3
lines changed
  • src/main/kotlin/com/lambda/client/module/modules/combat

1 file changed

+5
-3
lines changed

src/main/kotlin/com/lambda/client/module/modules/combat/AutoArmor.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ import net.minecraftforge.fml.common.gameevent.TickEvent
1919

2020
object AutoArmor : Module(
2121
name = "AutoArmor",
22-
description = "Automatically equips armour",
22+
description = "Automatically equips armor",
2323
category = Category.COMBAT,
2424
modulePriority = 500
2525
) {
26+
private val allowElytra by setting("Allow Elytra", false, description = "If activated it will not replace an equipped elytra with a chestplate")
27+
2628
init {
2729
safeListener<TickEvent.ClientTickEvent> {
2830
// store slots and values of best armor pieces, initialize with currently equipped armor
@@ -37,8 +39,8 @@ object AutoArmor : Module(
3739

3840
val armorType = item.armorType.index
3941

40-
// Skip if item is chestplate and we have elytra equipped
41-
if (armorType == 2 && player.inventory.armorInventory[2].item == Items.ELYTRA) continue
42+
// Skip if allowElytra is activated, item is chestplate, and we have elytra equipped
43+
if (allowElytra && armorType == 2 && player.inventory.armorInventory[2].item == Items.ELYTRA) continue
4244
val armorValue = getArmorValue(itemStack)
4345

4446
if (armorValue > bestArmors[armorType].second) {

0 commit comments

Comments
 (0)