Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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) :^)
  • Loading branch information
Baitinq committed Jan 14, 2023
commit ee536ae7eb1e4a66ee728dc04e2e9bee3bad9b52
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ object AutoArmor : Module(
category = Category.COMBAT,
modulePriority = 500
) {
private val allowElytra by setting("Allow Elytra", false, description = "If activated it will not replace an equipped elytra with a chestplate")

init {
safeListener<TickEvent.ClientTickEvent> {
// store slots and values of best armor pieces, initialize with currently equipped armor
Expand All @@ -37,8 +39,8 @@ object AutoArmor : Module(

val armorType = item.armorType.index

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

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