use of net.wurstclient.util.FakePlayerEntity in project Wurst7 by Wurst-Imperium.
the class RadarHack method onUpdate.
@Override
public void onUpdate() {
ClientPlayerEntity player = MC.player;
ClientWorld world = MC.world;
entities.clear();
Stream<Entity> stream = StreamSupport.stream(world.getEntities().spliterator(), true).filter(e -> !e.isRemoved() && e != player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> e instanceof LivingEntity).filter(e -> ((LivingEntity) e).getHealth() > 0);
if (filterPlayers.isChecked())
stream = stream.filter(e -> !(e instanceof PlayerEntity));
if (filterSleeping.isChecked())
stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
if (filterMonsters.isChecked())
stream = stream.filter(e -> !(e instanceof Monster));
if (filterAnimals.isChecked())
stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
if (filterInvisible.isChecked())
stream = stream.filter(e -> !e.isInvisible());
entities.addAll(stream.collect(Collectors.toList()));
}
use of net.wurstclient.util.FakePlayerEntity in project Wurst7 by Wurst-Imperium.
the class FollowHack method onEnable.
@Override
public void onEnable() {
WURST.getHax().fightBotHack.setEnabled(false);
WURST.getHax().protectHack.setEnabled(false);
WURST.getHax().tunnellerHack.setEnabled(false);
if (entity == null) {
Stream<Entity> stream = StreamSupport.stream(MC.world.getEntities().spliterator(), true).filter(e -> !e.isRemoved()).filter(e -> e instanceof LivingEntity && ((LivingEntity) e).getHealth() > 0 || e instanceof AbstractMinecartEntity).filter(e -> e != MC.player).filter(e -> !(e instanceof FakePlayerEntity));
if (filterPlayers.isChecked())
stream = stream.filter(e -> !(e instanceof PlayerEntity));
if (filterSleeping.isChecked())
stream = stream.filter(e -> !(e instanceof PlayerEntity && ((PlayerEntity) e).isSleeping()));
if (filterFlying.getValue() > 0)
stream = stream.filter(e -> {
if (!(e instanceof PlayerEntity))
return true;
Box box = e.getBoundingBox();
box = box.union(box.offset(0, -filterFlying.getValue(), 0));
return !MC.world.isSpaceEmpty(box);
});
if (filterMonsters.isChecked())
stream = stream.filter(e -> !(e instanceof Monster));
if (filterPigmen.isChecked())
stream = stream.filter(e -> !(e instanceof ZombifiedPiglinEntity));
if (filterEndermen.isChecked())
stream = stream.filter(e -> !(e instanceof EndermanEntity));
if (filterAnimals.isChecked())
stream = stream.filter(e -> !(e instanceof AnimalEntity || e instanceof AmbientEntity || e instanceof WaterCreatureEntity));
if (filterBabies.isChecked())
stream = stream.filter(e -> !(e instanceof PassiveEntity && ((PassiveEntity) e).isBaby()));
if (filterPets.isChecked())
stream = stream.filter(e -> !(e instanceof TameableEntity && ((TameableEntity) e).isTamed())).filter(e -> !(e instanceof HorseBaseEntity && ((HorseBaseEntity) e).isTame()));
if (filterTraders.isChecked())
stream = stream.filter(e -> !(e instanceof MerchantEntity));
if (filterGolems.isChecked())
stream = stream.filter(e -> !(e instanceof GolemEntity));
if (filterInvisible.isChecked())
stream = stream.filter(e -> !e.isInvisible());
if (filterStands.isChecked())
stream = stream.filter(e -> !(e instanceof ArmorStandEntity));
if (filterCarts.isChecked())
stream = stream.filter(e -> !(e instanceof AbstractMinecartEntity));
entity = stream.min(Comparator.comparingDouble(e -> MC.player.squaredDistanceTo(e))).orElse(null);
if (entity == null) {
ChatUtils.error("Could not find a valid entity.");
setEnabled(false);
return;
}
}
pathFinder = new EntityPathFinder();
EVENTS.add(UpdateListener.class, this);
EVENTS.add(RenderListener.class, this);
ChatUtils.message("Now following " + entity.getName().getString());
}
use of net.wurstclient.util.FakePlayerEntity in project Wurst7 by Wurst-Imperium.
the class FreecamHack method onEnable.
@Override
public void onEnable() {
EVENTS.add(UpdateListener.class, this);
EVENTS.add(PacketOutputListener.class, this);
EVENTS.add(IsPlayerInWaterListener.class, this);
EVENTS.add(PlayerMoveListener.class, this);
EVENTS.add(CameraTransformViewBobbingListener.class, this);
EVENTS.add(IsNormalCubeListener.class, this);
EVENTS.add(SetOpaqueCubeListener.class, this);
EVENTS.add(RenderListener.class, this);
fakePlayer = new FakePlayerEntity();
GameOptions gs = MC.options;
KeyBinding[] bindings = { gs.forwardKey, gs.backKey, gs.leftKey, gs.rightKey, gs.jumpKey, gs.sneakKey };
for (KeyBinding binding : bindings) binding.setPressed(((IKeyBinding) binding).isActallyPressed());
}
use of net.wurstclient.util.FakePlayerEntity in project Wurst7 by Wurst-Imperium.
the class PlayerEspHack method onUpdate.
@Override
public void onUpdate() {
PlayerEntity player = MC.player;
ClientWorld world = MC.world;
players.clear();
Stream<AbstractClientPlayerEntity> stream = world.getPlayers().parallelStream().filter(e -> !e.isRemoved() && e.getHealth() > 0).filter(e -> e != player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> Math.abs(e.getY() - MC.player.getY()) <= 1e6);
if (filterSleeping.isChecked())
stream = stream.filter(e -> !e.isSleeping());
if (filterInvisible.isChecked())
stream = stream.filter(e -> !e.isInvisible());
players.addAll(stream.collect(Collectors.toList()));
}
use of net.wurstclient.util.FakePlayerEntity in project Wurst7 by Wurst-Imperium.
the class ProtectCmd method call.
@Override
public void call(String[] args) throws CmdException {
if (args.length != 1)
throw new CmdSyntaxError();
ProtectHack protectHack = WURST.getHax().protectHack;
if (protectHack.isEnabled())
protectHack.setEnabled(false);
Entity entity = StreamSupport.stream(MC.world.getEntities().spliterator(), true).filter(e -> e instanceof LivingEntity).filter(e -> !e.isRemoved() && ((LivingEntity) e).getHealth() > 0).filter(e -> e != MC.player).filter(e -> !(e instanceof FakePlayerEntity)).filter(e -> args[0].equalsIgnoreCase(e.getName().getString())).min(Comparator.comparingDouble(e -> MC.player.squaredDistanceTo(e))).orElse(null);
if (entity == null)
throw new CmdError("Entity \"" + args[0] + "\" could not be found.");
protectHack.setFriend(entity);
protectHack.setEnabled(true);
}
Aggregations