Skip to content

Commit

Permalink
Fixed double jump on climb-ables
Browse files Browse the repository at this point in the history
  • Loading branch information
squeeglii committed May 12, 2023
1 parent 0d56f6d commit 733487d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import com.yyon.grapplinghook.util.Vec;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.LadderBlock;

import static com.yyon.grapplinghook.content.registry.GrappleModCustomizationProperties.ROCKET_ATTACHED;

Expand Down Expand Up @@ -51,6 +53,10 @@ public void updatePlayerPos() {
return;
}

if (entity instanceof LivingEntity e && e.onClimbable()) {
this.unattach();
}

Vec additionalmotion = new Vec(0,0,0);

if (GrappleModLegacyConfig.getConf().other.dont_override_movement_in_air && !entity.isOnGround() && !wasSliding && !wasWallrunning && !wasRocket && !firstTickSinceCreated) {
Expand Down Expand Up @@ -160,10 +166,6 @@ public void updatePlayerPos() {

newmotion = motion.add(additionalmotion);

// if (wallrun) {
// newmotion.add_ip(this.walldirection);
// }

newmotion.applyAsMotionTo(entity);

this.updateServerPos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ public void doDoubleJump() {

this.motion.y += GrappleModLegacyConfig.getConf().enchantments.doublejump.doublejumpforce;
this.motion.applyAsMotionTo(this.entity);
this.entity.resetFallDistance();
}

public void applySlidingFriction() {
Expand Down

0 comments on commit 733487d

Please sign in to comment.