use of mathax.client.mixininterface.IVec3d in project Client by MatHax.
the class Gravity method onTick.
@EventHandler
private void onTick(final TickEvent.Post event) {
if (mc.options.sneakKey.isPressed())
return;
Vec3d velocity = mc.player.getVelocity();
((IVec3d) velocity).set(velocity.x, velocity.y + 0.0568000030517578, velocity.z);
}
use of mathax.client.mixininterface.IVec3d in project Client by MatHax.
the class BoatFly method onBoatMove.
@EventHandler
private void onBoatMove(BoatMoveEvent event) {
if (event.boat.getPrimaryPassenger() != mc.player)
return;
event.boat.setYaw(mc.player.getYaw());
Vec3d vel = PlayerUtils.getHorizontalVelocity(speed.get());
double velX = vel.getX();
double velY = 0;
double velZ = vel.getZ();
if (mc.options.jumpKey.isPressed())
velY += verticalSpeed.get() / 20;
if (mc.options.sprintKey.isPressed())
velY -= verticalSpeed.get() / 20;
else
velY -= fallSpeed.get() / 20;
((IVec3d) event.boat.getVelocity()).set(velX, velY, velZ);
}
use of mathax.client.mixininterface.IVec3d in project Client by MatHax.
the class Vanilla method onMove.
@Override
public void onMove(PlayerMoveEvent event) {
Vec3d vel = PlayerUtils.getHorizontalVelocity(settings.vanillaSpeed.get());
double velX = vel.getX();
double velZ = vel.getZ();
if (mc.player.hasStatusEffect(StatusEffects.SPEED)) {
double value = (mc.player.getStatusEffect(StatusEffects.SPEED).getAmplifier() + 1) * 0.205;
velX += velX * value;
velZ += velZ * value;
}
Anchor anchor = Modules.get().get(Anchor.class);
if (anchor.isActive() && anchor.controlMovement) {
velX = anchor.deltaX;
velZ = anchor.deltaZ;
}
((IVec3d) event.movement).set(velX, event.movement.y, velZ);
}
use of mathax.client.mixininterface.IVec3d in project Client by MatHax.
the class Strafe method onMove.
@Override
public void onMove(PlayerMoveEvent event) {
switch(stage) {
case 0:
if (PlayerUtils.isMoving()) {
stage++;
speed = 1.18f * getDefaultSpeed() - 0.01;
}
case 1:
if (!PlayerUtils.isMoving() || !mc.player.isOnGround())
break;
((IVec3d) event.movement).setY(getHop(0.40123128));
speed *= settings.ncpSpeed.get();
stage++;
break;
case 2:
speed = distance - 0.76 * (distance - getDefaultSpeed());
stage++;
break;
case 3:
if (!mc.world.isSpaceEmpty(mc.player.getBoundingBox().offset(0.0, mc.player.getVelocity().y, 0.0)) || mc.player.verticalCollision && stage > 0) {
stage = 0;
}
speed = distance - (distance / 159.0);
break;
}
speed = Math.max(speed, getDefaultSpeed());
if (settings.ncpSpeedLimit.get()) {
if (System.currentTimeMillis() - timer > 2500L)
timer = System.currentTimeMillis();
speed = Math.min(speed, System.currentTimeMillis() - timer > 1250L ? 0.44D : 0.43D);
}
Vec2 change = transformStrafe(speed);
double velX = change.x;
double velZ = change.y;
Anchor anchor = Modules.get().get(Anchor.class);
if (anchor.isActive() && anchor.controlMovement) {
velX = anchor.deltaX;
velZ = anchor.deltaZ;
}
((IVec3d) event.movement).setXZ(velX, velZ);
}
use of mathax.client.mixininterface.IVec3d in project Client by MatHax.
the class BlockUtils method place.
public static boolean place(BlockPos blockPos, Hand hand, int slot, boolean rotate, int rotationPriority, boolean swingHand, boolean checkEntities, boolean swapBack) {
if (slot < 0 || slot > 8)
return false;
if (!canPlace(blockPos, checkEntities))
return false;
((IVec3d) hitPos).set(blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5);
BlockPos neighbour;
Direction side = getPlaceSide(blockPos);
if (side == null) {
side = Direction.UP;
neighbour = blockPos;
} else {
neighbour = blockPos.offset(side.getOpposite());
hitPos.add(side.getOffsetX() * 0.5, side.getOffsetY() * 0.5, side.getOffsetZ() * 0.5);
}
Direction s = side;
if (rotate) {
Rotations.rotate(Rotations.getYaw(hitPos), Rotations.getPitch(hitPos), rotationPriority, () -> {
InvUtils.swap(slot, swapBack);
place(new BlockHitResult(hitPos, s, neighbour, false), hand, swingHand);
if (swapBack)
InvUtils.swapBack();
});
} else {
InvUtils.swap(slot, swapBack);
place(new BlockHitResult(hitPos, s, neighbour, false), hand, swingHand);
if (swapBack)
InvUtils.swapBack();
}
return true;
}
Aggregations