Skip to content

Commit cb4b230

Browse files
committed
close #15, #21
1 parent 85e2892 commit cb4b230

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

src/main/java/io/github/cottonmc/skillcheck/mixins/MixinThiefClient.java

+14-13
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ private void handleWallJump() {
141141

142142
clingTime--;
143143
if (keyTimer > 0 && (keyTimer < 5 || clingTime < -15) && canWallCling(this)) {
144-
145144
Vec3d previousVelocity = this.getVelocity();
146145
double velY = previousVelocity.y;
147146
if (velY > -0.75) velY = 0.0;
@@ -151,34 +150,34 @@ private void handleWallJump() {
151150
clingX = this.getPos().getX();
152151
clingZ = this.getPos().getZ();
153152
switch(clingDirection) {
154-
// all these are player's direction from container view
153+
// all these are player's direction from container view (opposite of player look when looking at wall)
155154
case NORTH:
156-
clingX += 0.5;
155+
clingZ -= 0.1;
157156
break;
158157
case SOUTH:
159-
clingX += 0.5;
158+
clingZ += 0.1;
160159
break;
161160
case EAST:
162-
clingZ += 0.5;
161+
clingX += 0.1;
163162
break;
164163
case WEST:
165-
clingZ += 0.5;
164+
clingX -= 0.1;
166165
break;
167166
default:
168167
break;
169168
}
170169
switch(clingDirection2) {
171170
case NORTH:
172-
clingZ += 0.7;
171+
clingZ -= 0.1;
173172
break;
174173
case SOUTH:
175-
clingZ += 0.3;
174+
clingZ += 0.1;
176175
break;
177176
case EAST:
178-
clingX += 0.3;
177+
clingX += 0.1;
179178
break;
180179
case WEST:
181-
clingX += 0.7;
180+
clingX -= 0.1;
182181
break;
183182
default:
184183
break;
@@ -200,10 +199,12 @@ private static boolean nearWall(Entity entity, double dist) {
200199

201200
private static boolean canWallCling(PlayerEntity player) {
202201

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

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

206+
if (!player.world.getFluidState(player.getBlockPos()).isEmpty() || !player.world.getFluidState(player.getBlockPos().up()).isEmpty()) return false;
207+
207208
double dist = 0.4;
208209
Box box = player.getBoundingBox().shrink(0.2, 0, 0.2);
209210
Box[] axes = { box.stretch(0, 0, -dist), box.stretch(dist, 0, 0), box.stretch(0, 0, dist), box.stretch(-dist, 0, 0) };
@@ -230,8 +231,8 @@ private static boolean canWallCling(PlayerEntity player) {
230231
if (SkillCheck.SLIPPERY_BLOCKS.contains(player.world.getBlockState(getWallPos(player)).getBlock()) ^ SkillCheck.config.invertSlipperyTag
231232
|| player.world.getBlockState(getWallPos(player)).getBlock() instanceof FluidBlock) return false;
232233

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

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

0 commit comments

Comments
 (0)