Search in sources :

Example 1 with FakePlayerEntity

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()));
}
Also used : Category(net.wurstclient.Category) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) LivingEntity(net.minecraft.entity.LivingEntity) Hack(net.wurstclient.hack.Hack) SearchTags(net.wurstclient.SearchTags) Collectors(java.util.stream.Collectors) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ArrayList(java.util.ArrayList) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) Stream(java.util.stream.Stream) Window(net.wurstclient.clickgui.Window) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) UpdateListener(net.wurstclient.events.UpdateListener) RadarComponent(net.wurstclient.clickgui.components.RadarComponent) StreamSupport(java.util.stream.StreamSupport) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Collections(java.util.Collections) ClientWorld(net.minecraft.client.world.ClientWorld) LivingEntity(net.minecraft.entity.LivingEntity) Entity(net.minecraft.entity.Entity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) LivingEntity(net.minecraft.entity.LivingEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) ClientWorld(net.minecraft.client.world.ClientWorld) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) ClientPlayerEntity(net.minecraft.client.network.ClientPlayerEntity)

Example 2 with FakePlayerEntity

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());
}
Also used : Category(net.wurstclient.Category) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) ChatUtils(net.wurstclient.util.ChatUtils) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) ArrayList(java.util.ArrayList) ValueDisplay(net.wurstclient.settings.SliderSetting.ValueDisplay) Vec3d(net.minecraft.util.math.Vec3d) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity) StreamSupport(java.util.stream.StreamSupport) RenderListener(net.wurstclient.events.RenderListener) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) PathFinder(net.wurstclient.ai.PathFinder) LivingEntity(net.minecraft.entity.LivingEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) Box(net.minecraft.util.math.Box) GameRenderer(net.minecraft.client.render.GameRenderer) MatrixStack(net.minecraft.client.util.math.MatrixStack) BlockPos(net.minecraft.util.math.BlockPos) Hack(net.wurstclient.hack.Hack) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PathCmd(net.wurstclient.commands.PathCmd) SliderSetting(net.wurstclient.settings.SliderSetting) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) PathPos(net.wurstclient.ai.PathPos) Stream(java.util.stream.Stream) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) Monster(net.minecraft.entity.mob.Monster) RenderSystem(com.mojang.blaze3d.systems.RenderSystem) PathProcessor(net.wurstclient.ai.PathProcessor) UpdateListener(net.wurstclient.events.UpdateListener) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) DontSaveState(net.wurstclient.hack.DontSaveState) Comparator(java.util.Comparator) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) GolemEntity(net.minecraft.entity.passive.GolemEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Entity(net.minecraft.entity.Entity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) TameableEntity(net.minecraft.entity.passive.TameableEntity) MerchantEntity(net.minecraft.entity.passive.MerchantEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) Box(net.minecraft.util.math.Box) GolemEntity(net.minecraft.entity.passive.GolemEntity) HorseBaseEntity(net.minecraft.entity.passive.HorseBaseEntity) WaterCreatureEntity(net.minecraft.entity.mob.WaterCreatureEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) LivingEntity(net.minecraft.entity.LivingEntity) ZombifiedPiglinEntity(net.minecraft.entity.mob.ZombifiedPiglinEntity) AmbientEntity(net.minecraft.entity.mob.AmbientEntity) Monster(net.minecraft.entity.mob.Monster) EndermanEntity(net.minecraft.entity.mob.EndermanEntity) PassiveEntity(net.minecraft.entity.passive.PassiveEntity) ArmorStandEntity(net.minecraft.entity.decoration.ArmorStandEntity) AbstractMinecartEntity(net.minecraft.entity.vehicle.AbstractMinecartEntity)

Example 3 with FakePlayerEntity

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());
}
Also used : IKeyBinding(net.wurstclient.mixinterface.IKeyBinding) KeyBinding(net.minecraft.client.option.KeyBinding) IKeyBinding(net.wurstclient.mixinterface.IKeyBinding) GameOptions(net.minecraft.client.option.GameOptions) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity)

