Feature: AutoElytraSwap#305
Conversation
PoTheMagicDragon
left a comment
There was a problem hiding this comment.
I don't know enough about elytra logic to comment on that, so my comments are all naming/ code structure related
|
|
||
| var overriddenElytraPriority: Boolean? = null | ||
|
|
||
| val SORTER = compareByDescending<Slot> { |
There was a problem hiding this comment.
Normally I'd only make constants all upper case
There was a problem hiding this comment.
i think it also applies to constant-style values, as long as theyre completely immutable. In the example you sent me, it included regex too which you cant use const on either
| val new = swappable.find { new -> | ||
| equipped.canInsert(new.stack) && sorter.compare(equipped, new) > 0 | ||
| } ?: return@forEach | ||
| fun SafeContext.tick() { |
There was a problem hiding this comment.
Should there be an elytra manager instead of having auto armor, auto elytra swap, & elytra fly all tangled together?
There was a problem hiding this comment.
yeah youre right. I never meant for AutoElytraSwap to end up handling so much, it kind of just happened and i didnt really think too much about moving it out. I'll make an ElytraHandler object somewhere
| @JvmStatic val elytraFlyOnly by setting("ElytraFly Only", false, "Only swaps the chest piece when the ElytraFly module is enabled and gliding") | ||
| private val glideDelay by setting("Glide Delay", 0, 0..20, 1, "The delay, in ticks, between swapping to elytra, and starting to glide", unit = " ticks") | ||
|
|
||
| val ELYTRA_SELECTION = |
There was a problem hiding this comment.
Same thing about constants and case
| isItem(Items.ELYTRA) | ||
| .and { it.damage < it.maxDamage } | ||
| } | ||
| val CHESTPLATE_SELECTION = |
There was a problem hiding this comment.
Same thing about constants and case
|
|
||
| const val FAKE_PLAYER_ID = -2024-4-20 | ||
| object PlayerUtils { | ||
| const val FAKE_PLAYER_ID = -2024-4-20 |
There was a problem hiding this comment.
I like having these put into a class instead of free floating in a file
|
Looks good now |
Automatically swaps the users elytra when attempting to glide. This isn't just for standard flying either, it swaps to chestplate for fake fly, and has a couple extra settings. ElytraFly Only, so it won't swap your chestplate/elytra when regularly jumping and attempting to glide, and a glide delay to only start gliding after a certain amount of time post-swapping.