Skip to content

Commit

Permalink
close #15, #21
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jul 16, 2019
1 parent 85e2892 commit cb4b230
Showing 1 changed file with 14 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ private void handleWallJump() {

clingTime--;
if (keyTimer > 0 && (keyTimer < 5 || clingTime < -15) && canWallCling(this)) {

Vec3d previousVelocity = this.getVelocity();
double velY = previousVelocity.y;
if (velY > -0.75) velY = 0.0;
Expand All @@ -151,34 +150,34 @@ private void handleWallJump() {
clingX = this.getPos().getX();
clingZ = this.getPos().getZ();
switch(clingDirection) {
// all these are player's direction from container view
// all these are player's direction from container view (opposite of player look when looking at wall)
case NORTH:
clingX += 0.5;
clingZ -= 0.1;
break;
case SOUTH:
clingX += 0.5;
clingZ += 0.1;
break;
case EAST:
clingZ += 0.5;
clingX += 0.1;
break;
case WEST:
clingZ += 0.5;
clingX -= 0.1;
break;
default:
break;
}
switch(clingDirection2) {
case NORTH:
clingZ += 0.7;
clingZ -= 0.1;
break;
case SOUTH:
clingZ += 0.3;
clingZ += 0.1;
break;
case EAST:
clingX += 0.3;
clingX += 0.1;
break;
case WEST:
clingX += 0.7;
clingX -= 0.1;
break;
default:
break;
Expand All @@ -200,10 +199,12 @@ private static boolean nearWall(Entity entity, double dist) {

private static boolean canWallCling(PlayerEntity player) {

if (clingTime > -5 /*|| player.canClimb()*/ || player.getHungerManager().getFoodLevel() < 1) return false;
if (clingTime > -5 || player.getHungerManager().getFoodLevel() < 1) return false;

if (player.world.getBlockState(new BlockPos(player.getPos().getX(), player.getPos().getY() - 0.8, player.getPos().getZ())).isOpaque()) return false;

if (!player.world.getFluidState(player.getBlockPos()).isEmpty() || !player.world.getFluidState(player.getBlockPos().up()).isEmpty()) return false;

double dist = 0.4;
Box box = player.getBoundingBox().shrink(0.2, 0, 0.2);
Box[] axes = { box.stretch(0, 0, -dist), box.stretch(dist, 0, 0), box.stretch(0, 0, dist), box.stretch(-dist, 0, 0) };
Expand All @@ -230,8 +231,8 @@ private static boolean canWallCling(PlayerEntity player) {
if (SkillCheck.SLIPPERY_BLOCKS.contains(player.world.getBlockState(getWallPos(player)).getBlock()) ^ SkillCheck.config.invertSlipperyTag
|| player.world.getBlockState(getWallPos(player)).getBlock() instanceof FluidBlock) return false;


if (ClassManager.hasClass(player, SkillCheck.THIEF) || player.getPos().getY() < lastJumpY) return true; //TODO: change to use levels later?
//TODO maybe have a higher thief level where you can spam up a wall?
if (player.getPos().getY() < lastJumpY) return true;

if (walls.size() == 1) {

Expand Down

0 comments on commit cb4b230

Please sign in to comment.