File tree Expand file tree Collapse file tree
src/main/java/me/matl114/hacks/modules/move Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -680,7 +680,8 @@ public int findEmptyPlaceForElytra() {
680680
681681 if (ClientPlayerAccess .of (mc .player ).getServerScreenHandler () == mc .player .playerScreenHandler ) {
682682 Predicate <ItemStack > canUnbreakablePredicate = (item ) -> {
683- return (!VItem .getInstance ().canGlide (item ) && mc .player .canEquip (item , EquipmentSlot .CHEST ));
683+ return item .isEmpty ()
684+ || (!VItem .getInstance ().canGlide (item ) && mc .player .canEquip (item , EquipmentSlot .CHEST ));
684685 };
685686 // use cached autoSwitch slot
686687 if (thisFallFlyingIsAutoSwitch != -1
@@ -694,10 +695,7 @@ public int findEmptyPlaceForElytra() {
694695 }
695696 var re = InventoryUtils .findBestPlayerInventory (
696697 item -> {
697- if ((item .index () < 36 || item .index () == 40 )
698- && item .val ().isEmpty ()
699- || (!VItem .getInstance ().canGlide (item .val ())
700- && mc .player .canEquip (item .val (), EquipmentSlot .CHEST ))) {
698+ if ((item .index () < 36 || item .index () == 40 ) && (canUnbreakablePredicate .test (item .val ()))) {
701699 return DamageUtils .getArmorValue (mc .player , item .val (), EquipmentSlot .CHEST )
702700 * DamageUtils .getArmorToughnessValue (mc .player , item .val (), EquipmentSlot .CHEST );
703701 } else return null ;
You can’t perform that action at this time.
0 commit comments