Example 4 with FakePlayerEntity

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()));
}
Also used : Category(net.wurstclient.Category) SearchTags(net.wurstclient.SearchTags) ArrayList(java.util.ArrayList) VertexFormat(net.minecraft.client.render.VertexFormat) RotationUtils(net.wurstclient.util.RotationUtils) EnumSetting(net.wurstclient.settings.EnumSetting) Vec3d(net.minecraft.util.math.Vec3d) CameraTransformViewBobbingListener(net.wurstclient.events.CameraTransformViewBobbingListener) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) BufferRenderer(net.minecraft.client.render.BufferRenderer) GL11(org.lwjgl.opengl.GL11) RenderListener(net.wurstclient.events.RenderListener) VertexFormats(net.minecraft.client.render.VertexFormats) Tessellator(net.minecraft.client.render.Tessellator) Matrix4f(net.minecraft.util.math.Matrix4f) PlayerEntity(net.minecraft.entity.player.PlayerEntity) Box(net.minecraft.util.math.Box) GameRenderer(net.minecraft.client.render.GameRenderer) MatrixStack(net.minecraft.client.util.math.MatrixStack) BlockPos(net.minecraft.util.math.BlockPos) Hack(net.wurstclient.hack.Hack) Collectors(java.util.stream.Collectors) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) Stream(java.util.stream.Stream) CheckboxSetting(net.wurstclient.settings.CheckboxSetting) MathHelper(net.minecraft.util.math.MathHelper) RenderSystem(com.mojang.blaze3d.systems.RenderSystem) BufferBuilder(net.minecraft.client.render.BufferBuilder) UpdateListener(net.wurstclient.events.UpdateListener) ClientWorld(net.minecraft.client.world.ClientWorld) RenderUtils(net.wurstclient.util.RenderUtils) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) ClientWorld(net.minecraft.client.world.ClientWorld) AbstractClientPlayerEntity(net.minecraft.client.network.AbstractClientPlayerEntity) PlayerEntity(net.minecraft.entity.player.PlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity)

Example 5 with FakePlayerEntity

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);
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) Entity(net.minecraft.entity.Entity) CmdSyntaxError(net.wurstclient.command.CmdSyntaxError) CmdException(net.wurstclient.command.CmdException) LivingEntity(net.minecraft.entity.LivingEntity) CmdError(net.wurstclient.command.CmdError) StreamSupport(java.util.stream.StreamSupport) Comparator(java.util.Comparator) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) Command(net.wurstclient.command.Command) ProtectHack(net.wurstclient.hacks.ProtectHack) CmdSyntaxError(net.wurstclient.command.CmdSyntaxError) Entity(net.minecraft.entity.Entity) LivingEntity(net.minecraft.entity.LivingEntity) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity) CmdError(net.wurstclient.command.CmdError) ProtectHack(net.wurstclient.hacks.ProtectHack) FakePlayerEntity(net.wurstclient.util.FakePlayerEntity)

Aggregations

FakePlayerEntity (net.wurstclient.util.FakePlayerEntity)15 Entity (net.minecraft.entity.Entity)12 LivingEntity (net.minecraft.entity.LivingEntity)12 Stream (java.util.stream.Stream)11 StreamSupport (java.util.stream.StreamSupport)11 PlayerEntity (net.minecraft.entity.player.PlayerEntity)11 Category (net.wurstclient.Category)11 UpdateListener (net.wurstclient.events.UpdateListener)11 Hack (net.wurstclient.hack.Hack)11 CheckboxSetting (net.wurstclient.settings.CheckboxSetting)11 AmbientEntity (net.minecraft.entity.mob.AmbientEntity)10 Monster (net.minecraft.entity.mob.Monster)10 WaterCreatureEntity (net.minecraft.entity.mob.WaterCreatureEntity)10 AnimalEntity (net.minecraft.entity.passive.AnimalEntity)10 Box (net.minecraft.util.math.Box)10 SliderSetting (net.wurstclient.settings.SliderSetting)10 ValueDisplay (net.wurstclient.settings.SliderSetting.ValueDisplay)10 Comparator (java.util.Comparator)9 ArmorStandEntity (net.minecraft.entity.decoration.ArmorStandEntity)9 EndermanEntity (net.minecraft.entity.mob.EndermanEntity)9