Skip to content

Commit 3ffe92a

Browse files
committed
feat: progress
1. fix unbreakable selection
1 parent 4b34d04 commit 3ffe92a

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/main/java/me/matl114/hacks/modules/move/ElytraExtra.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)