Skip to content

Commit

Permalink
fix: #84 (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
zly2006 authored Dec 20, 2024
1 parent 793783f commit b60db2a
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,13 @@ private void disableDoubleTapSprint(CallbackInfo ci)

@Inject(method = "tickMovement",
at = @At(value = "INVOKE", shift = At.Shift.BEFORE,
target = "Lnet/minecraft/client/network/ClientPlayerEntity;isGliding()Z"))
target = "Lnet/minecraft/client/network/ClientPlayerEntity;checkGliding()Z"))
private void onFallFlyingCheckChestSlot(CallbackInfo ci)
{
if (FeatureToggle.TWEAK_AUTO_SWITCH_ELYTRA.getBooleanValue() &&
this.input.playerInput.jump() && this.input.playerInput.forward())
if (FeatureToggle.TWEAK_AUTO_SWITCH_ELYTRA.getBooleanValue())
{
// PlayerEntity#checkFallFlying
if (!this.isOnGround() && !this.isGliding() && !this.isInFluid() && !this.isClimbing() && !this.hasStatusEffect(StatusEffects.LEVITATION))
// this.checkGliding()
if (!this.isOnGround() && !this.hasVehicle() && this.glidingTicks == 0 && !this.isInFluid() && !this.isClimbing() && !this.hasStatusEffect(StatusEffects.LEVITATION))
{
if (!this.getEquippedStack(EquipmentSlot.CHEST).isOf(Items.ELYTRA) ||
this.getEquippedStack(EquipmentSlot.CHEST).getDamage() > this.getEquippedStack(EquipmentSlot.CHEST).getMaxDamage() - 10)
Expand Down

0 comments on commit b60db2a

Please sign in to comment.