Skip to content

Commit

Permalink
fix forge mixin crash
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Sep 24, 2023
1 parent 97067b9 commit 4db988d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
import net.minecraft.client.KeyMapping;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.world.entity.player.Abilities;
import net.minecraft.world.item.ElytraItem;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand Down Expand Up @@ -112,14 +110,14 @@ private void updateRidden(CallbackInfo cb) {
method = "aiStep",
at = @At(
value = "INVOKE",
target = "net/minecraft/world/item/ElytraItem.isFlyEnabled(Lnet/minecraft/world/item/ItemStack;)Z"
target = "Lnet/minecraft/client/player/LocalPlayer;tryToStartFallFlying()Z"
)
)
private boolean isFlyEnabled(ItemStack stack) {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer((LocalPlayer) (Object) this);
private boolean tryToStartFallFlying(final LocalPlayer instance) {
IBaritone baritone = BaritoneAPI.getProvider().getBaritoneForPlayer(instance);
if (baritone != null && baritone.getPathingBehavior().isPathing()) {
return false;
}
return ElytraItem.isFlyEnabled(stack);
return instance.tryToStartFallFlying();
}
}

0 comments on commit 4db988d

Please sign in to comment.