mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-20 01:12:13 +02:00
Add "Check line of sight" setting to KillauraHack
This commit is contained in:
parent
233b6aa557
commit
bb7cd73c1b
@ -23,8 +23,11 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.decoration.EndCrystalEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.RaycastContext;
|
||||
import net.wurstclient.Category;
|
||||
import net.wurstclient.SearchTags;
|
||||
import net.wurstclient.events.PostMotionListener;
|
||||
@ -73,6 +76,12 @@ public final class KillauraHack extends Hack
|
||||
private final PauseAttackOnContainersSetting pauseOnContainers =
|
||||
new PauseAttackOnContainersSetting(true);
|
||||
|
||||
private final CheckboxSetting checkLOS =
|
||||
new CheckboxSetting("Check line of sight",
|
||||
"Ensures that you don't reach through blocks when attacking.\n\n"
|
||||
+ "Slower but can help with anti-cheat plugins.",
|
||||
false);
|
||||
|
||||
private final EntityFilterList entityFilters =
|
||||
EntityFilterList.genericCombat();
|
||||
|
||||
@ -90,6 +99,7 @@ public final class KillauraHack extends Hack
|
||||
addSetting(fov);
|
||||
addSetting(damageIndicator);
|
||||
addSetting(pauseOnContainers);
|
||||
addSetting(checkLOS);
|
||||
|
||||
entityFilters.forEach(this::addSetting);
|
||||
}
|
||||
@ -161,8 +171,19 @@ public final class KillauraHack extends Hack
|
||||
|
||||
WURST.getHax().autoSwordHack.setSlot();
|
||||
|
||||
WURST.getRotationFaker()
|
||||
.faceVectorPacket(target.getBoundingBox().getCenter());
|
||||
Vec3d eyesPos = RotationUtils.getEyesPos();
|
||||
Vec3d hitVec = target.getBoundingBox().getCenter();
|
||||
if(checkLOS.isChecked() && MC.world
|
||||
.raycast(new RaycastContext(eyesPos, hitVec,
|
||||
RaycastContext.ShapeType.COLLIDER,
|
||||
RaycastContext.FluidHandling.NONE, MC.player))
|
||||
.getType() != HitResult.Type.MISS)
|
||||
{
|
||||
target = null;
|
||||
return;
|
||||
}
|
||||
|
||||
WURST.getRotationFaker().faceVectorPacket(hitVec);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user