Skip to content

Commit

Permalink
Fix #12, make auto jump not enable when jump boost is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
theRookieCoder committed Jan 5, 2023
1 parent 9692625 commit 3d170ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Expand Up @@ -41,9 +41,9 @@ java {
}

// TODO: Update this every release
def changelog = "Make auto jump not enable when stair is upside down"
def changelog = "Make auto jump not enable when stair is upside down or jump boost is enabled"

tasks.register('publish') {
task publish {
group 'Help'
description 'Upload to Modrinth and CurseForge, and sync body/description'
doLast {
Expand Down
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.block.enums.BlockHalf;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.GameOptions;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand All @@ -30,6 +31,9 @@ public void injectMethod(CallbackInfo ci) {
BlockPos pos = player.getBlockPos();
GameOptions options = MinecraftClient.getInstance().options;

options.getAutoJump().setValue(onStair(pos, world) || onStair(pos.down(), world));
options.getAutoJump().setValue(
!player.hasStatusEffect(StatusEffects.JUMP_BOOST)
&& (onStair(pos, world) || onStair(pos.down(), world))
);
}
}

0 comments on commit 3d170ee

Please sign in to comment.