use of me.wallhacks.spark.systems.clientsetting.clientsettings.AntiCheatConfig in project Spark-Client by Spark-Client-Development.
the class CrystalAura method rotate.
// rotation methods
boolean rotate(RotateType type) {
AntiCheatConfig cfg = AntiCheatConfig.getInstance();
if (currentCrystalBlockPos == null && currentCrystalEntity == null)
return true;
Vec3d pos = CrystalUtil.getRotationPos((type != PLACE), currentCrystalBlockPos, currentCrystalEntity);
boolean needsRotating = false;
boolean needsRaytracebypass = false;
switch(type) {
case PLACE:
needsRotating = cfg.placeRotate.getValue();
needsRaytracebypass = true;
break;
case BREAK:
needsRotating = cfg.attackRotate.getValue();
break;
case BOTH:
needsRotating = cfg.attackRotate.getValue() || cfg.placeRotate.getValue();
needsRaytracebypass = currentCrystalEntity == null;
break;
}
float[] rot = Spark.rotationManager.getLegitRotations(pos);
if (raytrace && needsRaytracebypass) {
if (!Spark.rotationManager.isRaytraceBypassDone()) {
float[] rotBypass = RaytraceUtil.getRotationForBypass(rot[0]);
if (rotBypass == null)
return false;
Spark.rotationManager.rotate(rotBypass, isUpdate, false);
return false;
}
}
if (!needsRotating)
return true;
return Spark.rotationManager.rotate(rot, isUpdate, false);
}
use of me.wallhacks.spark.systems.clientsetting.clientsettings.AntiCheatConfig in project Spark-Client by Spark-Client-Development.
the class ShulkerAura method onEnable.
@Override
public void onEnable() {
windowId = -1;
AntiCheatConfig cfg = AntiCheatConfig.getInstance();
targetPos = null;
targetFacing = null;
String message = "Could not find target";
for (EntityPlayer player : mc.world.playerEntities) {
if (mc.player.getDistance(player) > 6)
continue;
if (mc.player == player)
continue;
if (Spark.socialManager.isFriend(player))
continue;
// i dont like this but its a really easy check for now
if (!HoleUtil.isInHole(player))
continue;
BlockPos pos = new BlockPos(player.posX, player.posY + 2, player.posZ);
// check every direction for shulker aura posibilitys
EnumFacing face = EnumFacing.UP;
for (EnumFacing facing : EnumFacing.HORIZONTALS) {
// check places being possible to place at
// blocks oppisite of the trap need to be air to prevent the shulker from being blown up
BlockPos blockedCheck = pos.offset(facing.getOpposite());
if (!(mc.world.getBlockState(blockedCheck).getBlock() instanceof BlockAir))
continue;
if (!(mc.world.getBlockState(blockedCheck.up()).getBlock() instanceof BlockAir))
continue;
boolean blocked = false;
for (EnumFacing f : EnumFacing.HORIZONTALS) {
if (f == facing || f == facing.getOpposite())
continue;
if (!(mc.world.getBlockState(blockedCheck.offset(f)).getBlock() instanceof BlockAir) || !(mc.world.getBlockState(blockedCheck.offset(f).up()).getBlock() instanceof BlockAir)) {
blocked = true;
break;
}
}
if (blocked)
continue;
// actual block needs to be air so we can place crystals
if (!(mc.world.getBlockState(pos.offset(facing)).getBlock() instanceof BlockAir && BlockInteractUtil.blockCollisionCheck(pos.offset(facing), null)))
continue;
// block above it needs to be air too
if (!(mc.world.getBlockState(pos.add(facing.getDirectionVec()).up()).getBlock() instanceof BlockAir))
continue;
// block underneath needs to be air bedrock or obby so we can actually place crystal there after trapping
Block placeBlock = mc.world.getBlockState(pos.offset(facing).down()).getBlock();
if (!BlockInteractUtil.blockCollisionCheck(pos.offset(facing).down(), true) || !BlockInteractUtil.blockCollisionCheck(pos.offset(facing), true) || !BlockInteractUtil.blockCollisionCheck(pos.offset(facing, 2).down(), true))
continue;
if (!(placeBlock instanceof BlockAir || placeBlock instanceof BlockObsidian || placeBlock == Blocks.BEDROCK) && BlockInteractUtil.blockCollisionCheck(pos.offset(facing).down(), null))
continue;
// the position 2 blocks out needs to be air for placing the shulk
BlockPos shulkPos = pos.offset(facing, 2);
BlockPos outerPos = pos.offset(facing, 3);
Block shulkBlock = mc.world.getBlockState(shulkPos).getBlock();
if (!(shulkBlock instanceof BlockShulkerBox)) {
if (!shulkBlock.isReplaceable(mc.world, shulkPos) || !BlockInteractUtil.blockCollisionCheck(shulkPos, null))
continue;
} else
outerPos = shulkPos;
message = "Found target to attack but its to far away";
// raytrace and range checks
RayTraceResult outer = mc.world.rayTraceBlocks(mc.player.getPositionEyes(mc.getRenderPartialTicks()), new Vec3d(outerPos).add(0.5, 0.5, 0.5));
double distance = mc.player.getDistance(outerPos.getX() + 0.5, outerPos.getY() + 0.5, outerPos.getZ() + 0.5);
if (distance < cfg.placeRange.getValue() && (AntiCheatConfig.getInstance().raytrace.getValue() || outer == null || outerPos.equals(outer.getBlockPos()) || distance < cfg.placeWallRange.getValue())) {
face = facing;
break;
}
}
if (face != EnumFacing.UP) {
targetPos = pos;
targetFacing = face;
PacketMine.instance.pos = null;
return;
}
}
Spark.sendInfo(message);
disable();
}
Aggregations